From 355bc482db9d61717dfa6536fe7b2def64b41c59 Mon Sep 17 00:00:00 2001 From: Bryan Fullam Date: Fri, 27 Sep 2024 16:38:06 +0200 Subject: [PATCH 01/12] Commenting for clarity --- .../[strategyName]/[deployment]/route.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/frames/[projectName]/[strategyName]/[deployment]/route.tsx b/app/frames/[projectName]/[strategyName]/[deployment]/route.tsx index 80972114..8e6e7198 100644 --- a/app/frames/[projectName]/[strategyName]/[deployment]/route.tsx +++ b/app/frames/[projectName]/[strategyName]/[deployment]/route.tsx @@ -18,17 +18,22 @@ const handleRequest = frames(async (ctx) => { const yamlData = ctx.yamlData; let currentState: FrameState = ctx.state as unknown as FrameState; - // Handle state restoration after transactions + // Handle state restoration from URL after transactions if (ctx.url.searchParams.has("currentState")) { currentState = JSON.parse( decodeURI(ctx.url.searchParams.get("currentState")!) ); } + // Add strategy name and description to state from YAML if (currentState && !currentState.strategyName) { currentState.strategyName = yamlData.gui.name; } + if (currentState && !currentState.strategyDescription) { + currentState.strategyDescription = yamlData.gui.description; + } + // Add deployment option to state from URL if ( currentState && !currentState.deploymentOption && @@ -41,10 +46,7 @@ const handleRequest = frames(async (ctx) => { ) || undefined; } - if (currentState && !currentState.strategyDescription) { - currentState.strategyDescription = yamlData.gui.description; - } - + // Get token infos from YAML if (currentState && !currentState.tokenInfos.length) { const tokenInfos = await getTokenInfos(yamlData); currentState.tokenInfos = tokenInfos; @@ -85,10 +87,10 @@ const handleRequest = frames(async (ctx) => { // Generate buttons based on current state const buttonsData = await generateButtonsData(yamlData, currentState); + // Load font const dmSansLight = fs.readFile( path.join(path.resolve(process.cwd(), "public/_fonts"), "DMSans-Light.ttf") ); - const [dmSansLightData] = await Promise.all([dmSansLight]); return { From 2439b303111f145a3f3ce77440d039186eae4203 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Fri, 27 Sep 2024 23:10:55 +0400 Subject: [PATCH 02/12] add ci --- .github/workflows/rainix.yaml | 25 +++++++++++++++++++++++++ flake.nix | 11 ++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/rainix.yaml diff --git a/.github/workflows/rainix.yaml b/.github/workflows/rainix.yaml new file mode 100644 index 00000000..ec3ad594 --- /dev/null +++ b/.github/workflows/rainix.yaml @@ -0,0 +1,25 @@ +name: Rainix CI +on: [push] + +concurrency: + group: ${{ github.ref }}-rainix + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + standard-tests: + strategy: + matrix: + os: [ubuntu-latest] + task: [rainframe-test] + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v4 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - name: Run ${{ matrix.task }} + run: nix develop -c ${{ matrix.task }} \ No newline at end of file diff --git a/flake.nix b/flake.nix index 071876d1..cb1f6b6b 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,16 @@ outputs = { self, flake-utils, rainix }: flake-utils.lib.eachDefaultSystem (system: { - packages = rainix.packages.${system}; + packages = rec { + rainframe-test = rainix.mkTask.${system} { + name = "rainframe-test"; + body = '' + set -euxo pipefail + npm i + ''; + }; + + } // rainix.packages.${system}; devShells = rainix.devShells.${system}; } ); From dfbedf643e75dbc08377363d40e5fa5f3ac41962 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Fri, 27 Sep 2024 23:28:53 +0400 Subject: [PATCH 03/12] fix nix --- flake.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index cb1f6b6b..32624bdd 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,9 @@ outputs = { self, flake-utils, rainix }: flake-utils.lib.eachDefaultSystem (system: - { + let + pkgs = rainix.pkgs.${system}; + in rec { packages = rec { rainframe-test = rainix.mkTask.${system} { name = "rainframe-test"; @@ -19,7 +21,16 @@ }; } // rainix.packages.${system}; - devShells = rainix.devShells.${system}; + + devShells.default = pkgs.mkShell { + packages = [ + packages.rainframe-test + ]; + + shellHook = rainix.devShells.${system}.default.shellHook; + buildInputs = rainix.devShells.${system}.default.buildInputs; + nativeBuildInputs = rainix.devShells.${system}.default.nativeBuildInputs; + }; } ); } \ No newline at end of file From 6cf394b3269b96506a371cecfcb38f65195db76f Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sat, 28 Sep 2024 13:14:54 +0400 Subject: [PATCH 04/12] wip on arbitrum --- public/_images/arbitrum-arb-logo-full.svg | 48 +++++++++++++++++++++++ public/_strategies/arbitrum/frame.md | 3 ++ public/_strategies/arbitrum/webapp.md | 15 +++++++ 3 files changed, 66 insertions(+) create mode 100644 public/_images/arbitrum-arb-logo-full.svg create mode 100644 public/_strategies/arbitrum/frame.md create mode 100644 public/_strategies/arbitrum/webapp.md diff --git a/public/_images/arbitrum-arb-logo-full.svg b/public/_images/arbitrum-arb-logo-full.svg new file mode 100644 index 00000000..11ba2d1c --- /dev/null +++ b/public/_images/arbitrum-arb-logo-full.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/_strategies/arbitrum/frame.md b/public/_strategies/arbitrum/frame.md new file mode 100644 index 00000000..51cbf930 --- /dev/null +++ b/public/_strategies/arbitrum/frame.md @@ -0,0 +1,3 @@ +# Test project + +Test description \ No newline at end of file diff --git a/public/_strategies/arbitrum/webapp.md b/public/_strategies/arbitrum/webapp.md new file mode 100644 index 00000000..66f29d05 --- /dev/null +++ b/public/_strategies/arbitrum/webapp.md @@ -0,0 +1,15 @@ + + +# Raindex strategies on Arbitrum + +## Want to run a Raindex strategy on Arbitrum? + +Raindex allows anyone to deploy non-custodial, perpetual, and automated trading strategies on Arbitrum. + +## How to deploy + +1. Choose a strategy - this page has a number of strategies that you can choose from. Choose the strategy that aligns with your convictions. + +2. Watch the videos and follow the instructions to configure and deploy the strategy. + +3. Monitor the performance of the strategy, deposit and withdraw funds at any time. \ No newline at end of file From 02b423459dfc46c481b50d5d5d0ee782d7ea5d41 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sat, 28 Sep 2024 16:01:33 +0400 Subject: [PATCH 05/12] wip on arb dca --- .../arbitrum/0-auction-dca/auction-dca.rain | 175 ++++++++++++++++++ .../arbitrum/0-auction-dca/description.md | 0 2 files changed, 175 insertions(+) create mode 100644 public/_strategies/arbitrum/0-auction-dca/auction-dca.rain create mode 100644 public/_strategies/arbitrum/0-auction-dca/description.md diff --git a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain new file mode 100644 index 00000000..67e13a2b --- /dev/null +++ b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain @@ -0,0 +1,175 @@ +raindex-version: 8898591f3bcaa21dc91dc3b8584330fc405eadfa + +deployers: + arbitrum: + address: 0x9B0D254bd858208074De3d2DaF5af11b3D2F377F + network: arbitrum + +tokens: + arbitrum-wbtc: + network: arbitrum + address: 0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f + decimals: 8 + arbitrum-weth: + network: arbitrum + address: 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1 + decimals: 18 + +orders: + arbitrum-wbtc-weth: + orderbook: arbitrum + inputs: + - token: arbitrum-weth + outputs: + - token: arbitrum-wbtc + +scenarios: + arbitrum: + orderbook: arbitrum + runs: 1 + bindings: + time-per-amount-epoch: 86400 + amount-per-epoch: 24 + time-per-trade-epoch: 10800 + initial-io: 0.0005 + baseline: 0.0002 + next-trade-multiplier: 1.3 + next-trade-baseline-multiplier: 0.7 + min-trade-amount: 0.1 + max-trade-amount: 10 + +charts: + arbitrum: + +deployments: + arbitrum-wbtc-weth: + order: arbitrum-wbtc-weth + scenario: arbitrum + +gui: + name: Auction based cost averaging + description: > + Swap some token for another token regularly over time, using a preset budget. + + This is called "cost averaging" because spreading out a single large swap + into many smaller swaps over time reduces the impact of temporary market + movements. + deployments: + - deployment: arbitrum-wbtc-weth + name: Sell WBTC for WETH on Arbitrum. + description: > + Participate in [the flippening](https://ultrasound.money/#flippening) by swapping WBTC for WETH on Arbitrum. + fields: + - binding: time-per-amount-epoch + name: Time per amount epoch + description: > + The duration of one unit of streaming amount halflife. + +--- +#raindex-subparser 0x662dFd6d5B6DF94E07A60954901D3001c24F856a + +#time-per-amount-epoch !Duration of one unit of streaming amount halflife. +#time-per-trade-epoch !Duration of one unit of io ratio halflife. +#amount-per-epoch !Amount of output token to approve for buying per epoch. +#next-trade-multiplier !Start next auction at this x the last trade. +#next-trade-baseline-multiplier !Lifts the baseline to here relative to the previous trade. +#baseline !Minimum io ratio. This component of the io ratio is ignored by the halflife calculations. +#initial-io !Strat will be initialized with this as the starting last trade. Must be larger than baseline. +#min-trade-amount !Each trade must be at least this many output tokens. +#max-trade-amount !Each trade will be capped at this many tokens. + +#last-trade-time-key "last-trade-time" +#last-trade-io-key "last-trade-io" +#initial-time-key "initial-time" +#amount-used-key "amount-used" + +#set-last-trade +last-io:, +:set(hash(order-hash() last-trade-time-key) now()), +:set(hash(order-hash() last-trade-io-key) last-io); + +#set-initial-time +:set(hash(order-hash() initial-time-key) now()); + +#get-initial-time +:get(hash(order-hash() initial-time-key)); + +#get-last-trade +last-time:get(hash(order-hash() last-trade-time-key)), +last-io:get(hash(order-hash() last-trade-io-key)); + +#get-epoch +last-time _: call<'get-last-trade>(), +duration: sub(now() last-time), +initial-time: call<'get-initial-time>(), +total-duration: sub(now() initial-time), +amount-epochs: div(total-duration time-per-amount-epoch), +trade-epochs: div(duration time-per-trade-epoch); + +#amount-for-epoch +amount-epochs:, +total-available: linear-growth(0 amount-per-epoch amount-epochs), +used: get(hash(order-hash() amount-used-key)), +unused: sub(total-available used), +capped-unused: min(unused max-trade-amount); + +#halflife +max-val epoch:, +/** + * Shrinking the multiplier like this + * then applying it 10 times allows for + * better precision when max-io-ratio + * is very large, e.g. ~1e10 or ~1e20+ + * + * This works because `power` loses + * precision on base `0.5` when the + * exponent is large and can even go + * to `0` while the io-ratio is still + * large. Better to keep the multiplier + * higher precision and drop the io-ratio + * smoothly for as long as we can. + */ +multiplier: + power(0.5 div(epoch 10)), +val: + mul( + max-val + multiplier + multiplier + multiplier + multiplier + multiplier + multiplier + multiplier + multiplier + multiplier + multiplier + ); + +#io-for-epoch +epoch:, +last-io: call<'get-last-trade>(), +max-next-trade: mul(last-io next-trade-multiplier), +baseline-next-trade: mul(last-io next-trade-baseline-multiplier), +real-baseline: max(baseline-next-trade baseline), +variable-component: saturating-sub(max-next-trade real-baseline), +above-baseline: call<'halflife>(variable-component epoch), +_: add(real-baseline above-baseline); + +#handle-add-order +using-words-from raindex-subparser +:call<'set-last-trade>(initial-io), +:call<'set-initial-time>(); + +#calculate-io +using-words-from raindex-subparser +amount-epochs +trade-epochs:call<'get-epoch>(), +max-output: call<'amount-for-epoch>(amount-epochs), +io: call<'io-for-epoch>(trade-epochs), +:call<'set-last-trade>(io); + +#handle-io +:ensure(greater-than-or-equal-to(output-vault-decrease() min-trade-amount) "Min trade amount."), +used: get(hash(order-hash() amount-used-key)), +:set(hash(order-hash() amount-used-key) add(used output-vault-decrease())); \ No newline at end of file diff --git a/public/_strategies/arbitrum/0-auction-dca/description.md b/public/_strategies/arbitrum/0-auction-dca/description.md new file mode 100644 index 00000000..e69de29b From 03c7bd1da30332e3a5ca96c58b7ab225fd814c56 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sat, 28 Sep 2024 17:52:18 +0400 Subject: [PATCH 06/12] wip on arb dca --- .../arbitrum/0-auction-dca/auction-dca.rain | 129 +++++++++++++++--- 1 file changed, 113 insertions(+), 16 deletions(-) diff --git a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain index 67e13a2b..de8a1d95 100644 --- a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain +++ b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain @@ -1,5 +1,24 @@ raindex-version: 8898591f3bcaa21dc91dc3b8584330fc405eadfa +networks: + arbitrum: + rpc: https://rpc.ankr.com/arbitrum + chain-id: 42161 + network-id: 42161 + currency: ETH + +metaboards: + arbitrum: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-arbitrum/0.1/gn + +subgraphs: + arbitrum: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-arbitrum/0.1/gn + +orderbooks: + arbitrum: + address: 0x550878091b2B1506069F61ae59e3A5484Bca9166 + network: arbitrum + subgraph: arbitrum + deployers: arbitrum: address: 0x9B0D254bd858208074De3d2DaF5af11b3D2F377F @@ -28,15 +47,7 @@ scenarios: orderbook: arbitrum runs: 1 bindings: - time-per-amount-epoch: 86400 - amount-per-epoch: 24 - time-per-trade-epoch: 10800 - initial-io: 0.0005 - baseline: 0.0002 - next-trade-multiplier: 1.3 - next-trade-baseline-multiplier: 0.7 - min-trade-amount: 0.1 - max-trade-amount: 10 + raindex-subparser: 0xb06202aA3Fe7d85171fB7aA5f17011d17E63f382 charts: arbitrum: @@ -54,6 +65,9 @@ gui: This is called "cost averaging" because spreading out a single large swap into many smaller swaps over time reduces the impact of temporary market movements. + + The strategy works by repeatedly auctioning off tokens with an exponential + decay in the price, that resets each trade. deployments: - deployment: arbitrum-wbtc-weth name: Sell WBTC for WETH on Arbitrum. @@ -61,22 +75,105 @@ gui: Participate in [the flippening](https://ultrasound.money/#flippening) by swapping WBTC for WETH on Arbitrum. fields: - binding: time-per-amount-epoch - name: 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). + - binding: amount-per-epoch + name: Budget amount (per period) + description: > + The amount of WBTC to spend each budget period. + + For example, if the budget is daily and this is 0.01 then 0.01 WBTC will be sold for WETH each day. + - binding: min-trade-amount + name: Minimum trade amount description: > - The duration of one unit of streaming amount halflife. + The minimum amount of WBTC to sell in a single auction. + - binding: max-trade-amount + name: Maximum trade amount + description: > + The maximum amount of WBTC to sell in a single auction. + + - binding: time-per-trade-epoch + name: Auction period (in seconds) + description: > + The auction period is the time between each auction price halvening. + + As the auction is an exponential decay, the price will halve every time this period passes. + + For example, if the auction period is 1 hour then this is 3600 seconds (60 * 60). + If this hourly auction starts at 30 WETH per WBTC, and the baseline is 10 WETH per WBTC, + then the price will be 20 WETH per WBTC after 1 hour (halfway between 30 and 10), + 15 WETH per WBTC after 2 hours (halfway between 20 and 10), + and so on. + - binding: baseline + name: Baseline price + description: > + The absolute minimum amount of WETH per WBTC that the auction will + trade at. + + This is the inverse (i.e. `1 / x`) of the ETH/BTC ratio. + + For example, 20 WETH per WBTC would mean never selling WBTC when the + ETH/BTC ratio is worse than 0.05. + + This can be set to 0 to disable the baseline. + - binding: next-trade-multiplier + name: Auction start multiplier + description: > + The multiplier to apply to the last trade to kick off the next auction. + + For example, if this is 1.1 and the last trade was at 20 WETH per WBTC, + then the next auction will start at 22 WETH per WBTC. + + This should always be greater than 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. + + For example, if this is 0.9 and the last trade was at 20 WETH per WBTC, + then the next auction will end at 18 WETH per WBTC. + + Note that this moving baseline is ignored if it goes below the baseline. + I.e. the absolute minimum baseline overrides this if necessary. + + This can be set to 0 to disable the moving baseline. + - binding: initial-io + name: Kickoff price + description: > + The initial WETH per WBTC to kickoff the first auction. + + The strategy will pretend that a trade was made at this price before + the first auction, so that everything else can be calculated from there. + + This is WETH per WBTC, so if the ETH/BTC ratio is 0.05 then this should be 20. + + You can set this much higher than the market rates to start the strategy + off easily, for example you could set it at 50 if the market was around 20-25. + + There is no need for this to be exact, it just has to be ballpark and + definitely higher than the market. Any number within 1-10x the real + price should be fine. + + This should be greater than the baseline. + --- -#raindex-subparser 0x662dFd6d5B6DF94E07A60954901D3001c24F856a +#raindex-subparser !Raindex subparser. #time-per-amount-epoch !Duration of one unit of streaming amount halflife. -#time-per-trade-epoch !Duration of one unit of io ratio halflife. #amount-per-epoch !Amount of output token to approve for buying per epoch. +#min-trade-amount !Each trade must be at least this many output tokens. +#max-trade-amount !Each trade will be capped at this many tokens. + +#time-per-trade-epoch !Duration of one unit of io ratio halflife. +#baseline !Minimum io ratio. This component of the io ratio is ignored by the halflife calculations. + #next-trade-multiplier !Start next auction at this x the last trade. #next-trade-baseline-multiplier !Lifts the baseline to here relative to the previous trade. -#baseline !Minimum io ratio. This component of the io ratio is ignored by the halflife calculations. #initial-io !Strat will be initialized with this as the starting last trade. Must be larger than baseline. -#min-trade-amount !Each trade must be at least this many output tokens. -#max-trade-amount !Each trade will be capped at this many tokens. #last-trade-time-key "last-trade-time" #last-trade-io-key "last-trade-io" From ec32e8035220daed752e77d4d1770e42134c9365 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sat, 28 Sep 2024 20:51:18 +0400 Subject: [PATCH 07/12] wip on wbtc to weth --- .../arbitrum/0-auction-dca/auction-dca.rain | 86 +++++++++++++++++-- 1 file changed, 77 insertions(+), 9 deletions(-) diff --git a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain index de8a1d95..49327053 100644 --- a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain +++ b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain @@ -73,28 +73,57 @@ gui: name: Sell WBTC for WETH on Arbitrum. description: > Participate in [the flippening](https://ultrasound.money/#flippening) by swapping WBTC for WETH on Arbitrum. + deposits: + - token: arbitrum-wbtc + min: 0 + presets: + - 0 + - 0.001 + - 0.01 + - 0.1 + - 0.2 + 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 second (1) + value: 1 + - 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 amount (per period) + name: Budget (WBTC per period) description: > The amount of WBTC to spend each budget period. For example, if the budget is daily and this is 0.01 then 0.01 WBTC will be sold for WETH each day. + min: 0 - binding: min-trade-amount - name: Minimum trade amount + name: Minimum trade size description: > The minimum amount of WBTC to sell in a single auction. + min: 0 - binding: max-trade-amount - name: Maximum trade amount + name: Maximum trade size description: > The maximum amount of WBTC to sell in a single auction. - + min: 0 - binding: time-per-trade-epoch name: Auction period (in seconds) description: > @@ -107,6 +136,15 @@ gui: then the price will be 20 WETH per WBTC after 1 hour (halfway between 30 and 10), 15 WETH per WBTC after 2 hours (halfway between 20 and 10), and so on. + presets: + - name: Per second (1) + value: 1 + - name: Per minute (60) + value: 60 + - name: Per hour (3600) + value: 3600 + - name: Per day (86400) + value: 86400 - binding: baseline name: Baseline price description: > @@ -119,6 +157,15 @@ gui: ETH/BTC ratio is worse than 0.05. This can be set to 0 to disable the baseline. + presets: + - name: 10 + value: 10 + - name: 20 + value: 20 + - name: 25 + value: 25 + - name: 30 + value: 30 - binding: next-trade-multiplier name: Auction start multiplier description: > @@ -126,8 +173,16 @@ gui: For example, if this is 1.1 and the last trade was at 20 WETH per WBTC, then the next auction will start at 22 WETH per WBTC. - - This should always be greater than 1. + 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: > @@ -139,9 +194,22 @@ gui: Note that this moving baseline is ignored if it goes below the baseline. I.e. the absolute minimum baseline overrides this if necessary. - This can be set to 0 to disable the moving baseline. + This can be set to 0 to disable the moving baseline, and should be less than 1. + 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 price + name: Kickoff WETH per WBTC description: > The initial WETH per WBTC to kickoff the first auction. @@ -158,7 +226,7 @@ gui: price should be fine. This should be greater than the baseline. - + min: 0 --- #raindex-subparser !Raindex subparser. From 6f8741454efc5ea59300fe3f2b7867281a927b92 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sun, 29 Sep 2024 22:18:01 +0400 Subject: [PATCH 08/12] better auction times --- .../arbitrum/0-auction-dca/auction-dca.rain | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain index 49327053..dfca9897 100644 --- a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain +++ b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain @@ -137,13 +137,21 @@ gui: 15 WETH per WBTC after 2 hours (halfway between 20 and 10), and so on. presets: - - name: Per second (1) - value: 1 - - name: Per minute (60) - value: 60 - - name: Per hour (3600) + - name: Every 20 minutes (1200) + value: 1200 + - name: Every 30 minutes (1800) + value: 1800 + - name: Every hour (3600) value: 3600 - - name: Per day (86400) + - 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 price From f1e3c0047ae3645f45e16633767d3d9c0567e8d2 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sun, 29 Sep 2024 22:47:06 +0400 Subject: [PATCH 09/12] better auction times --- public/_strategies/arbitrum/0-auction-dca/auction-dca.rain | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain index dfca9897..66d717d2 100644 --- a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain +++ b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain @@ -93,8 +93,6 @@ gui: For example, if the budget is daily then this is 86400 seconds (24 * 60 * 60). min: 1 presets: - - name: Per second (1) - value: 1 - name: Per minute (60) value: 60 - name: Per hour (3600) From eb43fbad3c100dda6afd37e8763c6a32c031a768 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sun, 29 Sep 2024 23:07:19 +0400 Subject: [PATCH 10/12] tweak dca form --- .../arbitrum/0-auction-dca/auction-dca.rain | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain index 66d717d2..68c3a341 100644 --- a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain +++ b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain @@ -112,16 +112,16 @@ gui: For example, if the budget is daily and this is 0.01 then 0.01 WBTC will be sold for WETH each day. min: 0 - - binding: min-trade-amount - name: Minimum trade size - description: > - The minimum amount of WBTC to sell in a single auction. - min: 0 - binding: max-trade-amount name: Maximum trade size description: > The maximum amount of WBTC to sell in a single auction. min: 0 + - binding: min-trade-amount + name: Minimum trade size + description: > + The minimum amount of WBTC to sell in a single auction. + min: 0 - binding: time-per-trade-epoch name: Auction period (in seconds) description: > From ecf10d854cd16a22493a77f842c99d412efd7c56 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sun, 29 Sep 2024 23:15:11 +0400 Subject: [PATCH 11/12] presets for init ratio for btc --- public/_strategies/arbitrum/0-auction-dca/auction-dca.rain | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain index 68c3a341..f8a05460 100644 --- a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain +++ b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain @@ -233,6 +233,11 @@ gui: This should be greater than the baseline. min: 0 + presets: + - name: 50 + value: 50 + - name: 100 + value: 100 --- #raindex-subparser !Raindex subparser. From b112439d7a0460f470295e449a899c3cc1eb2990 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sun, 29 Sep 2024 23:22:37 +0400 Subject: [PATCH 12/12] presets for init ratio for btc --- public/_strategies/arbitrum/0-auction-dca/auction-dca.rain | 1 + 1 file changed, 1 insertion(+) diff --git a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain index f8a05460..c5b38df3 100644 --- a/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain +++ b/public/_strategies/arbitrum/0-auction-dca/auction-dca.rain @@ -78,6 +78,7 @@ gui: min: 0 presets: - 0 + - 0.0001 - 0.001 - 0.01 - 0.1