-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description Main part of #2215. This PR ports the settlement encoding logic which is currently contained in the legacy solver crate's [`SettlemenEncoder`](https://github.com/cowprotocol/services/blob/81831022cc41a05e76547b90e87694dc349a0388/crates/solver/src/settlement/settlement_encoder.rs#L37) to our domain. It is importantly still missing application of slippage tolerance (which is contained in [`SlippageContext`](https://github.com/cowprotocol/services/blob/81831022cc41a05e76547b90e87694dc349a0388/crates/solver/src/liquidity/slippage.rs#L123), porting which would have made this PR even larger. # Changes - [x] Introduce encoding module which exposes a function to take a solution and returns a settlement tx object - [x] Encode clearing prices, trades & interactions the way the settlement contract expects (guided by the boundary implementation) - [x] Implement `revertable` logic on `Solutions` (this also fixes #2640) - [x] Make allowance computation internalisation aware (currently allowances for internalised interactions are added to the execution plan even if we are building an internalised one) - [x] Unify `swap` implementation of the liquidity types to always return `Result` (one returned `Option`) ## How to test - [ ] Change default `encoding::Strategy` from Boundary to Domain and run tests. > [!IMPORTANT] > We still need to implement the slippage computation to make this strategy fully working Fixes #2215 & #2640 --------- Co-authored-by: Martin Beckmann <[email protected]>
- Loading branch information
1 parent
16d0963
commit 6bb059b
Showing
6 changed files
with
438 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.