Skip to content
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

dex(router): terminate execution based on the accurate path price #2681

Merged
merged 2 commits into from
Jun 7, 2023

Conversation

hdevalence
Copy link
Member

@hdevalence hdevalence commented Jun 6, 2023

Closes #2676, #2675

This aims to be a better solution than the temporary fix we did last week. Roughly, the idea is:

  • fill_route always makes progress, so it will return an exact price;
  • we can compare that exact price against the price limit.

This prevents looping infinitely based on no-profit arbs that are mis-estimated as being epsilon less than the price limit -- as soon as one of them actually executes, the exact price will be computed and checked against the price limit, terminating the process.

This aims to be a better solution than the temporary fix we did last week. Roughly, the idea is:

- `fill_route` always makes progress, so it will return an exact price;
- we can compare that exact price against the price limit.

This prevents looping infinitely based on no-profit arbs that are mis-estimated
as being epsilon less than the price limit -- as soon as one of them actually
executes, the exact price will be computed and checked against the price limit,
terminating the process.
@hdevalence hdevalence requested a review from erwanor June 6, 2023 19:13
@erwanor erwanor changed the title wip: terminate based on the actual price dex(router): terminate execution based on the accurate path price Jun 7, 2023
@erwanor erwanor temporarily deployed to smoke-test June 7, 2023 14:17 — with GitHub Actions Inactive
@erwanor erwanor marked this pull request as ready for review June 7, 2023 14:26
@erwanor erwanor merged commit 9cd566d into main Jun 7, 2023
6 checks passed
@erwanor erwanor deleted the dex-termination-better branch June 7, 2023 14:40
@cratelyn cratelyn added the A-dex Area: Relates to the dex label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dex Area: Relates to the dex
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-allow consecutively routing over the same route twice
3 participants