-
Notifications
You must be signed in to change notification settings - Fork 83
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
chore: Enable quoting with JIT orders liquidity #3082
Comments
nit: The new quote struct should have the uniform clearing prices instead of |
Ah, right. Updated the example.
Thanks, it was a typo, replaced with a |
# Description Closes task n1 from #3082. Introduces a new version of the driver's `/quote` response in the API schema in order to support a gradual migration to the quote with jit orders making the changes backward compatible. The driver changes are expected in the future PRs. # Changes > Update the driver's OpenAPI schema quote object with an enum with the old and new versions. Trade verifier returns error in case a new version is received. ## How to test Existing tests. I was thinking about how to test it properly, but it still requires e2e tests. So, it should be implemented in the next PRs.
# Description Closes task n2 from #3082 by implementing support of the quotes with JIT orders in the trade verifier. For a gradual migration, it has to support both quote versions. # Changes - [ ] Added a new version of the trade with JIT orders. - [ ] Utilized the clearing prices to calculate the out amount. - [ ] Altered the `Solver.sol` helper contract to fetch all token balances as was proposed in [one of the comments](#3085 (comment)), which reduces the overall code complexity. - [ ] Bumped into an issue while converting floats into `BigRational`. ~~Implemented a workaround with converting float's string representation into `BigRational`.~~ Used `BigDecimal` in the config instead. ## How to test Unit tests. e2e would be possible only once the driver support is implemented(see #3103).
# Description Closes task n3 from #3082 by start sending the new `/quote` response with the updated fields that include clearing prices instead of the executed amount, jit orders and pre-interactions. # Changes - [ ] Updated driver's `/quote` response which is now supported by the trade verifier. ## How to test New driver's and services' e2e tests.
Background
From #3027:
Details
Previous attempts to implement it(#3033 and #3038) showed that this is a more involved change than anticipated, which also requires breaking API changes.
Currently, JIT orders get simulated on limit prices which means they will not get any surplus. Any surplus that can be generated by using a CoW AMM would, therefore, go to the user quote. In reality, the user order that comes out of the quote would be settled at a worse price because if it gets settled against a CoW AMM order surplus will have to be shared. So, the solvers should be able to tell us at which price things should get settled so that we can reason about distributing surplus even in quotes.
To fix that we should allow solvers to return pre-interactions, JIT orders and uniform clearing prices with their quote. That way solvers could quote with CoW AMMs (require JIT orders, pre-interactions and UCP). They could also index the orderbook and return resting limit orders as JIT orders.
Tasks
Example
driver
crate and start sending the new quote version. Implement e2e tests.The text was updated successfully, but these errors were encountered: