-
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
add limit order pool integration #1
base: main
Are you sure you want to change the base?
Conversation
…riceChange property and improving code formatting. Update tests to validate new property behavior.
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.
comments
@@ -114,3 +114,41 @@ export function approximateNumberOfTickSpacingsCrossed( | |||
|
|||
return Math.floor(Math.abs(logPriceDiff / (tickSpacing * 251))); | |||
} | |||
|
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.
I implemented this function from rust sdk. Limit order tests succes with this func
maybe i did something wrong here
@@ -173,7 +177,56 @@ export class BasePool implements QuoteNode { | |||
const nextInitializedTickSqrtRatio = nextInitializedTick | |||
? toSqrtRatio(nextInitializedTick.tick) | |||
: null; | |||
|
|||
*/ |
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.
i changed here with my implementation but It works in limit order pool tests but other test scenarios are failed (base pool, twamm...)
maybe I did smth wrong here
@@ -198,25 +251,33 @@ export class BasePool implements QuoteNode { | |||
// cross the tick if the price moved all the way to the next initialized tick price | |||
if (nextInitializedTick && sqrtRatio === nextInitializedTickSqrtRatio) { | |||
activeTickIndex = isIncreasing | |||
? activeTickIndex + 1 | |||
: activeTickIndex - 1; | |||
? nextInitializedTick.index |
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.
change here due to the above changes
added limit order pool integration and tests according to rust sdk test cases.
I left comments about other changes