Appearance
DefiLlama Data Source
DefiLlama provides macro and DeFi regime context. It is not intended to map cleanly to every Hyperliquid asset.
Use it as a broad market state layer for capital, flows, and economic activity.
What We Store
| Channel | Table | Cadence | Purpose |
|---|---|---|---|
| TVL, stablecoin supply, and base capital levels | defillama_capital_base | 1h | Macro base capital context |
| Chain, protocol, and stablecoin flow changes | defillama_capital_flows | 1h | Macro flow context |
| DEX volume, fees, revenue, and open interest | defillama_economic_throughput | 1h | Macro throughput context |
Snapshot Model
The ingestor fetches broad snapshots from the free DefiLlama APIs:
text
chains
protocols
stablecoins
dex overview
fees overview
revenue overview
open interest overview
-> compact global/chain/protocol/stablecoin rowsThe rows are stored by subject:
| Subject type | Example |
|---|---|
global | defi |
chain | Ethereum, Solana, Arbitrum |
protocol | uniswap, aave, jupiter |
stablecoin | USDC, USDT, DAI |
How We Fetch Data
Configured endpoints:
| Config | Default |
|---|---|
DEFILLAMA_API_URL | https://api.llama.fi |
DEFILLAMA_STABLECOINS_URL | https://stablecoins.llama.fi |
The ingestor uses HTTP GET requests:
| Request | Base URL | Used for |
|---|---|---|
/v2/chains | DEFILLAMA_API_URL | Chain TVL and chain-level base capital |
/protocols | DEFILLAMA_API_URL | Protocol TVL, category, chain coverage, 1d/7d changes |
/stablecoins | DEFILLAMA_STABLECOINS_URL | Stablecoin supply and chain-level stablecoin flows |
/overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyVolume | DEFILLAMA_API_URL | DEX volume |
/overview/fees?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyFees | DEFILLAMA_API_URL | Fees |
/overview/fees?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyRevenue | DEFILLAMA_API_URL | Revenue |
/overview/open-interest?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true | DEFILLAMA_API_URL | Open interest |
The worker waits DEFILLAMA_REQUEST_DELAY_MS between snapshot requests. The client has a 15-second default timeout, retries 429 and 5xx responses, and defaults to two retries.
The broad DefiLlama endpoints already return all chains, thousands of protocols, and hundreds of stablecoins in a small number of requests. Storage caps control how much of each broad snapshot is retained in hourly feature rows; they do not change the upstream request count.
Default storage caps:
| Config | Default | Applies to |
|---|---|---|
DEFILLAMA_TOP_PROTOCOL_LIMIT | 1000 | Protocol rows in capital_base and capital_flows |
DEFILLAMA_TOP_STABLECOIN_LIMIT | 300 | Stablecoin rows in capital_base and capital_flows |
DEFILLAMA_TOP_THROUGHPUT_PROTOCOL_LIMIT | 500 | Protocol rows in economic_throughput |
Fetched snapshots are compacted into:
defillama_capital_basedefillama_capital_flowsdefillama_economic_throughput
Trading Context
Trading prompts can use DefiLlama context to answer:
- Is DeFi liquidity expanding or contracting?
- Are stablecoins flowing into or out of the market?
- Are fees, revenue, DEX volume, or open interest confirming risk appetite?
- Which chains or protocols are showing unusually strong/weak activity?
This data should influence asset decisions as macro context. It should not be treated as a direct per-asset feed for every Hyperliquid symbol.
Context Resolver Behavior
When an asset has a connected DefiLlama Data Stream Block, the block should be configured with a channel and a macro scope:
globalchainprotocolstablecoin
For explicit scopes, source links should point at the configured DefiLlama subject where possible, and the decision context resolver reads only that configured subject, such as Solana, aave, or USDC.
Legacy DefiLlama Data Stream Blocks without an explicit scope still return asset-relevant macro rows from the configured lookback window:
- Global
defirows for the selected DefiLlama channel. - Chain rows when
metrics.tokenSymbolmatches the asset symbol, such asBitcoinforBTC. - Stablecoin rows when the DefiLlama stablecoin subject matches the asset symbol, such as
USDC.
The resolver filters before applying maxPoints. This prevents a broad chain/protocol snapshot from hiding older relevant rows behind unrelated rows.
Local Commands
bash
cd backend
npm run defillama:ingest
npm run defillama:ingest -- --dry-run