> For the complete documentation index, see [llms.txt](https://nftperp.gitbook.io/core-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nftperp.gitbook.io/core-docs/nftperp/protocol-design/decentralized-limit-orderbook-dlob.md).

# Decentralized Limit Orderbook (DLOB)

An order book is a real-time, continuously updated list of buy and sell orders on an exchange for a particular financial asset, showing the quantity of the asset being bid on or offered at each price point. It facilitates transactions where buyers and sellers can match their orders according to prices and quantities. nftperp v2 uses a smart implementation of a fully onchain limit order book.

### nftperp DLOB Overview

nftperp's decentralized limit order book gives users complete control over their trades in the form of order submission, direction, prices, and size. The order book is fully onchain. Historically, storing and sorting thousands of orders on the chain has been very expensive. We solve this problem using the following approach:

* For every pair, there are ticks. Most pairs in our platform have a tick (price point) size of 0.01 ETH that stores all buy and sell orders at that price.
* When someone creates a market order, all orders belonging to that tick are matched. If the order is not filled, the onchain matching engine goes to the next tick and matches the limit orders in that tick. This process goes on until the market order is matched.

In this way, by smartly dividing and storing limit orders in a tick, we have created a fully onchain limit order book that can scale to tens of thousands of orders without significantly increasing gas cost for market orders.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://nftperp.gitbook.io/core-docs/nftperp/protocol-design/decentralized-limit-orderbook-dlob.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.
