> For the complete documentation index, see [llms.txt](https://fxprotocol.gitbook.io/fx-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fxprotocol.gitbook.io/fx-docs/guides/how-do-the-limit-orders-work.md).

# How do the limit orders work?

A Limit Order allows users to automatically open or close a position at a specified price within a set period of time.

When the market price reaches the trigger condition you set, the system will automatically execute your order — creating a true “set-and-forget” trading experience.

{% hint style="info" %}
💡 Important:

As always in DeFi, a limit order is not guaranteed to execute.

Keepers will only execute your order when the market price is sufficient to cover both your limit price and network fees.

Therefore, your order may not execute immediately when the price first reaches your limit level.
{% endhint %}

#### 1. Before You Start

* No gas fees are required to place an order. Gas is only required in case of cancelling your currents orders.
* Opening orders currently only accept fxUSD as base asset, use your favorite DEX aggregator to get some.
* You only need to authorize fxUSD and, if applicable, your position NFT.

{% hint style="info" %}
Looking at automating the limit orders? Look at the [developpers doc](/fx-docs/developers/integrating-the-f-x-limit-orders.md).
{% endhint %}

#### 2. Order Parameters

| **Parameter** | **Description**                                                                                                     |
| ------------- | ------------------------------------------------------------------------------------------------------------------- |
| Pay           | Amount of fxUSD to be used for opening or adding to a position.                                                     |
| Amount        | Amount of collateral to be sold when closing or reducing a position.                                                |
| Limit Price   | The price at which the limit order will be executed.                                                                |
| Limit Type    | For closing orders, choose Take Profit or Stop Loss.                                                                |
| Trigger Price | The trigger price is calculated automatically based on Limit Price and Slippage, but can be edited manually.        |
| Partial Fill  | Whether to allow partial order execution. Recommended for large orders so multiple Keepers can fill portions of it. |
| Expiration    | Order validity period. Default: 7 days (customizable, up to 1 year).                                                |

#### 3. Limit Order Types

| **Type**          | **Description**                                                                         |
| ----------------- | --------------------------------------------------------------------------------------- |
| Limit Open        | Opens a position when the market price reaches your set limit price.                    |
| Stop Loss Limit   | Executes at the Stop Loss (SL) price once the trigger condition is met.                 |
| Take Profit Limit | <p>Executes at the Take Profit (TP) price once the trigger condition </p><p>is met.</p> |

<br>

## Execution Conditions & Mechanism

* The protocol uses Chainlink Oracle prices.
* Only when the Oracle price meets the Trigger Price condition can a keeper initiate the trade.
* Execution occurs exactly at the Limit Price, with no slippage.
* Minimum trade size: 100 fxUSD (to incentivize Keeper execution).
* Open position: the protocol fees are deducted from the position.
* Close position: keeper handles the protocol fees.<br>

⚠️ Even when conditions are met, execution is not guaranteed and depends on keeper availability and market incentives. Note that this is true for every kind of limit order, not only on f(x) Protocol.

<br>


---

# 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://fxprotocol.gitbook.io/fx-docs/guides/how-do-the-limit-orders-work.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.
