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 tranche-space dashboard #44

Closed
wants to merge 3 commits into from
Closed
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
75 changes: 57 additions & 18 deletions src/tranche/tranche-space.rain
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,29 @@ scenarios:
# 0.01 is 1%
tranche-space-snap-threshold: 0.01

# This is only relevant if the tranche size/ratio is denominated in
# some token other than the input/output tokens. For example, if the
# TKN was being traded for WETH but the tranche size was denominated in
# USD then the reference-stable would be USD and the reference-reserve
# would be WETH, and the identity multiplier needs to be swapped out
# for e.g. a TWAP USDT based multiplier.
# Typically this is NOT needed as the tranche size and ratio ARE
# denominated in the input/output tokens.
io-ratio-multiplier: '''io-ratio-multiplier-identity'

scenarios:
buy:
bindings:
# This is only relevant if the tranche size/ratio is denominated in
# some token other than the input/output tokens. For example, if the
# TKN was being traded for WETH but the tranche size was denominated in
# USD then the reference-stable would be USD and the reference-reserve
# would be WETH, and the identity multiplier needs to be swapped out
# for e.g. a TWAP USDT based multiplier.
# Typically this is NOT needed as the tranche size and ratio ARE
# denominated in the input/output tokens.
io-ratio-multiplier: '''io-ratio-multiplier-identity'

# If TKN was being traded for some other token, for e.g WETH and if
# the tranche size/ratio was denominated in USD, then the reference and
# reserve bindings need to be given along with the twap bindings
reference-stable: 0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9
reference-stable-decimals: 6
reference-reserve: 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1
reference-reserve-decimals: 18
twap-fee: '[uniswap-v3-fee-high]'
twap-duration: 1800

# If we want to denominate the amount in BLUE when we're
# buying RED with it, then the amount is the OUTPUT.
amount-is-output: 1
Expand Down Expand Up @@ -189,6 +199,26 @@ scenarios:
test-now: 0
sell:
bindings:
# This is only relevant if the tranche size/ratio is denominated in
# some token other than the input/output tokens. For example, if the
# TKN was being traded for WETH but the tranche size was denominated in
# USD then the reference-stable would be USD and the reference-reserve
# would be WETH, and the identity multiplier needs to be swapped out
# for e.g. a TWAP USDT based multiplier.
# Typically this is NOT needed as the tranche size and ratio ARE
# denominated in the input/output tokens.
io-ratio-multiplier: '''io-ratio-multiplier-identity'

# If TKN was being traded for some other token, for e.g WETH and if
# the tranche size/ratio was denominated in USD, then the reference and
# reserve bindings need to be given along with the twap bindings
reference-stable: 0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9
reference-stable-decimals: 6
reference-reserve: 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1
reference-reserve-decimals: 18
twap-fee: '[uniswap-v3-fee-high]'
twap-duration: 1800

# If we want to denominate the amount in BLUE when we're
# selling RED for it, then the amount is the INPUT.
amount-is-output: 0
Expand Down Expand Up @@ -240,12 +270,15 @@ charts:
value: 0.6
unit-prefix: $
- label: Amount of RED purchased in the first tranche
value: 0.5.2
value: 0.5.3
- label: 'Initial io-ratio (i.e. # RED purchased per BLUE spent)'
value: 0.7
- label: Initial effective buy price (e.g. how much you pay for 1 RED in BLUE, visible on dextools)
value: 0.5.3
value: 0.5.4
unit-prefix: $
- label: IO-ratio multiplier
value: 0.4.0
description: 1 if the tranches are input/output token denominated, else the multiplier value between tokens TKN and the denominated token eg ETH.
- label: Starting tranche
value: 0.2.0
plots:
Expand All @@ -264,7 +297,7 @@ charts:
- type: line
options:
x: 0.0
y: 0.5.2
y: 0.5.3
'io-ratio (i.e. # of RED purchased per BLUE spent) vs tranche':
marks:
- type: line
Expand All @@ -276,7 +309,7 @@ charts:
- type: line
options:
x: 0.0
y: 0.5.3
y: 0.5.4
Starting tranche:
marks:
- type: dot
Expand All @@ -291,12 +324,15 @@ charts:
value: 0.6
unit-prefix: $
- label: Amount of BLUE received selling the first tranche of RED tokens
value: 0.5.2
value: 0.5.3
- label: 'Initial io-ratio (i.e. # of BLUE purchased per RED spent)'
value: 0.7
- label: Initial effective sell price (Amount of RED to sell 1 BLUE e.g. visible on dextools)
value: 0.7
unit-prefix: $
- label: IO-ratio multiplier
value: 0.4.0
description: 1 if the tranches are input/output token denominated, else the multiplier value between tokens TKN and the denominated token eg ETH.
- label: Starting tranche
value: 0.2.0
plots:
Expand All @@ -315,7 +351,7 @@ charts:
- type: line
options:
x: 0.0
y: 0.5.2
y: 0.5.3
'io-ratio (i.e. # of TKN purchased per $ spent) vs tranche':
marks:
- type: line
Expand Down Expand Up @@ -387,12 +423,15 @@ deployments:
#orderbook-subparser !The subparser for the Orderbook

#plottables-test
tranche-io-ratio
amount
io-ratio:,
input-amount: mul(amount io-ratio),
effective-price: inv(io-ratio);
effective-price: inv(io-ratio),
effective-tranche-io-ratio: inv(tranche-io-ratio);

#plottables-prod
tranche-io-ratio
amount
io-ratio:;

Expand Down Expand Up @@ -478,7 +517,7 @@ deployments:
amount-available: mul(tranche-total-size tranche-space-available),
amount: if(amount-is-output amount-available div(amount-available final-io-ratio)),
io-ratio: final-io-ratio,
:call<'plottables>(amount io-ratio);
:call<'plottables>(tranche-io-ratio amount io-ratio);

#handle-io
now
Expand Down
Loading