> For the complete documentation index, see [llms.txt](https://docs.afx.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.afx.xyz/trading-rules/slippage.md).

# Slippage

AFX provides configurable slippage protection for Market Orders to safeguard traders against unfavorable price movements due to low liquidity or volatile market conditions.

## How It Works

Slippage tolerance defines the maximum deviation from the current last traded price at which a Market Order can execute. Any portion of the order that would fill beyond the slippage boundary is automatically cancelled.

**Execution price boundaries:**

* Long / Buy: Execution Price ≤ Last Price × (1 + Slippage %)
* Short / Sell: Execution Price ≥ Last Price × (1 - Slippage %)

## Configuration

* Slippage is configured **per trading pair**, not globally.
* Configurable range: **0.5% to 5%** (in 0.1% increments).
* Default value: **3%**.

## Important Notes

* Slippage protection applies to **opening** positions only. Closing positions (including liquidation orders) are **not** subject to slippage limits, ensuring positions can always be fully closed.
* If the order book depth is insufficient to fill the order within the slippage boundary, only the portion within the boundary will be executed. The remaining portion is cancelled (partial fill behavior).


---

# 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://docs.afx.xyz/trading-rules/slippage.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.
