# This is a simple stop-limit order that will sell at the limit price # if the FTSO oracle price drops below a stop price. # # The order has a internal switch to check that it only runs once. tokens: eusdt: address: 0x96B41289D90444B8adD57e6F265DB5aE8651DF29 decimals: 6 network: flare wflr: address: 0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d decimals: 18 network: flare orders: flare: orderbook: flare inputs: - token: eusdt outputs: - token: wflr scenarios: flare: runs: 1 bindings: trade-amount: 5 limit-price: 0.027 stop-price: 0.035 deployments: flare: scenario: flare order: flare charts: Stop limit order selling WFLR: scenario: flare metrics: - label: FTSO price value: 0.0 - label: Stop price value: 0.1 - label: Limit price value: 0.2 - label: Trade amount (in $) value: 0.3 - label: Trade amount (in WFLR) value: 0.4 - label: IO ratio description: Amount of USD per WFLR sold. value: 0.5 --- #flare-subparser 0x57c613381deadaE520eC33556C1d51c9Dcb0adb3 #raindex-subparser 0x77991674ca8887D4ee1b583DB7324B41d5f894c4 #trade-amount !The amount of WFLR that we will sell. #stop-price !The price below which we'll sell WFLR. #limit-price !The price which we'll sell at if the FTSO reports a price below the stop price. #calculate-io using-words-from flare-subparser raindex-subparser ftso-price: ftso-current-price-usd("FLR" 3600), :ensure(less-than(ftso-price stop-price) "Threshold not hit."), /* ensure that this strat only runs once. */ :ensure(is-zero(get(order-hash())) "Already run."), :set(order-hash() 1), /* added this here to help charting */ _: stop-price, _: limit-price, input-amount: mul(trade-amount limit-price), max-output: trade-amount, price: limit-price; #handle-io :;