We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Ekubo initial_tick calculation before was incorrect.
Folder: onchain/cairo/launchpad/ Scope: launchpad.cairo, unrug.cairo, edge_cases_tests.cairo
TODO: We have done severals todo here #527, we need to verify and test it correctly.
1. Sort the tokens
2. Calculate y/x with liquidity_raised and initial_pool_supply.
If token1 == quote_address, we need to scale the factor to not get a 0 value.
4. Calculate the sqrt_ratio with the y_x factor calculated before.
5. Use the library MathLib of Ekubo and call: sqrt_ratio_to_tick (Issue SQRT_RATIO_TOO_LOW)
6. Ensure the computed tick aligns with tick_spacing:If not divisible, round it down to the nearest valid tick.
7. Calculate the bounds accordingly
Add edge tests
Verify pool initialization with test
Add test to buy tokens and verify it in the pool.
Add library MathLib sqrt_to_ratio
sort_token in launchpad
Calculate y_x with the correct scale factor ratio
Calculate sqrt_ratio
Calculate sqrt_ratio_to_tick
Bounds for full range liquidity
Continue the tests in the edge_cases_tests.cairo :
Actual error:
SQRT_RATIO_TOO_LOW BOUND_TICK_SPACING TICK_MAGNITUDE
Docs:
https://docs.ekubo.org/integration-guides/reference/math-1-pager
https://github.com/EkuboProtocol/abis/blob/main/src/interfaces/mathlib.cairo
https://github.com/EkuboProtocol/starknet-rust-sdk/blob/main/src/math/tick.rs
The text was updated successfully, but these errors were encountered:
I'd like to work on this issue @MSghais
Sorry, something went wrong.
@Jagadeeshftw give us some update on this issue please, pretty urgent
Jagadeeshftw
No branches or pull requests
Description
Ekubo initial_tick calculation before was incorrect.
Folder: onchain/cairo/launchpad/
Scope: launchpad.cairo, unrug.cairo, edge_cases_tests.cairo
TODO:
We have done severals todo here #527, we need to verify and test it correctly.
1. Sort the tokens
2. Calculate y/x with liquidity_raised and initial_pool_supply.
If token1 == quote_address, we need to scale the factor to not get a 0 value.
4. Calculate the sqrt_ratio with the y_x factor calculated before.
5. Use the library MathLib of Ekubo and call: sqrt_ratio_to_tick (Issue SQRT_RATIO_TOO_LOW)
6. Ensure the computed tick aligns with tick_spacing:If not divisible, round it down to the nearest valid tick.
7. Calculate the bounds accordingly
Add edge tests
Verify pool initialization with test
Add test to buy tokens and verify it in the pool.
Add library MathLib sqrt_to_ratio
sort_token in launchpad
Calculate y_x with the correct scale factor ratio
Calculate sqrt_ratio
Calculate sqrt_ratio_to_tick
Bounds for full range liquidity
Continue the tests in the edge_cases_tests.cairo :
Actual error:
SQRT_RATIO_TOO_LOW
BOUND_TICK_SPACING
TICK_MAGNITUDE
Docs:
https://docs.ekubo.org/integration-guides/reference/math-1-pager
https://github.com/EkuboProtocol/abis/blob/main/src/interfaces/mathlib.cairo
https://github.com/EkuboProtocol/starknet-rust-sdk/blob/main/src/math/tick.rs
The text was updated successfully, but these errors were encountered: