Submit TWAP Order

Submit a new Time-Weighted Average Price (TWAP) order for execution.

This operation uses the same OpenAPI endpoint as Smart Balance. Set portfolioType to TWAP and provide twapTrade.

Endpoint

POST /tt/themis-broker/openapi/portfolios/submit

Authentication: HMAC apiKey signature via REST headers. See Authentication.

Parameters

Top-level fields — the request body is flat, with no envelope.

Parameter Type Required Description
accountId long true Reality account ID
portfolioType string true Must be TWAP
strategy string false Free-text strategy label
twapTrade object true TWAP scheduling configuration (see below)
legs array true Array of Leg objects; at least 1 leg. All legs must have the same forCcy
customizedNote string false Maximum 100 characters
sendToDummyAccountIds array false Array of long account IDs to mirror the order to

twapTrade fields — required when portfolioType = TWAP.

Parameter Type Required Description
startTimestamp long false Start time in Unix epoch milliseconds; null or omitted starts from the server's current time
durationSec long true Total execution duration in seconds
frequencySec long true Interval between TWAP executions in seconds

legs[].Leg — each leg of the order.

Parameter Type Required Description
instrument string true Exchange symbol
instrumentType string true OPTION / PERPETUAL / DELIVERY_FUTURES / SPOT
side int true 1 BUY / 2 SELL
quantity decimal true Total order quantity
priceOptions object true Price configuration (see below)
priceSnapshot array false Reference prices captured at submit time for audit
timeInForce int false 1 GTC / 2 IOC / 3 FOK / 4 GTD
postOnly boolean false Default false
reduceOnly boolean false Default false
hidden boolean false Default false
tradeMode int false 1 CASH / 2 CROSS / 3 ISOLATED
positionSide int false 1 LONG / 2 SHORT / 3 NET
hedge boolean false Hedge flag; default false

priceOptions — nested under each leg.

Parameter Type Required Description
priceType string true LIMIT / MARKET / DYNAMIC
price decimal when priceType=LIMIT or DYNAMIC Order price
priceIn string when priceType=LIMIT or DYNAMIC Price currency or IV, as supported by the instrument and exchange
dynamicPriceStrategy string when priceType=DYNAMIC MID / MARK / MODEL / BID / ASK
dynamicPriceOffset decimal false Offset applied to the dynamic reference; may be negative
dynamicMs long when dynamicPriceStrategy is provided Reprice interval in milliseconds

Request Example

POST /tt/themis-broker/openapi/portfolios/submit HTTP/1.1
Authorization: Bearer <api-key>
Signalplus-API-Timestamp: 1776665215780
Signalplus-API-Nonce: e43b0618-6965-4b0b-a62d-a3a4f78eed52
Signalplus-API-Signature: <base64 hmac>
Content-Type: application/json

{
  "accountId": 10003443,
  "portfolioType": "TWAP",
  "strategy": "TWAP",
  "customizedNote": "one-hour TWAP",
  "twapTrade": {
    "startTimestamp": null,
    "durationSec": 3600,
    "frequencySec": 60
  },
  "legs": [
    {
      "instrument": "BTC-PERPETUAL",
      "instrumentType": "PERPETUAL",
      "side": 1,
      "quantity": 10000,
      "priceOptions": {
        "priceType": "MARKET",
        "price": null,
        "priceIn": null,
        "dynamicPriceStrategy": null,
        "dynamicPriceOffset": null,
        "dynamicMs": null
      },
      "priceSnapshot": [],
      "reduceOnly": false,
      "tradeMode": 2,
      "positionSide": 3
    }
  ]
}

Response Example

{
  "succ": true,
  "code": 0,
  "message": "",
  "value": {
    "portfolioId": 144115188955249274
  }
}

Response

Name Type Description
portfolioId long Newly created portfolio ID; use this for /info, /cancel, and WebSocket correlation

results matching ""

    No results matching ""