Skip to content
LogoLogo

userFills

Endpoint

WebSocket /ws

Selector: subscription.type: "userFills"

Purpose

Returns an initial snapshot of retained customer fills, then messages containing newly observed fill IDs. It does not expose fills belonging to unrelated customers.

Authorization

Owner or approved reader for subscription.user. The SDK signs requests. Current permissions are checked before delivery; expiry or revocation stops access.

Request fields

FieldTypeRequiredMeaning
methodStringYes"subscribe".
authObjectYesRequest proof with timestamp, nonce and signature; see authorization.
subscriptionObjectYesSubscription definition.
subscription.typeStringYes"userFills".
subscription.userAddressYesCustomer account authorized by the request signer.
subscription.aggregateByTimeBooleanNoOmit or use false. true is unsupported.

Request example

Test fixture. Generate a fresh proof before use. Fixture inputs.

{
  "method": "subscribe",
  "subscription": {
    "type": "userFills",
    "user": "0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf",
    "aggregateByTime": false
  },
  "auth": {
    "timestamp": 1796250000000,
    "nonce": "0x0404040404040404040404040404040404040404040404040404040404040404",
    "signature": "0x76a6ef4c8c20a13f71da130fe164337800308d6ccc7eaa44b9ebfbdc9b17df3c76993f0234b1c81bdba5aa3d665a6690f56ab785660dcb037adf05ac72f383b81b"
  }
}

Response fields

First receive a subscribe acknowledgement, then data:

FieldMeaning
channel"userFills".
dataCustomer fill snapshot or update.
data.isSnapshottrue for the first data message, including an empty snapshot; false for subsequent messages.
data.userSelected customer account address.
data.fillsRetained fills in the initial snapshot, or newly observed fills in subsequent messages.

Each fill contains:

FieldsMeaning
coin, side, px, szMarket, buy/sell side and decimal-string execution price/size.
time, tid, hash, oidMillisecond execution time, fill trade ID, fill hash and order ID.
startPosition, dir, closedPnlPosition before the fill, its effect and realized PnL.
crossedWhether the fill crossed the book.
fee, feeTokenDecimal-string fee and its token ("USDC").

Response example

{
  "channel": "userFills",
  "data": {
    "isSnapshot": true,
    "user": "0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf",
    "fills": []
  }
}

Constraints

  • An unchanged fill set produces no new message.
  • The snapshot contains at most 2,000 retained fills; it is not an unlimited archive or a guarantee that every missed update can be replayed.
  • Reconnect recovery uses fresh signed subscriptions and signed /info reconciliation.
  • Duplicate requests acknowledge the existing subscription without another snapshot.

unsubscribe stops this subscription. WebSocket overview covers connection limits and ongoing permissions.