Skip to content

fix(precompiles): align stablecoin DEX quotes with execution (TEMPO-DEX7)#5612

Open
crazywriter1 wants to merge 1 commit into
tempoxyz:mainfrom
crazywriter1:fix/dex7-quote-matches-execution
Open

fix(precompiles): align stablecoin DEX quotes with execution (TEMPO-DEX7)#5612
crazywriter1 wants to merge 1 commit into
tempoxyz:mainfrom
crazywriter1:fix/dex7-quote-matches-execution

Conversation

@crazywriter1

Copy link
Copy Markdown

Quote functions iterated per-tick over aggregate liquidity while swaps execute
per-order, so quotes diverged from execution when multiple orders rested at the
same tick (per-order rounding accumulates across order boundaries).

quote_exact_in/quote_exact_out now walk resting orders one-by-one, mirroring
fill_orders_exact_in/fill_orders_exact_out. Re-enables TEMPO-DEX7 invariant
assertions.

Verified locally: cargo test -p tempo-precompiles (919 passed), forge
StablecoinDEXInvariantTest (PASS), StablecoinDEX.t.sol (70 passed).

…EX7)

Quote functions iterated per-tick while swaps execute per-order, so quotes diverged when multiple orders rested at the same tick. quote_exact_in/out now walk resting orders one-by-one, mirroring fill_orders_exact_in/out. Re-enables TEMPO-DEX7 invariant assertions.
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