Skip to main content

Subscribe

{
  "method": "subscribe",
  "subscription": {
    "type": "twapUpdates",
    "user": "0x742d35cc6634c0532925a3b844bc9e7595f0beb"
  }
}

Response

{
  "channel": "twapUpdates",
  "data": {
    "isSnapshot": true,
    "user": "0x742d35cc6634c0532925a3b844bc9e7595f0beb",
    "twaps": [
      {
        "twapId": "0x1a2b3c...",
        "status": "active",
        "asset": "BTC",
        "side": "buy",
        "totalSz": "0.25",
        "filledSz": "0.10",
        "remainingSz": "0.15",
        "reduceOnly": false,
        "slicesFilled": 2,
        "slicesPartial": 0,
        "slicesRejected": 0,
        "totalNotional": "5030.0",
        "avgFillPx": "50300",
        "durationMs": 1800000,
        "sliceIntervalMs": 300000,
        "createdAt": 1701234567890,
        "startedAt": 1701234567890,
        "expectedEndAt": 1701236367890,
        "currentSliceIndex": 2,
        "totalExpectedSlices": 7,
        "randomize": true,
        "updatedAt": 1701235167890,
        "completedAt": null,
        "canceledAt": null,
        "reason": null
      }
    ]
  }
}

Response Fields

FieldTypeDescription
data.isSnapshotbooleantrue for the initial active-TWAP snapshot, else false
data.userstringLowercased user address
data.twapsarrayOne or more TWAP updates
twaps[].twapIdstringTWAP order id
twaps[].statusstringCurrent TWAP status
twaps[].assetstringDisplay market symbol
twaps[].sidestring"buy" or "sell"
twaps[].totalSzstringTotal requested size
twaps[].filledSzstringAggregate filled size
twaps[].remainingSzstringRemaining size
twaps[].reduceOnlybooleanWhether the TWAP is reduce-only
twaps[].totalNotionalstringAggregate filled notional value
twaps[].avgFillPxstringServer-derived VWAP, or "0" before any fills

Notes

  • The server sends an initial snapshot of the user’s currently active TWAPs immediately after a successful subscription. - Incremental updates are then emitted as TWAP state changes during execution. - Messages are scoped by user; clients should always include the user address in subscribe and unsubscribe requests. - The payload shape matches the TWAP REST responses for twapListActive and twapListHistory.