Skip to main content

Bootstrap and parsing notes

TopicContract
Initial user-data stateORDER_UPDATE, STRATEGY_UPDATE, and TRADER_UPDATE subscriptions begin with an empty PARTIAL; bootstrap existing state from REST before applying WebSocket UPDATE messages
Fully rejected ordersFully rejected order outcomes can carry placeholder makerOrderIntent fields such as empty strings plus side=0 and orderType=0; parsers must not assume full maker-intent fidelity on rejection-only outcomes
Reconnect postureResume one update family with its own globalOrdinal, then continue applying feed messages in top-level ordinal order on the live connection

Event ordering model

PropertyContract
Snapshot + stream modelREST provides initial state, realtime provides updates
Top-level sequenceGlobal monotonically increasing server notification sequence across all feeds and all connections; a single connection may observe gaps
Top-level ordinalPer-connection monotonically increasing message order across all subscribed feeds
globalOrdinalStable identifier over updates of one update type, used for REST pagination and reconciliation within that same update type; do not compare across different update types
orderMatchOrdinalShared identifier for all order outcomes from the same match
ORDER_UPDATE.ordinalPer-outcome ordinal within one orderMatchOrdinal group
Correlation keystrader, strategy, symbol, order identity fields

ORDER_UPDATE reasons

CodeReasonMeaning
0PostOrder posted to the book
1TradeOrder matched and traded
2LiquidationOrder outcome came from liquidation handling
3CancellationOrder was canceled
4OrderRejectionOrder was rejected during lifecycle processing
5CancelRejectionCancel or modify request was rejected

ORDER_UPDATE rejection codes

CodeReasonMeaning
0SelfMatchSame-trader crossing was prevented
1SolvencyGuardOrder could not proceed without violating solvency constraints
2MaxTakerPriceDeviationMatching would have exceeded mark-price deviation guard
3NoLiquidityNo usable liquidity remained in the book
4InvalidStrategyStrategy was invalid or nonexistent
5PostOnlyViolationPost-only order would have matched immediately

Cancel rejection codes

CodeReasonMeaning
0InvalidOrderOrder could not be found for cancel or modify

STRATEGY_UPDATE reasons

CodeReasonMeaning
0DepositCollateral deposited on-chain
1WithdrawCollateral withdrawal claimed on-chain
2WithdrawIntentCollateral locked for withdrawal
3FundingPaymentFunding transferred at settlement
4PnlSettlementPnL realized at periodic settlement
5TradePnL realized from trade fills
6FeeFees charged in collateral currency
7LiquidationStrategy liquidated and collateral zeroed
8ADLAuto-deleveraging occurred
9WithdrawRejectionWithdrawal attempt rejected

Withdraw rejection codes

CodeReasonMeaning
0InvalidStrategyStrategy was invalid or nonexistent
1InvalidInsuranceFundContributionInsurance-fund contribution was invalid or missing
2MaxWithdrawalAmountWithdrawal amount exceeded the allowed maximum
3InsufficientInsuranceFundContributionWithdrawal exceeded contributed amount
4InsufficientRemainingInsuranceFundWithdrawal would leave the insurance fund too low

TRADER_UPDATE reasons

CodeReasonMeaning
0DepositDDXDDX deposited on-chain
1WithdrawDDXDDX withdrawal claimed on-chain
2WithdrawDDXIntentDDX locked for withdrawal
3TradeMiningRewardDDX credited for trade mining
4ProfileUpdateTrader profile or fee preference changed
5FeeDistributionDDX rewarded during checkpoint fee distribution
6AdmissionTrader granted platform access
7DenialTrader denied platform access
8FeeFees charged in DDX
9WithdrawDDXRejectionDDX withdrawal attempt rejected

DDX withdraw rejection codes

CodeReasonMeaning
0InvalidTraderTrader was invalid or nonexistent
1InsufficientDDXBalanceTrader did not have enough DDX

Lifecycle mapping

PhasePrimary signal
Request accepted for sequencingRequest receipt
Matching and partial/complete fillsORDER_UPDATE
Strategy balance and margin effectsSTRATEGY_UPDATE
Trader-level balance/profile effectsTRADER_UPDATE
Terminal statesFilled, canceled, rejected, liquidated, or ADL-resolved
Apply realtime messages in top-level ordinal order for one connection. Use globalOrdinal to resume one update type after reconnects, do not compare it across different update types, and use orderMatchOrdinal plus ORDER_UPDATE.ordinal to reconstruct multi-outcome matches.

Liquidation and ADL reconciliation notes

TopicContract
liquidation outcome setExpect ORDER_UPDATE plus STRATEGY_UPDATE changes to position and collateral state rather than an order-only interpretation
ADL outcome setExpect strategy-level resolution effects in addition to order outcomes; ADL is not just a trade-print alias
insurance-fund-adjacent rejectionsWithdrawal-side insurance-fund rejection codes belong to strategy reconciliation, not to ordinary trade matching
Last modified on April 13, 2026