For the complete documentation index, see llms.txt. This page is also available as Markdown.

WebSocket Info API Reference

Download the current mainnet contract: Info AsyncAPI spec. This download describes the API currently available at that endpoint, which may differ from the version described in this guide. For the API 3.6.2 contract documented here, use the immutable canonical spec source.

Overview

The Reya DEX Trading WebSocket API v2 provides real-time streaming data for decentralized exchange operations on the Reya Network. This version offers user-friendly data structures with human-readable formats, removing blockchain-specific details while maintaining comprehensive trading functionality.

For placing and cancelling orders over WebSocket, see WebSocket Order Entry API Reference. The recommended integration runs both connections in parallel: that surface for order entry, this surface for market and account updates.

Server Endpoints

See Rate Limits for inbound message allowances, IP connection limits and recovery after a 4029 close. Pace subscription replay as well as steady-state traffic.

Production Environment

  • URL: wss://ws.reya.xyz/

  • Protocol: WSS

  • Description: Production WebSocket server for live trading on the order book

For integration testing against the same contract, use devnet1. See Environments for each environment's endpoints and signing values.

Channel Architecture

The API uses a hierarchical channel structure with clear separation between different data types:

1

Market Data Channels

  • /v2/perpMarkets/summary - Perp market summaries

  • /v2/perpMarket/{symbol}/summary - Individual perp market summary

  • /v2/spotMarkets/summary - Spot market summaries

  • /v2/spotMarket/{symbol}/summary - Individual spot market summary

  • /v2/market/{symbol}/perpExecutions - Market-specific perpetual executions

  • /v2/market/{symbol}/depth - L2 order book depth snapshots for a specific market

  • /v2/market/{symbol}/spotExecutions - Market-specific spot executions

  • /v2/market/{symbol}/executionBusts - Market-specific execution busts (failed fills — spot + perp)

  • /v2/assetOraclePrices - Asset Stork oracle prices

2

Wallet Data Channels

  • /v2/wallet/{address}/positions - Position updates

  • /v2/wallet/{address}/orderChanges - Order change updates

  • /v2/wallet/{address}/perpExecutions - Wallet-specific perpetual executions

  • /v2/wallet/{address}/spotExecutions - Wallet-specific spot executions

  • /v2/wallet/{address}/executionBusts - Wallet-specific execution busts (failed fills — spot + perp)

  • /v2/wallet/{address}/accountBalances - Account balance updates

  • /v2/wallet/{address}/transfers - Transfer history (account ledger) entries: deposits, withdrawals, transfers, stakes, spot legs, perp fees and rebates, liquidation penalties

  • /v2/wallet/{address}/accounts - Account creation / ownership-change notifications for the wallet

Parameter Validation

Symbol Parameter

  • Pattern: ^[A-Za-z0-9]+$

  • Examples: BTCRUSDPERP, ETHRUSDPERP, WETHRUSD, WBTCRUSD

  • Description: Trading symbol supporting alphanumeric characters

Address Parameter

  • Pattern: ^0x[a-fA-F0-9]{40}$

  • Example: 0x6c51275fd01d5dbd2da194e92f920f8598306df2

  • Description: Ethereum wallet address (40 hexadecimal characters)

Message Structure

The Info surface uses one envelope shape for streamed channel data, plus a small set of control envelopes for subscription management. All envelopes share a type discriminator at the top level; the rest of the body is type-specific.

Channel Data Envelope (Server → Client)

  • type: Always "channel_data" for data updates

  • timestamp: Server timestamp in milliseconds

  • channel: Specific channel identifier

  • data: Channel-specific payload (object or array)

Subscribe Envelope (Client → Server)

The id is an optional client-chosen correlation marker. The server does not echo it back in the confirmation and does not enforce uniqueness across in-flight subscribes; it is purely for client-side bookkeeping.

Subscribed Confirmation (Server → Client)

