# Total Value Locked (TVL)

## What is this endpoint for?

This endpoint receives information on the Total Value Locked (TVL) of all DeFi protocols covered by Kaiko.

### Endpoint

{% code overflow="wrap" %}

```http
https://us.market-api.kaiko.io/v2/data/tvl/
```

{% endcode %}

### Parameters

<table><thead><tr><th>Parameter</th><th width="104">Required</th><th width="318">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>protocol</code></td><td>No</td><td>The desired protocol <code>code</code>.<br><br>If not specified, the endpoint will return the list of all protocol codes.</td><td><code>aave</code></td></tr><tr><td><code>start_date</code></td><td>No</td><td>Starting date in YYYYMMDD (inclusive).</td><td><code>20230125</code></td></tr><tr><td><code>end_date</code></td><td>No</td><td>Ending date in YYYYMMDD (exclusive).</td><td><code>20230126</code></td></tr><tr><td><code>start_time</code></td><td>No</td><td>Starting time in ISO 8601 (inclusive)<br>Hours will be ignored.</td><td><code>2023-01-25T00:00:00.00</code></td></tr><tr><td><code>end_time</code></td><td>No</td><td>Ending time in ISO 8601 (exclusive)<br>Hours will be ignored.</td><td><code>2023-01-26T00:00:00.00</code></td></tr><tr><td><code>page_size</code></td><td>No</td><td><p>See <a data-mention href="/pages/mP3amLsYqKTsrRBoblxX">/pages/mP3amLsYqKTsrRBoblxX</a><br><br>Minimum: <code>1</code><br>Maximum: <code>1000</code></p><p>Default: <code>1000</code></p></td><td><code>100</code></td></tr><tr><td><code>sort</code></td><td>No</td><td>If <code>asc</code>, sort time-series in ascending. If desc, sort time-series in descending.<br><br>Default: <code>desc</code></td><td><code>asc</code></td></tr></tbody></table>

### Fields

<table><thead><tr><th width="137">Field</th><th width="228">Description</th><th>Example</th></tr></thead><tbody><tr><td><code>timestamp</code></td><td>Timestamp at which the interval begins.</td><td><code>1763856000</code></td></tr><tr><td><code>protocol_name</code></td><td>Protocol name.</td><td><code>Aave</code></td></tr><tr><td><code>protocol_code</code></td><td>Protocol code.</td><td><code>aave</code></td></tr><tr><td><code>tvl</code></td><td>Total value locked (TVL) in USD.</td><td><code>5.04046e+10</code></td></tr></tbody></table>

### Request examples

{% tabs %}
{% tab title="cURL" %}
{% code overflow="wrap" %}

```url
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/tvl?start_date=20251001&protocol=aave'
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code overflow="wrap" %}

```python
import http.client
import json

# Enter your Kaiko API Key
api_key = "KAIKO_API_KEY"
api_host = "us.market-api.kaiko.io"
api_base_endpoint = "/v2/data/tvl"
# Start of mandatory parameter configuration
mandatory_params = {

}
# End of mandatory parameter configuration
# Start of optional parameter configuration
optional_params = {
    'start_date':'20251001',
    'page_size':100,
    'sort':'desc',
    'protocol':'aave'
}
# End of optional parameter configuration
conn = http.client.HTTPSConnection(api_host)
headers = {
    "X-Api-Key": api_key,
    "Accept": "application/json"
}

all_params = {**mandatory_params, **optional_params}

url_params = []
for param, value in all_params.items():
    url_params.append(f"{param}={value}")
url_params = '&'.join(url_params)

endpoint_with_params = f"{api_base_endpoint}?{url_params}"

# Pagination for next pages
all_data = []
next_url = endpoint_with_params
while next_url:
    conn.request("GET", next_url, headers=headers)
    response = conn.getresponse()
    data = json.loads(response.read().decode("utf-8"))
    all_data.extend(data.get("data", []))
    print(f"Fetched {len(data.get('data', []))} datapoints. Total: {len(all_data)}")
    next_url = data.get("next_url", "").replace("https://us.market-api.kaiko.io", "")
    if not next_url:
        break
conn.close()
print(f" datapoints fetched: {(all_data)}")
```

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

### Response example

{% code overflow="wrap" %}

```json
{
    "query":
    {
        "protocol": "aave",
        "start_date": "seconds:1759276800",
        "end_date": "seconds:1764028800",
        "sort": "desc",
        "page_size": "1"
    },
    "time": "2025-11-25T10:20:15.37953193Z",
    "timestamp": 1764066015,
    "data":
    [
        {
            "timestamp": 1763856000,
            "protocol_name": "Aave",
            "protocol_code": "aave",
            "tvl": 50404639283.57133
        },
        /** Results **/
    ],
    "continuation_token": "xxx",
    "next_url": "https://eu.market-api.kaiko.io/v2/data/tvl?continuation_token=xxx"
}

```

{% endcode %}


---

# 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/rest-api/monitoring-solutions/kaiko-market-explorer/total-value-locked-tvl.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.
