> For the complete documentation index, see [llms.txt](https://d8x.gitbook.io/d8x/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://d8x.gitbook.io/d8x/node-sdk/market-data-api.md).

# Market data API

### Contract information endpoint

<mark style="color:green;">`GET`</mark> `/contracts`

**Endpoint:** `https://drip.d8x.xyz/coingecko/contracts`

**Example query:** `https://drip.d8x.xyz/coingecko/contracts?chain_id=80094`

**Description:** Summary of contracts traded on the exchange per chain, helps to differentiate between different products available. Describes the specification of the contracts, mainly the pricing of the contract and its type (vanilla, inverse, or quanto).

**Query parameter**

| Name      | Type   | Description               |
| --------- | ------ | ------------------------- |
| `chainId` | string | Chain ID, example `80094` |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "chain_id": 80094,
  "timestamp": 1742651686476,
  "contracts": [
    {
      "ticker_id": "BERA-USD-BUSD",
      "contract_specs": {
        "contract_type": "Quanto",
        "contract_price_currency": "USD",
        "contract_price": 6.72888518,
        "contract_collateral_currency": "BUSD"
      },
      "base_currency": "BERA",
      "target_currency": "USD",
      "last_price": 6.72621109570277,
      "base_volume": 19682.4,
      "target_volume": 132394.605967874,
      "high": 6.90110244246593,
      "low": 6.54647264146079,
      "product_type": "Perpetual",
      "open_interest": 2996.4,
      "index_price": 6.72888518,
      "index_name": "BERA-USD",
      "index_currency": "USD",
      "start_timestamp": 0,
      "end_timestamp": 0,
      "funding_rate": 0.000099999999999999,
      "next_funding_rate": 0.000099999999999999,
      "next_funding_rate_timestamp": 1742680486
    }
  ]
}
```

{% endtab %}

{% tab title="400" %}

```json
{"error":"no contracts available for chain 80092"}
```

{% endtab %}
{% endtabs %}

### Order book information endpoint

<mark style="color:green;">`GET`</mark> `/orderbook`

**Endpoint:** `https://drip.d8x.xyz/coingecko/orderbook/`

**Example query:** `https://drip.d8x.xyz/coingecko/orderbook/bera-usd-busd?chain_id=80094`

**Description:** The /orderbook/ticker\_id endpoint is to provide order book information returned for a given market pair/ticker.&#x20;

**Query parameter**

| Name        | Type   | Description                                                    |
| ----------- | ------ | -------------------------------------------------------------- |
| `ticker_id` | string | ticker\_id as per /contracts endpoint, example `bera-usd-busd` |
| `chainId`   | string | Chain ID, example `80094`                                      |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "ticker_id": "BERA-USD-BUSD",
  "timestamp": 1742655093756,
  "bids": [
    [6.71914942003763, 1],
    [6.71905124897608, 99.98],
    [6.71895928980235, 99.98],
    [6.71889671204414, 99.98],
    [6.71886241981041, 99.98],
    [6.71882812757668, 99.98],
    [6.71879383534295, 99.98],
    [6.71875954310921, 99.98],
    [6.71872525087548, 99.98],
    [6.71869095864175, 99.98],
    [6.71865666640802, 99.98],
    [6.71862237417429, 99.9799999999999],
    [6.71858808194055, 99.98],
    [6.71855378970682, 99.98],
    [6.71851949747309, 99.98],
    [6.71848520523936, 99.98],
    [6.71845091300562, 99.98],
    [6.71841662077189, 99.98],
    [6.71838232853816, 99.98],
    [6.71834803630443, 99.98],
    [6.71831374407069, 99.98],
    [6.71827945183696, 99.9799999999998],
    [6.71824515960323, 99.98],
    [6.7182108673695, 99.98],
    [6.71817657513576, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.98],
    [6.7181424543975, 99.9799999999996],
    [6.7181424543975, 99.9800000000005],
    [6.7181424543975, 99.9799999999996],
    [6.7181424543975, 99.9800000000005],
    [6.7181424543975, 99.9799999999996],
    [6.7181424543975, 99.9800000000005],
    [6.7181424543975, 99.9799999999996],
    [6.7181424543975, 99.9800000000005]
  ],
  "asks": [
    [6.7215023656025, 99.9800000000005],
    [6.7215023656025, 99.9799999999996],
    [6.7215023656025, 99.9800000000005],
    [6.7215023656025, 99.9799999999996],
    [6.7215023656025, 99.9800000000005],
    [6.7215023656025, 99.9799999999996],
    [6.7215023656025, 99.9800000000005],
    [6.7215023656025, 99.9799999999996],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.7215023656025, 99.98],
    [6.72146824486424, 99.98],
    [6.7214339526305, 99.98],
    [6.72139966039677, 99.98],
    [6.72136536816304, 99.9799999999998],
    [6.72133107592931, 99.98],
    [6.72129678369557, 99.98],
    [6.72126249146184, 99.98],
    [6.72122819922811, 99.98],
    [6.72119390699438, 99.98],
    [6.72115961476064, 99.98],
    [6.72112532252691, 99.98],
    [6.72109103029318, 99.98],
    [6.72105673805945, 99.98],
    [6.72102244582572, 99.9799999999999],
    [6.72098815359198, 99.98],
    [6.72095386135825, 99.98],
    [6.72091956912452, 99.98],
    [6.72088527689079, 99.98],
    [6.72085098465705, 99.98],
    [6.72081669242332, 99.98],
    [6.72078240018959, 99.98],
    [6.72074810795586, 99.98],
    [6.72068553019765, 99.98],
    [6.72059357102393, 99.98],
    [6.72049539996237, 1]
  ]
}
```

{% endtab %}

{% tab title="400" %}

```json
{"error":"DB not found chainId 80092"}
```

{% endtab %}
{% endtabs %}