The contents field carries an initial snapshot for channels that provide one (e.g. /v2/market/{symbol}/depth); otherwise it is omitted. For /v2/wallet/{address}/orderChanges, contents carries the current open orders plus a snapshotSequenceNumber cursor. For /v2/wallet/{address}/transfers, contents.data carries the wallet's most recent ledger entries, newest first.

Unsubscribe Envelope (Client → Server)

Unsubscribed Confirmation (Server → Client)

Error Envelope (Server → Client)

The shape and the full set of possible message values are documented in Error Catalog below.

Heartbeats

The heartbeat / connection-liveness mechanism is documented in detail on its own page — see Heartbeats. Short version: protocol-level pings handle liveness automatically, no application-level code is required on the client.

Reconnecting & resyncing

Delivery depends on the channel class:

  • Stateful feeds — depth and orderChanges — stay ordered and lossless while the connection is healthy. If your client cannot keep up, the connection closes with code 1013 (slow consumer — resubscribe for fresh snapshot). Reconnect and rebuild from a fresh snapshot.

  • Latest-value feeds — including assetOraclePrices — may skip intermediate updates and deliver the latest value per asset when your client falls behind. Do not use these channels as an every-tick ledger. If the client continues to fall behind, the connection closes with 1013.

A service restart or required feed resynchronization closes the connection with code 1012. Treat the reason string as advisory: recovery for both 1012 and 1013 is the same:

  1. Reconnect and re-send subscribe for each channel.

  2. The subscribed confirmation's contents carries a fresh initial snapshot for channels that provide one (e.g. /v2/market/{symbol}/depth returns a full SNAPSHOT). Rebuild from it and resume applying UPDATEs.

  3. For orderChanges, rebuild from the subscribed confirmation's contents.data open-order snapshot and contents.snapshotSequenceNumber cursor; subsequent rows have sequenceNumber greater than that cursor. For other per-wallet channels (positions, accountBalances), reconcile current state from REST, then resume the stream.

Updates from the disconnected window are not replayed. A reconnect/resubscribe returns a new top-100 SNAPSHOT; it does not inject a mid-stream snapshot into the old connection. An ordered per-market depth reset can instead be delivered in-band as an ordinary UPDATE that removes old levels and adds the replacement bounded view. Apply it using the same absolute-quantity rules as any update.

Channels Reference

1. Market Data Channels

/v2/perpMarkets/summary

Purpose: Real-time updates for all perp market summaries.

Subscription:

Message Structure:

Data Type - MarketSummary
  • symbol (string): Trading symbol

  • updatedAt (integer): Last calculation timestamp (milliseconds)

  • oiQty (string): Total open interest quantity

  • fundingRate (string): Current hourly funding rate

  • longFundingValue (string): Current long funding value

  • shortFundingValue (string): Current short funding value

  • volume24h (string): 24-hour trading volume

  • pxChange24h (string, optional): 24-hour price change

  • markPrice (string, optional): Mark price at summary update — the matching engine's mark

  • oraclePrice (string, optional): Stork's spot index feed for the market's underlying (<BASE>USD), converted to USDC (rUSD) using USDCUSD. This uses the same feed family and quote conversion as spot summaries. It is distinct from the matching engine's markPrice. Omitted when the spot tick is missing or older than 60 seconds, or the cross-rate is unavailable; there is no CEX-mark fallback. See Oracle & Index Prices.

  • throttledMidPrice (string, optional): Throttled order-book mid price at summary update. Absent on an empty or one-sided book

  • pricesUpdatedAt (integer, optional): Last price update timestamp

/v2/perpMarket/{symbol}/summary

Purpose: Real-time updates for a specific perp market's summary.

Parameters:

  • symbol: Trading symbol (e.g., BTCRUSDPERP, kBONKRUSDPERP)

Subscription:

Message Structure:

Data Type - MarketSummary

Same as above - see /v2/perpMarkets/summary channel for complete field definitions.

/v2/spotMarkets/summary

Purpose: Real-time updates for all spot market summaries

Subscription:

Message Structure:

