Skip to content

Check limit prices before simulation#4328

Draft
fafk wants to merge 3 commits intomainfrom
check-limit-before-sim
Draft

Check limit prices before simulation#4328
fafk wants to merge 3 commits intomainfrom
check-limit-before-sim

Conversation

@fafk
Copy link
Copy Markdown
Contributor

@fafk fafk commented Apr 13, 2026

Description

When the driver applies protocol fees (especially volume fees) to a solver's solution, the fee can exceed the available surplus for tight-spread pairs (e.g. stable<>stable such as USDC/USDT). This causes the on-chain simulation to revert, which is an expensive operation that could have been caught with a simple arithmetic check.

Changes

  • Add a check that prices after fees respect order limit price

How to test

  • Unit tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant