Skip to main content

DeFi TVL

Total Value Locked (TVL) data for DeFi protocols and chains.

Try it Live

Open in Swagger UI โ†’ to test these endpoints interactively.

Endpointsโ€‹

EndpointDescriptionPrice
GET /api/defi/tvl/{protocol}Protocol TVL$0.001
GET /api/defi/protocolsAll protocols$0.01
GET /api/defi/chainsChain TVL$0.01
GET /api/defi/yieldsYield opportunities$0.01

GET /api/defi/tvl/{protocol}โ€‹

Get TVL for a specific protocol.

Requestโ€‹

curl https://api.web3identity.com/api/defi/tvl/aave

Responseโ€‹

{
"protocol": "aave",
"name": "Aave",
"tvl": 12345678901,
"tvlUSD": "$12.3B",
"change24h": 2.45,
"change7d": -1.23,
"chains": {
"ethereum": 8000000000,
"polygon": 2000000000,
"avalanche": 1500000000,
"arbitrum": 845678901
},
"category": "lending",
"url": "https://aave.com",
"twitter": "aaborrowsave"
}

SDKโ€‹

const tvl = await client.getTVL('aave');
console.log(tvl.tvlUSD); // "$12.3B"

GET /api/defi/protocolsโ€‹

List all tracked protocols.

Query Parametersโ€‹

ParamTypeDefaultDescription
categorystringโ€”Filter by category
chainstringโ€”Filter by chain
limitnumber100Max results
orderBystringtvlSort field

Requestโ€‹

curl "https://api.web3identity.com/api/defi/protocols?category=dex&limit=10"

Responseโ€‹

{
"protocols": [
{
"id": "uniswap",
"name": "Uniswap",
"tvl": 5678901234,
"category": "dex",
"chains": ["ethereum", "arbitrum", "polygon", "base"]
},
{
"id": "curve-dex",
"name": "Curve",
"tvl": 2345678901,
"category": "dex",
"chains": ["ethereum", "arbitrum", "polygon"]
}
],
"count": 10,
"total": 245
}

GET /api/defi/chainsโ€‹

TVL by blockchain.

Responseโ€‹

{
"chains": [
{
"name": "Ethereum",
"gecko_id": "ethereum",
"tvl": 45678901234,
"protocols": 523
},
{
"name": "Arbitrum",
"gecko_id": "arbitrum",
"tvl": 3456789012,
"protocols": 156
}
]
}

GET /api/defi/yieldsโ€‹

Top yield farming opportunities.

Query Parametersโ€‹

ParamTypeDefaultDescription
minApynumber0Minimum APY
minTvlnumber0Minimum TVL
chainstringโ€”Filter by chain

Responseโ€‹

{
"pools": [
{
"pool": "USDC-USDT",
"protocol": "Curve",
"chain": "ethereum",
"apy": 5.67,
"tvl": 234567890,
"apyBase": 3.45,
"apyReward": 2.22
}
],
"count": 50
}

Categoriesโ€‹

CategoryExamples
dexUniswap, Curve, Balancer
lendingAave, Compound, MakerDAO
bridgeStargate, Hop, Across
liquid-stakingLido, Rocket Pool
derivativesGMX, dYdX
yieldYearn, Convex

SDK Examplesโ€‹

JavaScriptโ€‹

import { Web3IdentityClient } from '@web3identity/sdk';

const client = new Web3IdentityClient();

// Get protocol TVL
const aave = await client.getTVL('aave');
console.log(`Aave TVL: ${aave.tvlUSD}`);

// List DeFi protocols by category
const dexes = await client.getProtocols({
category: 'dex',
orderBy: 'tvl',
limit: 10
});

// Get yield opportunities
const yields = await client.getYields({
chain: 'ethereum',
minApy: 5,
minTvl: 1000000
});

Pythonโ€‹

from web3identity import Client

client = Client()

# Get protocol TVL
aave = client.get_tvl('aave')
print(f"Aave TVL: {aave['tvlUSD']}")

# Get chain TVL
chains = client.get_chain_tvl()
for chain in chains[:5]:
print(f"{chain['name']}: ${chain['tvl']:,.0f}")

cURL Examplesโ€‹

# Get Uniswap TVL
curl https://api.web3identity.com/api/defi/tvl/uniswap

# List lending protocols
curl "https://api.web3identity.com/api/defi/protocols?category=lending"

# Get Base chain yields above 5% APY
curl "https://api.web3identity.com/api/defi/yields?chain=base&minApy=5"

Data Sourceโ€‹

All DeFi data sourced from DefiLlama โ€” the largest TVL aggregator.