# FTSO Spread # This strategy is intended to be deployed as two separate orders. # # One order represents selling WFLR for WETH (i.e. the output is WFLR). # One order represents buying WFLR for WETH (i.e. the input is WFLR). # # Both orders read from the onchain FTSOs to get the pair price and then # offer a spread either side of the oracle price. The spread is calculated # by multiplying the io-ratio by a number larger than 1e18. # E.g. a 1% spread means the multiplier should be 101e16. # # The concept of "buying" and "selling" is represented by the input and # output tokens being reversed, and the FTSO base/quote being set accordingly. tokens: wflr: address: 0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d decimals: 18 network: flare weth: address: 0x62bD084cbcD6c85347C50292A141EA4D3e7e3511 decimals: 18 network: flare scenarios: flare: bindings: flare-sub-parser: 0xc4b7A086FD25260461f7F50ac9D62Cb86006bbEB spread-multiplier: 101e16 scenarios: sell-wflr: runs: 1 bindings: ftso-base: '"FLR"' ftso-quote: '"ETH"' buy-wflr: runs: 1 bindings: ftso-base: '"ETH"' ftso-quote: '"FLR"' orders: sell-wflr: inputs: - token: weth # `openssl rand -hex 32` vault-id: 0xcec26d26ca191a871ae3153b1f3d67c6bb2b00fd0a063db10ea8e8b0d524f20c outputs: - token: wflr vault-id: 0xcec26d26ca191a871ae3153b1f3d67c6bb2b00fd0a063db10ea8e8b0d524f20c network: flare buy-wflr: inputs: - token: wflr vault-id: 0xcec26d26ca191a871ae3153b1f3d67c6bb2b00fd0a063db10ea8e8b0d524f20c outputs: - token: weth vault-id: 0xcec26d26ca191a871ae3153b1f3d67c6bb2b00fd0a063db10ea8e8b0d524f20c network: flare deployments: sell-wflr: scenario: flare.sell-wflr order: sell-wflr buy-wflr: scenario: flare.buy-wflr order: buy-wflr charts: sell: scenario: flare.sell-wflr metrics: - label: FTSO sell price value: 0.0 - label: Final sell io-ratio value: 0.2 buy: scenario: flare.buy-wflr metrics: - label: FTSO buy price value: 0.0 - label: Final buy io-ratio value: 0.2 --- #spread-multiplier !The spread multiplier. 1e18 is 1x i.e. "no spread". 101e16 is 1.01x i.e. 1% spread. #ftso-base !The base token of the FTSO pair. #ftso-quote !The quote token of the FTSO pair. #calculate-io using-words-from 0xAfD94467d2eC43D9aD39f835BA758b61b2f41A0E 0x50fB1Be59721E7A2a3434dDd726d53780bfDe344 ftso-price: ftso-current-price-pair(ftso-base ftso-quote 3600), amount: max-decimal18-value(), price: decimal18-mul(ftso-price spread-multiplier); #handle-io :;