account
accountwss://api.staging.sphx.io/v1/wsEverything else that touches the authenticated account: deposits, withdrawal lifecycle, state changes, mass-cancel completions, and the margin-era set — settlement applies, margin deficit records, margin warnings, and the liquidation lifecycle. Requires bearer auth on the upgrade. No subscribe params (auto-scoped).
entitlement_change is reserved for V1 and never emitted today.
Subscribe
{ "op": "subscribe", "channel": "account" }
No params — the channel auto-scopes to the authenticated account.
Requires a bearer token on the upgrade request.
Events
deposit_credited
A deposit landed on your account.
| Field | Type | Required | Description |
|---|---|---|---|
asset_id | integer | ✓ | |
amount | integer · int64 | ✓ | Atomic units (1e-6 USDC). |
deposit_txn | string | ✓ | On-chain transaction reference. |
event_seq | integer · int64 | ✓ | Cluster sequence number — monotonic; drives gap detection and REST/WS joins. |
{
"channel": "account",
"event": "deposit_credited",
"data": {
"asset_id": 1,
"amount": 1000000,
"deposit_txn": "5xy7…solana-tx-sig",
"event_seq": 1058
}
}
withdrawal_state
Your withdrawal advanced (pending on hold, finalized on broadcast).
| Field | Type | Required | Description |
|---|---|---|---|
withdrawal_id | integer · uint64 | ✓ | |
state | pending · finalized | ✓ | V0 emits exactly these two. Intermediate custody states surface only on GET /v1/withdrawals/{id}. |
event_seq | integer · int64 | ✓ | Cluster sequence number — monotonic; drives gap detection and REST/WS joins. |
{
"channel": "account",
"event": "withdrawal_state",
"data": {
"withdrawal_id": 17,
"state": "finalized",
"event_seq": 1071
}
}
account_state_change
An account changed lifecycle state.
| Field | Type | Required | Description |
|---|---|---|---|
new_state | pending · active · trade_frozen · withdraw_frozen · fully_frozen · closed | ✓ | |
event_seq | integer · int64 | ✓ | Cluster sequence number — monotonic; drives gap detection and REST/WS joins. |
{
"channel": "market_lifecycle",
"event": "account_state_change",
"data": {
"event_seq": 1058,
"account_id": 7,
"new_state": 2
}
}
mass_cancel_complete
Your POST /v1/orders/cancel_all finished.
| Field | Type | Required | Description |
|---|---|---|---|
instrument_id | integer · int64 | ✓ | |
canceled_count | integer | ✓ | Authoritative count (the REST 202's estimate is a hint). |
sequencer_correlation_id | integer · int64 | ✓ | Matches the triggering POST /v1/orders/cancel_all response. |
event_seq | integer · int64 | ✓ | Cluster sequence number — monotonic; drives gap detection and REST/WS joins. |
{
"channel": "account",
"event": "mass_cancel_complete",
"data": {
"instrument_id": 1000,
"canceled_count": 14,
"sequencer_correlation_id": 20,
"event_seq": 4210
}
}
settlement_applied
A futures settle-to-market pass banked variation margin.
| Field | Type | Required | Description |
|---|---|---|---|
instrument_id | integer · int64 | ✓ | |
scheduled_time_ns | integer · int64 | — | |
vm_uusdc | integer · int64 | ✓ | Signed variation margin banked to margin cash. |
settle_ticks | integer · int64 | ✓ | |
prev_settle_ticks | integer · int64 | ✓ | |
position_rebased | true (const) | — | |
event_seq | integer · int64 | ✓ | Cluster sequence number — monotonic; drives gap detection and REST/WS joins. |
{
"channel": "account",
"event": "settlement_applied",
"data": {
"instrument_id": 1001,
"scheduled_time_ns": 1779100800000000000,
"vm_uusdc": -12500000,
"settle_ticks": 3901,
"prev_settle_ticks": 3899,
"position_rebased": true,
"event_seq": 5301
}
}
margin_deficit_flagged
The settlement pass recorded a maintenance-margin deficit.
| Field | Type | Required | Description |
|---|---|---|---|
maintenance_equity_uusdc | integer · int64 | ✓ | |
mm_total_uusdc | integer · int64 | ✓ | |
suppressed | boolean | ✓ | Deficit recorded while liquidation was suspended (staleness rung). |
event_seq | integer · int64 | ✓ | Cluster sequence number — monotonic; drives gap detection and REST/WS joins. |
{
"channel": "account",
"event": "margin_deficit_flagged",
"data": {
"maintenance_equity_uusdc": 180000000,
"mm_total_uusdc": 200000000,
"suppressed": false,
"event_seq": 5302
}
}
margin_warning
Your margin crossed a warning threshold (pre-breach).
| Field | Type | Required | Description |
|---|---|---|---|
sub_account | integer | ✓ | Always 1 (the margin sub-account) in V0. |
instrument | integer · int64 | ✓ | |
equity_uusdc | integer · int64 | ✓ | |
mm_requirement_uusdc | integer · int64 | ✓ | |
mm_ratio_bps | integer | ✓ | |
threshold_hit | integer | ✓ | |
mark_event_seq | integer · int64 | ✓ | Cluster sequence number — monotonic; drives gap detection and REST/WS joins. |
{
"channel": "account",
"event": "margin_warning",
"data": {
"sub_account": 1,
"instrument": 1000,
"equity_uusdc": 250000000,
"mm_requirement_uusdc": 200000000,
"mm_ratio_bps": 12500,
"threshold_hit": 1,
"mark_event_seq": 5290
}
}
liquidation_started
Liquidation began: resting orders canceled.
| Field | Type | Required | Description |
|---|---|---|---|
canceled_order_count | integer | ✓ | |
cured | boolean | ✓ | True when cancellation alone restored margin (no takeover follows). |
event_seq | integer · int64 | ✓ | Cluster sequence number — monotonic; drives gap detection and REST/WS joins. |
{
"channel": "account",
"event": "liquidation_started",
"data": {
"canceled_order_count": 6,
"cured": false,
"event_seq": 5303
}
}
liquidation_complete
The liquidation takeover completed.
| Field | Type | Required | Description |
|---|---|---|---|
filled_qty | integer · int64 | ✓ | |
penalty | integer · int64 | ✓ | |
shortfall_uusdc | integer · int64 | ✓ | |
remainder_uusdc | integer · int64 | ✓ | |
event_seq | integer · int64 | ✓ | Cluster sequence number — monotonic; drives gap detection and REST/WS joins. |
{
"channel": "account",
"event": "liquidation_complete",
"data": {
"filled_qty": 12,
"penalty": 5000000,
"shortfall_uusdc": 0,
"remainder_uusdc": 1500000,
"event_seq": 5310
}
}