-
Notifications
You must be signed in to change notification settings - Fork 610
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
BE-676 | Add SwapOutGivenInCases for CL pool #8954
base: main
Are you sure you want to change the base?
Conversation
Note for reviewer: pipeline seems to be failing due |
WalkthroughThe pull request introduces a comprehensive set of test cases for concentrated liquidity swaps in the Changes
Sequence DiagramsequenceDiagram
participant Swap as Swap Mechanism
participant Position1 as Liquidity Position 1
participant Position2 as Liquidity Position 2
participant TokenIn as Input Token
participant TokenOut as Output Token
TokenIn ->> Swap: Swap Request (Given Output Amount)
Swap ->> Position1: Check Liquidity
Swap ->> Position2: Check Liquidity
Position1 -->> Swap: Liquidity Details
Position2 -->> Swap: Liquidity Details
Swap ->> TokenOut: Transfer Output Amount
Swap ->> TokenIn: Receive Input Amount
The sequence diagram illustrates the high-level flow of the concentrated liquidity swap mechanism, showing how the swap is processed across multiple potential liquidity positions when a swap is initiated with a given output amount. ✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/apptesting/concentrated_liquidity.go (1)
804-832
: Consider adding high-level behavioral expectations.While the test case includes detailed Python calculations, it would be helpful to add a brief comment explaining the expected behavior and why these specific values were chosen.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/apptesting/concentrated_liquidity.go
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Summary
🔇 Additional comments (4)
app/apptesting/concentrated_liquidity.go (4)
798-804
: LGTM! Well-organized test cases with clear structure.The test cases are logically organized and cover various scenarios, starting from simple single position cases to complex overlapping ranges.
1046-1052
: Great use of ASCII art for visualizing price ranges!The ASCII art diagrams effectively communicate the price range relationships between positions, making it easier to understand the test scenarios.
1378-1403
: Well-documented edge case for slippage protection.The test case clearly documents the behavior when slippage protection interrupts the trade early, which is an important edge case to test.
Line range hint
1405-1781
: LGTM! Existing helper functions remain unchanged.The helper functions provide comprehensive utilities for testing concentrated liquidity pools.
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.
+1 for the github actions
Note that we are merging to |
Closes: BE-676
What is the purpose of the change
This PR adds swap in given out test cases for CL pools and is part of osmosis-labs/sqs#604.
Testing and Verifying
This change is a trivial rework / code cleanup without any test coverage.
Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?Where is the change documented?
x/{module}/README.md
)