Skip to main content

DeFi Protocols

Get comprehensive data on DeFi protocols including TVL, rankings, and categories.

Try it Live

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

Endpointsโ€‹

EndpointDescriptionPrice
GET /api/defi/protocolsAll protocols$0.01
GET /api/defi/protocol/{slug}Single protocol$0.01
GET /api/defi/top-protocolsTop by TVL$0.01

GET /api/defi/protocolsโ€‹

List all DeFi protocols with TVL and rankings.

Requestโ€‹

curl https://api.web3identity.com/api/defi/protocols

Query Parametersโ€‹

ParameterTypeDefaultDescription
categorystring-Filter by category (dex, lending, etc.)
chainstring-Filter by chain
minTvlnumber-Minimum TVL filter
limitnumber100Max results

Responseโ€‹

{
"protocols": [
{
"id": "aave",
"name": "Aave",
"slug": "aave",
"category": "Lending",
"chains": ["ethereum", "polygon", "arbitrum", "optimism", "avalanche"],
"tvl": 12456789012,
"tvlChange24h": 2.3,
"tvlChange7d": -1.2,
"logo": "https://icons.llama.fi/aave.png",
"url": "https://aave.com",
"description": "Decentralized lending protocol"
},
{
"id": "uniswap",
"name": "Uniswap",
"slug": "uniswap",
"category": "DEX",
"chains": ["ethereum", "polygon", "arbitrum", "optimism", "base"],
"tvl": 5678901234,
"tvlChange24h": 1.5,
"tvlChange7d": 3.8,
"logo": "https://icons.llama.fi/uniswap.png",
"url": "https://uniswap.org"
},
{
"id": "lido",
"name": "Lido",
"slug": "lido",
"category": "Liquid Staking",
"chains": ["ethereum", "polygon", "solana"],
"tvl": 34567890123,
"tvlChange24h": 0.8,
"tvlChange7d": 2.1,
"logo": "https://icons.llama.fi/lido.png",
"url": "https://lido.fi"
}
],
"total": 3
}

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

Get detailed data for a single protocol.

Requestโ€‹

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

Responseโ€‹

{
"id": "aave",
"name": "Aave",
"slug": "aave",
"category": "Lending",
"chains": ["ethereum", "polygon", "arbitrum", "optimism", "avalanche"],
"tvl": 12456789012,
"tvlChange24h": 2.3,
"tvlChange7d": -1.2,
"tvlChange30d": 5.6,
"logo": "https://icons.llama.fi/aave.png",
"url": "https://aave.com",
"twitter": "aaveaave",
"description": "Decentralized non-custodial liquidity protocol",
"chainTvls": {
"ethereum": 8901234567,
"polygon": 1234567890,
"arbitrum": 987654321,
"optimism": 876543210,
"avalanche": 456789024
},
"tokens": [
{
"name": "AAVE",
"symbol": "AAVE",
"address": "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
"price": 156.78
}
],
"metrics": {
"totalBorrowed": 4567890123,
"totalSupplied": 12456789012,
"activeUsers24h": 15678,
"transactions24h": 45678
}
}

GET /api/defi/top-protocolsโ€‹

Get top protocols ranked by TVL.

Requestโ€‹

curl "https://api.web3identity.com/api/defi/top-protocols?limit=10"

Query Parametersโ€‹

ParameterTypeDefaultDescription
limitnumber25Number of protocols
categorystring-Filter by category

Responseโ€‹

{
"protocols": [
{
"rank": 1,
"name": "Lido",
"slug": "lido",
"category": "Liquid Staking",
"tvl": 34567890123,
"tvlChange24h": 0.8,
"chains": ["ethereum", "polygon"]
},
{
"rank": 2,
"name": "MakerDAO",
"slug": "makerdao",
"category": "CDP",
"tvl": 15678901234,
"tvlChange24h": -0.5,
"chains": ["ethereum"]
},
{
"rank": 3,
"name": "Aave",
"slug": "aave",
"category": "Lending",
"tvl": 12456789012,
"tvlChange24h": 2.3,
"chains": ["ethereum", "polygon", "arbitrum", "optimism"]
}
],
"timestamp": "2026-02-08T16:30:00Z"
}

Protocol Categoriesโ€‹

CategoryDescriptionExamples
DEXDecentralized exchangesUniswap, Curve, Balancer
LendingLending/borrowingAave, Compound
Liquid StakingLiquid staking derivativesLido, Rocket Pool
CDPCollateralized debt positionsMakerDAO
YieldYield aggregatorsYearn Finance
BridgeCross-chain bridgesStargate, Synapse
DerivativesDerivatives tradingdYdX, GMX

SDK Examplesโ€‹

JavaScriptโ€‹

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

const client = new Web3IdentityClient();

// Get all protocols
const protocols = await client.getProtocols({
category: 'Lending',
minTvl: 1000000000 // $1B+
});

console.log(`Found ${protocols.total} lending protocols`);

// Get specific protocol
const aave = await client.getProtocol('aave');
console.log(`Aave TVL: $${(aave.tvl / 1e9).toFixed(2)}B`);
console.log(`Chains: ${aave.chains.join(', ')}`);

// Get top protocols
const top10 = await client.getTopProtocols({ limit: 10 });
top10.protocols.forEach((p, i) => {
console.log(`${i + 1}. ${p.name}: $${(p.tvl / 1e9).toFixed(2)}B`);
});

Pythonโ€‹

from web3identity import Client

client = Client()

# Get all protocols
protocols = client.get_protocols(category='Lending')
print(f"Found {len(protocols['protocols'])} lending protocols")

# Get specific protocol
aave = client.get_protocol('aave')
print(f"Aave TVL: ${aave['tvl'] / 1e9:.2f}B")

# Get top protocols
top10 = client.get_top_protocols(limit=10)
for i, protocol in enumerate(top10['protocols'], 1):
print(f"{i}. {protocol['name']}: ${protocol['tvl'] / 1e9:.2f}B")

cURL Examplesโ€‹

# Get all protocols
curl https://api.web3identity.com/api/defi/protocols

# Filter by category
curl "https://api.web3identity.com/api/defi/protocols?category=Lending"

# Filter by chain
curl "https://api.web3identity.com/api/defi/protocols?chain=arbitrum"

# Get specific protocol
curl https://api.web3identity.com/api/defi/protocol/aave

# Get top protocols
curl "https://api.web3identity.com/api/defi/top-protocols?limit=25"

Rate Limitsโ€‹

TierRate LimitNotes
Free100 requests/dayNo payment required
PaidUnlimited$0.01 per call via x402

Common Use Casesโ€‹

TVL Dashboardโ€‹

// Build a TVL ranking dashboard
const top25 = await client.getTopProtocols({ limit: 25 });

const dashboard = top25.protocols.map(p => ({
name: p.name,
tvl: `$${(p.tvl / 1e9).toFixed(2)}B`,
change24h: `${p.tvlChange24h > 0 ? '+' : ''}${p.tvlChange24h.toFixed(2)}%`,
category: p.category
}));

Multi-Chain Analysisโ€‹

// Analyze protocol across chains
const protocol = await client.getProtocol('aave');

const chainBreakdown = Object.entries(protocol.chainTvls)
.map(([chain, tvl]) => ({
chain,
tvl: `$${(tvl / 1e9).toFixed(2)}B`,
percentage: ((tvl / protocol.tvl) * 100).toFixed(1) + '%'
}))
.sort((a, b) => b.tvl - a.tvl);