Skip to content

Tests done#14

Open
ManvithaMolakala wants to merge 3 commits intotrovesfi:devfrom
ManvithaMolakala:main
Open

Tests done#14
ManvithaMolakala wants to merge 3 commits intotrovesfi:devfrom
ManvithaMolakala:main

Conversation

@ManvithaMolakala
Copy link
Collaborator

Closes #1

Added tests for Ekubo math functions.

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