> For the complete documentation index, see [llms.txt](https://docs.swap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.swap.io/swapping/limit-orders.md). Agents can also search and read this documentation through its [MCP server](https://docs.swap.io/~gitbook/mcp).

# Limit Orders

Limit orders on Swap.io: set a target price and let the order execute automatically on-chain, with optional Take Profit / Stop Loss.

<figure><img src="https://1709775646-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLKXMaZHVrZ63DTfeEJTG%2Fuploads%2FprE2flOonrfetD4rxQ1k%2Flimit-orders-cover.png?alt=media" alt="Limit order form on Swap.io, showing the Limit tab with a Buy Below trigger price"><figcaption></figcaption></figure>

**Limit Orders** let you trade at a price you choose instead of the current market price. You set a **target (limit) price**, deposit your tokens into an on-chain escrow in a single transaction, and the order executes **automatically** when the market reaches your price — you never have to watch the chart.

> 💡 In the Swap.io interface this feature lives on the **Limit** tab of the swap widget (next to **Swap** and **Recurring**). The product and notifications always say *Limit Order*.

### 🎯 Why use Limit Orders?

* **Buy the dip, sell the rally** — set the exact price you want and let the market come to you.
* **Take Profit & Stop Loss in one setup** — attach exit orders to your position up front; whichever triggers first executes, the rest is cancelled.
* **Set and forget** — the order lives on-chain and is executed by Swap.io's keeper infrastructure. Individual fills cost you nothing.
* **Stay in control** — track progress live, cancel anytime, and get your unfilled tokens back immediately.

***

### 🔄 How it works

1. **You configure the order once:** the pair, the amount to sell, your **Limit Price**, an optional **Take Profit / Stop Loss**, and an **expiry**.
2. **One escrow transaction is created on-chain.** Your input tokens are deposited into the order when you sign — you sign only once, even with TP/SL attached.
3. **Keepers execute the order automatically.** When the market price reaches your trigger, Swap.io's keeper infrastructure fills the order against on-chain liquidity. Fills can be **partial** — you keep whatever has executed so far.
4. **Track progress live.** The interface shows how far the market is from your price (`% to Fill`), the status of each Take Profit / Stop Loss leg, and unrealized PnL for bracket orders.
5. **Completion, cancellation, or expiry.** A fully filled order completes automatically. You can cancel an open order at any time — the **unfilled portion is refunded** to your wallet immediately. If the order reaches its expiry, it is closed on-chain and everything unfilled is returned.

```mermaid
sequenceDiagram
    actor You
    participant App as Swap.io App
    participant Escrow as On-chain Order
    participant Keeper as Swap.io Keeper

    You->>App: Set pair, amount, limit price, TP/SL, expiry
    App->>Escrow: One transaction creates the order (with TP/SL)
    You->>Escrow: Sign once — input tokens deposited
    loop Watching the market
        Keeper->>Escrow: Fill when your price is reached (full or partial)
        Escrow-->>You: Bought tokens from each fill
    end
    alt You cancel, or the order expires
        Escrow-->>You: Unfilled input refunded
    end
```

> ⚠️ **Stop orders execute through a price oracle.** Stop Loss / Buy Above triggers are gated by a Pyth oracle price and execute within a configurable **SL Slippage** tolerance. In sharp moves with low liquidity, price can gap beyond the slippage range and the stop may not execute.

***

### 🧩 Key concepts

| Concept                   | Description                                                                                                                          |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| **Limit Price**           | The trigger price for your order, shown as a percentage above or below the live market price (for example *Market −10%*).            |
| **Buy Below / Buy Above** | Direction labels for buy orders: below market (classic dip-buy limit) or above market (oracle-gated breakout entry).                 |
| **Take Profit (TP)**      | An attached exit that sells your position back when the price rises to your target.                                                  |
| **Stop Loss (SL)**        | An attached exit that sells your position back when the price falls to your trigger, within your SL slippage tolerance.              |
| **Brackets (TP + SL)**    | TP and SL share the same escrow as the parent order — you deposit once, and whichever leg triggers first wins.                       |
| **Expiry**                | How long the order stays open — from 10 minutes to 6 months (default **1 month**). Unfilled funds are returned at expiry.            |
| **Partial fills**         | Large orders can fill in several transactions; each fill is a real on-chain swap that stays yours.                                   |
| **Close via Market**      | For orders with TP/SL and an already-filled position: swap the filled position back to your input token at the current market price. |

### 💸 Fees & gas

* **Platform fee:** some pairs carry a platform fee on limit orders. When a fee applies to your pair, the exact percentage is shown in the order form before you sign, and the estimated output is already net of it.
* **Network fees:** creating and cancelling an order are normal Solana transactions. Many pairs support **gasless** execution — Swap.io sponsors the SOL network fee and deducts a small amount of the token instead. See Gasless Transactions.
* **Fills cost you nothing extra** — keepers submit the fill transactions.

### ⛓️ Availability

* Limit orders are available on **Solana** only.
* Minimum order size is **$10**; maximum order size is **$10,000**.
* **Stablecoin-to-stablecoin pairs are not supported** (use a regular Swap for instant 1:1 conversion).
* Slippage is **AUTO** for limit orders — there is no manual slippage setting on the parent order (only on the Stop Loss leg).
* Not every token is eligible for limit orders; if you open a pair with an unsupported token, the interface substitutes a supported one (SOL/USDC).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.swap.io/swapping/limit-orders.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
