# Valour - CDF Index

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

This endpoint is a customized index made specifically for Valour, a Kaiko Indices client. It's designed to serve as an underlying price feed for leveraged financial instruments. The price is calculated by measuring the performance of live futures contracts with a constant time to expiry to effectively reflect a price, mitigating the volatility caused by rollovers.

{% hint style="info" %}
You can find out more about our Customized Indices [here](https://www.kaiko.com/indices/customized-indices).
{% endhint %}

## 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/constant_duration_indices_v1
```

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

## Parameters

<table><thead><tr><th width="184">Parameter</th><th width="369.8125">Description</th><th>Examples</th></tr></thead><tbody><tr><td><code>index_code</code></td><td>The Kaiko CDF Index tickers</td><td><p><code>KAIKO_CDF_BTCUSDT</code></p><p>See the methodology for a full list of tickers.</p></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 `KAIKO_CDF_BTCUSDT,KAIKO_CDF_ETHUSDT`\
Alternatively, use a wildcard by entering a `*` and you'll receive all tickers you have as part of you Kaiko subscription.
{% endhint %}

## Fields

<table><thead><tr><th width="236.16015625">Field</th><th width="425.2421875">Description</th></tr></thead><tbody><tr><td><code>commodity</code></td><td>The type of publication. Either real-time or fixings</td></tr><tr><td><code>indexCode</code></td><td>The ticker identifying the rate.</td></tr><tr><td><code>base</code></td><td>Base asset of futures</td></tr><tr><td><code>quote</code></td><td>Quote asset of futures</td></tr><tr><td><code>computedCdf</code></td><td>Price of CDF index</td></tr><tr><td><code>exchange</code></td><td>The exchange code for underlying futures trade. Please find <a href="https://instruments.kaiko.com/#/exchanges">instrument explorer</a> for a full name of exchange.</td></tr><tr><td><code>frontFuture</code></td><td>A nested object containing:</td></tr><tr><td><ul><li><mark style="color:blue;"><code>symbol</code></mark></li></ul></td><td>Instrument code of front future. Please find <a href="https://instruments.kaiko.com/#/instruments">instrument explorer</a> for detailed information.</td></tr><tr><td><ul><li><mark style="color:blue;"><code>price</code></mark></li></ul></td><td>1-min VWAP of front future (Relevant doc of VWAP can be found <a href="https://docs.kaiko.com/kaiko-rest-api/data-feeds/level-1-and-level-2-data/level-1-aggregations/trade-count-ohlcv-and-vwap/vwap-only">here</a>.) If it's not available, last traded price</td></tr><tr><td><ul><li><mark style="color:blue;"><code>expiry</code></mark></li></ul></td><td>The timestamp of expiration of front future</td></tr><tr><td><ul><li><mark style="color:blue;"><code>timestamp</code></mark></li></ul></td><td>The timestamp of the price of front future.<br>If price is 1-min VWAP, <code>endTime</code> of the calculation<br>if price is from the last trade, the timestamp of the trade</td></tr><tr><td><ul><li><mark style="color:blue;"><code>weight</code></mark></li></ul></td><td>Applied weight to the price of front future</td></tr><tr><td><code>backFuture</code></td><td>A nested object containing:</td></tr><tr><td><ul><li><mark style="color:blue;"><code>symbol</code></mark></li></ul></td><td>Instrument code of back future. Please find <a href="https://instruments.kaiko.com/#/instruments">instrument explorer</a> for detailed information.</td></tr><tr><td><ul><li><mark style="color:blue;"><code>price</code></mark></li></ul></td><td>1-min VWAP of back future (Relevant doc of VWAP can be found <a href="https://docs.kaiko.com/kaiko-rest-api/data-feeds/level-1-and-level-2-data/level-1-aggregations/trade-count-ohlcv-and-vwap/vwap-only">here</a>.) If it's not available, last traded price</td></tr><tr><td><ul><li><mark style="color:blue;"><code>expiry</code></mark></li></ul></td><td>The timestamp of expiration of back future</td></tr><tr><td><ul><li><mark style="color:blue;"><code>timestamp</code></mark></li></ul></td><td>The timestamp of the price of back future.<br>If price is 1-min VWAP, <code>endTime</code> of the calculation<br>if price is from the last trade, the timestamp of the trade</td></tr><tr><td><ul><li><mark style="color:blue;"><code>weight</code></mark></li></ul></td><td>Applied weight to the price of back future</td></tr><tr><td><code>constantDuration</code></td><td>Constant Duration</td></tr><tr><td><code>status</code></td><td><p>Status of the publication<br><code>CDF_SUCCESS</code> : Calculation succeeded</p><p><code>CDF_NO_FUTURE</code> : Cannot find the relevant front or back future</p><p><code>CDF_NO_PRICE</code> : Futures are available but prices are not available</p></td></tr><tr><td><code>rateQuoteConversion</code></td><td>A nested object containing:</td></tr><tr><td><ul><li><mark style="color:blue;"><code>index</code></mark></li></ul></td><td>Kaiko Reference Rate that is used to convert the currency. Detailed methodology of Kaiko Reference rate can be found <a href="https://25446524.fs1.hubspotusercontent-eu1.net/hubfs/25446524/Factsheets/Kaiko%20Benchmark%20Rates%20Rulebook%20-%20202212%20(1).pdf">here</a></td></tr><tr><td><ul><li><mark style="color:blue;"><code>value</code></mark></li></ul></td><td>Price of <code>rateQuoteConversion</code> / <code>index</code></td></tr><tr><td><ul><li><mark style="color:blue;"><code>timestamp</code></mark></li></ul></td><td>Timestamp of <code>rateQuoteConversion</code> / <code>index</code></td></tr><tr><td><code>interval_startTime</code></td><td>The start time for the interval.</td></tr><tr><td><code>interval_endTime</code></td><td>The end time for the interval.</td></tr><tr><td><code>tsEvent</code></td><td>The exact time of the publication.</td></tr></tbody></table>

## Request examples

{% tabs %}
{% tab title="Python" %}
**Make sure to read our** [**Python quick-start guide**](broken://pages/vCciDqbvlaVg9L8IGTOq) **before starting.**

{% code overflow="wrap" %}

```python
 # This is a code example. Configure your parameters below #

from __future__ import print_function
from datetime import datetime, timedelta
import logging
import os
from google.protobuf.timestamp_pb2 import Timestamp
import grpc
from google.protobuf.json_format import MessageToJson
from kaikosdk import sdk_pb2_grpc
from kaikosdk.stream.constant_duration_indices_v1 import request_pb2 as pb_constant_duration_indices

def constant_duration_indices_v1_request(channel: grpc.Channel):
    try:
        with channel:
            stub = sdk_pb2_grpc.StreamConstantDurationIndicesServiceV1Stub(channel)

            responses = stub.Subscribe(pb_constant_duration_indices.StreamConstantDurationIndicesServiceRequestV1(
                index_code = "KAIKO_CDF_BTCUSDT"
            ))
            for response in responses:
                print("Received message %s" % (MessageToJson(response, including_default_value_fields = True)))
    except grpc.RpcError as e:
        print(e.details(), e.code())

def run():
    credentials = grpc.ssl_channel_credentials(root_certificates=None)
    call_credentials = grpc.access_token_call_credentials(os.environ['KAIKO_API_KEY'])
    composite_credentials = grpc.composite_channel_credentials(credentials, call_credentials)
    channel = grpc.secure_channel('gateway-v0-grpc.kaiko.ovh', composite_credentials)
    constant_duration_indices_v1_request(channel)

if __name__ == '__main__':
    logging.basicConfig()
    run()
```

{% endcode %}
{% endtab %}

{% tab title="Python (Replay)" %}

```python
# This is a code example. Configure your parameters below #

from __future__ import print_function
from datetime import datetime, timedelta
import logging
import os
from google.protobuf.timestamp_pb2 import Timestamp
import grpc
from google.protobuf.json_format import MessageToJson
from kaikosdk import sdk_pb2_grpc
from kaikosdk.stream.constant_duration_indices_v1 import request_pb2 as pb_constant_duration_indices

def constant_duration_indices_v1_request(channel: grpc.Channel):
    try:
        # start of date configuration #
        start = Timestamp()
        start.FromDatetime(datetime.utcnow() - timedelta(days=2))
        end = Timestamp()
        end.FromDatetime(datetime.utcnow() - timedelta(days=1))
        # end of date configuration #
        
        stub = sdk_pb2_grpc.StreamConstantDurationIndicesServiceV1Stub(channel)

        responses = stub.Subscribe(pb_constant_duration_indices.StreamConstantDurationIndicesServiceRequestV1(
            index_code = "KAIKO_CDF_BTCUSDT",
            interval={
                'start_time': start,
                'end_time': end
            }
        ))
        for response in responses:
            print("Received message %s" % (MessageToJson(response, including_default_value_fields = True)))
    except grpc.RpcError as e:
        print(e.details(), e.code())

def run():
    credentials = grpc.ssl_channel_credentials(root_certificates=None)
    call_credentials = grpc.access_token_call_credentials(os.environ['KAIKO_API_KEY'])
    composite_credentials = grpc.composite_channel_credentials(credentials, call_credentials)
    channel = grpc.secure_channel('gateway-v0-grpc.kaiko.ovh', composite_credentials)
    constant_duration_indices_v1_request(channel)

if __name__ == '__main__':
    logging.basicConfig()
    run()
```

{% endtab %}

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

{% code overflow="wrap" %}

```
curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/constant_duration_indices_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d '{ "indexCode": "KAIKO_CDF_BTCUSDT", "interval": {"startTime": "2025-04-24T15:30:00.000Z", "endTime": "2025-04-24T15:31:00.000Z" } }'
```

{% 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
{
   "result":{
      "commodity":"SIC_REAL_TIME",
      "indexCode":"KAIKO_CDF_BTCUSDT",
      "composition":{
         "base":"btc",
         "quote":"usdt",
         "data":[
            {
               "computedCdf":95024.52103689784,
               "exchange":"binc",
               "frontFuture":{
                  "symbol":"btcusdt_250627",
                  "price":94481.42295081966,
                  "expiry":"2025-06-27T08:00:00Z",
                  "timestamp":"2025-04-25T09:31:00Z",
                  "weight":0.6813186813186813
               },
               "backFuture":{
                  "symbol":"btcusdt_250926",
                  "price":96096.2,
                  "expiry":"2025-09-26T08:00:00Z",
                  "timestamp":"2025-04-25T09:29:41.131Z",
                  "weight":0.31868131868131866
               },
               "constantDuration":91,
               "status":"CDF_SUCCESS",
               "rateQuoteConversion":{
                  "index":"KK_RFR_USDTUSD",
                  "value":1.0003,
                  "timestamp":"2025-04-25T09:31:00Z"
               }
            }
         ]
      },
      "startTime":"2025-04-25T09:30:00Z",
      "endTime":"2025-04-25T09:31:00Z",
      "tsEvent":"2025-04-25T09:31:05.247126935Z"
   }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kaiko.com/kaiko-indices/customized-indices/valour-cdf-index.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
