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

# Order Strategies

> This section covers server-side order strategies such as OCO, conditional, trailing stop, chase, swarm, and TWAP orders.

An order strategy is a rule that Pacifica runs for you on the server. It watches the market and places, reprices, or cancels orders on your account until it finishes. Each strategy has a `strategy_type` and a `params` object. See [Strategy parameters](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/strategy-parameters.md) for every type.

For how each strategy behaves in the app, see [Order Types](https://docs.pacifica.fi/trading-on-pacifica/order-types).

* [Create order strategy](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/create-order-strategy.md): This endpoint allows users to create an order strategy.
* [Edit order strategy](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/edit-order-strategy.md): This endpoint allows users to replace the definition of an open order strategy.
* [Cancel order strategy](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/cancel-order-strategy.md): This endpoint allows users to cancel an order strategy and its open orders.
* [Get open order strategies](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/get-open-order-strategies.md): This endpoint allows users to list an account's order strategies that have not finished.
* [Get order strategy history](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/get-order-strategy-history.md): This endpoint allows users to list an account's finished order strategies.
* [Get order strategy](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/get-order-strategy.md): This endpoint allows users to get one order strategy by ID.
* [Get order strategy timeline](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/get-order-strategy-timeline.md): This endpoint allows users to get the lifecycle, order, and trade events of one order strategy.
* [Strategy parameters](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/strategy-parameters.md): The `params` object for each strategy type.

To stream lifecycle changes, subscribe to [Account order strategy updates](https://docs.pacifica.fi/api-documentation/api/websocket/subscriptions/account-order-strategy-updates.md).

### Lifecycle

A strategy's `lifecycle` is one of these values:

| `lifecycle` | Meaning |
| - | - |
| `pending` | Waiting for `scheduled_start_at` |
| `open` | Working. `phase` is `armed` while it waits for a trigger, and `running` while it trades |
| `paused` | Paused by a price boundary. It resumes when the price comes back |
| `completed` | Finished its work |
| `cancelled` | Cancelled by you or by the strategy. `terminal_reason` says why |
| `expired` | Reached `expires_at` or `scheduled_end_at` |
| `failed` | Could not continue, for example because its trigger order failed |

When a strategy reaches `cancelled` or `expired`, Pacifica cancels the orders it still has open. Fills that already happened stay.

### Limits

* An account can have up to 100 strategies that have not finished.
* Strategy endpoints accept [agent wallet](https://docs.pacifica.fi/api-documentation/api/signing/api-agent-keys.md) signatures.


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