Data Type - SpotMarketSummary
  • symbol (string): Trading symbol

  • updatedAt (integer): Last calculation timestamp (milliseconds)

  • volume24h (string): 24-hour trading volume in USD

  • pxChange24h (string, optional): Absolute 24-hour price change

  • oraclePrice (string, optional): Stork price for the market's base token — the spot index feed (<ASSET>USD) — quoted in USDC (also called rUSD on Reya Network). Perp MarketSummary.oraclePrice also uses the spot feed family.

  • throttledMidPrice (string, optional): Throttled order-book mid price at summary update. Omitted on an empty or one-sided book, where no mid exists — absent means "no mid", not zero.

/v2/spotMarket/{symbol}/summary

Purpose: Real-time updates for a specific spot market's summary

Parameters:

  • symbol: Trading symbol (e.g., WETHRUSD)

Subscription:

Message Structure:

Data Type - SpotMarketSummary

Same as above - see /v2/spotMarkets/summary channel for complete field definitions.

/v2/market/{symbol}/perpExecutions

Purpose: Real-time perpetual executions for a specific market

Parameters:

  • symbol: Trading symbol (e.g., BTCRUSDPERP, ETHRUSDPERP)

Subscription:

Message Structure:

Data Type - PerpExecution

Under the order book, a perpetual execution is a single match record carrying both sides. On the wallet-scoped channel you receive the record whether you were the taker or the maker — determine your side from takerAccountId vs makerAccountId.

  • exchangeId (integer): Exchange identifier

  • symbol (string): Trading symbol

  • takerAccountId (integer): Account identifier of the taker side of the match

  • makerAccountId (integer, optional): Maker account ID (counterparty providing liquidity)

  • takerOrderId (string, optional): Taker-side order ID. Absent when the taker order was filled and removed in the same matching round.

  • makerOrderId (string, optional): Maker-side order ID. Absent when the maker order was fully filled in this execution.

  • qty (string): Execution quantity

  • side (Side): Taker side (B=Buy, A=Sell). The maker is always the opposite side.

  • price (string): Execution price

  • takerFee (string): Gross fee debited from the taker in rUSD (signed; positive = the taker paid). On a fill with a fee breakdown it is exactly protocolFeeCredit + referrerFeeCredit + takerRebateCredit + poolFeeCredit.

  • protocolFeeCredit (string, optional): Fee component of takerFee credited to the protocol fee collector, in rUSD. Present on fills under the current fee model only; absent on legacy executions and never synthesized.

  • referrerFeeCredit (string, optional): Fee component of takerFee credited to the taker's referrer, in rUSD (0 with no referrer). Present on fills under the current fee model only.

  • takerRebateCredit (string, optional): Fee component of takerFee routed to the taker-rebate settlement bucket, in rUSD. Part of the gross debit — not necessarily an immediate net credit back to the taker. Present on fills under the current fee model only.

  • poolFeeCredit (string, optional): Fee component of takerFee credited to the passive pool, in rUSD. Present on fills under the current fee model only.

  • makerFee (string, optional): Signed net maker fee in rUSD from the legacy maker debit/credit legs (negative = rebate). Present only on legacy executions that recorded a maker debit or credit; omitted on every fill under the current fee model (no maker fee or rebate leg) and on ADL / MARKET_CLOSE.

  • takerOpeningFee (string, optional): Opening-fee portion of the taker fee in rUSD. Absent for position-extending executions.

  • makerOpeningFee (string, optional): Opening-fee portion of the maker fee in rUSD. Absent for position-extending executions and whenever makerFee is absent.

  • type (ExecutionType): Execution type (ORDER_MATCH, LIQUIDATION, ADL, MARKET_CLOSE)

  • timestamp (integer): Execution timestamp (milliseconds)

  • sequenceNumber (integer): Global sequence number

  • fillId (string): Stable fill identifier for correlating the execution with order updates.

  • takerRealizedPnl (string, optional): Taker realized PnL from this execution in rUSD (priceVariationPnl + fundingPnl). Absent for position-extending executions.

  • makerRealizedPnl (string, optional): Maker realized PnL from this execution in rUSD. Absent for position-extending executions.

  • takerPriceVariationPnl (string, optional): Taker PnL component from price movement in rUSD.

  • makerPriceVariationPnl (string, optional): Maker PnL component from price movement in rUSD.

  • takerFundingPnl (string, optional): Taker PnL component from funding payments in rUSD.

  • makerFundingPnl (string, optional): Maker PnL component from funding payments in rUSD.

