Get 24h ticker price

This WebSocket API provides real-time updates for tickers on Nami Exchange.

Get Ticker Price RealTime By Socket

Overview This WebSocket API provides real-time updates for tickers on Nami Exchange.

  • Base URL: wss://stream-asia2.nami.exchange

  • Path: /ws

  • Transport: WebSocket

  • Reconnection: Enabled with exponential backoff

Connection To establish a connection, use the following WebSocket client configuration:

const socket = socketIO("https://stream-asia2.nami.exchange", {
  path: "/ws",
  upgrade: false,
  reconnection: true,
  reconnectionDelay: 100,
  reconnectionDelayMax: 500,
  reconnectionAttempts: Infinity,
  transports: ["websocket"],
});

Events

1. Connect

  • Event: connect

  • Description: Triggered when the client successfully connects to the WebSocket server.

  • Example:

2. Subscribe to Tickers

  • Event: subscribe:ticker

  • Description: Subscribes to real-time Tickers updates for a specific trading pair.

  • Payload: string (trading pair, e.g., "BTCUSDT")

  • Example:

3. Receive Tickers Updates

  • Event: spot:ticker:update

  • Description: Provides real-time Tickers updates for the subscribed trading pair.

  • Payload: JSON object containing trade details.

  • Example Response:

  • Example Handling:

Disconnection & Reconnection

  • The WebSocket client automatically attempts to reconnect with exponential backoff.

  • If disconnected, it will retry indefinitely with a delay between 100ms - 500ms.

Notes

  • Ensure your WebSocket client supports reconnection strategies to maintain a stable connection.

  • Data is subject to market fluctuations and should be handled accordingly.

Last updated