> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rivermarkets.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Order Types

> Complete guide to all order types available on River Markets

## Basic Order Types

### Market Order

Executes immediately at the best available price.

* **Use case**: When you need immediate execution and price is less important
* **Example**: Market buy 100 contracts → fills at current best ask price

### Limit Order

Rests on the order book at a specified price.

* **Use case**: When you want price control and can wait for execution
* **Example**: Limit buy $100$ @ $0.65$ → only fills at \$0.65 or better

### Time in Force

* **IOC** : Immediate or Cancel - executes immediately for any available quantity, and cancels any unfilled remainder.
  * **Example**: IOC buy 10 contracts; if only 6 are available now, 6 fill and 4 are canceled.
* **FOK** : Fill-Or-Kill - must be filled completely and immediately, or the entire order is canceled.
  * **Example**: FOK buy 10 contracts; if all 10 cannot fill right now, nothing is executed.
* **GTD** : Good-Till-Date - stays active until a specific date/time, unless filled or canceled earlier.
  * **Example**: GTD limit buy valid until `2026-02-20 15:00 UTC`.
* **GTC** : Good-Till-Cancelled - stays active until fully filled or manually canceled (subject to platform-level max lifetime limits).
  * **Example**: Rest a GTC limit order on the book until market reaches your price.

***

## Conditional Order Types

Conditional orders are **not placed immediately**. They activate ("trigger") when specific conditions are met.

### Stop Orders

Stop orders trigger when price moves to a predefined stop price, using the traded price. On a buy stop order, the order is triggered if someone trades at or above the stop price. On a sell stop order, the order is triggered if someone trades at or below the stop price.

<Tabs>
  <Tab title="Stop Market">
    Triggers when market trades at or through your stop price, then executes as a market order (immediate fill at best available price).

    ```
    The market is currently trading at $0.70. You want to enter a short position
    if the market trades below or at $0.60.
    → Stop Market SELL @ $0.60
    → Triggers when price ≤ $0.60
    → Sends market sell order → fills immediately
    ```
  </Tab>

  <Tab title="Stop Limit">
    Triggers when market trades at or through your stop price, then executes as a limit order at your specified limit price.

    ```
    The market is currently trading at $0.70. You want to enter a short position
    if the market trades below or at $0.60, but you don't want to sell at lower
    than $0.59.
    → Stop Limit SELL @ $0.60, Limit $0.59
    → Triggers when price ≤ $0.60
    → Sends limit sell order @ $0.59 → waits for fill at $0.59 or better
    ```

    <Warning>May not fill if price moves too fast through your limit.</Warning>
  </Tab>
</Tabs>

**Directional logic:**

* **BUY stop**: Triggers at or above stop price (breakout entry or short exit)
* **SELL stop**: Triggers at or below stop price (stop loss or long exit)

### Reverse Stop Orders

Reverse stop orders trigger when price moves **in** your desired direction. Used exclusively for **take profit** scenarios.

A "reverse stop" is called "reverse" because it triggers in the **opposite** direction of a normal stop order.

<Tabs>
  <Tab title="Reverse Stop Market (TP Market)">
    Triggers when market trades at or through your target price (opposite direction from normal stop), then executes as a market order.

    ```
    You're LONG at $0.60, want to take profit if price rises to $0.80
    → TP Market (Reverse Stop Market) SELL @ $0.80
    → Normal stop would trigger BELOW, but reverse stop triggers ABOVE
    → Triggers when price ≥ $0.80
    → Sends market sell order → fills immediately
    ```
  </Tab>

  <Tab title="Reverse Stop Limit (TP Limit)">
    Triggers when market trades at or through your target price, then executes as a limit order at your specified limit price.

    ```
    You're LONG at $0.60, want to take profit around $0.80 but not worse than $0.79
    → TP Limit (Reverse Stop Limit) SELL @ $0.80, Limit $0.79
    → Triggers when price ≥ $0.80
    → Sends limit sell order @ $0.79 → waits for fill at $0.79 or better
    ```
  </Tab>
</Tabs>

**Directional logic (reversed from normal stop):**

* **BUY reverse stop**: Triggers at or below target (opposite of normal buy stop)
* **SELL reverse stop**: Triggers at or above target (opposite of normal sell stop)

**Why "reverse"?**

* Normal **SELL stop** @ $0.60 triggers when price ≤ $0.60 (price falling)
* **SELL reverse stop** @ $0.80 triggers when price ≥ $0.80 (price rising)
* The trigger direction is reversed!

### Take Profit Orders (TP)

**Parent-child orders**: Automatically triggers a child order when a parent order **fills**.

