> ## Documentation Index
> Fetch the complete documentation index at: https://docs.asksurf.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Lending & Staking

> Protocol-level daily activity aggregates for lending and staking protocols.

**2 tables** in this category.

## Tables

| View Name                      | Database | Source                   | ORDER BY |
| ------------------------------ | -------- | ------------------------ | -------- |
| `agent.ethereum_lending_daily` | `agent`  | `lending_ethereum.daily` | `—`      |
| `agent.ethereum_staking_daily` | `agent`  | `staking_ethereum.daily` | `—`      |

## Related Tables

* `agent.ethereum_fees_daily`
* `agent.ethereum_prices_day`
* `agent.ethereum_tvl_daily`
* `agent.ethereum_yields_daily`

## Table Schemas

### `agent.ethereum_lending_daily`

Protocol-level daily lending activity metrics aligned with DefiLlama format. One row per (project, version, block\_date). Covers deposits, withdrawals, borrows, repayments, and liquidations with USD volumes and participant counts. Sources from 15+ lending protocols (Aave v1/v2/v3, Compound, Morpho, Spark, etc.).

<Tip>
  * deposit\_volume\_usd and borrow\_volume\_usd are daily FLOW (activity), not outstanding STOCK
  * For net deposits: deposit\_volume\_usd - withdraw\_volume\_usd
  * liquidation\_volume\_usd combines supply-side + borrow-side liquidation amounts
  * active\_depositors and active\_borrowers are daily unique counts (not cumulative)
  * Cross-reference with tvl\_daily for utilization analysis
</Tip>

<Warning>
  * Activity metrics only — for outstanding balances, use TVL tables
  * USD pricing via CoinGecko — same coverage gaps as other USD-denominated tables
  * Not all lending protocols are covered — new or niche protocols may be missing
</Warning>

### `agent.ethereum_staking_daily`

Ethereum beacon chain staking flows by entity, aggregated daily. One row per (entity, entity\_category, block\_date). Tracks deposits, withdrawals (full + partial), net flow in both ETH and USD. Entity attribution maps validators to staking providers (Lido, Coinbase, Rocket Pool, etc.).

<Tip>
  * entity is the staking provider name (e.g., 'Lido', 'Coinbase', 'Rocket Pool')
  * entity\_category groups providers (e.g., 'liquid\_staking', 'cex', 'solo', 'staking\_pool')
  * net\_flow\_eth = deposits\_eth - withdrawals\_eth (positive = net staking inflow)
  * USD values use WETH price from CoinGecko — null on days with missing ETH price
</Tip>

<Warning>
  * Entity attribution is best-effort — some validators are unattributed ('unknown')
  * Does not include consensus rewards, only deposit/withdrawal flows
  * Partial withdrawals (skimming) and full withdrawals are combined in withdrawals\_eth
</Warning>
