Skip to content

Conversation

@fgimenez
Copy link
Member

Closes #929

Fixes a bug where calculate_quote_amount() used floor division (rounding down), which favored users over the exchange. Post-Moderato hardfork, the function now uses ceiling division (rounds up).

@fgimenez fgimenez requested review from 0xKitsune and klkvr November 17, 2025 09:30
@fgimenez fgimenez added C-Bug An unexpected or incorrect behavior A-precompile Related to precompiles C-audit Related to audit findings labels Nov 17, 2025
@mergify mergify bot added the S-breaking-stf This PR includes a breaking STF change label Nov 17, 2025
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@0xKitsune 0xKitsune merged commit d046f95 into main Nov 17, 2025
19 checks passed
@0xKitsune 0xKitsune deleted the fgimenez/fix-calculate-quote-amount branch November 17, 2025 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-precompile Related to precompiles C-audit Related to audit findings C-Bug An unexpected or incorrect behavior S-breaking-stf This PR includes a breaking STF change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: calculate_quote_amount() does not round up

5 participants