/v2/assetOraclePrices

Purpose: Real-time asset Stork oracle prices.

Subscription:

Message Structure:

Data Type - AssetOraclePrice
  • asset (string): Asset symbol

  • oraclePrice (string): Asset Stork oracle price

  • updatedAt (integer): Last update timestamp (milliseconds)

/v2/market/{symbol}/depth

Purpose: Real-time L2 order book depth for a specific market — an initial top-100 snapshot per side followed by incremental updates to that bounded view

Parameters:

  • symbol: Trading symbol (e.g., BTCRUSDPERP, SOLRUSDPERP)

Subscription:

Message Structure:

Update message (only changed levels; qty: "0" removes a level):

Data Type - Depth
  • symbol (string): Trading symbol

  • type (DepthType): SNAPSHOT (the bounded view — the first message after subscribe) or UPDATE (only the changed levels — every subsequent message)

  • bids (array): Bid side levels, sorted descending by price. On a SNAPSHOT, at most the best 100 levels on that side; on an UPDATE, only changes to that bounded view.

    • px (string): Price level

    • qty (string): Aggregated quantity at this price level — 0 means the level was removed (on an UPDATE)

  • asks (array): Ask side levels, sorted ascending by price. On a SNAPSHOT, at most the best 100 levels on that side; on an UPDATE, only changes to that bounded view.

    • px (string): Price level

    • qty (string): Aggregated quantity at this price level — 0 means the level was removed (on an UPDATE)

  • updatedAt (integer): Exchange timestamp (milliseconds) of the latest depth change for this market. It is comparable across connections. An unchanged value can mean a quiet market; use heartbeats to monitor connection liveness.

/v2/market/{symbol}/spotExecutions

Purpose: Real-time spot executions for a specific market

Parameters:

  • symbol: Trading symbol (e.g., WETHRUSD, WBTCRUSD)

Subscription:

Message Structure:

Data Type - SpotExecution
  • exchangeId (integer, optional): Exchange identifier

  • symbol (string): Trading symbol

  • takerAccountId (integer): Account identifier of the taker side of the trade

  • makerAccountId (integer): Maker account ID (counterparty providing liquidity)

  • takerOrderId (string, optional): Taker-side order ID. Absent when the taker order was filled and removed in the same matching round.

  • makerOrderId (string, optional): Maker-side order ID. Absent when the maker order was fully filled in this execution.

  • qty (string): Execution quantity in base asset units

  • side (Side): Taker side (B=Buy, A=Sell). The maker is always the opposite side.

  • price (string): Execution price in quote-per-base units

  • takerFee (string): Fee charged to the taker, in the market's fee asset

  • type (ExecutionType): Execution type — for spot, ORDER_MATCH or LIQUIDATION (ADL / MARKET_CLOSE are perp-only)

  • timestamp (integer): Execution timestamp (milliseconds since epoch)

  • sequenceNumber (integer): Monotonic per-execution sequence number across the spot matching engine; increases by 1 for every spot execution on Reya. Use this to dedup and gap-detect on the consumer side after a reconnect.

  • fillId (string): Stable fill identifier for correlating the execution with order updates.

/v2/market/{symbol}/executionBusts

Purpose: Real-time execution busts (failed fills) for a specific market — covers both spot and perp

Parameters:

  • symbol: Trading symbol (e.g., WETHRUSD, BTCRUSDPERP)

Subscription:

Message Structure:

Data Type - ExecutionBust

