taking Price Impact into account for partial trade size#435
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (19)
WalkthroughThis PR introduces price-impact-aware market price lookup by adding ChangesPrice Impact Routing
Raindex Router Fixes
raindex-route CLI Command
Minor Fixes and Cleanup
Sequence Diagram(s)sequenceDiagram
participant SharedState
participant RainSolverRouter
participant SushiRouter
SharedState->>RainSolverRouter: getMarketPrice(params)
RainSolverRouter->>SushiRouter: getMarketPrice(params)
SushiRouter-->>RainSolverRouter: Result<{price, route?: MultiRoute}>
RainSolverRouter-->>SharedState: Result<{price, route?: MultiRoute}>
alt route.priceImpact missing OR <= DEFAULT_PRICE_IMPACT_TOLERANCE
SharedState-->>SharedState: return early with price
else priceImpact exceeds tolerance
SharedState->>RainSolverRouter: findLargestTradeSize + retry
RainSolverRouter-->>SharedState: partial-trade market price
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed due to a network error. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This reverts commit cc2e65f.
Motivation
Caution
Do NOT merge before #430
This PR enables accounting for sushi's swap Price Impact for finding the partial trade size.
Solution
Checks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit
Release Notes
New Features
Improvements
Bug Fixes