> ## 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.

# Strategy Parameters

> The params object for each order strategy type.

[Create order strategy](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/create-order-strategy.md) and [Edit order strategy](https://docs.pacifica.fi/api-documentation/api/rest-api/order-strategies/edit-order-strategy.md) take a `strategy_type` and a `params` object. This page lists the `params` fields for each type. Unknown fields are rejected.

| `strategy_type` | Strategy |
| - | - |
| `oco` | [OCO](#oco): two stop legs, the first to trigger cancels the other |
| `conditional` | [Conditional](#conditional): one market or limit order when a price condition is met |
| `trailing_stop` | [Trailing stop](#trailing-stop): a market order when the price retraces by a trail distance |
| `auto_chase` | [Chase](#chase): a post-only limit order that follows the best bid or ask |
| `swarm` | [Swarm](#swarm): an amount split into market orders placed in quick succession |
| `trigger_swarm` | [Trigger swarm](#trigger-swarm): a swarm that starts when a price condition is met |
| `twap` | [TWAP](#twap): an amount split into market orders spread over time |

### Common values

| Field | Values |
| - | - |
| `side` | `bid` (buy) or `ask` (sell) |
| `trigger_direction` | `gte`: trigger when the price is at or above `trigger_price`. `lte`: at or below |
| `trigger_price_type` | `mark`, `mid`, `last`, `best_bid`, `best_ask`. Each type below says which values it accepts |
| `order_type`, `child_order_type` | `market` or `limit` |
| `boundary_action` | `pause` or `cancel` |
| `slippage_percent` | Max slippage for market orders, above 0 and at most 100. If omitted, Pacifica uses a default |

Send prices and amounts as decimal strings, for example `"0.01"`.

#### Take profit and stop loss

`take_profit` and `stop_loss` attach to the position that the strategy opens. You cannot use them with `reduce_only: true`.

| Field | Type | Need | Description |
| - | - | - | - |
| `stop_price` | decimal string | required | Trigger price |
| `limit_price` | decimal string | optional | Limit price. If omitted, the triggered order is a market order |
| `trigger_price_type` | string | optional | `mark`, `mid`, or `last` |

### OCO

Two stop legs on one market. The first leg whose trigger is crossed is placed as an order, and the other leg is cancelled. If both trigger in the same check, the first leg in `legs` wins. See [OCO](https://docs.pacifica.fi/trading-on-pacifica/order-types/strategies/oco.md).

| Field | Type | Need | Description |
| - | - | - | - |
| `symbol` | string | required | Market |
| `legs` | array | required | Exactly two legs. See below |
| `reduce_only` | boolean | required | Whether the triggered order is reduce-only |
| `slippage_percent` | decimal string | optional | Only allowed if at least one leg is a `market` leg |

Each leg:

| Field | Type | Need | Description |
| - | - | - | - |
| `trigger_price_type` | string | required | `mark` or `mid` |
| `trigger_direction` | string | required | `gte` or `lte` |
| `trigger_price` | decimal string | required | Trigger price |
| `side` | string | required | `bid` or `ask` |
| `amount` | decimal string | required | Order amount |
| `order_type` | string | required | `market`, or `limit` for a GTC limit order |
| `limit_price` | decimal string | conditional | Required for a `limit` leg. Not allowed for a `market` leg |

```json theme={null}
{
  "strategy_type": "oco",
  "params": {
    "symbol": "BTC",
    "reduce_only": true,
    "legs": [
      {"trigger_price_type": "mark", "trigger_direction": "gte", "trigger_price": "70000", "side": "ask", "amount": "0.01", "order_type": "market"},
      {"trigger_price_type": "mark", "trigger_direction": "lte", "trigger_price": "60000", "side": "ask", "amount": "0.01", "order_type": "limit", "limit_price": "59950"}
    ]
  }
}
```

### Conditional

Places one order when a price condition is met. The trigger can watch a different market from the one you trade. The strategy places one order and does not trigger again. See [Conditional Market](https://docs.pacifica.fi/trading-on-pacifica/order-types/strategies/conditional-market.md) and [Conditional Limit](https://docs.pacifica.fi/trading-on-pacifica/order-types/strategies/conditional-limit.md).

| Field | Type | Need | Description |
| - | - | - | - |
| `trigger_symbol` | string | required | Market whose price is watched |
| `trigger_price_type` | string | required | `mark`, `mid`, `last`, `best_bid`, or `best_ask` |
| `trigger_direction` | string | required | `gte` or `lte` |
| `trigger_price` | decimal string | required | Trigger price |
| `execution_symbol` | string | required | Market to trade |
| `side` | string | required | `bid` or `ask` |
| `amount` | decimal string | required | Order amount |
| `order_type` | string | required | `market` or `limit` |
| `limit_price` | decimal string | conditional | Required for `limit`. Not allowed for `market` |
| `tif` | string | conditional | `GTC`, `IOC`, `ALO`, or `TOB`. Required for `limit`. Not allowed for `market` |
| `reduce_only` | boolean | required | Whether the order is reduce-only |
| `take_profit` | object | optional | See [Take profit and stop loss](#take-profit-and-stop-loss) |
| `stop_loss` | object | optional | See [Take profit and stop loss](#take-profit-and-stop-loss) |
| `slippage_percent` | decimal string | optional | Only for `market` |

```json theme={null}
{
  "strategy_type": "conditional",
  "params": {
    "trigger_symbol": "BTC",
    "trigger_price_type": "mid",
    "trigger_direction": "lte",
    "trigger_price": "62000",
    "execution_symbol": "BTC",
    "side": "ask",
    "amount": "0.02",
    "order_type": "limit",
    "limit_price": "61950",
    "tif": "GTC",
    "reduce_only": true
  }
}
```

### Trailing stop

Tracks the best price since activation: the peak for a sell, the trough for a buy. When the price retraces by the trail distance, it places a market order. It triggers once. See [Trailing Stop](https://docs.pacifica.fi/trading-on-pacifica/order-types/strategies/trailing-stop.md).

| Field | Type | Need | Description |
| - | - | - | - |
| `symbol` | string | required | Market |
| `side` | string | required | `bid` or `ask` |
| `direction` | string | required | `exit` to close a position, or `entry` to open one |
| `size_mode` | string | required | `defined` uses `amount`. `full_position` closes the whole position at trigger time and needs `reduce_only: true` |
| `amount` | decimal string | conditional | Required for `defined`. Not allowed for `full_position` |
| `trail_bps` | integer | conditional | Trail distance in basis points, 1 to 9999 (0.01% to 99.99%). Send exactly one of `trail_bps` and `trail_value` |
| `trail_value` | decimal string | conditional | Trail distance as a price amount |
| `trigger_price_type` | string | required | `mark`, `mid`, or `last` |
| `child_order_type` | string | required | Must be `market` |
| `activation_price` | decimal string | optional | Tracking starts when the price reaches this level: rises to it for a sell, falls to it for a buy. If omitted, tracking starts at once |
| `reduce_only` | boolean | required | Whether the order is reduce-only |
| `purpose` | string | optional | `standard` (default) or `position_exit`. See below |
| `position_id` | string | conditional | Required for `position_exit`. Not allowed for `standard` |
| `slippage_percent` | decimal string | optional | Max slippage for the market order |

`position_exit` ties the trailing stop to one position. Set `position_id` to the position's `id` from [Get positions](https://docs.pacifica.fi/api-documentation/api/rest-api/account/get-positions.md), with `direction: "exit"` and `reduce_only: true`. The strategy is cancelled if that position is gone or has been replaced by a new one.

```json theme={null}
{
  "strategy_type": "trailing_stop",
  "params": {
    "symbol": "BTC",
    "side": "ask",
    "direction": "exit",
    "size_mode": "defined",
    "amount": "0.1",
    "trail_bps": 200,
    "trigger_price_type": "mid",
    "child_order_type": "market",
    "reduce_only": true
  }
}
```

### Chase

Rests a post-only (ALO) limit order at the best bid for a buy, or the best ask for a sell. When that price moves, Pacifica reprices the unfilled amount. See [Chase](https://docs.pacifica.fi/trading-on-pacifica/order-types/strategies/chase.md).

| Field | Type | Need | Description |
| - | - | - | - |
| `symbol` | string | required | Market |
| `side` | string | required | `bid` or `ask` |
| `amount` | decimal string | required | Total amount |
| `reduce_only` | boolean | required | Whether the orders are reduce-only |
| `mode` | string | required | `till_fill` chases until filled. `to_price` stops at `chase_to_price` |
| `chase_to_price` | decimal string | conditional | Furthest price to chase to: a ceiling for a buy, a floor for a sell. Required for `to_price`. Not allowed for `till_fill` |
| `boundary_action` | string | conditional | What happens past `chase_to_price`: `pause` or `cancel`. Required for `to_price`. Not allowed for `till_fill` |
| `take_profit` | object | optional | See [Take profit and stop loss](#take-profit-and-stop-loss) |
| `stop_loss` | object | optional | See [Take profit and stop loss](#take-profit-and-stop-loss) |

### Swarm

Splits an amount into market orders, called clips, placed in quick succession. See [Swarm](https://docs.pacifica.fi/trading-on-pacifica/order-types/strategies/swarm.md).

| Field | Type | Need | Description |
| - | - | - | - |
| `symbol` | string | required | Market |
| `side` | string | required | `bid` or `ask` |
| `amount` | decimal string | required | Total amount |
| `reduce_only` | boolean | required | Whether the clips are reduce-only |
| `number_of_clips` | integer | required | 2 to 100. Each clip must meet the market's minimum order size |
| `placement_speed_clips_per_second` | integer | required | 1 to 10 |
| `randomize_clips` | boolean | required | Vary clip sizes and gaps |
| `boundary_price` | decimal string | optional | Mark price limit: a ceiling for a buy, a floor for a sell. Send with `boundary_action` |
| `boundary_action` | string | optional | `pause` or `cancel` when the mark crosses `boundary_price`. Send with `boundary_price` |
| `take_profit` | object | optional | See [Take profit and stop loss](#take-profit-and-stop-loss) |
| `stop_loss` | object | optional | See [Take profit and stop loss](#take-profit-and-stop-loss) |
| `slippage_percent` | decimal string | optional | Max slippage for each clip |

A swarm whose boundary is already crossed when you create it is rejected.

### Trigger swarm

Waits for a price condition, then places clips one at a time. See [Trigger Swarm](https://docs.pacifica.fi/trading-on-pacifica/order-types/strategies/trigger-swarm.md).

| Field | Type | Need | Description |
| - | - | - | - |
| `trigger_symbol` | string | required | Market whose price is watched |
| `trigger_price_type` | string | required | `mark`, `mid`, `last`, `best_bid`, or `best_ask` |
| `trigger_direction` | string | required | `gte` or `lte` |
| `trigger_price` | decimal string | required | Trigger price |
| `execution_symbol` | string | required | Market to trade |
| `side` | string | required | `bid` or `ask` |
| `size_mode` | string | required | `defined` uses `amount`. `full_position` targets the whole position at trigger time and needs `purpose: "position_exit"` |
| `amount` | decimal string | conditional | Required for `defined`. Not allowed for `full_position` |
| `number_of_clips` | integer | required | 2 to 100 |
| `target_duration_seconds` | integer | optional | Spread the clips evenly over this many seconds. If omitted, each clip goes out once the previous one settles |
| `child_order_type` | string | required | Must be `market` |
| `reduce_only` | boolean | required | Whether the clips are reduce-only |
| `purpose` | string | optional | `standard` (default) or `position_exit` |
| `position_id` | string | conditional | Required for `position_exit`, which also needs `reduce_only: true`. Not allowed for `standard` |
| `slippage_percent` | decimal string | optional | Max slippage for each clip |

### TWAP

Splits an amount into market orders, called slices, spread over `duration_seconds`. Pacifica plans 2 to 100 slices based on the duration and the market's lot size. See [TWAP](https://docs.pacifica.fi/trading-on-pacifica/order-types/classic/twap.md).

| Field | Type | Need | Description |
| - | - | - | - |
| `symbol` | string | required | Market |
| `side` | string | required | `bid` or `ask` |
| `amount` | decimal string | required | Total amount |
| `reduce_only` | boolean | required | Whether the slices are reduce-only |
| `duration_seconds` | integer | required | Total running time in seconds. Must be positive |
| `randomize` | boolean | required | Vary slice sizes and gaps |
| `slippage_percent` | decimal string | optional | Max slippage for each slice |
| `price_limit` | decimal string | optional | Pause a buy while the mark is at or above this price, or a sell while it is at or below. Resumes when the price comes back |

```json theme={null}
{
  "strategy_type": "twap",
  "params": {
    "symbol": "BTC",
    "side": "ask",
    "amount": "1",
    "reduce_only": false,
    "duration_seconds": 5400,
    "randomize": true,
    "price_limit": "95000"
  }
}
```


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