A bust is emitted when the matching engine matched two orders but the on-chain settlement attempt reverted (e.g. insufficient balance, signature staleness, market paused). The match is rolled back; both orders are released back to their owners' state. This single channel covers both spot and perp — tell them apart by the symbol suffix (…RUSD = spot, …RUSDPERP = perp). See Trade Busts for the full trade lifecycle, when busts happen, and how clients should handle them.

  • symbol (string): Trading symbol (spot ends in RUSD, perp ends in RUSDPERP)

  • takerAccountId (integer): Account identifier of the taker side of the failed trade

  • exchangeId (integer): Exchange identifier

  • makerAccountId (integer): Maker account ID (counterparty)

  • takerOrderId (string): Taker-side order ID

  • makerOrderId (string): Maker-side order ID

  • qty (string): Failed base quantity in base asset units

  • side (Side): Taker side (B=Buy, A=Sell)

  • price (string): Price at which the failed match was attempted

  • reason (ExecutionBustReason): Machine-readable decoded revert reason object. Branch on reason.reasonName. Known contract errors have typed fields (for example AccountBelowIM includes accountId, delta, and shortfall); decoded but unmodeled contract errors use { reasonName: "<ErrorName>", args: { ... } }; legacy decoded strings use { reasonName: "DecodedReason", message: "..." }; undecodable bytes use { reasonName: "UnknownReason", message: "Unknown reason, reach out for support" }. You do not need to ABI-decode anything yourself.

  • timestamp (integer): Block timestamp of the failed settlement (milliseconds since epoch). This is the chain-side timestamp, not the original off-chain match timestamp.

  • sequenceNumber (integer): Monotonic execution-bust sequence number; increases by 1 per bust. Use it to dedup and gap-detect after a reconnect.

  • fillId (string): Stable fill identifier for correlating the bust with order updates.

2. Wallet Data Channels

/v2/wallet/{address}/positions

Purpose: Real-time position updates for a wallet

Parameters:

  • address: Ethereum wallet address (e.g., 0x6c51275fd01d5dbd2da194e92f920f8598306df2)

Subscription:

Message Structure:

Data Type - Position
  • exchangeId (integer): Exchange identifier

  • symbol (string): Trading symbol

  • accountId (integer): Account identifier

  • qty (string): Position quantity

  • side (Side): Position side (B=Buy, A=Sell)

  • avgEntryPrice (string): Average entry price

  • avgEntryFundingValue (string): Average entry funding value

  • lastTradeSequenceNumber (integer): Last execution sequence number

/v2/wallet/{address}/orderChanges

Purpose: Real-time order change updates for wallet order-state tracking.

API 3.5.4 introduced avgFillPx on order updates and the open-orders snapshot after the first fill. The example and field list below include this field.

Parameters:

  • address: Ethereum wallet address

Subscription:

Subscribed Confirmation:

The subscribed confirmation returns the current open-orders snapshot in contents.data and the snapshot cursor in contents.snapshotSequenceNumber. Snapshot orders do not include sequenceNumber; the cursor represents the snapshot boundary. Subsequent channel_data order rows include sequenceNumber greater than snapshotSequenceNumber.

Message Structure:

Data Type - Order

This channel carries state changes for all orders. The initial snapshot contains open orders. Each update reports the order's actual timeInForce and orderType.

