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

# Wholesale Credit Balances

> Balances of wholesale credit lines extended to institutional borrowers, in USD, with the cap, the remaining room under it and gross and net flows. Each series is one credit line balance, keyed by protocol, chain, credit line, token, balance type and balance subtype.

One row per wholesale credit balance, keyed by protocol, chain, credit line, token, balance type and balance subtype: the parent protocol and product, chain, token and the mapped protocol, project and network records. The id is the series key of the wholesale-credit-balances timeseries model.

| | |
| - | - |
| Access | Lending-protocols-dataset |
| Tabular model | `wholesale-credit-balances`: primary key `id` |
| Timeseries model | `wholesale-credit-balances`: intervals `1d`, series key `id` (Wholesale Credit Balance ID), series must be named (up to 10 per call) |

## Endpoints

> [card] [List Wholesale Credit Balances](https://docs.blockworks.com/api-reference/data-api/wholesale-credit/tabular-wholesale-credit-balances.md)
>
> One page of rows with per-column filters, sorting and pagination.

> [card] [Batch Get Wholesale Credit Balance timeseries](https://docs.blockworks.com/api-reference/data-api/wholesale-credit/timeseries-wholesale-credit-balances.md)
>
> Up to 10 series in one request, named by Wholesale Credit Balance ID in `series`.

> [card] [Get Wholesale Credit Balance timeseries](https://docs.blockworks.com/api-reference/data-api/wholesale-credit/timeseries-wholesale-credit-balances-by-id.md)
>
> One series over a time window, keyed by its Wholesale Credit Balance ID.

## Metrics

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

| Field | Name | Type | Unit | Description |
| - | - | - | - | - |
| `balanceUSD` | Balance (USD) | float64 | | Balance in USD. |
| `balanceCapUSD` | Balance Cap (USD) | float64 | | Balance cap in USD. |
| `balanceCapMaxUSD` | Maximum Balance Cap (USD) | float64 | | Maximum balance cap in USD. |
| `balanceCapGapUSD` | Balance Cap Gap (USD) | float64 | | Remaining room under the balance cap in USD. |
| `grossInflowUSD` | Gross Inflow (USD) | float64 | | Gross inflow to the balance in USD. |
| `grossOutflowUSD` | Gross Outflow (USD) | float64 | | Gross outflow from the balance in USD, stored as a negative number. |
| `netFlowUSD` | Net Flow (USD) | float64 | | Net flow (inflow plus outflow) in USD. |

## 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 wholesale-credit-balances timeseries model, the parent slug, chain, credit line id, token address, balance type and balance subtype, joined with underscores. (primary key) |
| `name` | string | `Eq`, `IsOneOf`, `Contains` | default | The display name of the balance, the credit line name, token symbol and balance subtype (or type). |
| `slug` | string | `Eq`, `IsOneOf` | yes | The parent protocol's project slug, the slug used for the same protocol across the API. |
| `parentSlug` | string | `Eq`, `IsOneOf` | yes | The parent protocol's short name. |
| `productSlug` | string | `Eq`, `IsOneOf` | | The product or version within the parent protocol. |
| `chain` | string | `Eq`, `IsOneOf` | | The short name of the chain (ethereum, base, solana). |
| `creditLineID` | string | `Eq`, `IsOneOf` | | The wholesale credit line's identifier. |
| `tokenAddress` | string | `Eq`, `IsOneOf` | | The token contract address (the mint address on Solana); null when unlabeled. |
| `balanceType` | string | `Eq`, `IsOneOf` | | The balance type as classified by Blockworks Research. |
| `balanceSubtype` | string | `Eq`, `IsOneOf` | | The finer balance classification; null where none is distinguished. |
| `creditLineName` | string | `Eq`, `IsOneOf`, `Contains` | | The wholesale credit line's display name. |
| `tokenSymbol` | string | `Eq`, `IsOneOf`, `Contains` | yes | The token's ticker symbol. |
| `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; null when unmapped. |
| `networkID` | string | `Eq`, `IsOneOf` | | The chain's networkID in the blockchains model; null when unmapped. |

## Example

```bash curl theme={null}
curl "https://api.blockworks.com/query/timeseries/wholesale-credit-balances/1d/<id>?timeframe=7d&selections=balanceUSD,balanceCapUSD" \
  -H "X-Blockworks-API-Key: $BLOCKWORKS_API_KEY"
```

See [Get Wholesale Credit Balance timeseries](https://docs.blockworks.com/api-reference/data-api/wholesale-credit/timeseries-wholesale-credit-balances-by-id.md) for the response and the errors.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.