<Tabs>
  <Tab title="TP Market">
    Triggers when parent order is **fully filled**, then activates a reverse stop market order.

    ```
    Place limit buy 100 @ $0.60 WITH TP Market @ $0.80
    → When buy fills → immediately activates reverse STOP Market SELL @ $0.80
    → That reverse stop triggers when price ≥ $0.80, and send a sell market order
    ```
  </Tab>

  <Tab title="TP Limit">
    Triggers when parent order is **fully filled**, then activates a limit order.

    ```
    Place limit buy 100 @ $0.60 WITH TP Limit @ $0.80
    → When buy fills → activates TP Limit SELL
    → Sends limit sell @ $0.80
    ```
  </Tab>
</Tabs>

### Stop Loss Orders (SL)

**Parent-child orders**: Automatically triggers a child order when a parent order **fills**.

<Tabs>
  <Tab title="SL Market">
    Triggers when parent order is **fully filled**, then activates a stop market order.

    ```
    Place limit buy 100 @ $0.60 WITH SL Market @ $0.55
    → When buy fills → immediately activates SL Market SELL @ $0.55
    → That SL Market is a stop order that triggers when price ≤ $0.55
    → That stop triggers when price ≤ $0.55, and send a sell market order
    ```
  </Tab>

  <Tab title="SL Limit">
    Triggers when parent order is **fully filled**, then activates a stop limit order.

    ```
    Place limit buy 100 @ $0.60 WITH SL Limit @ $0.55 (limit $0.54)
    → When buy fills → activates SL Limit SELL
    → Triggers when price ≤ $0.55 → sends limit sell @ $0.54
    ```
  </Tab>
</Tabs>

***

## Algorithmic Order Types

Algorithmic orders execute over time as a sequence of automatically-managed
child orders. They live on River's side, not the exchange's — a background
worker manages the lifecycle and you cancel the parent to cancel everything.
Placed via the [Complex Orders API](/api-reference/complex-orders).

### Iceberg

Splits a large order into smaller **tranches** so the full size is never
visible on the book. Only `displayed_qty` is posted at any moment; when a
tranche fully fills, the next is placed at the same `limit_price` until
`total_qty` is exhausted.

**Parameters:**

| Field            | Description                                                             |
| ---------------- | ----------------------------------------------------------------------- |
| `total_qty`      | Total quantity across all tranches                                      |
| `displayed_qty`  | Tranche size — quantity shown to the market at a time                   |
| `limit_price`    | Static price used for every tranche (between 0 and 1)                   |
| `post_only`      | If true, every tranche is posted maker-only                             |
| `reload_delay_s` | Optional seconds to wait between tranches (0 = immediate)               |
| `expiry_ts_utc`  | Optional GTD expiry for every tranche; venue expiry cancels the iceberg |

```
You want to buy 1,000 contracts but don't want to telegraph the size.
→ Iceberg BUY total_qty=1000, displayed_qty=50, limit_price=0.45
→ Tranche 1: post 50 @ $0.45. When filled →
→ Tranche 2: post 50 @ $0.45. When filled → … 20 tranches total.
```

<Note>
  Child tranches arrive on the [orders WebSocket](/ws-api-reference/orders)
  as ordinary `order` frames — clients can group them by `parent_iceberg_order_id`
  if needed.
</Note>

### Peg

Rests a single child order at the **top of book** and automatically **repegs**
it as the book moves, capped by a worst-price limit. Useful for capturing the
spread without manually chasing the market.

* **Buy peg**: rests at the current best bid, repegs up as bids rise, never
  pays more than `max_price` (the ceiling).
* **Sell peg**: rests at the current best ask, repegs down as asks fall, never
  sells below `min_price` (the floor).

**Parameters:**

| Field                 | Description                                                                                                                                                                                        |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `total_qty`           | Total quantity for the peg                                                                                                                                                                         |
| `min_price`           | Price floor — the child never rests below this (binds sell pegs). Optional; unset floors at 0                                                                                                      |
| `max_price`           | Price ceiling — the child never rests above this (binds buy pegs). Optional; unset ceils at 1                                                                                                      |
| `post_only`           | If true, a repeg that would cross the book cancels the peg instead of taking                                                                                                                       |
| `peg_min_stay_time_s` | Optional minimum seconds the child must rest before a price-driven repeg fires                                                                                                                     |
| `max_qty_level`       | Penny-jump threshold (contracts). If the level the peg would join holds more than this many contracts, rest one tick tighter instead (if not crossing the book and not already quoting the level). |
| `expiry_ts_utc`       | Optional GTD expiry for the resting child                                                                                                                                                          |