Order.sequenceNumber is present on live orderChanges event rows and on orderHistory REST rows. It is absent on open-order/resting snapshots, including openOrders REST responses and the contents.data snapshot in the orderChanges subscribed confirmation.

  • exchangeId (integer): Exchange identifier

  • symbol (string): Trading symbol

  • accountId (integer): Account identifier

  • sequenceNumber (integer, optional): Monotonic matching-engine order-event sequence. Present on live orderChanges event rows and orderHistory REST rows; omitted on open-order/resting snapshots. Use it to splice orderHistory with the live stream and to deduplicate inclusive orderHistory page-boundary overlap.

  • side (Side): Order side (B=Buy, A=Sell)

  • limitPx (string): Limit price

  • orderType (OrderType): LIMIT, STOP_LOSS, or TAKE_PROFIT.

  • status (OrderStatus): Order status (OPEN, FILLED, CANCELLED). A partially filled order with a resting remainder stays OPEN; use cumQty to identify partial fills. Request rejections are returned as errors instead of order-status updates.

  • createdAt (integer): Creation timestamp (milliseconds)

  • lastUpdateAt (integer): Last-update timestamp (milliseconds). It reflects the order's most recent change and equals createdAt until the order changes.

  • orderId (string): Order identifier

  • clientOrderId (string, optional): Client-provided order ID, present when the order has a non-zero client id

  • triggered (boolean, optional): false for an armed trigger, true for a fired protective child, never true for LIMIT. Present on current openOrders and orderChanges; always omitted on orderHistory, where absence means unknown. See Armed and fired trigger orders.

  • qty (string, optional): Order quantity; omitted while a trigger is armed. A fired child's remaining quantity is an upper bound: each fill is clamped to the position still reducible

  • execQty (string, optional): Executed quantity in the current order update

  • cumQty (string, optional): Cumulative executed quantity across all fills

  • avgFillPx (string, optional): Quantity-weighted average price across all maker and taker fills of the order, excluding fees; corresponds to cumQty. Omitted before the first fill and preserved across amendments and cancellation. The same field is exposed on REST openOrders and orderHistory. See Average fill price for rounding and examples.

  • firstFillId (string, optional): Identifier of the first fill this update represents. Together with fillCount, identifies a contiguous fill range. Present only on fill updates.

  • fillCount (integer, optional): Number of fills this update represents. Present only with firstFillId.

  • timeInForce (TimeInForce, optional): The order's actual time in force. Book orders rest with GTC/GTT; armed triggers can carry IOC/GTC/GTT for their future child.

  • reduceOnly (boolean, optional): Reduce-only flag, reflecting the value signed on the order

  • postOnly (boolean, optional): Post-only (maker-only) flag, reflecting the value signed on the order

  • expiresAfter (integer, optional): For GTT, the signed expiry timestamp (Unix seconds); absent for GTC/IOC. A protective trigger and child share this expiry and stop early to allow time for settlement

  • cancelReason (CancelReason, optional): Present when a CANCELLED order includes a machine-readable reason — e.g. USER_CANCEL, GTT_EXPIRED, SELF_TRADE_PREVENTION, or RISK_CANCELLED. For FEED_RESET and close code 1012, see Reconnecting & resyncing.

  • cancelReasonMessage (string, optional): Human-readable explanation for cancelReason

/v2/wallet/{address}/perpExecutions

Purpose: Real-time perpetual execution updates for a wallet

Parameters:

  • address: Ethereum wallet address

Subscription:

Message Structure:

Data Type - PerpExecution

Same as above - see /v2/market/{symbol}/perpExecutions channel for complete field definitions.

/v2/wallet/{address}/spotExecutions

Purpose: Real-time spot execution updates for a wallet

Parameters:

  • address: Ethereum wallet address

Subscription:

Message Structure:

Data Type - SpotExecution

Same as above - see /v2/market/{symbol}/spotExecutions channel for complete field definitions.

/v2/wallet/{address}/executionBusts

Purpose: Real-time execution bust updates for a wallet — covers both spot and perp

Parameters:

  • address: Ethereum wallet address

Subscription:

Message Structure:

Data Type - ExecutionBust

Same as above - see /v2/market/{symbol}/executionBusts channel for complete field definitions.

/v2/wallet/{address}/accountBalances

Purpose: Real-time account balance updates for a wallet

Parameters:

  • address: Ethereum wallet address

Subscription:

Message Structure:

Data Type - AccountBalance
  • accountId (integer): Account identifier

  • asset (string): Asset symbol (e.g., WETH, RUSD)

  • realBalance (string): Sum of account net deposits and realized PnL from closed positions

  • balanceDEPRECATED (string): Sum of account net deposits only (deprecated, will be removed)

/v2/wallet/{address}/transfers

