-
Notifications
You must be signed in to change notification settings - Fork 1
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
Tests done #14
base: dev
Are you sure you want to change the base?
Tests done #14
Conversation
@@ -48,7 +48,7 @@ def run_simulation(self, liquidity_range, rebalance_range, train_swap_df, token1 | |||
sqrt_lower_bound = liquidity_lower_bound**0.5 | |||
sqrt_upper_bound = liquidity_upper_bound**0.5 | |||
sqrt_price = initial_price**0.5 | |||
initial_liquidity = get_liquidity(token1_provided, sqrt_price, sqrt_lower_bound) | |||
initial_liquidity = get_liquidity(10**30, token1_provided, sqrt_price, sqrt_lower_bound, sqrt_upper_bound) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment on what this number is
capital_in_token1 = y + x*(sqrt_price**2) # price_ratio = token0/token1 | ||
return capital_in_token1 | ||
|
||
L = get_liquidity(10**30, y, sqrt_price, sqrt_lower_bound, sqrt_upper_bound) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment
|
||
return liquidity | ||
|
||
y = total_capital_token1_terms*sqrt_price**2/(1+sqrt_price**2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesnt seem right.
math.sqrt(1.000001 ** (158840 * bool_to_sign(0))), # sb | ||
0 # Expected result is 0 #y | ||
) | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No tests written for get_capital_token1_terms_from_L, get_capital_in_token1_terms_fromy, get_liquidity_from_token1_capital, impermanent_loss_absolute
Closes #1
Added tests for Ekubo math functions.