Order book
Every market on Loaf, spot and perp, has its own central limit order book: one open book where every buyer and seller meets, matched under the same rules for everyone.
An open, all-to-all book
Every order goes into the market’s public book, and every participant trades in that same book on the same terms: individual traders, firms, outside market makers and Loaf’s own market maker, the Loaf Liquidity Provider (LLP). Your order can match anyone’s, with no dealer standing between you and the market.
Everyone, LLP included, uses the same public API, with no privileged data and no execution priority. Every book’s best price levels, and the size resting at each, are public on the market page and through the API.
No B-book
Many centralised exchanges and brokers run an A-book and B-book model. Some customer orders are passed through to a market (the A-book). Others are kept in-house, where the venue or an internal desk takes the other side (the B-book), so the venue gains when those customers lose. From the outside, you cannot tell which book your order went to.
Loaf does not B-book. Every order is matched in the public order book, under the same rules, against whoever is on the other side. LLP quotes in that same book, where anyone can trade against it or outbid it, and its rules of engagement set out how it trades.
Price-time priority
Bids rest at their limit prices, highest first, and asks rest at theirs, lowest first. Orders match by price-time priority: the best price fills first, then the earliest order at that price.
Example. Three sell orders rest on a book when a buy order arrives for 12.0 units with a limit of 10.05 USD.
| Resting sell order | Price (USD) | Size (units) | Arrived | Filled against the buy |
|---|---|---|---|---|
| A | 10.02 | 4.0 | First | 4.0 units at 10.02 |
| B | 10.02 | 6.0 | Second | 6.0 units at 10.02 |
| C | 10.05 | 10.0 | Third | 2.0 units at 10.05 |
A fills before B because it arrived first at the same price, and C keeps 8.0 units on the book.
Fills
Every fill executes at the resting order’s price, so an order that crosses the book can fill better than its limit. In the example above, the buyer’s limit was 10.05 USD, but 10.0 of the 12.0 units filled at 10.02 USD, for an average of 10.025 USD a unit.
Transparent, Verifiable Matching
Every order the matching engine takes in is written to the intake journal, a public, hash-chained record, so anyone can check the order of arrival. Every fill is then proven with a zero-knowledge validity proof and verified on the blockchain before it settles. A fill that breaks the rules fails its proof and is voided (see Settlement and finality).
Who supplies the book
Other traders and market makers supply the book, and anyone can quote into it (see Market making). The Loaf Liquidity Provider (LLP) is the market maker that gives every Loaf market two-sided depth from its first trade. Matching engine explains how the engine keeps each book.