Purpose: Transfer history (account ledger) entries for a wallet — the same entries GET /v2/wallet/{address}/transfers returns, one per account side of every on-chain transfer leg, signed from the account's view. Net deposits only: realized PnL and funding never appear. See Transfer History (Account Ledger).

Parameters:

  • address: Ethereum wallet address

Subscription:

The subscribed acknowledgement carries the wallet's most recent entries in contents.data, newest first (at most 30 for the whole wallet; zero-amount entries are not pushed). Every later frame carries one new entry.

Message Structure:

Data Type - Transfer
  • sequenceNumber (integer): Unique id of the entry, increasing in chain order and never reused

  • accountId (integer): The account this entry belongs to

  • asset (string): Asset symbol (e.g., RUSD, SRUSD)

  • amount (string): Signed from this account's view; negative = collateral left the account

  • netDepositsAfter (string): Net deposits of the account in asset right after this entry (same basis as AccountBalance.balanceDEPRECATED; not realBalance)

  • type (string): Entry type — DEPOSIT, WITHDRAWAL, TRANSFER, POOL_STAKE, POOL_UNSTAKE, PERP_TAKER_FEE, PERP_REFERRER_REBATE, PERP_TAKER_REBATE, PERP_POOL_REBATE, PERP_FEE, SPOT_EXECUTION, AUTO_EXCHANGE, AUTO_EXCHANGE_INSURANCE_FEE, LIQUIDATION_*, INSURANCE_FUND_COVERAGE, POOL_MERGE, OTHER; treat an unfamiliar value as OTHER

  • counterpartyAccountId (integer, optional): The other side of the leg; absent for deposits, withdrawals, stakes and unstakes

  • symbol (string, optional): Market of the execution that caused the entry (perp fee entries, spot entries)

  • spotExecutionSequenceNumber (integer, optional): SpotExecution.sequenceNumber for spot entries

  • fillId (string, optional): Fill identifier linking the entry to PerpExecution.fillId / SpotExecution.fillId; historical perp fee entries may omit it

  • timestamp (integer): Block timestamp in milliseconds

  • transactionHash (string): The settling transaction

/v2/wallet/{address}/accounts

Purpose: Notifies when an account owned by the wallet is created, has its main/spot binding change, or (defensively) changes ownership. Lets you detect new accounts without polling.

Subscription:

Message Structure:

Data Type - AccountUpdate
  • accountId (decimal string): The account that was created or changed.

  • owner (string): The owner wallet address.

  • mainAccountId (decimal string or null): The owner's main perp account id, or null when none is bound.

  • spotAccountId (decimal string or null): The owner's spot account id, or null when none is bound.

  • isMainPerpAccount (boolean): Whether accountId is the owner's main perp account.

  • isSpotAccount (boolean): Whether accountId is the owner's spot account.

  • removed (boolean, optional): Present and true only on the previous owner's channel when an account's ownership changes — drop the account from that owner's list.

Error Catalog

For validation and subscription failures, the server emits an error envelope and keeps the connection open; only the offending operation is rejected. Exceeding the inbound message allowance instead closes the connection with 4029; see Rate Limits. Error envelopes share this shape:

The channel field is included when the error relates to a specific channel (e.g. an invalid subscribe target). It is omitted for frame-level errors that aren't tied to a particular channel.

Common message strings emitted by the server:

Message
When emitted
Client action

Invalid JSON

The frame body could not be parsed as JSON.

Fix the client serializer.

Invalid type

The frame's type field is not one of subscribe, unsubscribe, ping. (pong is server-only — clients don't send JSON pong frames.)

Verify the request type.

Invalid channel name

The subscribe / unsubscribe target does not match a known channel path or has malformed parameters (e.g. an invalid symbol or address).

Check the channel name against the Channels Reference and the Parameter Validation rules.

Error while fetching snapshot from {channel}

The initial snapshot could not be provided, so the subscription did not succeed.

Retry the subscribe after a short backoff. If the problem persists, contact support with the channel name and timestamp.

Subscribe rate limit exceeded — slow down

The connection or IP exhausted its separate subscription-request allowance. No snapshot is sent for the rejected request.

