API ReferenceWebSocket APITrade Actions
WS Action: Modify
Modify orders or update TP/SL via WebSocket.
Alpha Version
The Ostium Builder Service is in Alpha. API endpoints, specifications, and builder URLs may change without notice. Use with caution in production environments.
Action: modify
Modify a limit order or update TP/SL on an open trade. The payload mirrors
POST /v1/exchange/modify.
Headers (in envelope)
| Header | Required | Description |
|---|---|---|
X-Trader-Address | Yes | Trader wallet address. |
X-API-Key | No | Delegated mode (delegate wallet must be verified). |
Payload
| Field | Type | Required | Description |
|---|---|---|---|
a | number | Yes | Pair index. |
i | number | Yes | Order or trade index. |
p | string | No | New limit order price (numeric string > 0). |
tp | string | No | New take-profit price ("0" resets to default). |
sl | string | No | New stop-loss price ("0" resets to default). |
Constraints
- At least one of
p,tp, orslis required. - If
pis omitted, only one oftporslmay be set per request. - Delegated mode supports one modify action per request.
Success Data (unsigned)
| Field | Type | Required | Description |
|---|---|---|---|
transactions | UnsignedTransaction[] | Yes | One unsigned transaction. |
Delegated mode returns { "txHash", "smartAccountAddress" } as described in
/docs/websocket/trade-actions.
Example
{
"id": "4",
"action": "modify",
"headers": { "X-Trader-Address": "0xYourWallet" },
"payload": { "a": 0, "i": 0, "tp": "46000" }
}Success Response (unsigned)
{
"id": "4",
"ok": true,
"data": {
"transactions": [
{ "to": "0x...", "data": "0x...", "value": "0", "from": "0xYourWallet" }
]
}
}Related
See /docs/http/exchange/modify for HTTP details.