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 |
|---|---|---|---|
| Capital base | defillama_capital_base | 1h | TVL, stablecoin supply, and base capital levels |
| Capital flows | defillama_capital_flows | 1h | Chain, protocol, and stablecoin flow changes |
| Economic throughput | defillama_economic_throughput | 1h | DEX volume, fees, revenue, and open interest |
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 capital base |
/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.
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 Latest Data viewer and decision context resolver 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 to those relevant subjects before applying maxPoints. This prevents a broad chain/protocol snapshot from hiding older BTC-relevant rows behind unrelated rows. Protocol rows are stored for macro summaries and future enrichment, but they are not blindly attached to every asset.
Local Commands
bash
cd services/market-backend
npm run defillama:ingest
npm run defillama:ingest -- --dry-run