Retry with backoff and pace subscription replay across connections sharing the IP.

Data Types & Schemas

Enumeration Types

Side - Order/position side indicator
  • B: Buy/Bid

  • A: Ask/Sell

ExecutionType - Type of execution that occurred
  • ORDER_MATCH: Regular order matching

  • LIQUIDATION: Liquidation execution

  • ADL: Auto-deleveraging execution

  • MARKET_CLOSE: Perp-only terminal execution used to close a residual position when a market is force-closed

OrderStatus - Current status of an order
  • OPEN: Order is active and can be filled

  • FILLED: Order has been completely filled

  • CANCELLED: Order has been cancelled

CancelReason - Why a `CANCELLED` order terminated
  • NO_LIQUIDITY: IOC executed zero quantity because no fillable liquidity was available at its limit

  • IOC_REMAINDER: IOC partially filled and cancelled the unfilled remainder

  • SELF_TRADE_PREVENTION: Order would have crossed the same account

  • GTT_EXPIRED: GTT order expired

  • USER_CANCEL: Explicit user cancel

  • MASS_CANCEL: Explicit cancel-all

  • CANCEL_ALL_AFTER: Cancel-on-disconnect timer fired

  • RISK_CANCELLED: Pre-trade risk cancelled an already-resting maker as it was about to match. cancelReasonMessage is fixed per reason and does not identify the binding check; matching continues through the remaining book

  • OCO_SIBLING_FIRED: A protective child was created, consuming the paired armed stop even if the child filled nothing

  • PROTECTIVE_SELF_TRADE_SWEEP: A resting maker was swept so the account's protective stop could execute

  • POSITION_CLOSED: Nothing remains reducible. Before a child exists, both armed legs are cancelled; for a resting child, a zero reducible-size clamp cancels its remainder

  • RISK_REJECTED: Pre-trade risk refused a protective fire before a child existed; both legs are cancelled. The reason message is fixed, not the specific failed check

  • FEED_RESET: Resynchronization signal, not an order cancellation. Resynchronization currently uses close code 1012 instead; reconnect and re-subscribe for fresh snapshots

OrderType - Type of order placed
  • LIMIT: Limit order

  • STOP_LOSS: Stop-loss (trigger) order

  • TAKE_PROFIT: Take-profit (trigger) order

TimeInForce - Order duration specification
  • IOC: Immediate or Cancel

  • GTC: Good Till Cancel

  • GTT: Good Till Time (auto-expires at the order's signed expiresAfter)

DepthType - Order book depth message type
  • SNAPSHOT: Snapshot of the public top-100 view per side

  • UPDATE: Diff containing one or more absolute changed levels across bids and asks; qty: "0" removes a level

AccountType - Account type classification

Used by the REST account model. WebSocket messages do not carry an AccountType field — the accounts channel conveys account classification via the isMainPerpAccount / isSpotAccount booleans instead.

  • MAINPERP: Main perpetual trading account

  • SUBPERP: Sub perpetual trading account

  • SPOT: Spot trading only account

Connection Management

Reconnection Pattern

Reconnect with the usual exponential-backoff-with-jitter pattern. The Reya-specific steps — re-subscribe to every channel and reconcile missed events from REST (e.g. GET /v2/wallet/{address}/openOrders, GET /v2/wallet/{address}/perpExecutions) — are covered in Reconnecting & resyncing above.

For the meaning of WS close codes you'll see on onclose (1000, 1001, 1006, etc.), see What Happens When the Server Closes the Connection.

Service Restarts

Info service restarts close connections with code 1012; reconnect and re-subscribe for fresh snapshots. Order Entry uses close code 1001. Both are documented in Service restarts.

Python SDK Example

Worked examples are included in the Python SDK 3.6.1.0 under examples/websocket/. The directory is split by market type:

After installing the pinned SDK, run from its checkout:

See each script's docstring for prerequisites (.env setup, funded accounts). The SDK's .env.example targets devnet1; for mainnet, replace those entries with the mainnet values.

Last updated