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

# How ordr.trade works

> The design ideas behind ordr.trade

ordr.trade is a fully on-chain orderbook. The goal is simple: match the speed and
low cost of a propAMM, while staying open to any market maker and keeping every
order, cancel, and fill visible on chain. We call this idea **OpenMM**, short for
Open Market Making.

To get there, ordr.trade is built around five main ideas.

## 1. Each market maker gets their own book

Instead of one shared order book that every market maker has to update, each market
maker on ordr.trade has their own book. Because no one shares a book with anyone
else, there is nothing to wait in line for. Hundreds of market makers can all update
their prices in the same moment without blocking each other.

## 2. One account holds all of a maker's funds

Normally, a market maker who quotes prices on twenty different markets needs to lock
up separate funds in twenty different places. On ordr.trade, each market maker has
one account, called a vault, that holds all of their funds across every market they
trade on. An order is just a promise backed by that vault. Funds only move at the
moment a trade actually happens, often called just-in-time, or JIT, execution.

This means a market maker can use the same pool of funds to quote prices across many
markets at once, instead of splitting their funds up and tying most of it down doing
nothing.

## 3. Updating prices is fast and cheap

When the market moves, a market maker on ordr.trade does not need to cancel and
resubmit every single order one by one. Each market maker's orders are stored around
a center price, as a small offset from it, not as a full price. Moving that one
center price shifts every order at once, in a single step. This makes updating
prices across an entire book almost as fast and cheap as updating one number.

Here is a simple example. Say the mid price is $100, the tick size is $0.01, and a
market maker has a bid resting with an offset of -5 and a size of 10 tokens.

```
mid       = $100
tick_size = $0.01
offset    = -5
size      = 10 tokens

price = mid + (offset × tick_size)
price = $100 + (-5 × $0.01)
price = $100 - $0.05
price = $99.95
```

That order rests at $99.95. If the market moves and the maker calls `update_mid` to
move the mid to $101, the same order reprices automatically, without the maker
touching the order itself:

```
mid    = $101
offset = -5        (unchanged)

price = mid + (offset × tick_size)
price = $101 + (-5 × $0.01)
price = $101 - $0.05
price = $100.95
```

This happens for every resting order at once, no matter how many there are.

Every `update_mid` call also carries a sequence number that only ever increases. If
a maker's reprice transaction gets delayed and lands after a newer one, the program
checks that number and simply discards the stale update instead of letting it roll
the price backward. ordr.trade also uses ACE (Application Controlled Execution), a
feature from Jito, so a maker's own cancel or reprice gets priority to land ahead of
other transactions trying to trade against that same market in the same block.
Together, this means a maker's price update is both given the best chance to land
first and, even if one still arrives late, can never overwrite a newer price. See
[Sequence numbers and ACE](https://docs.ordr.trade/architecture/sequencing-and-ace.md) for the full detail.

## 4. Market makers get to cancel first

When the market moves, the market maker who already has an order in the book should
get the first chance to cancel or update it, before anyone else can trade against
that now-stale price. As covered above, ordr.trade gets this with help from ACE, a
feature from Jito, which gives a market maker's own cancel or price update priority
to land ahead of other trades trying to hit that same market in the same slot.

## 5. Faster price updates help fight MEV

MEV, short for maximal extractable value, is the profit a bot makes by trading
against a price before the person who posted it can fix it. On an order book, the
main way to shrink that profit is to shrink the time a stale price sits exposed.
Because repricing an entire book is one instruction instead of many, a market maker
can react to a moving market almost the instant they see it, instead of racing to
land a pile of cancel-and-replace transactions before a bot gets there first. The
smaller that window gets, the less a bot has to work with.

ordr.trade pushes this further by hand-writing the reprice instruction,
`update_mid`, in low-level assembly. The whole instruction, including the safety
check that stops an old price from overwriting a newer one, currently costs just 33
units of compute. That is cheap enough that a market maker's reprice is never the
reason a transaction is slow or expensive to land.

## Who this helps

**Market makers** can keep their pricing strategy private and only publish the
orders that come out of it. They don't need to build and run their own custom
program to compete. They just open an account, fund their vault, and start quoting.

**Aggregators and trading apps** get one place to look for a reliable price, instead
of having to guess prices across many separate pools. They can either read the order
book directly or send an order and let the matching happen on chain.

**Traders** get tighter spreads because market makers can quote more safely, and they
get full visibility into every order, cancel, and fill, all of which happen on chain
and can be checked by anyone.

> [card] [Go deeper: Architecture](https://docs.ordr.trade/architecture/overview.md)
>
> See exactly how the on-chain program stores a book, matches orders, and
> keeps a maker's reprice safe from stale quotes.


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