Get Recent Trade
This WebSocket API provides real-time updates for recent trades on Nami Exchange.
Get Recent Trades Realtime By Socket
Overview This WebSocket API provides real-time updates for recent trades 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:
Events
1. Connect
Event:
connect
Description: Triggered when the client successfully connects to the WebSocket server.
Example:
2. Subscribe to Recent Trades
Event:
subscribe:recent_trade
Description: Subscribes to real-time recent trade updates for a specific trading pair.
Payload:
string
(trading pair, e.g.,"BTCUSDT"
)Example:
3. Receive Recent Trade Updates
Event:
spot:recent_trade:add
Description: Provides real-time recent trade updates for the subscribed trading pair.
Payload: JSON object containing trade details.
Example Response:
Response Fields:
S
string
Trade side (BUY
or SELL
)
s
string
Trading pair (e.g., BTCUSDT
)
p
number
Trade price
q
number
Trade quantity
Q
number
Unknown field (may represent extra trade metadata)
t
number
Trade timestamp (Unix time in milliseconds)
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