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โ
| Endpoint | Description | Price |
|---|---|---|
GET /api/defi/tvl/{protocol} | Protocol TVL | $0.001 |
GET /api/defi/protocols | All protocols | $0.01 |
GET /api/defi/chains | Chain TVL | $0.01 |
GET /api/defi/yields | Yield 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โ
| Param | Type | Default | Description |
|---|---|---|---|
category | string | โ | Filter by category |
chain | string | โ | Filter by chain |
limit | number | 100 | Max results |
orderBy | string | tvl | Sort 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โ
| Param | Type | Default | Description |
|---|---|---|---|
minApy | number | 0 | Minimum APY |
minTvl | number | 0 | Minimum TVL |
chain | string | โ | 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โ
| Category | Examples |
|---|---|
dex | Uniswap, Curve, Balancer |
lending | Aave, Compound, MakerDAO |
bridge | Stargate, Hop, Across |
liquid-staking | Lido, Rocket Pool |
derivatives | GMX, dYdX |
yield | Yearn, 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.
Related Endpointsโ
- Token Prices โ Price data for DeFi tokens
- Wallet Balances โ Check DeFi positions
- Trending Tokens โ Trending DeFi tokens