Skip to main content
The order book contains resting buy and sell orders. Better prices execute first. Among resting limit orders at the same price, older orders execute before newer ones. This is first-in, first-out, or FIFO, priority.

An example queue

Alice places a sell order for 1 WETH at 2,500 USDC. Ben later places another sell order at the same price. If a buyer takes 0.5 WETH and there is no passive liquidity at that price, Alice’s order fills partially; Ben’s remains unchanged. A sell order at 2,490 would execute before either of them because it offers a better price to the buyer. Passive liquidity at the same price has priority over resting limit orders.

Partial fills

An order can execute through several trades. Its remaining amount stays open until it fills, is canceled, or is removed under an applicable execution rule. Very small residual amounts that cannot settle to one smallest unit of the payment token are removed as dust. This matters when reconciling the final remainder of an order.

Replacing an order

Replacing an order creates a new order and loses the old queue position, even if the price stays the same. The new resting order joins the back of its price level. An account can have up to 62 active order slots in each market. Fully filled or canceled orders free a slot for reuse. For implementation details about reusable slots and order identities, see Orders, Cancellation, and Replacement.