> For the complete documentation index, see [llms.txt](https://docs.metalx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metalx.com/developers-dex/contract-mappings/order-types.md).

# Order Types

Order types on Metal X Trading DEX are classified into:

* Orderbook (OrderType = **0**)
* Limit Order (OrderType **= 1**)
  * Market Buy: Price = 9223372036854775806 \
    &#x20;                         OR\
    Market Sell: Price = 1<br>

    **Note:** Above mentioned prices are raw prices, actual prices in API are divided by 10^(ask precision)
* Stop Loss order (OrderType **= 2**)
* Takep Profit order (OrderType **= 3**)

**Orderbook:** It represents an order is sitting in orderbook and waiting to get matched. The user can not place order directly under this category. The order gets promoted to this type after processing from the below categories.

**Limit Order:** It is an order with limit price placed in the orderq. This order will promoted into orderbook or executed/fills on reaching the limit price(it can be less for buy ordes or more for sell orders)

**Market Order:** Market orders are a special type of limit order that are executed/fills as quickly as possible after processing on XPR Network. It is applicable for both buy and sell orders.

{% hint style="info" %}
**NOTE:** The fill\_type for market order needs to be IOC
{% endhint %}

**Stoploss Order:** Stoploss order is an order that gives an opportunity to the user/trader to choose maximum amount of loose on the trade. Both limit and stoploss price has to be selected on the trade. Also this order is not guaranteed to be executed.

**Takeprofit Order:** Takeprofit order is an order that gives an opportunity to the user/trader to choose minimum profit on trade. Both limit and takeprofit price has to be selected on the trade. Also this order is not guaranteed to be executed.

{% hint style="info" %}
**Note**: On executing limit buy orders there are chances that the user might receive more than expected tokens. This would be possible when a better execution price(sell offer) available at that instant, mostly the additional tokens would be in small fractions instead of receiving back dust amounts like other exchanges.\
\
**Example:** If a market sell order of 200 XPR placed at 0.199, when a limit buy order of 100 XPR at 0.2 exist, user will receive 100.5026 XPR\
\
**Benefits:** Users are not left with small unsellable dust values
{% endhint %}


---

# 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.metalx.com/developers-dex/contract-mappings/order-types.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.
