Price Feed

Details how to read and follow price updates

DNS

https://backend-pricing.eu.gains.trade

NOTE: No auth is required for accessing REST GET endpoints and the WebSocket event stream. However, rate limiting is in place, so please fetch data only as necessary and rely on the event stream to keep price data updated.

Common Endpoint

Charts

Fetch current OHLCs for each pair.

/charts

Format:

  • Comprehensive list of OHLCs

  • pairId is the index in the array (I.e. BTC/USD pairId = 0; opens[0], highs[0], lows[0], closes[0] will construct OHLC)

  • { time, opens: [], highs: [], lows: [], closes: [] }

Event Stream

Subscribe for all price updates. Provides updates every 25ms.

wss://backend-pricing.eu.gains.trade

  • Format:

    • Array of price updates for a given 25ms interval

    • All even indexes are pairIds, odd are pair prices

    • No particular order

    • [<pairIdX>,<pairIdXPrice>, <pairIdN>, <pairIdNPrice>, <pairIdY>, <pairIdYPrice>...]

Every ~1000ms there's single item array update. It's ping message with updated timestamp ie:[1724244390036]

Last updated