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

Tests done #14

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Tests done #14

wants to merge 3 commits into from

Conversation

ManvithaMolakala
Copy link
Contributor

Closes #1

Added tests for Ekubo math functions.

@@ -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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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
)
]
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Analyse Ekubo ETH/wstETH pool and suggest optimum LP range strategy
2 participants