Skip to main content

account

privatechannel: accountwss://api.staging.sphx.io/v1/ws

Everything 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.

FieldTypeRequiredDescription
asset_idinteger
amountinteger · int64Atomic units (1e-6 USDC).
deposit_txnstringOn-chain transaction reference.
event_seqinteger · int64Cluster sequence number — monotonic; drives gap detection and REST/WS joins.
Example frame
{
"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).

FieldTypeRequiredDescription
withdrawal_idinteger · uint64
statepending · finalizedV0 emits exactly these two. Intermediate custody states surface only on GET /v1/withdrawals/{id}.
event_seqinteger · int64Cluster sequence number — monotonic; drives gap detection and REST/WS joins.
Example frame
{
"channel": "account",
"event": "withdrawal_state",
"data": {
"withdrawal_id": 17,
"state": "finalized",
"event_seq": 1071
}
}

account_state_change

An account changed lifecycle state.

FieldTypeRequiredDescription
new_statepending · active · trade_frozen · withdraw_frozen · fully_frozen · closed
event_seqinteger · int64Cluster sequence number — monotonic; drives gap detection and REST/WS joins.
Example frame
{
"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.

FieldTypeRequiredDescription
instrument_idinteger · int64
canceled_countintegerAuthoritative count (the REST 202's estimate is a hint).
sequencer_correlation_idinteger · int64Matches the triggering POST /v1/orders/cancel_all response.
event_seqinteger · int64Cluster sequence number — monotonic; drives gap detection and REST/WS joins.
Example frame
{
"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.

FieldTypeRequiredDescription
instrument_idinteger · int64
scheduled_time_nsinteger · int64
vm_uusdcinteger · int64Signed variation margin banked to margin cash.
settle_ticksinteger · int64
prev_settle_ticksinteger · int64
position_rebasedtrue (const)
event_seqinteger · int64Cluster sequence number — monotonic; drives gap detection and REST/WS joins.
Example frame
{
"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.

FieldTypeRequiredDescription
maintenance_equity_uusdcinteger · int64
mm_total_uusdcinteger · int64
suppressedbooleanDeficit recorded while liquidation was suspended (staleness rung).
event_seqinteger · int64Cluster sequence number — monotonic; drives gap detection and REST/WS joins.
Example frame
{
"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).

FieldTypeRequiredDescription
sub_accountintegerAlways 1 (the margin sub-account) in V0.
instrumentinteger · int64
equity_uusdcinteger · int64
mm_requirement_uusdcinteger · int64
mm_ratio_bpsinteger
threshold_hitinteger
mark_event_seqinteger · int64Cluster sequence number — monotonic; drives gap detection and REST/WS joins.
Example frame
{
"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.

FieldTypeRequiredDescription
canceled_order_countinteger
curedbooleanTrue when cancellation alone restored margin (no takeover follows).
event_seqinteger · int64Cluster sequence number — monotonic; drives gap detection and REST/WS joins.
Example frame
{
"channel": "account",
"event": "liquidation_started",
"data": {
"canceled_order_count": 6,
"cured": false,
"event_seq": 5303
}
}

liquidation_complete

The liquidation takeover completed.

FieldTypeRequiredDescription
filled_qtyinteger · int64
penaltyinteger · int64
shortfall_uusdcinteger · int64
remainder_uusdcinteger · int64
event_seqinteger · int64Cluster sequence number — monotonic; drives gap detection and REST/WS joins.
Example frame
{
"channel": "account",
"event": "liquidation_complete",
"data": {
"filled_qty": 12,
"penalty": 5000000,
"shortfall_uusdc": 0,
"remainder_uusdc": 1500000,
"event_seq": 5310
}
}