- Connect to multiple exchanges via WebSocket APIs to stream real-time price data
- Connect to REST APIs (for fallback / metadata)
- Track only tokens listed on at least two exchanges (to allow arbitrage)
- Stream prices from exchange WebSockets.
- Periodically or on request, fetch all prices from Redis for a token
- Absolute difference from the highest price.
- Percentage difference from the highest price.
- Optional: full pairwise differences if needed.
- Every N seconds: Collect prices from Redis; Compute and format arbitrage opportunities; Send structured data (JSON) to the connected clients.
- Cleanup or update stale data
- Gracefully handle WebSocket disconnections (auto-reconnect every 24h or on drop).
- Handle exchanges WebSocket ping/pong, errors, messages and etc.
- Handle Redis connection errors.
-
/prices: Returns latest price data from Redis for all or specific tokens. -
/tokens: Returns a list of available tokens (e.g., those present on 2+ exchanges) -
/arbitrage: Returns calculated arbitrage opportunities. -
/alerts: Returns alerts for significant price changes. -
/health: Returns service health status.