> For the complete documentation index, see [llms.txt](https://docs.bcdex.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bcdex.net/order-book-protocol.md).

# Order Book Protocol

Smart contracts are excellent for online global storage, allowing all transaction participants to complete data exchange based on smart contracts, i.e., order matching. BCDEx stores orders from different chains in corresponding on-chain order contracts and has implemented the following protocols based on the order protocol:

a. Order placement protocol: Buyers/sellers can deposit quotes and assets into the contract to complete order placement. The counterparty can complete the transaction separately, even when the order placer is offline. By querying order information in the contract and performing order-taking operations, order matching is completed.

b. Market maker quoting protocol: To facilitate multiple, batch, and automated order placements by market makers, users can create quoting contracts, setting trading strategies within the contract, such as maximum/minimum transaction amounts, slippage curves, quotes, and other features.

c. Cross-chain exchange routing based on multi-chain orders: Market maker A provides exchange services between BTC-ETH, while market maker B provides exchange services between BTC-BSC. When a user wants to exchange BSC's BTCB for ETH's WBTC, they can place orders to both A and B within the order protocol, completing two exchanges in one step and achieving cross-chain routing.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.bcdex.net/order-book-protocol.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
