Endpoint
Request Body
| Parameter | Type | Description |
|---|---|---|
action* | object | See below |
action.type* | string | Must be "twapOrder" |
action.asset* | string | 8-char perp AssetId hex string |
action.isBuy* | boolean | true for buy, false for sell |
action.sz* | string | Total TWAP size |
action.reduceOnly* | boolean | Reduce-only execution |
action.durationMinutes* | number | Total schedule duration in minutes |
action.numSlices* | number | Number of child slices to schedule |
action.randomize* | boolean | Whether to randomize slice timing within the schedule |
nonce* | number | Replay-protection nonce |
expiresAfter | number | Optional expiration timestamp in ms |
signature* | object | EIP-712 signature |
Response
Response Fields
| Field | Type | Description |
|---|---|---|
response.data.status | "pending" | "rejected" | pending means the TWAP was accepted into the event pipeline |
response.data.twapOrderId | string | undefined | Deterministic TWAP id, present on accepted requests |
response.data.error | string | undefined | Rejection reason when the request reaches handler logic but fails |
Example Request
Notes
twapOrderIdis deterministic from the signed request transaction id. - Schedules must satisfy the current slice-interval bounds enforced by the backend: minimum 10 seconds and maximum 10 minutes between slices. - The backend validates current mark price, first-slice margin, and minimum slice notional before accepting a non-reduce-only TWAP. - Reduce-only TWAPs are additionally checked against the remaining closable size after existing reduce-only orders and active TWAP reservations. - Accepted TWAPs begin withresponse.data.status: "pending"and then progress throughtwapListActive,twapListHistory, and WebSockettwapUpdates.
