> ## 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 Market

> Deposits, outstanding borrows and TVL in USD for one lending market within a protocol product on one chain. Each series is one market, keyed by protocol, product, chain and market key. The finest grain of the lending data, with thousands of series, so name the markets you need.

One row per lending market, the finest grain of the lending data, keyed by protocol, product, chain and market key: market name and type, the parent protocol and product, chain and the mapped protocol record. The id is the series key of the lending-protocols-by-product-market timeseries model.

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

## Endpoints

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

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

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

## Metrics

3 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 market's tokens. |
| `borrowed-usd` | Borrowed (USD) | float64 |      | Total outstanding borrows in USD across the market's tokens.              |
| `tvl-usd`      | TVL (USD)      | float64 |      | TVL in USD, deposits minus borrows.                                       |

## 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-market timeseries model, the product id followed by the market key, joined with underscores. (primary key) |
| `name`         | string | `Eq`, `IsOneOf`, `Contains` | default | The display name of the market (market name when present, else the market key).                                                                               |
| `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 market lives on (ethereum, bnb, solana).                                                                                      |
| `marketName`   | string | `Eq`, `IsOneOf`, `Contains` |         | The market display name.                                                                                                                                      |
| `marketType`   | string | `Eq`, `IsOneOf`             |         | The market type where the protocol distinguishes one (for example core, pooled or credit\_vault); null otherwise.                                             |
| `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-market/1d/aave_aave-v2_avalanche_c_0x4f01aed16d97e3ab5ab2b501154dc9bb0f1a5a2c?timeframe=7d&selections=deposits-usd,borrowed-usd" \
  -H "X-Blockworks-API-Key: $BLOCKWORKS_API_KEY"
```

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