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

Trade Settlement

Reya matches orders off-chain and settles trades on Reya Network. For your integration, the key distinction is between an order being matched and its fills being confirmed.

The two stages

  1. Match. Reya validates your signed order and matches it against available liquidity. The order-submission response and orderChanges report the order outcome, including any matched quantity.

  2. Settlement. Each fill is validated and settled on-chain. Confirmed trades appear on spotExecutions or perpExecutions; failed settlements appear on executionBusts.

Checks performed by Reya

Reya verifies signatures and signer permissions, order validity, nonces, balances, margin, price limits and applicable market rules. Each matched fill must also pass settlement checks against the current account and market state.

You submit signed order-management requests through REST or WebSocket Order Entry. Reya handles settlement; you do not submit a separate settlement transaction for your fills.

When is a trade final?

Once a fill appears on spotExecutions or perpExecutions, it has settled on Reya Network and will not be busted. Use the channel for the product you trade. The unified executionBusts channel reports failed settlements for both spot and perp.

When settlement fails

Account balances, margin and prices can change between matching and settlement. A fill may fail settlement if it falls outside the permitted price band, a required price is stale, margin is insufficient, or a GTT order's signed expiresAfter has passed. The request-signing deadline is checked at entry; it is separate from the order's settlement expiry.

A failed settlement is reported as a trade bust: the failed fill does not change your settled position. It does not undo other fills that settled successfully. See Trade Busts for how to reconcile the outcome.

What this means for your integration

  • Drive your trade ledger from spotExecutions and perpExecutions. The order-submission response and orderChanges report matching outcomes before settlement.

  • Reconcile each fill independently. An order can produce multiple fills, some of which settle while others bust.

  • De-duplicate execution events. Use (channel, sequenceNumber) as the idempotency key. See Executions & Trade History for identifiers, pagination and reconnect recovery.

Last updated