Skip to main content

Overview

Subscribe to userFills to receive real-time notifications when your orders are executed (filled).

Subscribe

Request Body

ParameterTypeDescription
method*stringMust be "subscribe"
subscription*objectSee below
subscription.type*stringMust be "userFills"
subscription.user*stringYour wallet address (lowercase), e.g., "0x742d35cc6634c0532925a3b844bc9e7595f0beb"

Response

Subscription Confirmation:
{
  "channel": "subscriptionResponse",
  "data": {
    "method": "subscribe",
    "subscription": {
      "type": "userFills",
      "user": "0x742d35cc6634c0532925a3b844bc9e7595f0beb"
    }
  }
}
Fill Updates:
{
  "channel": "userFills",
  "data": {
    "user": "0x742d35cc6634c0532925a3b844bc9e7595f0beb",
    "isSnapshot": false,
    "fills": [
      {
        "coin": "BTC",
        "px": "50000.00",
        "sz": "0.1",
        "side": "B",
        "time": 1701234567890,
        "startPosition": "0",
        "dir": "Open Long",
        "closedPnl": "0",
        "hash": "0x1234...",
        "oid": 12345,
        "crossed": true,
        "fee": "2.50",
        "tid": 67890,
        "feeToken": "USDC"
      }
    ]
  }
}

Fill Fields

FieldTypeDescription
coinstringAsset symbol (BTC, ETH, etc.)
pxstringExecution price
szstringFill size
sidestring"B" (buy) or "A" (ask/sell)
timenumberTimestamp in milliseconds
startPositionstringPosition size before fill
dirstringDirection (e.g., “Open Long”, “Close Short”)
closedPnlstringRealized PnL from this fill
hashstringTransaction hash
oidnumberOrder ID
crossedbooleanWhether order crossed the spread
feestringFee charged
tidnumberTrade ID
feeTokenstringToken used for fee payment

Unsubscribe

{
  "method": "unsubscribe",
  "subscription": {
    "type": "userFills",
    "user": "0x742d35cc6634c0532925a3b844bc9e7595f0beb"
  }
}

Notes

  • Fills are sent in real-time as they occur
  • Multiple fills may arrive in a single message
  • User address must be lowercase
  • closedPnl shows realized profit/loss for position-reducing fills