# Subscribe

## What is this endpoint for? <a href="#what-is-this-endpoint-for" id="what-is-this-endpoint-for"></a>

Monitor the overall performance of specific buckets of assets. The indices combine several data sources to summarize market performance. They can be used to aid the issuance of derivatives contracts or investment vehicles by providing pricing for settlement. You can see our full list of indices [here](https://www.kaiko.com/products/rates-and-indices/indices) and learn more about their performance in our [factsheet](https://backoffice.kaiko.com/wp-content/uploads/sites/1/2024/02/blue_chip_23q4.pdf).&#x20;

### Endpoints

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

```url
gateway-v0-grpc.kaiko.ovh
```

{% endtab %}

{% tab title="http" %}

```url
gateway-v0-http.kaiko.ovh
```

{% endtab %}

{% tab title="API (testing)" %}
{% code overflow="wrap" %}

```url
https://gateway-v0-http.kaiko.ovh/api/stream/index_multi_assets_v1
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Request parameters

<table><thead><tr><th width="184">Parameter</th><th width="400">Description</th><th>Examples</th></tr></thead><tbody><tr><td><code>index_code</code></td><td>The Indices ticker. <br><br>You can find a full list of our tickers <a href="https://www.kaiko.com/products/rates-and-indices/kaiko-digital-asset-rates">here</a>. </td><td><code>KT5</code></td></tr></tbody></table>

{% hint style="info" %}
**Requesting multiple tickers at the same time**\
\
To configure multiple tickers in the same stream, provide the  `indexCode` as a comma-separated list eg `KT5,KT10NYC`\
\
Alternatively, use a wildcard by entering a `*` and you'll receive all tickers you have as part of your Kaiko subscription.
{% endhint %}

### Response fields

<table><thead><tr><th width="223">Field</th><th width="537">Description</th></tr></thead><tbody><tr><td><code>indexCode</code></td><td>The ticker identifying the index.</td></tr><tr><td><code>commodity</code></td><td>The type of publication. Either real-time or fixings</td></tr><tr><td><code>interval</code></td><td>The time period in which transaction data are considered for the calculation of the index. If an index's calculation methodology has an interval of 15 seconds, <code>startTime</code> and <code>endTime</code> will be separated by <code>15s</code>.</td></tr><tr><td><code>mainQuote</code></td><td>is the quote asset used for the index denomination.</td></tr><tr><td><code>compositions</code></td><td>The list of underlying data used to calculate the index price.</td></tr><tr><td><ul><li><mark style="color:blue;"><code>underlyingInstrument</code></mark></li></ul></td><td>The ticker for the Kaiko Reference Rate(s) used to calculate the multi-asset index.</td></tr><tr><td><ul><li><mark style="color:blue;"><code>base</code></mark></li></ul></td><td>The base asset for the used Reference Rate.</td></tr><tr><td><ul><li><mark style="color:blue;"><code>quote</code></mark></li></ul></td><td>The quote asset for the used Reference Rate</td></tr><tr><td><ul><li><mark style="color:blue;"><code>Exchanges</code></mark></li></ul></td><td>The exchanges used to calculate the Reference Rate.</td></tr><tr><td><ul><li><mark style="color:blue;"><code>insturmentInterval</code></mark></li></ul></td><td>The <code>startTime</code> and <code>endTime</code> of the calculation period for the specific Reference Rate.</td></tr><tr><td><ul><li><mark style="color:blue;"><code>tsEvent</code></mark></li></ul></td><td>The time the rate was published by Kaiko.</td></tr><tr><td><code>price</code></td><td>Information on the pricing for the index.</td></tr><tr><td><ul><li><mark style="color:blue;"><code>indexValue</code></mark></li></ul></td><td>The value for the index publication.</td></tr><tr><td><code>pairs</code></td><td>The pricing details of the underlying Kaiko Reference Rates used in the calculation.</td></tr><tr><td><ul><li><mark style="color:blue;"><code>underlyingPrice</code></mark></li></ul></td><td>The published price of the Reference Rate.</td></tr><tr><td><ul><li><mark style="color:blue;"><code>weightingFactor</code></mark></li></ul></td><td>The weighting of the Reference Rate to the index.</td></tr><tr><td><ul><li><mark style="color:blue;"><code>cappingFactor</code></mark></li></ul></td><td>The capping of the Reference Rate to the index.</td></tr><tr><td><ul><li><mark style="color:blue;"><code>currencyConversionFactor</code></mark></li></ul></td><td>The conversion factor used in the Reference Rate for the index.</td></tr><tr><td><code>tsEvent</code></td><td>The theoretical time of price publication</td></tr><tr><td><code>tsCompute</code></td><td>The exact time of price computation.</td></tr></tbody></table>

## Request examples

{% tabs %}
{% tab title="Python" %}
{% @github-files/github-code-block url="<https://github.com/kaikodata/kaiko-sdk-examples/blob/master/python/code-example/index_multi_asset.py>" visible="false" %}
{% endtab %}

{% tab title="Python (Replay)" %}
**This example demonstrates how to request historical data using replay. The maximum amount of data you can request for one replay cannot exceed a total of 24 hours in `hours`, `seconds`, and `minutes`.** \
\
**Replay data is available on a 72-hour rolling basis and should only be used to retrieve missed data. If full history is required, please use Rest API or CSV deployment methods.**

{% @github-files/github-code-block url="<https://github.com/kaikodata/kaiko-sdk-examples/blob/master/python/code-example/index_multi_asset_replay.py>" visible="false" %}
{% endtab %}

{% tab title="cURL" %}
**cURL requests are intended for testing purposes only.**

{% code overflow="wrap" %}

```url
curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/index_multi_assets_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{\"indexCode\": \"KT5\"}"
```

{% endcode %}
{% endtab %}

{% tab title="Other examples" %}
For more advanced users, you can access our full SDK [here](https://github.com/kaikodata/kaiko-sdk-examples/tree/master), where you'll find more coding languages, examples and guidance.
{% endtab %}
{% endtabs %}

## Response Example

```json
{
  "commodity": "SIC_REAL_TIME",
  "indexCode": "KT5",
  "interval": {
    "startTime": "2024-08-12T14:23:55Z",
    "endTime": "2024-08-12T14:29:00Z"
  },
  "mainQuote": "usd",
  "compositions": [
    {
      "underlyingInstrument": "KK_RFR_AVAXUSD",
      "base": "avax",
      "quote": "usd",
      "exchanges": [
        "bfnx",
        "cbse",
        "krkn",
        "stmp"
      ],
      "instrumentInterval": {
        "startTime": "2024-08-12T14:23:55Z",
        "endTime": "2024-08-12T14:28:55Z"
      },
      "currencyConversion": "none",
      "tsEvent": "2024-08-12T14:28:56.074863348Z"
    },
    {
      "underlyingInstrument": "KK_RFR_BTCUSD",
      "base": "btc",
      "quote": "usd",
      "exchanges": [
        "bfnx",
        "cbse",
        "krkn",
        "lmax",
        "stmp"
      ],
      "instrumentInterval": {
        "startTime": "2024-08-12T14:24:00Z",
        "endTime": "2024-08-12T14:29:00Z"
      },
      "currencyConversion": "none",
      "tsEvent": "2024-08-12T14:29:01.087284434Z"
    },
    {
      "underlyingInstrument": "KK_RFR_ETHUSD",
      "base": "eth",
      "quote": "usd",
      "exchanges": [
        "bfnx",
        "cbse",
        "krkn",
        "lmax",
        "stmp"
      ],
      "instrumentInterval": {
        "startTime": "2024-08-12T14:23:55Z",
        "endTime": "2024-08-12T14:28:55Z"
      },
      "currencyConversion": "none",
      "tsEvent": "2024-08-12T14:28:56.142347541Z"
    },
    {
      "underlyingInstrument": "KK_RFR_SOLUSD",
      "base": "sol",
      "quote": "usd",
      "exchanges": [
        "bfnx",
        "cbse",
        "gmni",
        "krkn",
        "stmp"
      ],
      "instrumentInterval": {
        "startTime": "2024-08-12T14:24:00Z",
        "endTime": "2024-08-12T14:29:00Z"
      },
      "currencyConversion": "none",
      "tsEvent": "2024-08-12T14:29:00.784958075Z"
    },
    {
      "underlyingInstrument": "KK_RFR_XRPUSD",
      "base": "xrp",
      "quote": "usd",
      "exchanges": [
        "cbse",
        "indr",
        "krkn",
        "lmax",
        "stmp"
      ],
      "instrumentInterval": {
        "startTime": "2024-08-12T14:23:55Z",
        "endTime": "2024-08-12T14:28:55Z"
      },
      "currencyConversion": "none",
      "tsEvent": "2024-08-12T14:28:55.988918370Z"
    }
  ],
  "price": {
    "indexValue": 334.99947165068875,
    "divisor": 26979870988.68237,
    "pairs": [
      {
        "underlyingInstrument": "KK_RFR_AVAXUSD",
        "underlyingPrice": 21.333163636363636,
        "weightingFactor": 17278580619.32558,
        "cappingFactor": 1.0,
        "currencyConversionFactor": 1.0
      },
      {
        "underlyingInstrument": "KK_RFR_BTCUSD",
        "underlyingPrice": 59699.73163636363,
        "weightingFactor": 390312772.9127332,
        "cappingFactor": 0.119856816159272,
        "currencyConversionFactor": 1.0
      },
      {
        "underlyingInstrument": "KK_RFR_ETHUSD",
        "underlyingPrice": 2680.1494545454543,
        "weightingFactor": 2288124768.3108406,
        "cappingFactor": 0.373375636405882,
        "currencyConversionFactor": 1.0
      },
      {
        "underlyingInstrument": "KK_RFR_SOLUSD",
        "underlyingPrice": 147.37236363636362,
        "weightingFactor": 17542805404.323048,
        "cappingFactor": 1.0,
        "currencyConversionFactor": 1.0
      },
      {
        "underlyingInstrument": "KK_RFR_XRPUSD",
        "underlyingPrice": 0.5706330909090909,
        "weightingFactor": 1755466226611.777,
        "cappingFactor": 1.0,
        "currencyConversionFactor": 1.0
      }
    ]
  },
  "tsEvent": "2024-08-12T14:29:00Z",
  "tsCompute": "2024-08-12T14:29:05.210675561Z"
}
```
