From a8dfa11517502826da2bc77792d93d7207823faa Mon Sep 17 00:00:00 2001 From: Siddharth2207 Date: Tue, 7 Jan 2025 12:17:48 +0530 Subject: [PATCH 1/2] STG setup --- .../raindex/1-auction-dca/auction-dca.rain | 514 ++++++++++++++++++ public/_strategies/raindex/3-grid/grid.rain | 202 +++++++ 2 files changed, 716 insertions(+) diff --git a/public/_strategies/raindex/1-auction-dca/auction-dca.rain b/public/_strategies/raindex/1-auction-dca/auction-dca.rain index 84a56dec..0564f672 100644 --- a/public/_strategies/raindex/1-auction-dca/auction-dca.rain +++ b/public/_strategies/raindex/1-auction-dca/auction-dca.rain @@ -124,6 +124,14 @@ tokens: network: bsc address: 0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56 decimals: 18 + bsc-stg: + network: bsc + address: 0xB0D502E938ed5f4df2E681fE6E419ff29631d62b + decimals: 18 + bsc-usdt: + network: bsc + address: 0x55d398326f99059fF775485246999027B3197955 + decimals: 18 base-cbbtc: network: base address: 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf @@ -221,6 +229,10 @@ tokens: network: polygon address: 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 decimals: 6 + polygon-stg: + network: polygon + address: 0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590 + decimals: 18 polygon-gfi: network: polygon address: 0x874e178A2f3f3F9d34db862453Cd756E7eAb0381 @@ -294,6 +306,20 @@ orders: - token: bsc-busd outputs: - token: bsc-tft + bsc-stg-usdt: + orderbook: bsc + network: bsc + inputs: + - token: bsc-stg + outputs: + - token: bsc-usdt + bsc-usdt-stg: + orderbook: bsc + network: bsc + inputs: + - token: bsc-usdt + outputs: + - token: bsc-stg base-cbbtc-usdc: orderbook: base network: base @@ -574,6 +600,20 @@ orders: - token: polygon-usdce outputs: - token: polygon-gfi + polygon-stg-usdce: + orderbook: polygon + network: polygon + inputs: + - token: polygon-stg + outputs: + - token: polygon-usdce + polygon-usdce-stg: + orderbook: polygon + network: polygon + inputs: + - token: polygon-usdce + outputs: + - token: polygon-stg polygon-usdc-ioen: orderbook: polygon network: polygon @@ -719,6 +759,12 @@ deployments: polygon-usdce-gfi: order: polygon-usdce-gfi scenario: polygon + polygon-stg-usdce: + order: polygon-stg-usdce + scenario: polygon + polygon-usdce-stg: + order: polygon-usdce-stg + scenario: polygon polygon-ioen-usdc: order: polygon-ioen-usdc scenario: polygon @@ -731,6 +777,12 @@ deployments: bsc-busd-tft: order: bsc-busd-tft scenario: bsc + bsc-stg-usdt: + order: bsc-stg-usdt + scenario: bsc + bsc-usdt-stg: + order: bsc-usdt-stg + scenario: bsc base-cbbtc-usdc: order: base-cbbtc-usdc scenario: base @@ -2846,6 +2898,238 @@ gui: The initial GFI per USDCe to kickoff the first auction (e.g. 250). min: 0 + - deployment: polygon-usdce-stg + name: Sell STG for USDC.e on Polygon. + description: > + DCA STG for USDC.e on Polygon. + deposits: + - token: polygon-stg + min: 0 + presets: + - 0 + - 100 + - 1000 + - 10000 + - 100000 + 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 (STG per period) + description: > + The amount of STG to spend each budget period. + + For example, if the budget is daily and this is 1000 then 1000 STG will be sold for USDC.e each day. + min: 0 + - binding: max-trade-amount + name: Maximum trade size (STG) + description: > + The maximum amount of STG to sell in a single auction. + min: 0 + - binding: min-trade-amount + name: Minimum trade size (STG) + description: > + The minimum amount of STG 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.e per STG + description: > + The absolute minimum amount of USDC.e per STG that the auction will trade at (e.g. 0.479). + 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.e per STG + description: > + The initial USDC.e per STG to kickoff the first auction (e.g. 0.479). + min: 0 + + - deployment: polygon-stg-usdce + name: Buy STG with USDCe on Polygon. + description: > + DCA USDCe for STG on Polygon. + deposits: + - token: polygon-usdce + 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 (USDCe per period) + description: > + The amount of USDCe to spend each budget period. + + For example, if the budget is daily and this is 100 then 100 USDCe will be sold for STG each day. + min: 0 + - binding: max-trade-amount + name: Maximum trade size (USDCe) + description: > + The maximum amount of USDCe to sell in a single auction. + min: 0 + - binding: min-trade-amount + name: Minimum trade size (USDCe) + description: > + The minimum amount of USDCe 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 STG per USDCe + description: > + The absolute minimum amount of STG per USDCe that the auction will trade at (e.g. 1.5). + 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 STG per USDCe + description: > + The initial STG per USDCe to kickoff the first auction (e.g. 2.08). + min: 0 + - deployment: polygon-usdc-ioen name: Sell IOEN for USDC on Polygon. description: > @@ -3308,6 +3592,236 @@ gui: The initial BUSD per TFT to kickoff the first auction (e.g. 0.009 BUSD per TFT) min: 0 + - deployment: bsc-stg-usdt + name: Buy STG with USDT on BSC. + description: > + Swap USDT for STG on BSC. + deposits: + - token: bsc-usdt + min: 0 + presets: + - 0 + - 100 + - 1000 + - 10000 + - 100000 + + 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 (USDT per period) + description: > + The amount of USDT to spend each budget period. + + For example, if the budget is daily and this is 1000 then 1000 USDT will be spent buying STG each day. + min: 0 + - binding: max-trade-amount + name: Maximum trade size (USDT) + description: > + The maximum amount of USDT to spend in a single auction. + min: 0 + - binding: min-trade-amount + name: Minimum trade size (USDT) + description: > + The minimum amount of USDT to spend 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. + 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 STG per USDT + description: > + The absolute minimum amount of STG per USDT that the auction will trade at (e.g. 1.5) + 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. + 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 STG per USDT + description: > + The initial STG per USDT to kickoff the first auction. (e.g. 2.08) + min: 0 + + - deployment: bsc-usdt-stg + name: Sell STG for USDT on BSC. + description: > + Swap STG for USDT on BSC. + deposits: + - token: bsc-stg + min: 0 + presets: + - 0 + - 100 + - 1000 + - 10000 + - 100000 + + 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 (STG per period) + description: > + The amount of STG to spend each budget period. + + For example, if the budget is daily and this is 100 then 100 STG will be sold for USDT each day. + min: 0 + - binding: max-trade-amount + name: Maximum trade size (STG) + description: > + The maximum amount of STG to sell in a single auction. + min: 0 + - binding: min-trade-amount + name: Minimum trade size (STG) + description: > + The minimum amount of STG 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. + 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 USDT per STG + description: > + The absolute minimum amount of USDT per STG that the auction will trade at (e.g. 0.40 USDT per STG). + 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. + 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 USDT per STG + description: > + The initial USDT per STG to kickoff the first auction (e.g. 0.47 USDT per STG) + min: 0 + - deployment: base-cbbtc-usdc name: Buy cbBTC with USDC on Base. description: > diff --git a/public/_strategies/raindex/3-grid/grid.rain b/public/_strategies/raindex/3-grid/grid.rain index e7d220b7..f8e44ad1 100644 --- a/public/_strategies/raindex/3-grid/grid.rain +++ b/public/_strategies/raindex/3-grid/grid.rain @@ -91,6 +91,14 @@ tokens: network: bsc address: 0x8f0FB159380176D324542b3a7933F0C2Fd0c2bbf decimals: 7 + bsc-usdt: + network: bsc + address: 0x55d398326f99059fF775485246999027B3197955 + decimals: 18 + bsc-stg: + network: bsc + address: 0xB0D502E938ed5f4df2E681fE6E419ff29631d62b + decimals: 18 bsc-busd: network: bsc address: 0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56 @@ -98,6 +106,14 @@ tokens: network: polygon address: 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359 decimals: 6 + polygon-stg: + network: polygon + address: 0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590 + decimals: 18 + polygon-usdce: + network: polygon + address: 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 + decimals: 6 polygon-ioen: network: polygon address: 0xd0e9c8f5Fae381459cf07Ec506C1d2896E8b5df6 @@ -147,6 +163,20 @@ orders: - token: bsc-busd outputs: - token: bsc-tft + bsc-usdt-stg: + orderbook: bsc + network: bsc + inputs: + - token: bsc-usdt + outputs: + - token: bsc-stg + bsc-stg-usdt: + orderbook: bsc + network: bsc + inputs: + - token: bsc-stg + outputs: + - token: bsc-usdt polygon-usdc-ioen: orderbook: polygon network: polygon @@ -154,6 +184,20 @@ orders: - token: polygon-usdc outputs: - token: polygon-ioen + polygon-stg-usdce: + orderbook: polygon + network: polygon + inputs: + - token: polygon-stg + outputs: + - token: polygon-usdce + polygon-usdce-stg: + orderbook: polygon + network: polygon + inputs: + - token: polygon-usdce + outputs: + - token: polygon-stg scenarios: base: @@ -194,6 +238,12 @@ deployments: bsc-busd-tft: order: bsc-busd-tft scenario: bsc + bsc-usdt-stg: + order: bsc-usdt-stg + scenario: bsc + bsc-stg-usdt: + order: bsc-stg-usdt + scenario: bsc polygon-usdc-ioen: order: polygon-usdc-ioen scenario: polygon @@ -352,6 +402,158 @@ gui: - name: 24 hours (86400) value: 86400 + - deployment: bsc-usdt-stg + name: Grid sell STG for USDT on BSC. + description: + Grid sell STG for USDT on BSC network. + deposits: + - token: bsc-stg + min: 0 + presets: + - 0 + - 100 + - 500 + - 1000 + - 2000 + fields: + - binding: baseline-io-ratio + name: Baseline USDT per STG (e.g. 0.47) + min: 0 + - binding: io-ratio-growth + name: IO ratio growth per tranche (e.g. 0.01) + min: 0 + - binding: tranche-size + name: Tranche size in STG (e.g. 100) + min: 0 + - binding: seconds-per-tranche + name: Time to recharge one grid tranche in seconds (0 is disabled). + min: 0 + presets: + - name: Disabled (0) + value: 0 + - name: 1 hour (3600) + value: 3600 + - name: 6 hours (21600) + value: 21600 + - name: 12 hours (43200) + value: 43200 + - name: 24 hours (86400) + value: 86400 + + - deployment: bsc-stg-usdt + name: Grid buy STG with USDT on BSC. + description: + Grid buy STG with USDT on BSC network. + deposits: + - token: bsc-usdt + min: 0 + presets: + - 0 + - 100 + - 500 + - 1000 + - 2000 + fields: + - binding: baseline-io-ratio + name: Baseline STG per USDT (e.g. 2.08) + min: 0 + - binding: io-ratio-growth + name: IO ratio growth per tranche (e.g. 0.1) + min: 0 + - binding: tranche-size + name: Tranche size in USDT (e.g. 100) + min: 0 + - binding: seconds-per-tranche + name: Time to recharge one grid tranche in seconds (0 is disabled). + min: 0 + presets: + - name: Disabled (0) + value: 0 + - name: 1 hour (3600) + value: 3600 + - name: 6 hours (21600) + value: 21600 + - name: 12 hours (43200) + value: 43200 + - name: 24 hours (86400) + value: 86400 + + - deployment: polygon-usdce-stg + name: Grid sell STG for USDC.e on Polygon. + description: + Grid sell STG for USDC.e on Polygon network. + deposits: + - token: polygon-stg + min: 0 + presets: + - 0 + - 100 + - 500 + - 1000 + - 2000 + fields: + - binding: baseline-io-ratio + name: Baseline USDT per STG (e.g. 0.47) + min: 0 + - binding: io-ratio-growth + name: IO ratio growth per tranche (e.g. 0.01) + min: 0 + - binding: tranche-size + name: Tranche size in STG (e.g. 100) + min: 0 + - binding: seconds-per-tranche + name: Time to recharge one grid tranche in seconds (0 is disabled). + min: 0 + presets: + - name: Disabled (0) + value: 0 + - name: 1 hour (3600) + value: 3600 + - name: 6 hours (21600) + value: 21600 + - name: 12 hours (43200) + value: 43200 + - name: 24 hours (86400) + value: 86400 + + - deployment: polygon-stg-usdce + name: Grid buy STG with USDCe on Polygon. + description: + Grid buy STG with USDCe on Polygon network. + deposits: + - token: polygon-usdce + min: 0 + presets: + - 0 + - 100 + - 500 + - 1000 + - 2000 + fields: + - binding: baseline-io-ratio + name: Baseline STG per USDCe (e.g. 2.08) + min: 0 + - binding: io-ratio-growth + name: IO ratio growth per tranche (e.g. 0.1) + min: 0 + - binding: tranche-size + name: Tranche size in USDCe (e.g. 100) + min: 0 + - binding: seconds-per-tranche + name: Time to recharge one grid tranche in seconds (0 is disabled). + min: 0 + presets: + - name: Disabled (0) + value: 0 + - name: 1 hour (3600) + value: 3600 + - name: 6 hours (21600) + value: 21600 + - name: 12 hours (43200) + value: 43200 + - name: 24 hours (86400) + value: 86400 + - deployment: polygon-usdc-ioen name: Grid sell IOEN for USDC on Polygon. description: From 1bff490a25cf331d53064c1c136d302cad90d6ad Mon Sep 17 00:00:00 2001 From: Siddharth2207 Date: Tue, 7 Jan 2025 12:56:22 +0530 Subject: [PATCH 2/2] add deployment --- public/_strategies/raindex/3-grid/grid.rain | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/_strategies/raindex/3-grid/grid.rain b/public/_strategies/raindex/3-grid/grid.rain index f8e44ad1..69df660c 100644 --- a/public/_strategies/raindex/3-grid/grid.rain +++ b/public/_strategies/raindex/3-grid/grid.rain @@ -247,6 +247,12 @@ deployments: polygon-usdc-ioen: order: polygon-usdc-ioen scenario: polygon + polygon-usdce-stg: + order: polygon-usdce-stg + scenario: polygon + polygon-stg-usdce: + order: polygon-stg-usdce + scenario: polygon polygon-weth-mnw: order: polygon-weth-mnw scenario: polygon @@ -493,7 +499,7 @@ gui: - 2000 fields: - binding: baseline-io-ratio - name: Baseline USDT per STG (e.g. 0.47) + name: Baseline USDC.e per STG (e.g. 0.47) min: 0 - binding: io-ratio-growth name: IO ratio growth per tranche (e.g. 0.01)