Perps Guide
Orderbook Perps

The Engines · Ch. 11

Orderbook Perps

You click buy. Somewhere, a stranger just became your mirror image: short exactly what you’re now long. No house, no pool, no vault. Just the two of you, matched by a book.

The Idea

Intuition

An orderbook perp is a model you already half-know. It’s the bid/ask stack from Chapter 1, except the thing stacked up is perp contracts, not coins.

Two roles run it. Makers post resting orders and wait, and that waiting is the liquidity. Takers cross the spread to trade right now, paying the ask to buy or hitting the bid to sell (Chapter 1). Makers earn the spread; takers pay it.

When your buy matches a resting sell, two positions are born at once: you go long, the maker goes short. You are each other’s counterparty. Every long on the book is matched by a short, so the exchange itself takes no side. It just matches, and runs the funding, mark, and liquidation machinery from Part II.

The catch is that this only works if makers show up. Deep book, tight spread, clean fills. Thin book, and you are back to slippage (Chapter 2). The whole model lives or dies on liquidity. Watch a match happen, then send an order yourself.

The Math

How It’s Calculated

In plain terms: the price is set by the best resting orders, your fill is the average of whatever you consume, and because every trade creates a long and a short at once, the book is always balanced.

The quoted price is the mid between the best two resting orders:

mid=best bid+best ask2\text{mid} = \frac{\text{best bid} + \text{best ask}}{2}

A larger taker order walks up the book, so your fill is the size-weighted average of the levels you consume (the slippage from Chapter 2):

fill=ipiqiiqi\text{fill} = \frac{\sum_i p_i\, q_i}{\sum_i q_i}

And the identity that defines the model: every contract has a long holder and a short holder, so

OIlong=OIshortalways.\text{OI}_{\text{long}} = \text{OI}_{\text{short}} \quad \text{always.}

That balance is why a pure orderbook has no protocol-level skew and no house position. The imbalance problem from Chapter 9 only appears once a pool takes the other side, which is the next two chapters.

central limit order book
mid $3000.00 · spread $1.00
$3001.50
4
$3001.00
6
$3000.50
5
mid
$2999.50
5
$2999.00
6
$2998.50
4
·
matched positions appear here
OI long =OI short
A book of resting orders. Makers quote both sides; the gap between them is the spread.

Note

This is the model most crypto perps use, and it’s superb where flow is deep: tight spreads, honest price discovery, no house risk. Its weakness is the cold start. Every new market needs makers before it’s usable, which is hard to repeat across hundreds of less-liquid assets. That single weakness is what the next engines are built to route around.