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

# Metrics Daily

The `lending.metrics_daily` table contains daily aggregated metrics for lending platforms, grouped by project and protocol.

This table provides a high-level overview of lending activity across protocols, including outstanding loans, available liquidity, and total supplied amounts in USD.

### Sample Query

Finding the daily metrics for Aave across all protocol versions on Ethereum:

```sql theme={null}
select 
    date,
    project,
    protocol,
    outstanding_loans_usd,
    available_liquidity_usd,
    supplied_amount_usd
from ethereum.lending.metrics_daily
where project = 'aave'
order by date desc
```

Finding the total outstanding loans across all lending protocols on a specific date:

```sql theme={null}
select 
    date,
    sum(outstanding_loans_usd) as total_outstanding_loans_usd,
    sum(available_liquidity_usd) as total_available_liquidity_usd,
    sum(supplied_amount_usd) as total_supplied_usd
from ethereum.lending.metrics_daily
where date = '2026-01-13'
group by date
```

### Table Columns

Unique Key: `unique_id`

| Column                    | Data Type         | Description                                                            |
| ------------------------- | ----------------- | ---------------------------------------------------------------------- |
| date                      | DATE              | Date of the metrics snapshot                                           |
| project                   | VARCHAR           | Name of the lending project (e.g., aave, compound, morpho\_blue)       |
| protocol                  | VARCHAR           | Underlying protocol version (e.g., aave\_v1, compound\_v2)             |
| outstanding\_loans\_usd   | FLOAT             | Total value of outstanding loans in USD                                |
| available\_liquidity\_usd | FLOAT             | Total available liquidity in USD                                       |
| supplied\_amount\_usd     | FLOAT             | Total supplied amount in USD (outstanding loans + available liquidity) |
| usd\_balance              | FLOAT             | USD balance of the protocol                                            |
| unique\_id                | VARCHAR           | Unique identifier for the record (date + project + protocol)           |
| \_created\_at             | TIMESTAMP\_NTZ(9) | Timestamp of when the record was created                               |
| \_updated\_at             | TIMESTAMP\_NTZ(9) | Timestamp of when the record was last updated                          |
