-
Notifications
You must be signed in to change notification settings - Fork 97
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
Price improvement e2e test #2539
Conversation
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.
Lg, although it's a bit unclear what actually happens under the hood, since we see only two random numbers in the test. Might be useful to add a comment similar to other tests (this can be recovered from existing logs and/or by adding temporary logs to observe execution)
This reverts commit ef9b42d.
57da899
to
7efbc03
Compare
Added a comment, but not sure how to properly reflect the price limit adjustments based on the quote. |
# Conflicts: # crates/orderbook/openapi.yml
ae53b07
to
b499e19
Compare
b499e19
to
ece7143
Compare
// Settlement contract balance after execution = 205312824093250 GNO = | ||
// 205312824093250 GNO * 9871377667766744586 / (10000000000000000000 - | ||
// 205312824093250) = 202676203868401 DAI | ||
execute_test( |
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.
Is this execute_test
wrapper really necessary assuming we get rid of all the redundant surplus test cases and just keep 3 cases (surplus, price improvement and volume fee)? I think having three more verbose test cases would be better.
Maybe we could use more meaningful values (currently it seems like these were derived by running the test once and adjusting the values to what the test created) so it might not be that useful. But then, I also don't want us to go down the rabbit hole of redesigning the whole test infra like we did in the driver crate. Is it possible to use limit orders to ensure predictable match amounts?
Otherwise we can maybe do something like
- Seed a bit of liquidity on the AMM that serves the token pair
- Get a quote (which we use for placing the order)
- Inject more liquidity into the AMM (this should improve the price)
- Get another quote which we can do to do the math of how much the user should get in the end of the day.
This way it would be a bit easier to follow that these long digit series.
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.
Will be tackled in the #2468
Fixes #2534
Those e2e tests are also required to be refactored and unified into a single test case. This will be done in a separate PR.