Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wlth-limit-order-single.rain #20

Merged
merged 4 commits into from
Jul 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 35 additions & 23 deletions strategies/wlth/wlth-limit-order-single.rain
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,44 @@ scenarios:


charts:
base-wlth-buy-metrics:
Buy WLTH, sell USDC single limit order:
scenario: limit-orders.buy.metric
metrics:
- label: io-ratio-1
- label: Price
value: 0.3.2
- label: amount-1
unit-suffix: " WLTH"
description: 'Unit price, WLTH per USDC (stack item 0.3.2)'
- label: Effective Price (as visible on dex tools)
value: 0.3.3

base-wlth-sell-metrics:
unit-suffix: " USDC"
description: 'Effective price in USDC denomination'
- label: Units
value: 0.3.4
unit-suffix: " USDC"
description: 'Units purchased (stack item 0.3.3)'
- label: Total Price
value: 0.3.5
unit-suffix: " WLTH"
description: 'Amount of WLTH recevied.'
Buy USDC, sell WLTH single limit order:
scenario: limit-orders.sell.metric
metrics:
- label: io-ratio-1
- label: Price
value: 0.3.2
- label: amount-1
value: 0.3.3

unit-suffix: " USDC"
description: 'Unit price, USDC per WLTH (stack item 0.3.2)'
- label: Effective Price (as visible on dex tools)
value: 0.3.2
unit-suffix: " USDC"
description: 'Effective price in USDC denomination'
- label: Units
value: 0.3.4
unit-suffix: " WLTH"
description: 'Units sold (stack item 0.3.3)'
- label: Total Price
value: 0.3.5
unit-suffix: " USDC"
description: 'Amount of USDC recevied.'
deployments:
base-wlth-buy:
scenario: limit-orders.buy.prod
Expand All @@ -131,18 +153,6 @@ deployments:
#io-ratio-1 !IO ratio for first order.
#ouptut-amount-1 !Output amount for first order.

#io-ratio-2 !IO ratio for second order.
#ouptut-amount-2 !Output amount for second order.

#io-ratio-3 !IO ratio for third order.
#ouptut-amount-3 !Output amount for third order.

#io-ratio-4 !IO ratio for fourth order.
#ouptut-amount-4 !Output amount for fourth order.

#io-ratio-5 !IO ratio for fifth order.
#ouptut-amount-5 !Output amount for fifth order.

#count-key "count-key"
#plottables !Binding to plot values.
#get-trade-count !Binding to get trade count.
Expand All @@ -154,7 +164,9 @@ deployments:
#plottables-metric
amount io-ratio: ,
_: io-ratio-1,
_: ouptut-amount-1;
effective-ratio-1: inv(io-ratio-1),
_: ouptut-amount-1,
input-amount-1: mul(io-ratio-1 ouptut-amount-1);

#get-trade-count-prod
trade-count-key: hash(order-hash() count-key),
Expand Down Expand Up @@ -182,4 +194,4 @@ deployments:
#handle-io
trade-count-key: hash(order-hash() count-key),
trade-count: get(trade-count-key),
:set(trade-count-key add(trade-count 1));
:set(trade-count-key add(trade-count 1));
Loading