Closed dcatki closed 3 months ago
Things to focus on
In the rainlang
This will be max or min io-ratio
This should be in reference currency not USD
Change this to oracle-dca or something similar
what if this isnt in stables, like they want to liquidate eth for link?
usd-amount18 token-amount18 ratio-multiplier time-since-cooldown: , io-ratio: div(token-amount18 add(usd-amount18 call<'bounty-auction>(time-since-cooldown))), :call<'calculate-twap-ratio>(io-ratio ratio-multiplier), / Add io-ratio and max-op on stack/ : usd-amount18, _: io-ratio;
usd-amount18 token-amount18 ratio-multiplier time-since-cooldown: , io-ratio: div(saturating-sub(usd-amount18 call<'bounty-auction>(time-since-cooldown)) token-amount18), :call<'calculate-twap-ratio>(io-ratio inv(ratio-multiplier)), / Add io-ratio and max-op on stack/ : token-amount18, _: io-ratio;
amount-usd18 ratio-multiplier: , _: uniswap-v3-quote-exact-input(reserve-token distribution-token mul(amount-usd18 ratio-multiplier) twap-io-fee);
why are these duplicated
tokens: token-link: network: h20-community-polygon address: 0x53E0bca35eC356BD5ddDFebbD1Fc0fD03FaBad39 token-usdt: network: h20-community-polygon address: 0xc2132D05D31c914a87C6611C10748AEb04B58e8F token-usdc: network: h20-community-polygon address: 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 token-wmatic: network: h20-community-polygon address: 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270
# Distribution token, i.e token that is bought or sold, for and against the stable token.
distribution-token: 0x53E0bca35eC356BD5ddDFebbD1Fc0fD03FaBad39
# Stable token, token with price pegged to one dollar.
stable-token: 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
# If the distribution token is paired with a stable token in a univ3 pool,
# then address for this binding is same as the stable token address.
# Eg: If the uniswap-v3 pair is LINK-USDC, then reserve token address is same as USDC address.
#
# If the distribution token is paired with native wrapped token in a univ3 pool,
# then address for this binding is the address of the native wrapped token.
# Eg: If the uniswap-v3 pair is LINK-WETH, then reserve token address is same as WETH address.
# This reserve token will be compared against stable token to calculate the dollar
# equivalent twap.
reserve-token: 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
Updated community strat, oracle based DCA, uni v3