Draft
Conversation
Contact and Token addresses now are private structs containing Address. Implemented Deref for them and updated usages.
Contact and Token addresses now are private structs containing Address. Implemented Deref for them and updated usages.
Adds dependency on simulator for solver
These can be added as post-processing step at the callsite. Reverted invalid contracts changes Addressed comments
Co-authored-by: José Duarte <duarte.gmj@gmail.com>
Removed unecessary tracing call and cleand up From conversion
Co-authored-by: José Duarte <duarte.gmj@gmail.com>
It makes more sense from the perspective of simulation and trade encoding since the sell tokens are always transferred into settlement contract and the buy tokens are always withdrawn from it. From the perspective of trade verification, the in and out amounts make sense since they are calculated based on the provided price query.
Trade verification logic encodes a trade that is the most disadvantageous while not affecting the outcome of the simulation (if it reverts) For simple order simulation this is not necessary.
|
Reminder: Please consider backward compatibility when modifying the API specification.
Caused by: |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The baseline solver does not estimate the gas used by the solution accurately. It is fine-ish for basic swaps but in case of sell=buy swaps, which are inherently hook gas heavy the provided quotes do not account for the costs.
Having the simulator crate and taking inspiration from already existing order simulation endpoint, an accurate method of estimating solution gas usage can be utilized.
Changes
How to test
Unit tests, E2E tests and test staging deployment