Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 1.94 KB

File metadata and controls

49 lines (31 loc) · 1.94 KB
id TIP-1030
title Allow same-tick flip orders
description Relaxes the placeFlip validation to allow flipTick to equal tick, enabling flip orders that flip to the same price.
authors Dan Robinson
status Draft
related TIP-1002
protocolVersion T5
supersedes TIP-1002

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 > tick required; for asks, flipTick < tick required
  • New behavior: For bids, flipTick >= tick required; for asks, flipTick <= tick required

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 flipTick is closer to or equal to tick) 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 == tick are accepted and behave like any other flip order
  • Flip orders with flipTick strictly on the wrong side of tick are still rejected