> For the complete documentation index, see [llms.txt](https://docs.dexpal.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dexpal.io/for-partners/schemas/trigger-order.md).

# Trigger Order

A reusable object representing a stop loss or take profit order attached to a position or limit order. Used in [`positions`](/for-partners/endpoints/user-positions.md) and [`orders`](/for-partners/endpoints/user-orders.md) as a nested array.

## Schema

| Field           | Type    | Required | Description                                                                        |
| --------------- | ------- | -------- | ---------------------------------------------------------------------------------- |
| `action`        | enum    | yes      | Type of trigger. `takeProfit` or `stopLoss`.                                       |
| `triggerPrice`  | number  | yes      | Price at which the order fires, in quote currency.                                 |
| `amountPercent` | number  | yes      | Percentage of the position to close when triggered. `100` = close entire position. |
| `createdAt`     | ISO8601 | yes      | Timestamp when the trigger order was created.                                      |

## Example

```json
{
  "action": "takeProfit",
  "triggerPrice": 70000.0,
  "amountPercent": 100.0,
  "createdAt": "2024-09-06T23:00:00Z"
}
```

```json
{
  "action": "stopLoss",
  "triggerPrice": 58000.0,
  "amountPercent": 100.0,
  "createdAt": "2024-09-06T23:00:00Z"
}
```

## Notes

* A single position or order may have multiple trigger orders at different price points (e.g. partial take profits).
* `amountPercent` values across multiple triggers do not need to sum to 100 — DEX behaviour varies.
* Not all DEXes support trigger orders on limit orders. Return an empty array if not applicable.
