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

# Take profits and stop losses

> Take-profit and stop-loss trigger-order routes across Hyperliquid core, HIP-3, and HIP-4, with the window and wallet filter params.

Take-profit and stop-loss orders are trigger orders: they rest until a price condition fires. Pull trigger-order lifecycle rows for a symbol on Hyperliquid core, HIP-3, and HIP-4, including take-profit and stop-loss orders; `order_type` and `trigger_condition` identify the trigger type.

Each row shows a trigger order being placed, canceled, or fired, with its trigger condition and price. [Trades](/rest-api/trades) has any resulting execution, and [Order history](/rest-api/order-history) the wider lifecycle. [Introducing HIP-3 L4 and TP/SL Order Data](https://0xarchive.io/resources/product-updates/l4-tpsl-data) explains what the HIP-3 L4 and TP/SL data add; the route contract is below.

<Warning>
  Take-profit and stop-loss records are drawn from the same `l4_orders` order-event capture as order history, so they share its coverage start: Hyperliquid core and HIP-3 begin 2026-03-10; HIP-4 begins 2026-05-02. A query entirely before that window returns `200` with an empty array; that means the dataset doesn't cover that period, not that no trigger orders existed. For fills from before the order-event start date, use [Trades](/rest-api/trades) instead.
</Warning>

## Get take profits and stop losses

<Tabs>
  <Tab title="Hyperliquid">
    ```bash theme={"theme":"github-dark"}
    curl "https://api.0xarchive.io/v1/hyperliquid/orders/BTC/tpsl?start=1783885994093&end=1783885994093&limit=1" \
      -H "X-API-Key: $OXARCHIVE_API_KEY"
    ```

    `/v1/hyperliquid/orders/{symbol}/tpsl`. Plain perp symbols such as `BTC`.
  </Tab>

  <Tab title="HIP-3">
    ```bash theme={"theme":"github-dark"}
    curl "https://api.0xarchive.io/v1/hyperliquid/hip3/orders/km:US500/tpsl" \
      -H "X-API-Key: $OXARCHIVE_API_KEY"
    ```

    `/v1/hyperliquid/hip3/orders/{symbol}/tpsl`. Namespaced builder symbols, case-sensitive.
  </Tab>

  <Tab title="HIP-4">
    ```bash theme={"theme":"github-dark"}
    curl "https://api.0xarchive.io/v1/hyperliquid/hip4/orders/%230/tpsl" \
      -H "X-API-Key: $OXARCHIVE_API_KEY"
    ```

    `/v1/hyperliquid/hip4/orders/{symbol}/tpsl`. Outcome side ids such as `%230`.
  </Tab>
</Tabs>

Response items are untyped in OpenAPI. The Hyperliquid core example below is representative and abridged. Fields can be omitted or added by order type and venue family, so capture a live response before binding a strict client model. The core example uses a July 2026 window, which needs a paid plan; on Free, use a window inside the most recent 30 days.

## Request parameters

| Parameter | Description |
| - | - |
| `symbol` | Path, required, string. Trading pair symbol, e.g. `BTC` |
| `start` | Query, optional, integer (ms) or string. Start time, Unix milliseconds or RFC 3339 (e.g. `1767225600000`) |
| `end` | Query, optional, integer (ms) or string. End time, Unix milliseconds or RFC 3339 |
| `triggered` | Query, optional, boolean. Filter by whether the trigger fired |
| `user` | Query, optional, string. Filter by wallet address. `user_address` is not read by this route; passing it is silently ignored and returns unfiltered results, so use `user`. |
| `limit` | Query, optional, integer. Max results. Default 1000, max 10000 |
| `cursor` | Query, optional, string. Pagination cursor from `meta.next_cursor` |

## Example response

Hyperliquid core, `BTC`. The example is representative and abridged. The wallet and request ID values are synthetic. The opaque response cursor and transaction hash are omitted.

```json theme={"theme":"github-dark"}
{
  "success": true,
  "data": [
    {
      "timestamp": "2026-07-12T19:53:14.093Z",
      "block_time": "2026-07-12T19:53:14.093Z",
      "block_number": 1070255443,
      "seq": 418,
      "coin": "BTC",
      "user_address": "0x1234567890abcdef1234567890abcdef12345678",
      "status": "open",
      "side": "B",
      "limit_price": 70169,
      "size": 0.03158,
      "orig_size": 0.03158,
      "oid": 494263411055,
      "order_type": "Stop Market",
      "trigger_condition": "Price above 64972",
      "trigger_price": 64972,
      "is_trigger": true,
      "is_position_tpsl": false,
      "reduce_only": true
    }
  ],
  "meta": {
    "count": 1,
    "request_id": "33333333-3333-4333-8333-333333333333"
  }
}
```

## When to use it

A take-profit or stop-loss sits as a trigger until its price condition fires. Triggering and filling are separate lifecycle events. Pair this route with [Trades](/rest-api/trades) to see whether the triggered order executed and [Order history](/rest-api/order-history) to follow later status changes. Use the `user` filter to study one wallet's risk management, or use `/v1/hyperliquid/orders/{symbol}/trigger-levels` for pending trigger-order concentrations. Read [Projected liquidation and trigger levels](/rest-api/liquidation-levels) for the distinct level semantics, and [Order flow](/rest-api/order-flow) for trigger placements counted per time bucket. Keep the trigger price, side, status, and timestamps together so you can follow the sequence without treating one event as the order's final state.

## Access

Each venue's start date, WebSocket channels, and page limit come from [`GET /v1/capabilities`](/capabilities), followed by the SDK, CLI, and MCP names for the same data. The start date is the first served row on that venue; exact starts vary by market, so check `/v1/symbols` for a single symbol. Send `0xArchive-Version: 2026-10-01` for the current response contract; see [API conventions](/conventions).

| Venue and data type | Availability |
| - | - |
| Hyperliquid: Take profits and stop losses | No venue-wide start date; see `/v1/symbols` per symbol<br />REST only, no WebSocket channel<br />Up to 10,000 rows a page |
| Hyperliquid: Trigger levels | No venue-wide start date; see `/v1/symbols` per symbol<br />REST only, no WebSocket channel<br />Up to 100 rows a page |
| HIP-3: Take profits and stop losses | No venue-wide start date; see `/v1/symbols` per symbol<br />REST only, no WebSocket channel<br />Up to 10,000 rows a page |
| HIP-3: Trigger levels | No venue-wide start date; see `/v1/symbols` per symbol<br />REST only, no WebSocket channel<br />Up to 100 rows a page |
| HIP-4: Take profits and stop losses | No venue-wide start date; see `/v1/symbols` per symbol<br />REST only, no WebSocket channel<br />Up to 10,000 rows a page |

| Surface | Names |
| - | - |
| Python SDK | `client.hyperliquid.orders.tpsl(symbol, ...)`; `.orders.trigger_levels(...)`, `.orders.trigger_levels_history(...)` |
| TypeScript SDK | `client.hyperliquid.orders.tpsl(symbol, ...)`; `.orders.triggerLevels(...)` |
| Rust SDK | `client.hyperliquid.orders.tpsl` |
| CLI | `oxa orders tpsl`, `oxa orders trigger-levels`, `oxa orders trigger-levels-history`; HIP-4 `oxa hip4 orders tpsl` |
| MCP tools | `get_tpsl`, `get_hip3_tpsl`, `get_hip4_tpsl`; trigger levels `get_trigger_levels`, `get_trigger_levels_history`, `get_hip3_trigger_levels`, `get_hip3_trigger_levels_history` |

## Stream it live

There is no dedicated take-profit or stop-loss channel. Trigger orders surface in the L4 order-event stream (`l4_orders`, plus the venue-prefixed variants), where you can filter for trigger order types as they are placed, fired, or canceled.

```javascript theme={"theme":"github-dark"}
ws.send(JSON.stringify({ op: "subscribe", channel: "l4_orders", symbol: "BTC" }));
```

Connection and reconnect handling live in the [WebSocket](/websocket) tab; see [WebSocket channels](/websocket/channels) for the family matrix.

## Export in bulk

Take-profit and stop-loss records ship in the `l4_orders` (Order Events / TP/SL) export schema (`$4/GB`, `$12.50 minimum`), delivered as Parquet with ZSTD compression. Build a selection in the [Data Catalog](/data-catalog); columns and coverage keys are on [Export schemas](/export-schemas).

## Next step

For the full lifecycle of each order, continue to [Order history](/rest-api/order-history).


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