# This strategy will sell WFLR based on the price of the FTSO pair FLR/USD # # It is designed as an auction and will only trade once. # # From the start time, the strategy will offer to sell WFLR at a percentage of the FTSO price. # Each second "auction-rate-percentage" will be deducted from the price. For example, if # the rate is 0.1% and 10 seconds have elapsed, the strategy will make an offer at 99% of # the FTSO price. If the FTSO price is $1 per WFLR, the strategy would accept 99c per WFLR. tokens: eusdt: network: flare address: 0x96B41289D90444B8adD57e6F265DB5aE8651DF29 decimals: 6 wflr: network: flare address: 0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d decimals: 18 orders: # vault-id is `openssl rand -hex 32` sell-wflr: orderbook: flare inputs: - token: eusdt vault-id: 0xdce98e3a7ee4b8b7ec1def4542b220083f8c3f0d569f142752cdc5bad6e14092 outputs: - token: wflr vault-id: 0xdce98e3a7ee4b8b7ec1def4542b220083f8c3f0d569f142752cdc5bad6e14092 scenarios: default: deployer: flare runs: 1 bindings: trade-amount: 500e18 start-time: 1712582040 auction-rate-percentage: 1e15 deployments: default: scenario: default order: sell-wflr charts: Dutch order: scenario: default metrics: - label: FTSO price description: $ per FLR value: 0.0 - label: Time elapsed value: 0.1 - label: Total percentage deducted value: 0.2 - label: Percentage mulitplier value: 0.3 - label: Trade price value: 0.4 --- #trade-amount !The amount that we want to sell. #start-time !The timestamp in seconds when the auction starts - works best as a minute or two after the order will be deployed #auction-rate-percentage !The percentage of the price that we'll deduct every second from our offer #calculate-io using-words-from 0xAfD94467d2eC43D9aD39f835BA758b61b2f41A0E 0x50fB1Be59721E7A2a3434dDd726d53780bfDe344 /* ensure that the cooldown time has elapsed since the last trade */ :ensure( any( greater-than-or-equal-to(block-timestamp() start-time) is-zero(get("already traded")) ) "Auction hasn't started" ), /* getting a quote from the Flare FTSO */ ftso-price: ftso-current-price-usd("FLR" 3600), time-elapsed: int-saturating-sub(block-timestamp() start-time), /* determining the percentage below the FTSO price we'll offer this block */ total-percentage-deducted: int-mul(time-elapsed auction-rate-percentage), percentage-multiplier: int-saturating-sub(1e18 total-percentage-deducted), /* applying that percentage to the FTSO price */ trade-price: decimal18-mul(ftso-price percentage-multiplier), :set("already traded" 1), max-output: trade-amount, io-ratio: trade-price; #handle-io :;