curl --request POST \
--url https://staging.apimonaco.xyz/api/v1/orders/twap \
--header 'Content-Type: application/json' \
--header 'X-Monaco-Signature: <api-key>' \
--data '
{
"tradingPairId": "afae0e16-2d05-4ee9-9ee8-afae0e162d05",
"side": "BUY",
"quantity": "10",
"durationSeconds": 3600,
"startTime": "2026-08-01T10:00:00Z",
"endTime": "2026-08-01T11:00:00Z",
"limitPrice": "35000.00",
"slippageToleranceBps": 100,
"randomize": true,
"reduceOnly": false,
"tradingMode": "SPOT",
"marginAccountId": "123e4567-e89b-12d3-a456-426614174000",
"riskBucketId": "123e4567-e89b-12d3-a456-426614174001",
"marginMode": "CROSS",
"leverage": "5",
"strategyKey": "my-strategy",
"useMasterBalance": false,
"clientTwapId": "oms-3f6a1c",
"executionStyle": "PASSIVE",
"triggerPrice": "98000.00",
"triggerDirection": "BELOW",
"conditionalExpiry": "2026-09-01T00:00:00Z"
}
'import requests
url = "https://staging.apimonaco.xyz/api/v1/orders/twap"
payload = {
"tradingPairId": "afae0e16-2d05-4ee9-9ee8-afae0e162d05",
"side": "BUY",
"quantity": "10",
"durationSeconds": 3600,
"startTime": "2026-08-01T10:00:00Z",
"endTime": "2026-08-01T11:00:00Z",
"limitPrice": "35000.00",
"slippageToleranceBps": 100,
"randomize": True,
"reduceOnly": False,
"tradingMode": "SPOT",
"marginAccountId": "123e4567-e89b-12d3-a456-426614174000",
"riskBucketId": "123e4567-e89b-12d3-a456-426614174001",
"marginMode": "CROSS",
"leverage": "5",
"strategyKey": "my-strategy",
"useMasterBalance": False,
"clientTwapId": "oms-3f6a1c",
"executionStyle": "PASSIVE",
"triggerPrice": "98000.00",
"triggerDirection": "BELOW",
"conditionalExpiry": "2026-09-01T00:00:00Z"
}
headers = {
"X-Monaco-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Monaco-Signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tradingPairId: 'afae0e16-2d05-4ee9-9ee8-afae0e162d05',
side: 'BUY',
quantity: '10',
durationSeconds: 3600,
startTime: '2026-08-01T10:00:00Z',
endTime: '2026-08-01T11:00:00Z',
limitPrice: '35000.00',
slippageToleranceBps: 100,
randomize: true,
reduceOnly: false,
tradingMode: 'SPOT',
marginAccountId: '123e4567-e89b-12d3-a456-426614174000',
riskBucketId: '123e4567-e89b-12d3-a456-426614174001',
marginMode: 'CROSS',
leverage: '5',
strategyKey: 'my-strategy',
useMasterBalance: false,
clientTwapId: 'oms-3f6a1c',
executionStyle: 'PASSIVE',
triggerPrice: '98000.00',
triggerDirection: 'BELOW',
conditionalExpiry: '2026-09-01T00:00:00Z'
})
};
fetch('https://staging.apimonaco.xyz/api/v1/orders/twap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.apimonaco.xyz/api/v1/orders/twap",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tradingPairId' => 'afae0e16-2d05-4ee9-9ee8-afae0e162d05',
'side' => 'BUY',
'quantity' => '10',
'durationSeconds' => 3600,
'startTime' => '2026-08-01T10:00:00Z',
'endTime' => '2026-08-01T11:00:00Z',
'limitPrice' => '35000.00',
'slippageToleranceBps' => 100,
'randomize' => true,
'reduceOnly' => false,
'tradingMode' => 'SPOT',
'marginAccountId' => '123e4567-e89b-12d3-a456-426614174000',
'riskBucketId' => '123e4567-e89b-12d3-a456-426614174001',
'marginMode' => 'CROSS',
'leverage' => '5',
'strategyKey' => 'my-strategy',
'useMasterBalance' => false,
'clientTwapId' => 'oms-3f6a1c',
'executionStyle' => 'PASSIVE',
'triggerPrice' => '98000.00',
'triggerDirection' => 'BELOW',
'conditionalExpiry' => '2026-09-01T00:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Monaco-Signature: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging.apimonaco.xyz/api/v1/orders/twap"
payload := strings.NewReader("{\n \"tradingPairId\": \"afae0e16-2d05-4ee9-9ee8-afae0e162d05\",\n \"side\": \"BUY\",\n \"quantity\": \"10\",\n \"durationSeconds\": 3600,\n \"startTime\": \"2026-08-01T10:00:00Z\",\n \"endTime\": \"2026-08-01T11:00:00Z\",\n \"limitPrice\": \"35000.00\",\n \"slippageToleranceBps\": 100,\n \"randomize\": true,\n \"reduceOnly\": false,\n \"tradingMode\": \"SPOT\",\n \"marginAccountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"riskBucketId\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"marginMode\": \"CROSS\",\n \"leverage\": \"5\",\n \"strategyKey\": \"my-strategy\",\n \"useMasterBalance\": false,\n \"clientTwapId\": \"oms-3f6a1c\",\n \"executionStyle\": \"PASSIVE\",\n \"triggerPrice\": \"98000.00\",\n \"triggerDirection\": \"BELOW\",\n \"conditionalExpiry\": \"2026-09-01T00:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Monaco-Signature", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging.apimonaco.xyz/api/v1/orders/twap")
.header("X-Monaco-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tradingPairId\": \"afae0e16-2d05-4ee9-9ee8-afae0e162d05\",\n \"side\": \"BUY\",\n \"quantity\": \"10\",\n \"durationSeconds\": 3600,\n \"startTime\": \"2026-08-01T10:00:00Z\",\n \"endTime\": \"2026-08-01T11:00:00Z\",\n \"limitPrice\": \"35000.00\",\n \"slippageToleranceBps\": 100,\n \"randomize\": true,\n \"reduceOnly\": false,\n \"tradingMode\": \"SPOT\",\n \"marginAccountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"riskBucketId\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"marginMode\": \"CROSS\",\n \"leverage\": \"5\",\n \"strategyKey\": \"my-strategy\",\n \"useMasterBalance\": false,\n \"clientTwapId\": \"oms-3f6a1c\",\n \"executionStyle\": \"PASSIVE\",\n \"triggerPrice\": \"98000.00\",\n \"triggerDirection\": \"BELOW\",\n \"conditionalExpiry\": \"2026-09-01T00:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.apimonaco.xyz/api/v1/orders/twap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Monaco-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tradingPairId\": \"afae0e16-2d05-4ee9-9ee8-afae0e162d05\",\n \"side\": \"BUY\",\n \"quantity\": \"10\",\n \"durationSeconds\": 3600,\n \"startTime\": \"2026-08-01T10:00:00Z\",\n \"endTime\": \"2026-08-01T11:00:00Z\",\n \"limitPrice\": \"35000.00\",\n \"slippageToleranceBps\": 100,\n \"randomize\": true,\n \"reduceOnly\": false,\n \"tradingMode\": \"SPOT\",\n \"marginAccountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"riskBucketId\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"marginMode\": \"CROSS\",\n \"leverage\": \"5\",\n \"strategyKey\": \"my-strategy\",\n \"useMasterBalance\": false,\n \"clientTwapId\": \"oms-3f6a1c\",\n \"executionStyle\": \"PASSIVE\",\n \"triggerPrice\": \"98000.00\",\n \"triggerDirection\": \"BELOW\",\n \"conditionalExpiry\": \"2026-09-01T00:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"twapOrderId": "123e4567-e89b-12d3-a456-426614174000",
"status": "SUCCESS",
"message": "TWAP order created successfully",
"state": "PENDING",
"marginAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"riskBucketId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"plannedSlices": 120,
"firstSliceAt": "2026-08-01T10:00:27Z",
"endTime": "2026-08-01T11:00:00Z"
}Create TWAP order
Create TWAP order.
Create a server-side TWAP (time-weighted average price) parent order. The matching engine executes it as a schedule of MARKET child orders with seeded size/timing randomization across the requested window, then stops hard at the end time — any unfilled remainder is reported as shortfall, never traded past the window. Delegated-agent sessions are rejected.
curl --request POST \
--url https://staging.apimonaco.xyz/api/v1/orders/twap \
--header 'Content-Type: application/json' \
--header 'X-Monaco-Signature: <api-key>' \
--data '
{
"tradingPairId": "afae0e16-2d05-4ee9-9ee8-afae0e162d05",
"side": "BUY",
"quantity": "10",
"durationSeconds": 3600,
"startTime": "2026-08-01T10:00:00Z",
"endTime": "2026-08-01T11:00:00Z",
"limitPrice": "35000.00",
"slippageToleranceBps": 100,
"randomize": true,
"reduceOnly": false,
"tradingMode": "SPOT",
"marginAccountId": "123e4567-e89b-12d3-a456-426614174000",
"riskBucketId": "123e4567-e89b-12d3-a456-426614174001",
"marginMode": "CROSS",
"leverage": "5",
"strategyKey": "my-strategy",
"useMasterBalance": false,
"clientTwapId": "oms-3f6a1c",
"executionStyle": "PASSIVE",
"triggerPrice": "98000.00",
"triggerDirection": "BELOW",
"conditionalExpiry": "2026-09-01T00:00:00Z"
}
'import requests
url = "https://staging.apimonaco.xyz/api/v1/orders/twap"
payload = {
"tradingPairId": "afae0e16-2d05-4ee9-9ee8-afae0e162d05",
"side": "BUY",
"quantity": "10",
"durationSeconds": 3600,
"startTime": "2026-08-01T10:00:00Z",
"endTime": "2026-08-01T11:00:00Z",
"limitPrice": "35000.00",
"slippageToleranceBps": 100,
"randomize": True,
"reduceOnly": False,
"tradingMode": "SPOT",
"marginAccountId": "123e4567-e89b-12d3-a456-426614174000",
"riskBucketId": "123e4567-e89b-12d3-a456-426614174001",
"marginMode": "CROSS",
"leverage": "5",
"strategyKey": "my-strategy",
"useMasterBalance": False,
"clientTwapId": "oms-3f6a1c",
"executionStyle": "PASSIVE",
"triggerPrice": "98000.00",
"triggerDirection": "BELOW",
"conditionalExpiry": "2026-09-01T00:00:00Z"
}
headers = {
"X-Monaco-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Monaco-Signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tradingPairId: 'afae0e16-2d05-4ee9-9ee8-afae0e162d05',
side: 'BUY',
quantity: '10',
durationSeconds: 3600,
startTime: '2026-08-01T10:00:00Z',
endTime: '2026-08-01T11:00:00Z',
limitPrice: '35000.00',
slippageToleranceBps: 100,
randomize: true,
reduceOnly: false,
tradingMode: 'SPOT',
marginAccountId: '123e4567-e89b-12d3-a456-426614174000',
riskBucketId: '123e4567-e89b-12d3-a456-426614174001',
marginMode: 'CROSS',
leverage: '5',
strategyKey: 'my-strategy',
useMasterBalance: false,
clientTwapId: 'oms-3f6a1c',
executionStyle: 'PASSIVE',
triggerPrice: '98000.00',
triggerDirection: 'BELOW',
conditionalExpiry: '2026-09-01T00:00:00Z'
})
};
fetch('https://staging.apimonaco.xyz/api/v1/orders/twap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.apimonaco.xyz/api/v1/orders/twap",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tradingPairId' => 'afae0e16-2d05-4ee9-9ee8-afae0e162d05',
'side' => 'BUY',
'quantity' => '10',
'durationSeconds' => 3600,
'startTime' => '2026-08-01T10:00:00Z',
'endTime' => '2026-08-01T11:00:00Z',
'limitPrice' => '35000.00',
'slippageToleranceBps' => 100,
'randomize' => true,
'reduceOnly' => false,
'tradingMode' => 'SPOT',
'marginAccountId' => '123e4567-e89b-12d3-a456-426614174000',
'riskBucketId' => '123e4567-e89b-12d3-a456-426614174001',
'marginMode' => 'CROSS',
'leverage' => '5',
'strategyKey' => 'my-strategy',
'useMasterBalance' => false,
'clientTwapId' => 'oms-3f6a1c',
'executionStyle' => 'PASSIVE',
'triggerPrice' => '98000.00',
'triggerDirection' => 'BELOW',
'conditionalExpiry' => '2026-09-01T00:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Monaco-Signature: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging.apimonaco.xyz/api/v1/orders/twap"
payload := strings.NewReader("{\n \"tradingPairId\": \"afae0e16-2d05-4ee9-9ee8-afae0e162d05\",\n \"side\": \"BUY\",\n \"quantity\": \"10\",\n \"durationSeconds\": 3600,\n \"startTime\": \"2026-08-01T10:00:00Z\",\n \"endTime\": \"2026-08-01T11:00:00Z\",\n \"limitPrice\": \"35000.00\",\n \"slippageToleranceBps\": 100,\n \"randomize\": true,\n \"reduceOnly\": false,\n \"tradingMode\": \"SPOT\",\n \"marginAccountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"riskBucketId\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"marginMode\": \"CROSS\",\n \"leverage\": \"5\",\n \"strategyKey\": \"my-strategy\",\n \"useMasterBalance\": false,\n \"clientTwapId\": \"oms-3f6a1c\",\n \"executionStyle\": \"PASSIVE\",\n \"triggerPrice\": \"98000.00\",\n \"triggerDirection\": \"BELOW\",\n \"conditionalExpiry\": \"2026-09-01T00:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Monaco-Signature", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging.apimonaco.xyz/api/v1/orders/twap")
.header("X-Monaco-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tradingPairId\": \"afae0e16-2d05-4ee9-9ee8-afae0e162d05\",\n \"side\": \"BUY\",\n \"quantity\": \"10\",\n \"durationSeconds\": 3600,\n \"startTime\": \"2026-08-01T10:00:00Z\",\n \"endTime\": \"2026-08-01T11:00:00Z\",\n \"limitPrice\": \"35000.00\",\n \"slippageToleranceBps\": 100,\n \"randomize\": true,\n \"reduceOnly\": false,\n \"tradingMode\": \"SPOT\",\n \"marginAccountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"riskBucketId\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"marginMode\": \"CROSS\",\n \"leverage\": \"5\",\n \"strategyKey\": \"my-strategy\",\n \"useMasterBalance\": false,\n \"clientTwapId\": \"oms-3f6a1c\",\n \"executionStyle\": \"PASSIVE\",\n \"triggerPrice\": \"98000.00\",\n \"triggerDirection\": \"BELOW\",\n \"conditionalExpiry\": \"2026-09-01T00:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.apimonaco.xyz/api/v1/orders/twap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Monaco-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tradingPairId\": \"afae0e16-2d05-4ee9-9ee8-afae0e162d05\",\n \"side\": \"BUY\",\n \"quantity\": \"10\",\n \"durationSeconds\": 3600,\n \"startTime\": \"2026-08-01T10:00:00Z\",\n \"endTime\": \"2026-08-01T11:00:00Z\",\n \"limitPrice\": \"35000.00\",\n \"slippageToleranceBps\": 100,\n \"randomize\": true,\n \"reduceOnly\": false,\n \"tradingMode\": \"SPOT\",\n \"marginAccountId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"riskBucketId\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"marginMode\": \"CROSS\",\n \"leverage\": \"5\",\n \"strategyKey\": \"my-strategy\",\n \"useMasterBalance\": false,\n \"clientTwapId\": \"oms-3f6a1c\",\n \"executionStyle\": \"PASSIVE\",\n \"triggerPrice\": \"98000.00\",\n \"triggerDirection\": \"BELOW\",\n \"conditionalExpiry\": \"2026-09-01T00:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"twapOrderId": "123e4567-e89b-12d3-a456-426614174000",
"status": "SUCCESS",
"message": "TWAP order created successfully",
"state": "PENDING",
"marginAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"riskBucketId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"plannedSlices": 120,
"firstSliceAt": "2026-08-01T10:00:27Z",
"endTime": "2026-08-01T11:00:00Z"
}Authorizations
Ed25519 session-key request signing. Every authenticated request carries three headers: X-Monaco-PublicKey (64-char lowercase-hex session public key), X-Monaco-Timestamp (Unix milliseconds, within 30s of server time), and X-Monaco-Signature (hex ed25519 signature). The signature is over METHOD\npath?query\ntimestamp_ms\nSHA256_hex(body), where the body hash is the SHA-256 of the empty byte string when there is no body. Obtain the session keypair from POST /api/v1/auth/challenge followed by POST /api/v1/auth/verify.
Body
Trading pair UUID
"afae0e16-2d05-4ee9-9ee8-afae0e162d05"
Order side: BUY or SELL
"BUY"
Total quantity to execute across the window as decimal string. Must be at least 2x the pair's minimum order size so it can be sliced, and small enough that the window's slice budget can carry it with every child at or below the pair's maximum order size.
"10"
Execution window length in seconds from launch. Exactly one of durationSeconds or endTime must be set. Bounds (env-tunable defaults): 60 to 2592000 (1 minute to 30 days).
3600
Window start (RFC 3339, UTC only — use a Z suffix; non-UTC offsets are rejected). Only valid together with endTime; defaults to now.
"2026-08-01T10:00:00Z"
Window end (RFC 3339, UTC only — use a Z suffix; non-UTC offsets are rejected). Exactly one of durationSeconds or endTime must be set. The effective window must satisfy the same duration bounds. Execution stops hard at this time; any unfilled remainder is reported as shortfall.
"2026-08-01T11:00:00Z"
Optional parent-level limit price as decimal string. BUY child orders never execute above it, SELL children never below it. Omitted: slippage band protection only.
"35000.00"
Per-slice protective price band in basis points around the reference price (default 100 = 1%, maximum 500 = 5% — deliberately tighter than the standalone market-order cap; TWAP slices never sweep deep)
x <= 500100
Apply seeded randomization to slice sizes and timing (default true). The seed is recorded for audit, so the schedule is reproducible to compliance but unpredictable to the market.
true
Whether the TWAP parent is reduce-only (margin only). Child orders inherit it and clamp to the live position.
false
Trading mode: SPOT or MARGIN (default: SPOT)
"SPOT"
Margin account UUID for margin TWAP orders. Resolved once at creation and reused by every child order.
"123e4567-e89b-12d3-a456-426614174000"
Existing isolated risk bucket UUID for risk-bucket-scoped margin TWAP orders. Snapshot at creation.
"123e4567-e89b-12d3-a456-426614174001"
Risk bucket mode for margin TWAP orders. Defaults to ISOLATED. Values: ISOLATED, CROSS. On an isolated-only market (TradingPairData.isolated_only) a CROSS order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code CROSS_MARGIN_NOT_ALLOWED. One margin mode per market and margin account: while the account holds the pair in its other risk bucket (an open position, or a resting order that is not reduce-only), an order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code MARGIN_MODE_CONFLICT; reduce-only orders always pass, so a pair already held in both modes can be reduced on either side until one closes.
ISOLATED, CROSS "CROSS"
Leverage multiplier as a decimal string. Required for normal margin TWAP orders; optional and ignored for reduce-only.
"5"
Strategy key used to group risk buckets for margin orders
"my-strategy"
Use master account balance for sub-account orders
false
Client-assigned idempotency key (max 36 chars), unique per user and application. A duplicate is rejected with 409.
"oms-3f6a1c"
Child execution style. TAKER (default): each slice executes immediately as a banded MARKET order. PASSIVE: each slice rests as a post-only limit at the same-side touch (maker where possible, repriced to follow the touch, never beyond the parent limit price or the protective band), and the leftover is swept as a banded MARKET order at the slice deadline. Passive parents use a slower default slice cadence (~60s).
TAKER, PASSIVE "PASSIVE"
Price-triggered activation: the parent waits (PENDING) until the reference price reaches or crosses this price in triggerDirection, then runs a floating window of durationSeconds from the trigger instant. Requires triggerDirection and durationSeconds; incompatible with startTime/endTime. Rejected if the condition is already met at creation. Margin markets arm against the oracle mark and the create is rejected while the market has no mark yet (retry once one is published); once the parent is waiting, activation evaluates the mark when it is available and the venue reference price (book-derived median, last-trade fallback) when it is not, so a mark outage cannot leave a live trigger unwatched. Spot markets use the venue reference price throughout.
"98000.00"
Which way the reference price must cross triggerPrice to activate: ABOVE (activate when price rises to or through it) or BELOW (falls to or through it). Required with triggerPrice; no exact print is required — a reference price observed at or beyond the level activates. The condition is evaluated on the engine's own polling cadence rather than on every market tick, so a price that crosses and reverts entirely between two observations is not seen; there is no high/low watermark.
ABOVE, BELOW "BELOW"
Deadline for the trigger to fire (RFC 3339, UTC only — Z suffix; non-UTC offsets rejected). If the trigger has not fired by then the parent cancels with terminal reason 'trigger expired'. Only valid with triggerPrice; must be in the future and at most the maximum window (default 30 days) from creation, which is also the default when omitted.
"2026-09-01T00:00:00Z"
Response
OK
Created TWAP parent order UUID
"123e4567-e89b-12d3-a456-426614174000"
Result status: SUCCESS or FAILED. SUCCESS means the parent is durably recorded; execution itself is best-effort within the window.
"SUCCESS"
Human-readable status message
"TWAP order created successfully"
Initial parent state: always PENDING at create. An unconditional parent activates on its first attempted slice; a conditional one (triggerPrice set) stays PENDING until its trigger fires.
"PENDING"
Resolved margin account UUID for margin TWAP orders
Resolved isolated risk bucket UUID for risk-bucket-scoped margin TWAP orders
Number of slices in the planned schedule
120
Planned time of the first slice (ISO 8601). PROVISIONAL for a conditional parent (triggerPrice set): its window floats from the trigger instant, which is unknown at create, so this is computed from the provisional [create, create + durationSeconds] window and is re-anchored when the trigger fires. Read the armed window back from the TWAP read model (startAt / endAt / triggeredAt) instead of scheduling on this value.
"2026-08-01T10:00:27Z"
Resolved window end (ISO 8601). Execution never continues past it. PROVISIONAL for a conditional parent (triggerPrice set) for the same reason as firstSliceAt: the real window is [trigger instant, trigger instant + durationSeconds] and is re-anchored on activation.
"2026-08-01T11:00:00Z"
Was this page helpful?

