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

chore: Define minimum slippage tolerance #2137

Closed
fleupold opened this issue Dec 7, 2023 · 3 comments
Closed

chore: Define minimum slippage tolerance #2137

fleupold opened this issue Dec 7, 2023 · 3 comments
Labels
oncall Issue/PR for consideration during oncall rotation track:services-maintenance services maintenance track (Protocol)

Comments

@fleupold
Copy link
Contributor

fleupold commented Dec 7, 2023

Background

We had an alert about frequently failing settlements on Gnosis Chain, which seems to be due to setting too little slippage tolerance.

Details

Some users on Gnosis Chain trade ridiculously small amounts (example). Those solutions are particularly prone to reversion because the way Gnosis solvers compute slippage tolerance is a relative volume % capped at some maximum value.

Now 0.1% slippage tolerance of a minuscule value is an even smaller absolute value making solutions very prone to revert if the underlying AMM has the slightest change in reserves (cf. this simulation)

Acceptance criteria

Similar to the maximum absolute-slippage, allow to define a minimum absolute slippage which is being respected in the solutions

/// The absolute slippage allowed by the solver.
#[serde_as(as = "Option<serialize::U256>")]
absolute_slippage: Option<eth::U256>,

@fleupold fleupold added good first issue Good for newcomers oncall Issue/PR for consideration during oncall rotation track:services-maintenance services maintenance track (Protocol) labels Dec 7, 2023
@fleupold fleupold added help wanted Extra attention is needed track:services-maintenance services maintenance track (Protocol) and removed track:services-maintenance services maintenance track (Protocol) labels Jan 16, 2024
@Braqzen
Copy link
Contributor

Braqzen commented Jan 30, 2024

Looking around it seems straightforward to add another field, rename this current one and retain functionality. I'm unsure about when the minimum slippage would be used within the Limit though. Adding it and not using it anywhere seems lackluster. Should the minimum be used in the calculations of the Limit?

@MartinquaXD
Copy link
Contributor

Thanks for your interest in this issue.
Each dex solver implementation queries the respective dex API and applies a slippage to that solution in the swap() function. This is where the min_slippage would come into play.

However, this particular code was already moved into a separate repo and for legal reasons we must no longer accept external contributions for it.
I will therefore remove the help wanted tag from it to avoid further confusion.

@MartinquaXD MartinquaXD removed good first issue Good for newcomers help wanted Extra attention is needed labels Jan 30, 2024
Copy link

This issue has been marked as stale because it has been inactive a while. Please update this issue or it will be automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oncall Issue/PR for consideration during oncall rotation track:services-maintenance services maintenance track (Protocol)
Projects
None yet
Development

No branches or pull requests

3 participants