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
https://us.market-api.kaiko.io/v2/data/tvl/Parameters
Parameter
Required
Description
Example
protocol
No
The desired protocol code.
If not specified, the endpoint will return the list of all protocol codes.
aave
start_date
No
Starting date in YYYYMMDD (inclusive).
20230125
end_date
No
Ending date in YYYYMMDD (exclusive).
20230126
sort
No
If asc, sort time-series in ascending. If desc, sort time-series in descending.
Default: desc
asc
Fields
Field
Description
Example
timestamp
Timestamp at which the interval begins.
1763856000
protocol_name
Protocol name.
Aave
protocol_code
Protocol code.
aave
tvl
Total value locked (TVL) in USD.
5.04046e+10
Request examples
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'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)}")Response example
{
"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"
}
Last updated
Was this helpful?
