LogoLogo
  • Getting Started
  • How to Connect
  • REST API
    • Order
    • PublicMarketData
    • Wallet
    • Trade
    • Models
  • Smart Contract ABI
    • OrderBook
    • Order Data (explanation)
  • Websocket API
    • Orderbook
    • Ticker
  • SDK Documentation
    • Getting Started
    • REST API Interaction
    • Smart Contract Interaction
      • Order Placement
      • Order Cancelation
Powered by GitBook

Privacy

  • Privacy Policy

All rights reserved. 21X AG

On this page
  • Ticker data
  • Overview
  • Channel
  • Subscription
  • Market Data Model
Export as PDF
  1. Websocket API

Ticker

Ticker data

This guide explains how to use the WebSocket API to subscribe to market data updates via the /ticker channel.


Overview

The WebSocket API allows clients to receive real-time market data updates. Subscribing to the /ticker channel provides updates for market ticker data, including prices, bids, asks, and quantities.


Channel

/ticker/*

  • Subscribe to get ticker data from all active markets.

/ticker/bytradingpair/{market symbol}

  • Subscribe to get ticker data from specific markets

  • Client may be subscribed to many markets at the same time.


Subscription

{
    "id": "94c68f6e-44ba-46ec-b9fb-4eb7addfe5ea",
    "type": "subscribe",
    "channel": "ticker/*",
    "authorization": {
        "host": "vfqqino6svadzoqkann4355in4.appsync-api.eu-central-1.amazonaws.com",
        "x-amz-date": "20250117T133706Z",
        "x-api-key": "da2-vjlcb7rsira4bggsctnmzcjvwe"
    }
}
{"id":"94c68f6e-44ba-46ec-b9fb-4eb7addfe5ea","type":"subscribe_success"}

Market Data Model

When subscribed to the /ticker channel, the server sends market data updates in the following format:

Content type: application/json

Example message

{
  "channel": "ticker",
  "data": [
    {
      "symbol": "AMDIIIAX/EUROe",
      "lastPrice": 120.2,
      "bestBid": 120.05,
      "bestBidQuantity": 36,
      "bestAsk": 120.2,
      "bestAskQuantity": 150.5,
      "time": "2024-12-16T12:28:22.462Z"
    }
  ]
}

Field Descriptions

Field
Type
Description

channel

string

The name of the channel (ticker).

data

array

An array of market data objects.

symbol

string

The trading pair symbol (e.g., AMDIIIAX/EUROe).

lastPrice

number

The last traded price.

bestBid

number

The best bid price available.

bestBidQuantity

number

Quantity available at the best bid price.

bestAsk

number

The best ask price available.

bestAskQuantity

number

Quantity available at the best ask price.

time

string

Timestamp of the data update (ISO 8601 format).


PreviousOrderbookNextSDK Documentation

Last updated 1 month ago