Skip to main content

Deploy Strategy

Deploy a strategy. The engine begins evaluating entry conditions immediately and may place orders on the configured exchange. Strategies in draft or paused status can be deployed; deploying from paused resumes execution with any param changes since the last run.

Endpoint

POST /v1/strategies/{id}/deploy

Weight: 10 Authentication: Required (signed) — see Authentication.

Request

Path parameter: id — the strategy identifier (e.g. strat_8f2a1b).

NameTypeMandatoryDescription
capitaldecimalNOOverride the strategy's stored capital for this run. Decimal string. If omitted, the strategy's saved value is used.
leverageintegerNOOverride the strategy's stored leverage for this run. Range 1–20. If omitted, the strategy's saved value is used.
dry_runbooleanNOWhen true, the engine consumes live market data and emits the same WebSocket events but places no real orders. Default false.

Overrides are applied to the running session only and do not modify the stored strategy definition. Use Update Strategy to persist changes.

Response

Returns the strategy object with status: "deployed" and deployed_at updated to the current server time.

{
"id": "strat_8f2a1b",
"name": "BTC grid 1h",
"template_id": "tpl_grid",
"params": {
"grid_levels": 8,
"upper_price": "72000",
"lower_price": "60000",
"rebalance_threshold": "0.02"
},
"symbols": ["BTCUSDT"],
"timeframe": "1h",
"capital": "10000.00",
"leverage": 3,
"status": "deployed",
"deployed_at": "2026-04-29T12:00:00Z",
"created_at": "2026-04-28T15:30:00Z",
"updated_at": "2026-04-29T12:00:00Z",
"stats": {
"open_positions": 0,
"total_pnl": "0.00",
"total_trades": 0,
"win_rate": "0.000"
}
}

Response fields

Same shape as Get Strategy. After a successful deploy:

  • status is deployed.
  • deployed_at is the deploy timestamp.
  • stats reflects the cumulative state across all runs (it is not reset on each deploy).

Errors

  • 400 INVALID_PARAMETERcapital below the template minimum, or leverage out of range.
  • 402 INSUFFICIENT_FUNDS — account quote-currency balance is below the requested capital.
  • 404 NOT_FOUND — strategy does not exist or is not owned by the caller.
  • 409 INVALID_STATE — strategy status is not draft or paused (e.g. already deployed, stopped, or in error).

See Errors for the full list.

Example

curl -X POST "https://api.pipai.example/v1/strategies/strat_8f2a1b/deploy" \
-H "X-PipAI-API-Key: $API_KEY" \
-H "X-PipAI-Timestamp: $TS" \
-H "X-PipAI-Signature: $SIG" \
-H "Content-Type: application/json" \
-d '{
"capital": "10000.00",
"leverage": 3,
"dry_run": false
}'