diff --git a/package-lock.json b/package-lock.json index 6ab39d36..fbd633b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "rain.frame", "version": "0.0.25", + "license": "LicenseRef-DCL-1.0", "dependencies": { "@fontsource/dm-sans": "^5.0.22", "@hookform/resolvers": "^3.9.0", diff --git a/public/_strategies/raindex/1-auction-dca/auction-dca.rain b/public/_strategies/raindex/1-auction-dca/auction-dca.rain index 6baa0e9a..49142add 100644 --- a/public/_strategies/raindex/1-auction-dca/auction-dca.rain +++ b/public/_strategies/raindex/1-auction-dca/auction-dca.rain @@ -180,6 +180,10 @@ tokens: network: polygon address: 0x3c59798620e5fEC0Ae6dF1A19c6454094572Ab92 decimals: 18 + polygon-ioen: + network: polygon + address: 0xd0e9c8f5Fae381459cf07Ec506C1d2896E8b5df6 + decimals: 18 orders: arbitrum-wbtc-weth: @@ -364,6 +368,20 @@ orders: - token: polygon-mnw outputs: - token: polygon-usdc + polygon-usdc-ioen: + orderbook: polygon + network: polygon + inputs: + - token: polygon-usdc + outputs: + - token: polygon-ioen + polygon-ioen-usdc: + orderbook: polygon + network: polygon + inputs: + - token: polygon-ioen + outputs: + - token: polygon-usdc scenarios: arbitrum: @@ -454,6 +472,12 @@ deployments: polygon-usdc-mnw: order: polygon-usdc-mnw scenario: polygon + polygon-ioen-usdc: + order: polygon-ioen-usdc + scenario: polygon + polygon-usdc-ioen: + order: polygon-usdc-ioen + scenario: polygon bsc-tft-busd: order: bsc-tft-busd scenario: bsc @@ -1380,6 +1404,238 @@ gui: The initial MNW per USDC to kickoff the first auction (e.g. 2.2). min: 0.01 + - deployment: polygon-usdc-ioen + name: Sell IOEN for USDC on Polygon. + description: > + DCA IOEN for USDC on Polygon. + deposits: + - token: polygon-ioen + min: 0 + presets: + - 0 + - 100000 + - 200000 + - 1000000 + - 2000000 + fields: + - binding: time-per-amount-epoch + name: Budget period (in seconds) + description: > + The budget is spent over this time period. + + For example, if the budget is daily then this is 86400 seconds (24 * 60 * 60). + min: 1 + presets: + - name: Per minute (60) + value: 60 + - name: Per hour (3600) + value: 3600 + - name: Per day (86400) + value: 86400 + - name: Per week (604800) + value: 604800 + - name: Per 30 days (2592000) + value: 2592000 + - name: Per 365 days (31536000) + value: 31536000 + - binding: amount-per-epoch + name: Budget (IOEN per period) + description: > + The amount of IOEN to spend each budget period. + + For example, if the budget is daily and this is 10000 then 10000 IOEN will be sold for USDC each day. + min: 0 + - binding: max-trade-amount + name: Maximum trade size (IOEN) + description: > + The maximum amount of IOEN to sell in a single auction. + min: 0 + - binding: min-trade-amount + name: Minimum trade size (IOEN) + description: > + The minimum amount of IOEN to sell in a single auction. + min: 0 + - binding: time-per-trade-epoch + name: Auction period (in seconds) + description: > + The auction period is the time between each auction price halvening. + min: 600 + presets: + - name: Every 20 minutes (1200) + value: 1200 + - name: Every 30 minutes (1800) + value: 1800 + - name: Every hour (3600) + value: 3600 + - name: Every 2 hours (7200) + value: 7200 + - name: Every 3 hours (10800) + value: 10800 + - name: Every 6 hours (21600) + value: 21600 + - name: Every 12 hours (43200) + value: 43200 + - name: Every 24 hours (86400) + value: 86400 + - binding: baseline + name: Baseline USDC per IOEN + description: > + The absolute minimum amount of USDC per IOEN that the auction will trade at (e.g. 0.002942). + min: 0 + - binding: next-trade-multiplier + name: Auction start multiplier + description: > + The multiplier to apply to the last trade to kick off the next auction. + min: 1.01 + presets: + - name: 1.01x + value: 1.01 + - name: 1.02x + value: 1.02 + - name: 1.05x + value: 1.05 + - name: 1.1x + value: 1.1 + - binding: next-trade-baseline-multiplier + name: Auction end multiplier + description: > + The multiplier to apply to the last trade to set the baseline for the next auction. + min: 0 + presets: + - name: Disabled (0) + value: 0 + - name: 0.7x + value: 0.7 + - name: 0.8x + value: 0.8 + - name: 0.9x + value: 0.9 + - name: 0.95x + value: 0.95 + - name: 0.99x + value: 0.99 + - binding: initial-io + name: Kickoff USDC per IOEN + description: > + The initial USDC per IOEN to kickoff the first auction (e.g. 0.002942). + min: 0 + + - deployment: polygon-ioen-usdc + name: Buy IOEN with USDC on Polygon. + description: > + DCA USDC for IOEN on Polygon. + deposits: + - token: polygon-usdc + min: 0 + presets: + - 0 + - 100 + - 1000 + - 5000 + - 10000 + fields: + - binding: time-per-amount-epoch + name: Budget period (in seconds) + description: > + The budget is spent over this time period. + + For example, if the budget is daily then this is 86400 seconds (24 * 60 * 60). + min: 1 + presets: + - name: Per minute (60) + value: 60 + - name: Per hour (3600) + value: 3600 + - name: Per day (86400) + value: 86400 + - name: Per week (604800) + value: 604800 + - name: Per 30 days (2592000) + value: 2592000 + - name: Per 365 days (31536000) + value: 31536000 + - binding: amount-per-epoch + name: Budget (USDC per period) + description: > + The amount of USDC to spend each budget period. + + For example, if the budget is daily and this is 100 then 100 USDC will be sold for IOEN each day. + min: 0 + - binding: max-trade-amount + name: Maximum trade size (USDC) + description: > + The maximum amount of USDC to sell in a single auction. + min: 0 + - binding: min-trade-amount + name: Minimum trade size (USDC) + description: > + The minimum amount of USDC to sell in a single auction. + min: 0 + - binding: time-per-trade-epoch + name: Auction period (in seconds) + description: > + The auction period is the time between each auction price halvening. + min: 600 + presets: + - name: Every 20 minutes (1200) + value: 1200 + - name: Every 30 minutes (1800) + value: 1800 + - name: Every hour (3600) + value: 3600 + - name: Every 2 hours (7200) + value: 7200 + - name: Every 3 hours (10800) + value: 10800 + - name: Every 6 hours (21600) + value: 21600 + - name: Every 12 hours (43200) + value: 43200 + - name: Every 24 hours (86400) + value: 86400 + - binding: baseline + name: Baseline IOEN per USDC + description: > + The absolute minimum amount of IOEN per USDC that the auction will trade at (e.g. 330). + min: 0 + - binding: next-trade-multiplier + name: Auction start multiplier + description: > + The multiplier to apply to the last trade to kick off the next auction. + min: 1.01 + presets: + - name: 1.01x + value: 1.01 + - name: 1.02x + value: 1.02 + - name: 1.05x + value: 1.05 + - name: 1.1x + value: 1.1 + - binding: next-trade-baseline-multiplier + name: Auction end multiplier + description: > + The multiplier to apply to the last trade to set the baseline for the next auction. + min: 0 + presets: + - name: Disabled (0) + value: 0 + - name: 0.7x + value: 0.7 + - name: 0.8x + value: 0.8 + - name: 0.9x + value: 0.9 + - name: 0.95x + value: 0.95 + - name: 0.99x + value: 0.99 + - binding: initial-io + name: Kickoff IOEN per USDC + description: > + The initial IOEN per USDC to kickoff the first auction (e.g. 330). + min: 0 + - deployment: bsc-tft-busd name: Buy TFT with BUSD on BSC. description: > diff --git a/public/_strategies/raindex/4-canary/canary.rain b/public/_strategies/raindex/4-canary/canary.rain new file mode 100644 index 00000000..f3aa33a8 --- /dev/null +++ b/public/_strategies/raindex/4-canary/canary.rain @@ -0,0 +1,140 @@ +raindex-version: 8898591f3bcaa21dc91dc3b8584330fc405eadfa + +networks: + base: + rpc: https://mainnet.base.org + chain-id: 8453 + network-id: 8453 + currency: ETH + +subgraphs: + base: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-base/0.7/gn + +metaboards: + base: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-base-0x59401C93/0.1/gn + +orderbooks: + base: + address: 0xd2938e7c9fe3597f78832ce780feb61945c377d7 + network: base + subgraph: base + +deployers: + base: + address: 0xC1A14cE2fd58A3A2f99deCb8eDd866204eE07f8D + network: base + +tokens: + base-usdc: + network: base + address: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 + decimals: 6 + base-weth: + network: base + address: 0x4200000000000000000000000000000000000006 + decimals: 18 + +orders: + base: + orderbook: base + network: base + inputs: + # Input is irrelevant because we always set the IO ratio to 0. + - token: base-usdc + outputs: + - token: base-weth + +scenarios: + base: + deployer: base + orderbook: base + runs: 1 + bindings: + raindex-subparser: 0x662dFd6d5B6DF94E07A60954901D3001c24F856a + +deployments: + base: + order: base + scenario: base + +gui: + name: Canary + description: > + Does nothing except give a bounty to the solver regularly. Useful to test + that there are solvers active on a given network/Raindex deployment. + deployments: + - deployment: base + name: Canary on Base. + description: + A simple strategy that gives a bounty to the solver regularly. + deposits: + - token: base-weth + min: 0 + presets: + - 0 + - 0.001 + - 0.01 + fields: + - binding: cooldown + name: Cooldown between possible trades in seconds. + min: 120 + presets: + - name: Two minutes (120) + value: 120 + - name: Five minutes (300) + value: 300 + - name: 1 hour (3600) + value: 3600 + - binding: min-bounty + name: Minimum bounty to give to the solver (in ETH). + min: 0 + presets: + - value: 0 + - value: 0.0000003 + - binding: max-bounty + name: Maximum bounty to give to the solver (in ETH). + min: 0 + presets: + - value: 0.00005 + - binding: time-per-epoch + name: Total auction duration in seconds. + min: 1 + presets: + - name: 5 minutes + value: 300 + - name: 15 minutes + value: 900 + - name: 1 hour + value: 3600 + +--- +#raindex-subparser !The subparser contract address for Raindex. +#cooldown !The time in seconds between possible trades. +#min-bounty !The minimum bounty to give to the solver. +#max-bounty !The maximum bounty to give to the solver. +#time-per-epoch !The time in seconds for an epoch. There is only one epoch in this strategy. + +#calculate-io +using-words-from raindex-subparser +last-trade: get(order-hash()), +open-trade-time: add(last-trade cooldown), +:ensure( + greater-than( + now() + open-trade-time + ) + "Cooldown" +), +:set(order-hash() now()), +duration: sub(now() open-trade-time), +epoch: div(duration time-per-epoch), +auction-bounty: linear-growth(min-bounty sub(max-bounty min-bounty) epoch), +bounty: min(max-bounty auction-bounty), +ratio: 0; + +#handle-io +:; + +#handle-add-order +using-words-from raindex-subparser +:set(order-hash() now()); \ No newline at end of file diff --git a/public/_strategies/raindex/4-canary/description.md b/public/_strategies/raindex/4-canary/description.md new file mode 100644 index 00000000..fea12beb --- /dev/null +++ b/public/_strategies/raindex/4-canary/description.md @@ -0,0 +1,16 @@ +The canary order does nothing except run on a cooldown and hand tokens over to +the solver for free (to pay for gas). + +It is useful only to show that orders clear on some network. If the canary is +deployed and does not run, it means that there are no solvers monitoring the +network, or at least not the raindex contract that the canary is deployed on. + +The canary is basically a stripped back version of the sampler. It runs but +doesn't sample anything. + +Anyone can deploy this strat and fund it themselves to convince themselves that +there is at least one solver operational on some network. + +It's somewhat morbidly named after canaries in old coal mines that would quickly +die if there was a gas leak, hopefully alerting everyone else to evacuate to +safety in time, or repair the leak.