Skip to content

Commit

Permalink
Merge pull request #324 from rainlanguage/2024-12-26-cusdx-usdce
Browse files Browse the repository at this point in the history
CUSDX<>USDCe dca auction, dsf
  • Loading branch information
thedavidmeister authored Dec 27, 2024
2 parents 43a469b + 84bb9a5 commit 7fdb0aa
Show file tree
Hide file tree
Showing 2 changed files with 308 additions and 0 deletions.
196 changes: 196 additions & 0 deletions public/_strategies/raindex/1-auction-dca/auction-dca.rain
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,20 @@ orders:
- token: flare-cusdx
outputs:
- token: flare-cysflr
flare-cusdx-usdce:
orderbook: flare
network: flare
inputs:
- token: flare-cusdx
outputs:
- token: flare-usdce
flare-usdce-cusdx:
orderbook: flare
network: flare
inputs:
- token: flare-usdce
outputs:
- token: flare-cusdx
flare-cysflr-usdce:
orderbook: flare
network: flare
Expand Down Expand Up @@ -734,6 +748,12 @@ deployments:
flare-cysflr-usdce:
order: flare-cysflr-usdce
scenario: flare
flare-cusdx-usdce:
order: flare-cusdx-usdce
scenario: flare
flare-usdce-cusdx:
order: flare-usdce-cusdx
scenario: flare
flare-usdce-cysflr:
order: flare-usdce-cysflr
scenario: flare
Expand Down Expand Up @@ -4600,6 +4620,182 @@ gui:
The initial cUSDX per cysFLR to kickoff the first auction. (e.g. 0.80 cUSDX per cysFLR)
min: 0

- deployment: flare-usdce-cusdx
name: Sell cUSDX for USDCe on Flare.
description: >
Swap cUSDX for USDCe on Flare.
deposits:
- token: flare-cusdx
min: 0
presets:
- 0
- 100
- 200
- 500
- 1000
- 2000

fields:
- binding: time-per-amount-epoch
name: Budget period (in seconds)
description: >
The budget is spent over this time period.
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
- binding: amount-per-epoch
name: Budget (cUSDX per period)
description: >
The amount of cUSDX to spend each budget period.
min: 0
- binding: max-trade-amount
name: Maximum trade size (cUSDX)
description: >
The maximum amount of cUSDX to sell in a single auction.
min: 0
- binding: min-trade-amount
name: Minimum trade size (cUSDX)
description: >
The minimum amount of cUSDX 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 hour (3600)
value: 3600
- name: Every 2 hours (7200)
value: 7200
- binding: baseline
name: Baseline USDCe per cUSDX
description: >
The absolute minimum amount of USDCe per cUSDX that the auction will trade at.
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
- 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.9x
value: 0.9
- name: 0.95x
value: 0.95
- binding: initial-io
name: Kickoff USDCe per cUSDX
description: >
The initial USDCe per cUSDX to kickoff the first auction.
min: 0

- deployment: flare-cusdx-usdce
name: Sell USDCe for cUSDX on Flare.
description: >
Swap USDCe for cUSDX on Flare.
deposits:
- token: flare-usdce
min: 0
presets:
- 0
- 1000
- 2000
- 5000
- 10000
- 20000

fields:
- binding: time-per-amount-epoch
name: Budget period (in seconds)
description: >
The budget is spent over this time period.
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
- binding: amount-per-epoch
name: Budget (USDCe per period)
description: >
The amount of USDCe to spend each budget period.
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.
presets:
- name: Every hour (3600)
value: 3600
- name: Every 2 hours (7200)
value: 7200
- binding: baseline
name: Baseline cUSDX per USDCe
description: >
The absolute minimum amount of cUSDX per USDCe that the auction will trade at.
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
- 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.9x
value: 0.9
- name: 0.95x
value: 0.95
- binding: initial-io
name: Kickoff cUSDX per USDCe
description: >
The initial cUSDX per USDCe to kickoff the first auction.
min: 0

- deployment: flare-cysflr-usdce
name: Sell USDCe for cysFLR on Flare.
description: >
Expand Down
112 changes: 112 additions & 0 deletions public/_strategies/raindex/2-dynamic-spread/dynamic-spread.rain
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,100 @@ gui:
- 100
- 200
- 500
- deployment: flare-usdce-cusdx
name: USDCe<>cUSDX on Flare.
description: Rotate USDCe and cUSDX on Flare.

