# Orderbook & Matching Engine

Zeta v2 utilises a fully on chain orderbook and matching engine with similar operations to the [Open Book](https://github.com/openbook-dex) DEX on Solana.

Depositing into Zeta for the first time requires the creation of a open orders account. This is done atomically in the first order you place on that market. (This will have a **one time cost** per market of \~0.024 SOL).

**Orderbook constraints**

The orderbook has enough space allocated to store a maximum of 455 orders per side (bid and ask). It uses a FIFO mechanism (first in first out).

If more than 455 orders are placed, the worst order (lowest bid or highest ask) placed on the orderbook will be booted off, and the corresponding order is cancelled for the user.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zeta.markets/zeta-protocol/exchange-architecture/orderbook-and-matching-engine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
