Skip to main content
A “raw” market order is dangerous on a thin book: one big taker can sweep the book and fill at catastrophic prices. Intention eliminates this risk by converting every market order into a protective limit order before it reaches the matching engine. The converted limit has a carefully computed cap that bounds slippage and protects the account from bankruptcy.

Why convert

The goal is to protect both the trader and the protocol from:
  1. Catastrophic slippage. On a low-liquidity pair, a large market order can eat several basis points of depth and fill at prices well outside any reasonable expectation.
  2. Account bankruptcy (negative balance). If a leveraged fill is bad enough, the resulting loss can exceed the trader’s margin. Bankruptcy is fatal for the trader and for the protocol, because the protocol has to backstop the shortfall.
By capping the market order with a protective price, Intention ensures that the worst-case fill is still within the user’s slippage tolerance and within the account’s ability to absorb the loss.

Three outcomes

A converted market order resolves into one of three outcomes:
  • Full fill at good prices. The book is deep enough to fill the whole order before the protective cap. The user gets a fill close to the mid.
  • Partial fill. The book fills some of the order, then prices run past the cap. The remainder is cancelled immediately, and the user is notified of the partial fill.
  • Rejection. At submission time, the best available price already exceeds the protective cap, or the account’s free collateral does not support the trade. The order is rejected before any fill occurs.

Slippage tolerance

Users set a per-order slippage tolerance. The default is 10%, the maximum is 10%, and the minimum is 0.01%. Given the book’s best price on the relevant side:
  • For a buy: user_most_price = ask1 × (1 + slippage)
  • For a sell: user_most_price = bid1 × (1 - slippage)
This is the user-chosen bound. Intention also enforces its own bounds.

Platform price band

Every contract has a price band derived from index and mark prices:
  • Highest buy price: min(max(index, mark × (1 + x%)), mark × (1 + y%))
  • Lowest sell price: max(min(index, mark × (1 - x%)), mark × (1 - y%))
This band keeps converted orders from reaching absurd prices even when the user’s slippage tolerance is maximal.

Bankruptcy-aware cap

For cross-margin accounts, Intention solves for the worst fill price X that still leaves the account solvent: X must keep available balance plus post-trade floating loss above initial margin and fees, or — for a pure close — must stay on the safe side of the bankruptcy price. For isolated accounts, the cap ensures the order does not immediately trigger liquidation. The final price for a buy is min(platform_band, user_most_price, X); for a sell it is the mirror max. If the cap is worse than the best opposing quote, the order is rejected outright.

Worked example

A trader has 10,000walletbalance,noposition,andwantstobuy10BTCat10×leverage.Themarkpriceis10,000 wallet balance, no position, and wants to buy 10 BTC at 10× leverage. The mark price is 10,200, best ask is 10,000,theplatformbandcapsbuysat10,000, the platform band caps buys at 11,550, and slippage tolerance is 10%. Solving the solvency equation gives a safe cap X ≈ $10,263. The order is then executed as a limit buy at $10,263, which fills everything available up to that price and cancels anything beyond it.

Interaction with resting orders

When a converted market order crosses the book at a price better than existing resting limit orders from the same account, Intention rechecks margin. If the new effective state cannot support the existing orders, it cancels the lowest-priority ones first to free up margin — preserving the converted market order’s execution. Multiple market orders submitted in the same block are merged into a single effective price for the account so they cannot stack against each other.