TIP-1030: Allow same-tick flip orders
Abstract
Relaxes the placeFlip validation to allow flipTick == tick, enabling flip orders that flip to the same price. This supersedes TIP-1002, extracting the "allow same-tick flip orders" portion without the "prevent crossed orders" change.
Motivation
Currently, placeFlip requires flipTick to be strictly on the opposite side of tick (e.g., for a bid, flipTick > tick). This prevents use cases like instant token convertibility, where someone wants to place flip orders on both sides at the same tick to create a stable two-sided market that automatically replenishes when orders are filled.
Specification
Modified behavior
The placeFlip validation is relaxed to allow flipTick == tick:
- Current behavior: For bids,
flipTick > tickrequired; for asks,flipTick < tickrequired - New behavior: For bids,
flipTick >= tickrequired; for asks,flipTick <= tickrequired
Events
No new events.
New errors
No new errors.
Implications
- Locked books: Same-tick flip orders can result in
best_bid_tick == best_ask_tick. This forecloses any future upgrade that would forbid bids and asks from resting at the same tick, since same-tick flip orders legitimately create that state. - MEV: Tighter flip orders (where
flipTickis closer to or equal totick) increase the likelihood of certain kinds of MEV, such as backrunning, since the new opposite-side order appears at a better price for the backrunner.
Invariants
- Flip orders with
flipTick == tickare accepted and behave like any other flip order - Flip orders with
flipTickstrictly on the wrong side oftickare still rejected
Was this helpful?