Why convert
The goal is to protect both the trader and the protocol from:- 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.
- 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.
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)
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%))
Bankruptcy-aware cap
For cross-margin accounts, Intention solves for the worst fill priceX 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,200, best ask is 11,550, and slippage tolerance is 10%. Solving the solvency equation gives a safe capX ≈ $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.