R-Ticker

R-Ticker

Get live access to price movements across the crypto market.

The Ticker system collects real-time price data from crypto exchanges and delivers it to users. The system pulls data from more than 50 exchanges and monitors price, change, and volume information of trading pairs in real time.

Key Features:

  • 50+ crypto exchange integrations (Binance, Bybit, OKX, Coinbase, Kraken, etc.)
  • Real-time price, percentage change, and trading volume data
  • High-performance data access via Redis cache
  • Real-time data streaming over WebSocket (Centrifugo)

Architecture

  1. Data Collection: A separate ticker service runs for each exchange and fetches data from the exchange API
  2. Cache: Collected data is written to Redis (1-minute TTL)
  3. Distribution: Users access the data via REST API

Data Collection Process

Ticker Loop

For each exchange, a separate ticker service runs every 5 seconds:

  1. An HTTP GET request is sent to the exchange ticker endpoint
  2. The response is processed and normalized
  3. Data is written to Redis in bulk (batch insert)
  4. In case of an error, the system waits 10 seconds and retries

Data Format

Key Format: {exchange}-{pair}-{metric}
Example: binance-BTCUSDT-price

Metrics:

  • price: Last price
  • change: Price change (absolute value)
  • changePercent: Price change percentage (%)
  • volume: 24-hour trading volume (in quote asset)

API Usage

Authentication

To use the Ticker API, you must first obtain a JWT token.

Endpoint: POST /api/v1/ticker/login
Use the token in subsequent requests via the Authorization: Bearer {token} header.

WebSocket Stream

You can establish a WebSocket connection for real-time data streaming.

Endpoint: POST /api/v1/ticker/ws/login

Parameters:

  • exchange: Exchange names (lowercase, e.g. binance, bybit)
  • pair: Trading pairs (uppercase, e.g. BTCUSDT, ETHUSDT)
  • value: Metric types (price, change, changepercent, volume)

response:

{
  "exchanges": ["binance", "bybit"],
  "pairs": ["BTCUSDT", "ETHUSDT"],
  "values": ["price", "changepercent", "volume"]
}

Single Data Query (REST)

To retrieve real-time data for a specific exchange and trading pair:

Endpoint: GET /api/v1/ticker/{exchange}/{pair}/{value}

Parameters:

  • exchange: Exchange name (lowercase, e.g. binance, bybit)
  • pair: Trading pair (uppercase, e.g. BTCUSDT, ETHUSDT)
  • value: Metric type (price, change, changepercent, volume)

Response:

{
  "exchange": "binance",
  "pair": "BTCUSDT",
  "value": "price",
  "data": "90671.89"
}

Error Codes:

  • 400: Invalid parameters
  • 401: Authentication error
  • 404: Data not found
  • 500: Server error

Data Stream Details:

  • After the initial connection, the system waits up to 30 seconds (for the client to connect)
  • All selected data is sent every 5 seconds
  • If there are no active users left in the channel, the stream stops automatically
  • Sent in batches (all key-value pairs in a single message)

Supported Exchanges

  • The system is currently integrated with 50+ exchanges. A separate ticker service runs for each exchange.

Symbol Normalization

All data received from exchanges is converted to a standard format:

  • Hyphens are removed: BTC-USDTBTCUSDT
  • Special cases: BTTBTTC
  • All pairs are converted to uppercase
  • Exchange names are converted to lowercase

API Errors

When an error occurs in exchange APIs:

  1. Non-HTTP 200 response: Wait 10 seconds, then retry the request
  2. Connection error: Wait 10 seconds, then retry the request
  3. Invalid response format: Log the error, wait 10 seconds
  4. Panic: Caught and logged by the recover middleware

Special Cases

Kraken

Since Kraken uses different naming for some coins, the system performs automatic conversion:

Kraken Standard
XDG, XXDG DOGE
XBT, XXBT BTC
XETC ETC
XETH ETH
XLTC LTC
XREP REP
XXLM XLM
XXMR XMR
XXRP XRP
XZEC ZEC
ZCAD CAD
ZEUR EUR
ZGBP GBP
ZJPY JPY
ZUSD USD
XMLN MLN