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

# Limit Order

> Place a limit order with GTC, IOC, ALO, ALO_SLIDE, or ALO_JOIN over WebSocket

> [!NOTE]
>
> Submit this action through the signed WebSocket `post` envelope. See the
> [request format](https://docs.bulk.trade/api-reference/ws-trading.md#post-request-format) and
> [Transaction Signing](https://docs.bulk.trade/api-reference/signing.md) for nonce, signature, and
> canonical encoding requirements. These examples contain illustrative nonces
> and placeholder signatures; sign the exact payload with a fresh nonce before use.

```json Request theme={null}
{
  "method": "post",
  "request": {
    "type": "action",
    "payload": {
      "actions": [
        {"l": {"c": "BTC-USD", "b": true, "px": 100000.0, "sz": 0.1, "tif": "GTC", "r": false, "i": false}}
      ],
      "nonce": "1704067200000000000",
      "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
      "signature": "5j7s...base58..."
    }
  },
  "id": 1
}
```

```json Response (Resting) theme={null}
{
  "type": "post",
  "id": 1,
  "data": {
    "type": "action",
    "payload": {
      "status": "ok",
      "response": {
        "type": "order",
        "data": {
          "statuses": [{
            "resting": {
              "oid": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F"
            }
          }]
        }
      }
    }
  }
}
```

```json Response (Filled) theme={null}
{
  "type": "post",
  "id": 1,
  "data": {
    "type": "action",
    "payload": {
      "status": "ok",
      "response": {
        "type": "order",
        "data": {
          "statuses": [{
            "filled": {
              "oid": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F",
              "totalSz": 0.1,
              "avgPx": 102500.0
            }
          }]
        }
      }
    }
  }
}
```

```json Response (Partially Filled) theme={null}
{
  "type": "post",
  "id": 1,
  "data": {
    "type": "action",
    "payload": {
      "status": "ok",
      "response": {
        "type": "order",
        "data": {
          "statuses": [{
            "partiallyFilled": {
              "oid": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F",
              "totalSz": 0.05,
              "avgPx": 102500.0
            }
          }]
        }
      }
    }
  }
}
```

```json Response (Error) theme={null}
{
  "type": "post",
  "id": 1,
  "data": {
    "type": "action",
    "payload": {
      "status": "ok",
      "response": {
        "type": "order",
        "data": {
          "statuses": [{
            "error": {
              "message": "Insufficient margin"
            }
          }]
        }
      }
    }
  }
}
```

**Limit order (`l`) fields:** `c` (symbol), `b` (true = buy), `px` (limit price), `sz` (size), `tif` (time in force), `r` (reduce-only), `i` (isolated routing flag, defaults to false), optional builder-code fee in `builderCode` (`{to, fee}`; omit when absent).

With builder code:

```json theme={null}
{"l": {"c": "BTC-USD", "b": true, "px": 100000.0, "sz": 0.1, "tif": "GTC", "r": false, "i": false, "builderCode": {"to": "recipient_pubkey_base58", "fee": 5}}}
```

**Time in force:** `GTC` (good till cancel), `IOC` (immediate or cancel),
`ALO` (strict post-only; rejects if crossing), `ALO_SLIDE` (crossing price slides
to the nearest non-crossing display tick), and `ALO_JOIN` (crossing price joins
the same-side best quote, falling back to Slide if that side is empty).

For example, the signed `payload.actions` may contain:

```json theme={null}
[
  {"l": {"c": "BTC-USD", "b": true, "px": 100000.0, "sz": 0.1, "tif": "ALO_SLIDE", "r": false, "i": false}}
]
```

Use `"ALO_JOIN"` to choose Join. JSON requests use these names, not numeric
enum indices. Account/order update responses use `postOnlySlide` and
`postOnlyJoin`. Resting buy prices round down and sell prices round up to the
display tick; IOC retains native precision.

Market-executing conditional legs support basis-point slippage overrides:
`slippage` on `st`, `tp`, and `trl`; `slSlippage` / `tpSlippage` on `rng`.
Use the updated SDK signing encoder for conditional actions, including mixed
batches. See [Place & Cancel Orders](https://docs.bulk.trade/api-reference/placeOrder.md#conditional-slippage-overrides).

## Responses and errors

See the shared [response format](https://docs.bulk.trade/api-reference/ws-trading.md#response-format),
[status types](https://docs.bulk.trade/api-reference/ws-trading.md#status-types), and
[error handling](https://docs.bulk.trade/api-reference/ws-trading.md#error-handling). Follow subsequent
order and fill events through the [account stream](https://docs.bulk.trade/api-reference/ws-account.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.