fields:
- binding: is-fast-exit
name: Fast exit?
description: If enabled, the strategy will attempt to exit any position it builds up in a single trade, as soon as it can do so profitably.
presets:
- name: Yes
value: 1
- name: No
value: 0
- binding: initial-io
name: Initial price (USDCe per cUSDX)
description: The rough initial USDCe per cUSDX ratio
min: 0
- binding: next-trade-multiplier
name: Next trade multiplier
description: This is the most the strategy will move the price in a single trade. Larger numbers will capture larger price jumps but trade less often, smaller numbers will trade more often but be less defensive against large price jumps in the market.
min: 1
presets:
- name: 1.001x
value: 1.001
- name: 1.002x
value: 1.002
- name: 1.005x
value: 1.005
- binding: cost-basis-multiplier
name: Cost basis multiplier
description: The minimum spread applied to the breakeven in addition to the auction. This is applied in both directions so 1.01x would be a 2% total spread.
min: 1
presets:
- name: 1 (auction spread only)
value: 1
- name: 1.0005x (0.1% total)
value: 1.0005
- name: 1.001x (0.2% total)
value: 1.001
- name: 1.0025x (0.5% total)
value: 1.0025
- name: 1.005x (1% total)
value: 1.005
- binding: time-per-epoch
name: Time per halving (seconds)
description: The amount of time (in seconds) between halvings of the price and the amount offered during each auction, relative to their baselines.
min: 600
presets:
- name: 1 hour (3600)
value: 3600
- name: 2 hours (7200)
value: 7200
- name: 4 hours (14400)
value: 14400
- name: 8 hours (28800)
value: 28800
- binding: max-amount
name: Max amount
description: The maximum amount of USDCe that will be offered in a single auction.
min: 0
presets:
- name: 10
value: 10
- name: 100
value: 100
- name: 1000
value: 1000
- binding: min-amount
name: Minimum amount
description: The minimum amount of USDCe that will be offered in a single auction.
min: 0
presets:
- name: 10
value: 10
- name: 100
value: 100
- name: 1000
value: 1000

deposits:
- token: flare-usdce
min: 0
presets:
- 0
- 100
- 200
- 500
- token: flare-cusdx
min: 0
presets:
- 0
- 100
- 200
- 500

- deployment: flare-usdce-sflr
name: USDC.e<>sFLR on Flare.
Expand Down Expand Up @@ -2814,6 +2908,12 @@ scenarios:
amount-token: 0xfbda5f676cb37624f28265a144a48b0d6e87d3b6
initial-output-token: 0x12e605bc104e93B45e1aD99F9e555f659051c2BB
initial-input-token: 0xfbda5f676cb37624f28265a144a48b0d6e87d3b6
usdce-cusdx:
runs: 1
bindings:
amount-token: 0xfbda5f676cb37624f28265a144a48b0d6e87d3b6
initial-output-token: 0xFE2907DFa8DB6e320cDbF45f0aa888F6135ec4f8
initial-input-token: 0xfbda5f676cb37624f28265a144a48b0d6e87d3b6
usdce-wflr:
runs: 1
bindings:
Expand Down Expand Up @@ -3319,6 +3419,15 @@ orders:
outputs:
- token: flare-usdce
- token: flare-wflr
flare-usdce-cusdx:
network: flare
orderbook: flare
inputs:
- token: flare-usdce
- token: flare-cusdx
outputs:
- token: flare-usdce
- token: flare-cusdx
polygon-quick-old-quick:
network: polygon
orderbook: polygon
Expand Down Expand Up @@ -3486,6 +3595,9 @@ deployments:
flare-usdce-wflr:
order: flare-usdce-wflr
scenario: flare.usdce-wflr
flare-usdce-cusdx:
order: flare-usdce-cusdx
scenario: flare.usdce-cusdx
flare-sflr-joule:
order: flare-sflr-joule
scenario: flare.sflr-joule
Expand Down

0 comments on commit 7fdb0aa

Please sign in to comment.