> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gains.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Market data

> Markets, prices, the virtual order book, candles, recent trades and funding. All public, no credentials.

Public endpoints need no headers. They are rate limited per IP; use the [WebSocket](/developer/trading-api/websocket) for anything you would otherwise poll.

## Markets

`GET /v1/{chain}/markets` lists every pair with everything you need before placing an order:

| Field                                                 | Use                                                                                                                               |
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `symbol`, `pairIndex`                                 | `symbol` (`BTC/USD`) in bodies; `pairIndex` for on-chain correlation. `pairIndex` is also the Hyperliquid asset id on the facade. |
| `group`, `isOpen`                                     | `crypto`, `forex`, `stocks`, `indices`, `commodities`, and whether the session is open now.                                       |
| `minLeverage`, `maxLeverage`                          | Accepted leverage range.                                                                                                          |
| `minPositionUsd`, `minCollateralUsd`                  | Smallest order the contracts accept.                                                                                              |
| `pricePrecision`, `sizePrecision`                     | Maximum decimals for prices and sizes.                                                                                            |
| `spreadRate`, `fees.openFeeRate`, `fees.closeFeeRate` | Fractions of notional (`0.0006` = 0.06 %).                                                                                        |
| `funding`                                             | Current hourly funding and borrowing rates, open interest per side, skew.                                                         |
| `collaterals`                                         | Tokens accepted as collateral on this chain, with decimals and address.                                                           |
| `onlyIsolated`                                        | Always `true` in v1.                                                                                                              |

`GET /v1/{chain}/markets/{symbol}` returns one market. Write the symbol as `BTC-USD` or `BTC%2FUSD` in the path.

## Prices

`GET /v1/{chain}/prices` returns the `mark` and `index` price of every market. Mark is the execution price (spot plus skew for core crypto, futures for volatile crypto); index is the price liquidations use. They differ on volatile crypto pairs and are equal elsewhere. Updates arrive every 25 ms on the `prices` WebSocket channel.

## Order book

`GET /v1/{chain}/markets/{symbol}/book?levels=20`

gTrade has no resting order book: execution goes through shared vault liquidity with deterministic price impact. The endpoint returns the **virtual order book** derived from the on-chain depth bands: each level is the liquidity available at that price offset, exactly what the trading interface displays.

```json theme={null}
{
  "market": "BTC/USD",
  "markPrice": "65000",
  "bids": [{ "price": "64993.5", "size": "3.8461", "sizeUsd": "250000", "cumulativeUsd": "250000" }],
  "asks": [{ "price": "65006.5", "size": "3.8457", "sizeUsd": "250000", "cumulativeUsd": "250000" }],
  "timestamp": 1700000000000
}
```

`size` is in base asset, `sizeUsd` in USD, `cumulativeUsd` the depth from the mark to that level. Bids are ordered from the best (highest) price, asks from the best (lowest).

## Candles

`GET /v1/{chain}/markets/{symbol}/candles?interval=1h&from=1700000000000&to=1700086400000`

Intervals: `1m`, `5m`, `15m`, `30m`, `1h`, `4h`, `1d`. `from` and `to` are epoch milliseconds. Candles are mark-price OHLC; there is no volume on a synthetic book. The `candles` WebSocket channel streams the live candle.

## Recent trades

`GET /v1/{chain}/markets/{symbol}/trades?limit=100` returns the last executed trades on the market (opens, closes, liquidations), newest first, with `price`, `sizeUsd`, `side`, `action`, `timestamp` and `txHash`.

## Funding

`GET /v1/{chain}/markets/{symbol}/funding` returns the current rates:

| Field                                                    | Meaning                                                       |
| -------------------------------------------------------- | ------------------------------------------------------------- |
| `fundingRateLongHourly`                                  | Percent per hour paid by longs. Negative means longs receive. |
| `fundingRateShortHourly`                                 | Same for shorts.                                              |
| `borrowingRateHourly`                                    | Percent per hour paid by both sides for vault liquidity.      |
| `openInterestLongUsd`, `openInterestShortUsd`, `skewUsd` | Open interest and net exposure.                               |

Funding on gTrade is velocity-based: the rate drifts with the skew instead of resetting every eight hours. Read the rate again before assuming it is constant.