```
The best bid is $0.48, best ask is $0.50, you want to buy up to $0.49.
→ Peg BUY total_qty=200, max_price=0.49
→ Post 200 @ $0.48 (top of book)
→ Best bid moves to $0.485 → repeg to $0.485
→ Best bid moves to $0.495 → would exceed max_price → child stays at $0.49
→ Best bid moves to $0.51 → exceeds max, peg cancels (or stays at $0.49 until cancel/expiry)

With max_qty_level=5000:
→ Best bid moves to $0.49 showing 8,000 contracts → rather than joining that
  queue, post 200 @ $0.491 (one tick inside the spread), ahead of the 8,000.
```

<Note>
  `post_only=true` is recommended for makers — without it, a fast-moving book
  could cause a repeg to cross and consume liquidity at your limit price.
</Note>

### Smart Taker

Rests **nothing** on the book. Instead it watches the opposite side and fires an
**IOC clip** the moment at least `min_qty` of acceptable liquidity (priced within
`limit_price`) appears, repeating until `total_qty` is filled. Use it to take
size opportunistically — without showing your intent or chasing the market — and
only when the fill is worth the taker fee and spread.

* **Buy smart taker**: waits for asks at or below `limit_price`, then takes up to
  the available size in a single IOC clip.
* **Sell smart taker**: waits for bids at or above `limit_price`, then takes.

**Parameters:**

| Field           | Description                                                                                                                                                                                                                    |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `total_qty`     | Total quantity to take across all clips                                                                                                                                                                                        |
| `limit_price`   | Worst price the taker will cross at (max for buy, min for sell), between 0 and 1                                                                                                                                               |
| `min_qty`       | Book-depth gate: minimum acceptable liquidity resting within `limit_price` before a clip fires. A depth floor on the book, **not** a per-clip fill floor — it may exceed `total_qty` (e.g. take 100 only when ≥500 is resting) |
| `expiry_ts_utc` | Optional GTD expiry; on expiry the order is torn down                                                                                                                                                                          |

```
You want 500 contracts, but only if you can take real size at $0.30 or better.
→ Smart Taker BUY total_qty=500, limit_price=0.30, min_qty=100
→ Book shows 20 @ $0.30 → below min_qty → no clip (don't cross for dust)
→ Liquidity builds to 150 @ $0.30 → fire IOC clip, take 150
→ … repeat until 500 filled or expiry_ts_utc passes.
```

<Note>
  A smart taker places no order until acceptable liquidity appears — an active
  smart taker with no fills yet is simply waiting, not stuck. Child IOC clips
  arrive on the [orders WebSocket](/ws-api-reference/orders) as ordinary `order`
  frames — clients can group them by `parent_smart_taker_order_id`.
</Note>

***

## Comparison

| Type            | Trigger                            | Execution                    | Primary Use                                 |
| --------------- | ---------------------------------- | ---------------------------- | ------------------------------------------- |
| **Market**      | Immediate                          | Best price                   | Need immediate fill                         |
| **Limit**       | Rests on book                      | At limit or better           | Price control                               |
| **Stop Market** | Price moves against                | Market order                 | Stop loss, breakout                         |
| **Stop Limit**  | Price moves against                | Limit order                  | Stop loss with price protection             |
| **TP Market**   | Parent fills + price moves for     | Market via reverse stop      | Take profit                                 |
| **TP Limit**    | Parent fills + price moves for     | Limit via reverse stop       | Take profit with control                    |
| **SL Market**   | Parent fills + price moves against | Market via stop              | Stop loss from entry                        |
| **SL Limit**    | Parent fills + price moves against | Limit via stop               | Stop loss with price floor                  |
| **Iceberg**     | Immediate (per tranche)            | Sequential limit tranches    | Hide size on a large order                  |
| **Peg**         | Tracks top of book                 | Resting limit, auto-repegged | Capture the spread up to a limit            |
| **Smart Taker** | Liquidity ≥ `min_qty` within limit | IOC clips, nothing resting   | Take size opportunistically without showing |

***

## Key Concepts

### Stop vs Reverse Stop

* **Stop**: Triggers when price moves AGAINST you (exit losses, enter breakouts)
* **Reverse Stop**: Triggers when price moves FOR you (take profits)

### Parent-Child Orders

* **TP/SL orders** are "meta-orders" that activate child orders when a parent fills
* The child order itself is usually a stop or reverse stop order
* This creates a two-step process: Parent fill → Child activation → Price trigger → Execution

### Trigger Direction Summary

| Side     | Stop (Loss/Breakout)  | Reverse Stop (Profit)   |
| -------- | --------------------- | ----------------------- |
| **BUY**  | Triggers ≥ stop price | Triggers ≤ target price |
| **SELL** | Triggers ≤ stop price | Triggers ≥ target price |
