Order Types
All orders are matched using price-time priority. At the same price level, earlier orders fill first.
Market orders: The user chooses the amount to trade and his order is completely filled at the best prices the orderbook is offering.
Limit Orders: The user chooses the amount to trade and the price to trade at. Based on the type of limit order, different behaviors are possible:
Standard: The amount is filled until the chosen price. The unfilled amount is placed as a pending order on the orderbook.
Fill Or Kill: The order needs to be completely filled until the price, otherwise the transaction aborts.
Post Only: Ensures the order is placed on the book with no fills. If the order would immediately match against existing liquidity, the transaction aborts. Use this to guarantee maker fees.
Immediate Or Cancel: The order is filled until the chosen price, the unfilled amount is canceled and returned to the account.
Stop Market Order: Triggers a market order when the trigger price crosses your stop price. The trigger price source is chosen per order: index (oracle) price, book price, or mark price.
Stop Limit Order: Triggers a limit order when the trigger price crosses your stop price, with the same choice of trigger price source.
Scale Order: Distributes a total size across multiple limit orders evenly spaced between a start and end price. Useful for building order grids, DCA-style entries, or liquidity ladders in a single transaction. An optional size skew parameter controls whether the distribution is uniform or weighted towards one end of the price range.
One Triggers Other (OTO): Place a limit order with an attached SL/TP at creation time. The SL/TP is linked to the limit order and only becomes active once the limit order is matched and a position is opened. This is distinct from placing SL/TP directly on an existing position.
TWAP Order: Splits a large order into equal-size chunks executed at regular time intervals, tracking the time-weighted average price and reducing market impact. Each chunk executes as an immediate-or-cancel order bounded by a maximum slippage around the mark price, so chunks take liquidity without ever resting on the book. Any amount a chunk fails to fill is carried over into later executions. The order's details — size, direction, and schedule — are stored onchain only as a salted hash and stay private until execution. A TWAP order can be given an expiry, and canceling it at any time refunds the unused gas allocated for its execution.
Modifications
Reduce only: When enabled, the order can only reduce or close an existing position. It will never increase your position size or open a new one. Use this as a safety measure when closing or scaling out of trades.
Expiry: Sets a time limit on the order. If the order has not been fully filled by the expiry time, it is automatically cancelled. Useful for time-sensitive strategies where stale orders become a risk.
Last updated