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

# Lending Protocols by Product

> The lending-protocols metrics broken down by product (version) and blockchain: deposits, borrows, TVL, interest, fees and revenue in USD. Each series is one product on one chain, keyed by protocol, product and chain.

One row per lending product deployment, one protocol version on one blockchain, keyed by protocol, product and chain: name, parent protocol, product, chain and the mapped protocol record. The id is the series key of the lending-protocols-by-product timeseries model.

|                  |                                                                                                                                 |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| Access           | Projects\_protocols\_unified                                                                                                    |
| Tabular model    | `lending-protocol-products`: primary key `id`, identifiers `slug`                                                               |
| Timeseries model | `lending-protocols-by-product`: intervals `1d`, series key `id` (Protocol Product Chain ID), every series available in one call |

## Endpoints

<CardGroup cols={2}>
  <Card title="List Lending Protocol Products" icon="arrow-right" href="/api-reference/data-api/lending-protocols/tabular-lending-protocol-products">
    One page of rows with per-column filters, sorting and pagination.
  </Card>

  <Card title="Batch Get Lending Protocol Product timeseries" icon="arrow-right" href="/api-reference/data-api/lending-protocols/timeseries-lending-protocols-by-product">
    Every series in one request, or the named ones.
  </Card>

  <Card title="Get Lending Protocol Product timeseries" icon="arrow-right" href="/api-reference/data-api/lending-protocols/timeseries-lending-protocols-by-product-by-id">
    One series over a time window, keyed by its Protocol Product Chain ID.
  </Card>
</CardGroup>

## Metrics

10 metrics. Use the `Field` value in `selections`; every point starts with the timestamp and continues in this order.

| Field                     | Name                      | Type    | Unit | Description                                                                              |
| ------------------------- | ------------------------- | ------- | ---- | ---------------------------------------------------------------------------------------- |
| `deposits-usd`            | Deposits (USD)            | float64 |      | Total deposits (supply and collateral) in USD across the product's markets.              |
| `borrowed-usd`            | Borrowed (USD)            | float64 |      | Total outstanding borrows in USD across the product's markets.                           |
| `tvl-usd`                 | TVL (USD)                 | float64 |      | TVL in USD, deposits minus borrows.                                                      |
| `interest-usd`            | Interest (USD)            | float64 |      | Daily interest paid by borrowers in USD.                                                 |
| `net-interest-income-usd` | Net Interest Income (USD) | float64 |      | Daily net interest income in USD, the interest kept by the protocol.                     |
| `flash-loan-fees-usd`     | Flash Loan Fees (USD)     | float64 |      | Daily flash loan fees in USD.                                                            |
| `liquidation-fees-usd`    | Liquidation Fees (USD)    | float64 |      | Daily liquidation fees in USD.                                                           |
| `royalties-usd`           | Royalties (USD)           | float64 |      | Daily royalty fees in USD.                                                               |
| `fees-usd`                | Fees (USD)                | float64 |      | Daily total fees in USD, interest plus flash loan, liquidation and royalty fees.         |
| `revenue-usd`             | Revenue (USD)             | float64 |      | Daily revenue in USD, net interest income plus flash loan, liquidation and royalty fees. |

## Columns

Use the `Field` value in `selections`, `sortBy`, and as the base of a filter parameter (`Field` plus one of its `Filters` suffixes).

| Field          | Type   | Filters                     | Sort    | Description                                                                                                                                                                  |
| -------------- | ------ | --------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`           | string | `Eq`, `IsOneOf`             |         | The series key of the lending-protocols-by-product timeseries model, the parent protocol, product and chain joined with underscores (aave\_aave-v3\_arbitrum). (primary key) |
| `name`         | string | `Eq`, `IsOneOf`, `Contains` | default | The display name of the product, for example aave-v3 or the name of a single pool.                                                                                           |
| `slug`         | string | `Eq`, `IsOneOf`             | yes     | The parent protocol's project slug, the slug used for the same protocol across the API. (identifier 1)                                                                       |
| `parentSlug`   | string | `Eq`, `IsOneOf`             | yes     | The parent protocol's short name, the id in lending-protocols (aave).                                                                                                        |
| `productSlug`  | string | `Eq`, `IsOneOf`             |         | The product or version within the parent protocol (aave-v3).                                                                                                                 |
| `chain`        | string | `Eq`, `IsOneOf`             |         | The short name of the chain the product runs on (ethereum, arbitrum, solana).                                                                                                |
| `protocolSlug` | string | `Eq`, `IsOneOf`             |         | The slug of the protocol record mapped to the product; null when unmapped.                                                                                                   |
| `protocolName` | string | `Eq`, `IsOneOf`             |         | The name of the protocol record mapped to the product; null when unmapped.                                                                                                   |
| `projectID`    | string | `Eq`, `IsOneOf`             |         | The identifier of the parent protocol's project record.                                                                                                                      |

## Example

```bash curl theme={null}
curl "https://api.blockworks.com/query/timeseries/lending-protocols-by-product/1d/aave_aave-v2_avalanche_c?timeframe=7d&selections=deposits-usd,borrowed-usd" \
  -H "X-Blockworks-API-Key: $BLOCKWORKS_API_KEY"
```

See [Get Lending Protocol Product timeseries](/api-reference/data-api/lending-protocols/timeseries-lending-protocols-by-product-by-id) for the response and the errors.
