-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add any pair capability to refinance strategy #153
feat: add any pair capability to refinance strategy #153
Conversation
… & targetDebt RefinanceParams
…4939/add-any-pair-to-simulator-order-planner
This pull request has been linked to Shortcut Story #14939: Add any pair to Simulator/Order Planner. |
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.
Great job! I have some concerns on the refinance parameters fields, let's talk about it
sdk/simulator-service/src/strategies/refinance/RefinanceLendingToLending.ts
Outdated
Show resolved
Hide resolved
…4939/add-any-pair-to-simulator-order-planner
- Add Swaps to Simulation output - Refactor `Simulation` -> `ISimulation` to align better with rest of the SDK - Refactor Swap related types from `swap-common` -> `sdk-common` to remove cyclic dependencies in simulation types Note: - `getSpotPrices` simplified to `getSpotPrice` in #153 TODO: - Write tests for simulation swaps (done in #153) - Update refinance strategy to handle swaps (current implementation is based on assumptions that no longer hold following ProtocolManager/Plugins/Pool work) (done in #153)
sdk/simulator-service/src/implementation/simulator-engine/reducer/swapReducer.ts
Outdated
Show resolved
Hide resolved
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.
Looks good, just a few requests
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.
Looks great! Thanks for refactoring it
- Add Swaps to Simulation output - Refactor `Simulation` -> `ISimulation` to align better with rest of the SDK - Refactor Swap related types from `swap-common` -> `sdk-common` to remove cyclic dependencies in simulation types Note: - `getSpotPrices` simplified to `getSpotPrice` in #153 TODO: - Write tests for simulation swaps (done in #153) - Update refinance strategy to handle swaps (current implementation is based on assumptions that no longer hold following ProtocolManager/Plugins/Pool work) (done in #153)
- Reintroduce the two swaps to refinance strategy - Simplify spotPrice method on SwapManager and SwapProviders. Gets one price only. Calculates a derived spot price when the quote token is a token and not a currency symbol. - Calculate the borrowAmount on the target protocol when a debtSwap is required. Accounts for slippage and summer fees when determining how much to borrow to repay flashloan - Account for summer fees when getting quotes on swap steps - Add getSummerFee method to SwapManager (currently resolves only to 20 basis pts - will update shortly) TODO: - Add config and implement getSummerFee appropriately.
TODO: