# 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: sell-wflr: orderbook: flare inputs: - token: eusdt outputs: - token: wflr scenarios: default: deployer: flare runs: 1 bindings: trade-amount: 500 start-time: 1716297140 auction-rate-percentage: 0.001 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 --- #flare-subparser 0x57c613381deadaE520eC33556C1d51c9Dcb0adb3 #raindex-subparser 0x77991674ca8887D4ee1b583DB7324B41d5f894c4 #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 flare-subparser raindex-subparser :ensure(is-zero(get(order-hash())) "Already traded."), :set(order-hash() 1), /* getting a quote from the Flare FTSO */ ftso-price: ftso-current-price-usd("FLR" 3600), /* sub will error on negative values so nothing can happen before the start time */ time-elapsed: sub(block-timestamp() start-time), /* determining the percentage below the FTSO price we'll offer this block */ total-percentage-deducted: mul(time-elapsed auction-rate-percentage), percentage-multiplier: saturating-sub(1 total-percentage-deducted), /* applying that percentage to the FTSO price */ trade-price: mul(ftso-price percentage-multiplier), max-output: trade-amount, io-ratio: trade-price; #handle-io :;