> For the complete documentation index, see [llms.txt](https://sol-perps-bot.gitbook.io/sol-perps-bot-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sol-perps-bot.gitbook.io/sol-perps-bot-docs/trading-basics/order-types.md).

# Order Types & Execution

Fluvion supports a comprehensive suite of order types and execution controls to accommodate both manual discretionary traders and automated algorithmic strategies.

***

## Core Order Types

### 1. Market Order

A **Market Order** executes immediately against the resting liquidity in the orderbook at the best available prices until the requested order size is completely filled.

* **Speed**: Instantaneous matching.
* **Role**: Always classified as a **Taker** order (incurs the taker fee rate).
* **Slippage Protection**: Fluvion enforces a max slippage tolerance (default 0.5%–1.0%, customizable in Settings) to protect you from executing at unfavorable prices during sudden thin-book periods.

### 2. Limit Order

A **Limit Order** lets you specify the exact price at which you are willing to buy or sell.

* **Buy Limit**: Placed at or below the current market price. Executes only at the limit price or lower.
* **Sell Limit**: Placed at or above the current market price. Executes only at the limit price or higher.
* **Resting Liquidity**: If the order cannot be filled immediately, it rests on the orderbook as passive depth.
* **Role**: When resting on the book before execution, fills count as **Maker** (qualifying for lower maker fee tiers or rebates).

***

## Conditional & Stop Orders

### 3. Stop Market

A **Stop Market** order remains dormant until the market hits a specified **Trigger Price**. Once the trigger is touched, a Market order is automatically fired into the book.

* Commonly used for hard **Stop-Loss** execution to prevent outsized losses.

### 4. Stop Limit

A **Stop Limit** order activates when the **Trigger Price** is hit, placing a **Limit Order** at your specified limit price.

* Gives control over execution price, but carries the risk of not filling if the market moves past the limit price too rapidly.

### 5. Take-Profit & Stop-Loss (TP/SL)

Fluvion allows you to attach automated TP/SL parameters directly when placing an entry order, or add/amend them on an open position:

* **Take-Profit (TP)**: Automatically closes the position when the market hits your target profit price.
* **Stop-Loss (SL)**: Automatically market-closes the position if the market moves against you, cutting losses before liquidation.
* **Trigger Reference**: You can choose whether TP/SL triggers based on the **Last Price** or the **Mark Price** (recommended to avoid false wicks).

***

## Time-In-Force (TIF) Policies

Time-in-Force instructions specify how long an order remains active in the orderbook:

| TIF Mode                      | Description                                                                                                                                                           | Typical Use Case                                      |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| **GTC (Good 'Til Cancelled)** | Remains active in the orderbook until completely filled or manually cancelled. *(Default mode)*                                                                       | Standard swing limit orders.                          |
| **IOC (Immediate or Cancel)** | Fills as much of the order as possible immediately at the specified limit price. Any unfilled portion is cancelled instantly.                                         | Large block orders without leaving resting liquidity. |
| **FOK (Fill or Kill)**        | All-or-nothing execution. If the entire order cannot be filled immediately at the limit price or better, the order is cancelled completely without any partial fills. | Arbitrage and precise quantity executions.            |

***

## Advanced Execution Flags

### Post-Only

The **Post-Only** flag ensures your limit order is placed into the orderbook as passive liquidity and **never takes liquidity**:

* If the order would match immediately against existing resting orders upon arrival (acting as a taker), the engine automatically cancels the order.
* **Benefit**: Guarantees you always pay the cheaper **Maker** fee rate and never accidentally incur a Taker fee.

### Reduce-Only

A **Reduce-Only** order can strictly **decrease or close** an existing position:

* It will never increase the position size or open a new position in the opposite direction.
* If the size of a Reduce-Only order exceeds your currently open position size, the engine automatically trims the order size down to match your exact position quantity.
* **Benefit**: Eliminates the danger of accidentally flipping your position (e.g. from Long to Short) if an old exit order fills after you have already closed your trade manually.

***

## Order Types Summary Matrix

| Order Type                 |    Execution Speed   |  Maker / Taker |     Guaranteed Price?    |    Guaranteed Fill?    |
| -------------------------- | :------------------: | :------------: | :----------------------: | :--------------------: |
| **Market**                 |       Immediate      |      Taker     | No (subject to slippage) |           Yes          |
| **Limit (resting)**        |   When price is hit  |      Maker     |            Yes           | No (depends on market) |
| **Limit (immediate fill)** |       Immediate      |      Taker     |            Yes           |     Partial or Full    |
| **Post-Only Limit**        |    Passive resting   |   Maker only   |            Yes           |           No           |
| **Stop Market**            | Immediate on trigger |      Taker     |            No            |  Yes (once triggered)  |
| **Stop Limit**             | Rest/fill on trigger | Maker or Taker |            Yes           |           No           |
