DeFi yield pool history
POST /api/defi-yield-historyDaily APY and TVL history for one DeFi yield pool (DefiLlama pool id from defi-yields): per-day total/base/reward APY and TVL, most recent `limit` days (default 90, max 3650), plus a summary (latest, min, max, mean APY and TVL change over the window). Send POST /api/defi-yield-history with the required field pool and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with source, fetchedAt, pool, totalPoints, count and 2 more.
Unknown pool ids answer 422. Keyless public data.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pool | string | yes | DefiLlama pool id (UUID) as returned by defi-yields. |
limit | number | no | Most recent days to return (default 90, max 3650). |
Example request
curl -i -X POST https://agent402.tools/api/defi-yield-history \
-H "Content-Type: application/json" \
-d '{"pool":"54e9b138-3146-4c1f-8dce-1cb948f5ef96","limit":7}'
Without payment this returns HTTP 402 Payment Required with the exact price for defi-yield-history; any x402 v2 or MPP client pays it and retries.
Example response
{
"source": "defillama-yields",
"fetchedAt": "2026-08-22T12:00:00.000Z",
"pool": "54e9b138-3146-4c1f-8dce-1cb948f5ef96",
"totalPoints": 170,
"count": 2,
"summary": {
"apy": {
"latest": 3.51,
"first": 3.9,
"min": 3.2,
"max": 3.9,
"mean": 3.6,
"changePct": -10
},
"tvlUsd": {
"latest": 546610322,
"first": 579045934,
"min": 540000000,
"max": 580000000,
"mean": 560000000,
"changePct": -5.6
}
},
"points": [
{
"date": "2026-08-21",
"tvlUsd": 548000000,
"apy": 3.6,
"apyBase": null,
"apyReward": 3.6
},
{
"date": "2026-08-22",
"tvlUsd": 546610322,
"apy": 3.51,
"apyBase": null,
"apyReward": 3.51
}
]
}
| Field | Type | Always present | In the example |
|---|---|---|---|
source | string | yes | defillama-yields |
fetchedAt | string | yes | 2026-08-22T12:00:00.000Z |
pool | string | yes | 54e9b138-3146-4c1f-8dce-1cb948f5ef96 |
totalPoints | number | yes | 170 |
count | number | yes | 2 |
summary | object | yes | 2 fields: apy, tvlUsd |
points | array of objects | yes | 2 items in the example |
From an MCP client
catalog.call {
"slug": "defi-yield-history",
"params": {
"pool": "54e9b138-3146-4c1f-8dce-1cb948f5ef96",
"limit": 7
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for defi-yield-history; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
poolis required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/defi-yield-history returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/defi-yield-history", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"pool": "54e9b138-3146-4c1f-8dce-1cb948f5ef96",
"limit": 7
}),
});
Related tools
DeFi chain TVL history
POST /api/defi-chain-tvl-historyDaily TVL history for one chain (Ethereum, Base, Solana, Arbitrum...) or for all of DeFi (chain "all") from DefiLlama's …
DeFi yield screener
POST /api/defi-yieldsScreen DeFi yield pools (lending, LP, staking, vaults) across every chain from DefiLlama's free Yields dataset: filter b…
DeFi TVL by chain
POST /api/defi-chainsBlockchains ranked by DeFi TVL from DefiLlama's free chain list: name, TVL in USD, share of total DeFi TVL, native token…
DeFi protocol profile
POST /api/defi-protocolProfile of one DeFi protocol by DefiLlama slug (aave-v3, uniswap-v3, lido, morpho-v1...): TVL rank among all protocols, …
DeFi protocols ranked by TVL
POST /api/defi-protocolsDeFi protocols ranked by current TVL from DefiLlama's free protocol list: filter by category (Lending, Dexs, Liquid Stak…
DeFi protocol TVL
POST /api/defi-tvlLook up the current Total Value Locked (TVL) for a DeFi protocol via DeFiLlama's public API. Identify the protocol by it…