The DEXAGG WebSocket API provides real-time updates for market data and account information. Connect to receive live order book updates, trade executions, position changes, and more.
Connection
WebSocket Endpoint
wss://api.dexaggregatorbeta.xyz/ws
Connection Example
const WebSocket = require('ws');
const ws = new WebSocket('wss://api.dexaggregatorbeta.xyz/ws');
ws.on('open', function open() {
console.log('Connected to DEXAGG WebSocket');
});
ws.on('message', function message(data) {
const update = JSON.parse(data);
console.log('Received:', update);
});
Authentication
Private streams require authentication. Send an authentication message immediately after connection.
Authentication Message
{
"method": "auth",
"params": {
"apiKey": "your_api_key",
"timestamp": 1698765432000,
"signature": "hmac_sha256_signature"
}
}
Public Streams
Order Book Updates
Topic: orderbook:{symbol}
Subscribe to real-time order book updates for a specific symbol.
{
"method": "subscribe",
"params": {
"topic": "orderbook:BTC-USD",
"exchanges": ["hyperliquid", "aster"],
"depth": 20
}
}
Trade Updates
Topic: trades:{symbol}
Subscribe to real-time trade executions for a specific symbol.
{
"method": "subscribe",
"params": {
"topic": "trades:BTC-USD",
"exchanges": ["hyperliquid", "aster"]
}
}
Private Streams
Order Updates
Topic: orders
Subscribe to real-time updates for your orders.
{
"method": "subscribe",
"params": {
"topic": "orders",
"symbols": ["BTC-USD", "ETH-USD"]
}
}
Position Updates
Topic: positions
Subscribe to real-time position updates.
{
"method": "subscribe",
"params": {
"topic": "positions",
"symbols": ["BTC-USD", "ETH-USD"]
}
}
Rate Limits
- Connections per API key: 5 simultaneous connections
- Subscriptions per connection: 50 topics
- Messages per second: 100 outbound messages
For complete WebSocket documentation including authentication, error handling, and reconnection strategies, see our comprehensive WebSocket guide.