For the complete documentation index, see llms.txt. This page is also available as Markdown.

Order Matching

TxFlow uses a Price-Time Priority Central Limit Order Book (CLOB).

Matching Priority

  1. Best price first — highest bid (for sells) or lowest ask (for buys) matches first

  2. Oldest Order First — among orders at the same price, the earliest order is matched first

Matching Process

When a taker order arrives:

  1. Find the best maker order on the opposite side.

  2. Execute at the maker's price (takers receive price improvement when possible).

  3. Repeat until the taker order is fully filled or no more crossing orders exist.

  4. If unfilled remainder exists — limit orders rest in the book; market and IOC orders are cancelled.

Example

Order book state:

Bids (Buy)
Price
Asks (Sell)

2 BTC

$49,950

5 BTC

$49,900

$50,000

3 BTC

$50,050

4 BTC

Scenario: You place a Market BUY for 5 BTC.

  1. Match 3 BTC @ $50,000 (oldest ask at best price)

  2. Match 2 BTC @ $50,050 (next best ask)

  3. Order fully filled; average execution price = $50,020

Pages
Description

Market, Limit, and advanced orders

Detailed liquidation mechanics

Trading and funding fees

Last updated

Was this helpful?