> For the complete documentation index, see [llms.txt](https://saejins-organization.gitbook.io/mettle-market-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://saejins-organization.gitbook.io/mettle-market-docs/market-orders.md).

# Market Orders

#### Core Concept of Market Orders

A **market order** means:

* You want to **buy or sell immediately**
* You are **willing to accept the best available limit order price.**&#x20;
* You do **not specify a price**, just the amount

This is ideal for traders who value **speed over precision**.

***

**Matching Logic**

* We fetch and sort limit orders by **price priority** and **timestamp** (FIFO).
* Matching is based on the side:
  * **BUY YES** → Matches with lowest-price **SELL YES**
  * **BUY NO** → Matches with lowest-price **SELL NO**
  * **SELL YES** → Matches with highest-price **BUY YES**
  * **SELL NO** → Matches with highest-price **BUY NO**
* **Partial Fills & Fallbacks**
  * If your market order **cannot be fully matched**:
    * The matched portion is settled on-chain.
    * The unmatched portion is **NOT stored** — market orders are either **fully matched or partially filled and discarded**.

#### Maker-Taker Priority

Mettle Market uses **maker-taker price priority** for all matches — including standard and cross-side matches:

* The **maker** is the trader whose order was already resting in the order book.
* The **taker** is the trader who submits a new order that triggers the match.
* The **trade executes at the maker’s price**, not the taker’s.

This ensures:

* Makers receive their requested price
* Takers never pay more (or receive less) than they agreed to
* Price-time fairness across all trades

Even in [**cross-side matching**](/mettle-market-docs/cross-side-matching.md) (e.g. BUY YES vs. BUY NO), the first order is treated as the maker, and the match executes at **that price** for both parties.


---

# 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://saejins-organization.gitbook.io/mettle-market-docs/market-orders.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.
