Yield Farming
Find the best yield farming opportunities with real-time APY data.
Try it Live
Open in Swagger UI โ to test these endpoints interactively.
Endpointsโ
| Endpoint | Description | Price |
|---|---|---|
GET /api/defi/yields | All yield pools | $0.01 |
GET /api/defi/farms | Active farms | $0.01 |
GET /api/yields/{pool} | Single pool data | $0.01 |
GET /api/defi/yieldsโ
List all yield farming opportunities across chains.
Requestโ
curl https://api.web3identity.com/api/defi/yields
Query Parametersโ
| Parameter | Type | Default | Description |
|---|---|---|---|
chain | string | - | Filter by chain |
protocol | string | - | Filter by protocol |
minTvl | number | - | Minimum TVL |
minApy | number | - | Minimum APY (%) |
sort | string | apy | Sort by: apy, tvl, apyBase |
limit | number | 100 | Max results |
Responseโ
{
"pools": [
{
"id": "aave-v3-usdc-ethereum",
"pool": "USDC",
"chain": "ethereum",
"project": "aave-v3",
"symbol": "aUSDC",
"tvlUsd": 1234567890,
"apy": 4.25,
"apyBase": 2.75,
"apyReward": 1.50,
"rewardTokens": ["AAVE"],
"underlyingTokens": ["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"],
"url": "https://app.aave.com/reserve-overview/?underlyingAsset=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48&marketName=proto_mainnet_v3"
},
{
"id": "curve-3pool-ethereum",
"pool": "3pool",
"chain": "ethereum",
"project": "curve",
"symbol": "3Crv",
"tvlUsd": 987654321,
"apy": 3.85,
"apyBase": 2.10,
"apyReward": 1.75,
"rewardTokens": ["CRV"],
"underlyingTokens": [
"0x6B175474E89094C44Da98b954EedeAC495271d0F",
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"0xdAC17F958D2ee523a2206206994597C13D831ec7"
],
"url": "https://curve.fi/#/ethereum/pools/3pool"
}
],
"total": 2,
"timestamp": "2026-02-08T16:30:00Z"
}
GET /api/defi/farmsโ
Get active yield farms with staking opportunities.
Requestโ
curl "https://api.web3identity.com/api/defi/farms?chain=arbitrum"
Responseโ
{
"farms": [
{
"id": "gmx-glp-arbitrum",
"name": "GLP",
"chain": "arbitrum",
"protocol": "gmx",
"stakingToken": "GLP",
"rewardTokens": ["ETH", "esGMX"],
"tvlUsd": 456789012,
"apy": 18.5,
"apyBase": 12.0,
"apyReward": 6.5,
"dailyRewardUsd": 15234,
"contract": "0x1aDDD80E6039594eE970E5872D247bf0414C8903",
"url": "https://app.gmx.io/#/earn"
},
{
"id": "pendle-pt-eth-arbitrum",
"name": "PT-stETH",
"chain": "arbitrum",
"protocol": "pendle",
"stakingToken": "PT-stETH-26DEC2024",
"rewardTokens": ["PENDLE", "ARB"],
"tvlUsd": 234567890,
"apy": 8.75,
"apyBase": 6.25,
"apyReward": 2.50,
"maturity": "2024-12-26T00:00:00Z",
"contract": "0x...",
"url": "https://app.pendle.finance/trade/pools"
}
],
"total": 2
}
GET /api/yields/{pool}โ
Get detailed data for a specific yield pool.
Requestโ
curl https://api.web3identity.com/api/yields/aave-v3-usdc-ethereum
Responseโ
{
"id": "aave-v3-usdc-ethereum",
"pool": "USDC",
"chain": "ethereum",
"project": "aave-v3",
"symbol": "aUSDC",
"tvlUsd": 1234567890,
"apy": 4.25,
"apyBase": 2.75,
"apyReward": 1.50,
"apyBase7d": 2.80,
"apyBase30d": 2.95,
"rewardTokens": ["AAVE"],
"underlyingTokens": [
{
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"symbol": "USDC",
"decimals": 6
}
],
"poolMeta": {
"totalSupply": 1234567890,
"totalBorrow": 456789012,
"utilizationRate": 37.0,
"ltv": 80.0,
"liquidationThreshold": 85.0
},
"url": "https://app.aave.com/reserve-overview/?underlyingAsset=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48&marketName=proto_mainnet_v3",
"history": {
"apy7d": [4.20, 4.25, 4.30, 4.22, 4.28, 4.25, 4.25],
"tvl7d": [1200000000, 1210000000, 1220000000, 1215000000, 1230000000, 1234000000, 1234567890]
}
}
APY Breakdownโ
Understanding yield components:
| Field | Description |
|---|---|
| apy | Total APY (base + rewards) |
| apyBase | Base yield from protocol fees |
| apyReward | Additional yield from token rewards |
| apyBase7d | 7-day average base APY |
| apyBase30d | 30-day average base APY |
SDK Examplesโ
JavaScriptโ
import { Web3IdentityClient } from '@web3identity/sdk';
const client = new Web3IdentityClient();
// Find high-yield opportunities
const yields = await client.getYields({
minApy: 10,
chain: 'arbitrum',
sort: 'apy',
limit: 10
});
console.log('Top 10 yields on Arbitrum:');
yields.pools.forEach((pool, i) => {
console.log(`${i + 1}. ${pool.project} ${pool.pool}: ${pool.apy.toFixed(2)}% APY`);
console.log(` TVL: $${(pool.tvlUsd / 1e6).toFixed(2)}M`);
});
// Get farm details
const farm = await client.getFarm('gmx-glp-arbitrum');
console.log(`${farm.name} APY: ${farm.apy}%`);
console.log(`Reward tokens: ${farm.rewardTokens.join(', ')}`);
// Track pool performance
const pool = await client.getYieldPool('aave-v3-usdc-ethereum');
const avg7d = pool.history.apy7d.reduce((a, b) => a + b) / 7;
console.log(`7-day average APY: ${avg7d.toFixed(2)}%`);
Pythonโ
from web3identity import Client
client = Client()
# Find stable yields
yields = client.get_yields(
chain='ethereum',
min_apy=3.0,
min_tvl=100000000 # $100M+ TVL
)
for pool in yields['pools']:
print(f"{pool['project']} {pool['pool']}: {pool['apy']:.2f}% APY")
print(f" TVL: ${pool['tvlUsd'] / 1e6:.2f}M")
# Get specific pool
pool = client.get_yield_pool('curve-3pool-ethereum')
print(f"3pool APY: {pool['apy']:.2f}%")
print(f"Base APY: {pool['apyBase']:.2f}%")
print(f"Reward APY: {pool['apyReward']:.2f}%")
cURL Examplesโ
# Get all yields
curl https://api.web3identity.com/api/defi/yields
# Filter by chain
curl "https://api.web3identity.com/api/defi/yields?chain=arbitrum"
# High APY opportunities
curl "https://api.web3identity.com/api/defi/yields?minApy=10&sort=apy"
# Stable yields with high TVL
curl "https://api.web3identity.com/api/defi/yields?minTvl=100000000&sort=tvl"
# Get specific pool
curl https://api.web3identity.com/api/defi/yields/aave-v3-usdc-ethereum
# Get farms on Base
curl "https://api.web3identity.com/api/defi/farms?chain=base"
Rate Limitsโ
| Tier | Rate Limit | Notes |
|---|---|---|
| Free | 100 requests/day | No payment required |
| Paid | Unlimited | $0.01 per call via x402 |
Common Use Casesโ
Yield Aggregator Dashboardโ
// Build yield comparison tool
const allYields = await client.getYields({ minTvl: 10000000 });
const comparison = allYields.pools
.filter(p => p.underlyingTokens.includes(USDC_ADDRESS))
.sort((a, b) => b.apy - a.apy)
.slice(0, 10)
.map(p => ({
protocol: p.project,
pool: p.pool,
chain: p.chain,
apy: `${p.apy.toFixed(2)}%`,
tvl: `$${(p.tvlUsd / 1e6).toFixed(1)}M`
}));
Risk-Adjusted Yield Rankingโ
// Filter for safe, stable yields
const stableYields = await client.getYields({
minTvl: 50000000, // $50M+ TVL (more established)
minApy: 3.0, // Reasonable APY (avoid unrealistic)
sort: 'tvl' // Sort by safety proxy
});
// Prioritize base APY over rewards (more sustainable)
const safest = stableYields.pools
.filter(p => p.apyBase / p.apy > 0.7) // 70%+ is base yield
.slice(0, 5);
Related Endpointsโ
- DeFi Protocols โ Protocol data
- DeFi TVL โ Historical TVL
- Token Prices โ Underlying token prices
- Stablecoins โ Stablecoin metrics