> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kuru.io/llms.txt
> Use this file to discover all available pages before exploring further.

# How Orders Match

> How Kuru finds liquidity and executes a trade.

When you submit an order, Kuru looks for available liquidity at a price your order accepts. A buy takes the lowest available sell price first. A sell takes the highest available buy price first.

## Two sources of liquidity

Liquidity comes from resting limit orders and passive liquidity positions. The matching engine considers both when finding the best price.

Resting orders specify a price and remaining amount. Passive positions supply liquidity through price bands whose inventory changes as trades occur.

## Price comes first

Suppose you want to buy 1 WETH at a limit of 2,500 USDC. If 0.4 WETH is offered at 2,490 and another 0.6 at 2,500, the order can fill across both prices. It does not pay 2,500 for the amount available at 2,490.

If there is not enough liquidity within your price limit, the remaining amount follows the rules of your [order type](/matching-engine/order-types).

## Priority at the same price

At the same price, passive liquidity executes before resting limit orders. Resting limit orders then execute in the order they joined that price level: earlier orders fill first.

See [Order Book and Priority](/matching-engine/order-book-and-matching) for partial fills and replacements, and [Passive Liquidity Events](/matching-engine/passive-liquidity) for passive execution and indexing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.