# Price Feed

## DNS

&#x20;[https://backend-pricing.eu.gains.trade](https://backend-pricing.eu.gains.trade/charts)

*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:&#x20;

* 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.&#x20;

`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>...]`

{% hint style="info" %}
Every \~1000ms there's single item array update. It's ping message with updated timestamp ie:`[1724244390036]`
{% endhint %}
