> For the complete documentation index, see [llms.txt](https://docs.kaiko.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kaiko.com/rest-api/defi-lending-and-borrowing-markets/market-data/events/lending-protocol-metrics.md). Agents can also search and read this documentation through its [MCP server](https://docs.kaiko.com/~gitbook/mcp).

# Lending protocol metrics

{% hint style="info" %}

### This data is included in the following Kaiko packages:

* **Level 1 & Level 2 Data** \[Level 1 Tick-Level Tier]
* **Level 1 & Level 2 Data** \[Level 2 Aggregations Tier]
* **Level 1 & Level 2 Data** \[Level 2 Tick-Level Tier]

*Subscriptions with "DeFi Lending & Borrowing" as the market type.*
{% endhint %}

## What is this endpoint for?

> Protocol metrics give the activity of one lending protocol over time, hourly or daily: deposits, collateral and borrows, flows of deposits, withdrawals, borrows and repayments in US dollars, interest earned by suppliers and paid by borrowers, protocol revenue and liquidations. Use it to track a protocol's growth, revenue and risk.

```json
{"openapi":"3.1.1","info":{"title":"Kaiko API","version":"2026-10-01"},"tags":[{"name":"Lending","description":"Lending and borrowing protocols (Aave, Compound, Maker): the on-chain events of their markets, read from the protocols' own contracts."}],"servers":[{"url":"https://api.kaiko.io","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"Your Kaiko API key. Sent on every request. Never in a query parameter.\n"}},"parameters":{"BlockchainQuery":{"name":"blockchain","in":"query","required":true,"description":"Kaiko blockchain code. An unknown chain is a 404 `unsupported_blockchain`.","schema":{"type":"string","pattern":"^[a-z0-9_]+$"}},"LendingProtocolRequiredQuery":{"name":"protocol","in":"query","required":true,"description":"Kaiko protocol code: `aav3` (Aave v3), `aav2` (Aave v2), `cmpd` (Compound v2), `cmp3` (Compound v3) or `mkr` (Maker). An unknown protocol, or one that does not run on `blockchain`, returns 404 `unknown_protocol`. `aav3` runs on `ethereum`, `polygon`, `avalanche`, `arbitrum` and `optimism`; `aav2` on `ethereum`, `polygon` and `avalanche`; `cmpd`, `cmp3` and `mkr` on `ethereum`. `/defi/lending/protocol-summaries` lists the protocols of a blockchain.","schema":{"type":"string","pattern":"^[a-z0-9]{1,16}$"}},"StartTimeQuery":{"name":"start_time","in":"query","required":false,"description":"Inclusive start of the window, ISO 8601 UTC. The endpoint documents its precision and its default when omitted; a nanosecond endpoint accepts any precision from seconds to nanoseconds.\n","schema":{"type":"string","format":"date-time"}},"EndTimeQuery":{"name":"end_time","in":"query","required":false,"description":"Exclusive end of the window, ISO 8601 UTC, at the precision the endpoint documents. Defaults to now. Must be after `start_time`.\n","schema":{"type":"string","format":"date-time"}},"LendingMetricsIntervalQuery":{"name":"interval","in":"query","required":false,"description":"Bucket length. Buckets end on UTC multiples of it since the Unix epoch: `1d` buckets end at 00:00 UTC, `1w` buckets on Thursdays.","schema":{"$ref":"#/components/schemas/LendingMetricsInterval"}},"LendingMetricsSortQuery":{"name":"sort","in":"query","required":false,"description":"Order on `timestamp`, the bucket end. Newest first by default.","schema":{"$ref":"#/components/schemas/Sort"}},"PageSizeQuery":{"name":"page_size","in":"query","required":false,"description":"Rows per page. A value above the maximum returns 400, never a silent cap. Endpoints needing other bounds define their own `PageSize<Resource>Query`.\n","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}},"ApiVersionQuery":{"name":"api_version","in":"query","required":false,"description":"Contract version to serve, as a date. Each endpoint serves its newest version released on or before it, so one date pins the whole API. When omitted, the endpoint's oldest version still served is used, so breaking changes only reach clients that raise their date. Append `-preview` (`2027-02-01-preview`) to also be served preview versions, which carry no stability promise. A date in the future, or one resolving to a retired version, returns 400 `unsupported_api_version`. The version served is echoed in `meta.api_version`, and `meta.url` and `meta.next_url` always carry this parameter. No `default` here on purpose: it differs per endpoint, and the request validator would otherwise fill in one date for all of them.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}(-preview)?$"}}},"schemas":{"LendingMetricsInterval":{"type":"string","description":"Bucket length of a lending metrics read: whole hours, so the cumulative interest is read from the hourly checkpoints.","enum":["1h","4h","1d","1w"],"default":"1d"},"Sort":{"type":"string","enum":["asc","desc"],"default":"desc","description":"Order on the time axis."},"ListLendingProtocolMetricsResponse":{"type":"object","description":"One page of `LendingProtocolMetric` rows.","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LendingProtocolMetric"}},"meta":{"$ref":"#/components/schemas/Meta"}}},"LendingProtocolMetric":{"type":"object","description":"One time bucket of a lending protocol's activity and state. Unique on (`blockchain`, `protocol`, `timestamp`). Column names are lending.v2's, decided with product on 2026-10-22: an exception to rule 11, so a concept can carry another name in a sibling dataset (the supply rate is `supply_rate` in market-snapshots, `lend_rate` in the metrics datasets and `current_liquidity_rate` in a position's supply leg).","required":["blockchain","protocol","protocol_name","protocol_version","timestamp","num_assets","total_deposited_usd","total_collateral_usd","total_borrowed_usd","total_utilization_ratio","collateral_ratio","cumulative_liquidated_usd","cumulative_liquidated_profit_usd","cumulative_protocol_revenue_usd","cumulative_interest_accumulated_usd","cumulative_interest_earned_usd","cumulative_interest_paid_usd","interval_protocol_revenue_usd","interval_interest_earned_usd","interval_interest_paid_usd","interval_interest_accumulated_usd","interval_number_of_deposits","interval_number_of_withdraws","interval_number_of_repays","interval_number_of_borrows","interval_number_of_liquidations","interval_number_of_flash_loans","interval_number_of_users","interval_deposited_usd","interval_withdrawn_usd","interval_repaid_usd","interval_borrowed_usd","interval_liquidated_usd","interval_flash_loaned_usd","interval_liquidated_profit_usd"],"properties":{"blockchain":{"type":"string","description":"Kaiko blockchain code."},"protocol":{"type":"string","description":"Kaiko protocol code (`aav3`, `aav2`, `cmpd`, `cmp3`, `mkr`)."},"protocol_name":{"type":"string","description":"Protocol family (`aave`, `compound`, `makerdao`)."},"protocol_version":{"type":"string","description":"Protocol version within its family (`v1`, `v2`, `v3`)."},"timestamp":{"type":"string","format":"date-time","description":"End of the bucket `(timestamp − interval, timestamp]`. ISO 8601 UTC, millisecond precision; always whole seconds (`.000Z`). lending.v2 sent `datetime`, unix seconds."},"num_assets":{"type":["integer","null"],"format":"int64","description":"Active reserves in scope at the bucket end."},"total_deposited_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Deposits in USD at the bucket end, at the protocol's own oracle prices."},"total_collateral_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Collateral-enabled deposits in USD at the bucket end."},"total_borrowed_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Borrows in USD at the bucket end."},"total_utilization_ratio":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"`total_borrowed_usd` / `total_deposited_usd`, as a fraction; can exceed 1 on Maker."},"collateral_ratio":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"`total_collateral_usd` / `total_deposited_usd`, as a fraction."},"cumulative_liquidated_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Liquidated debt in USD since genesis. `null` on Compound v2."},"cumulative_liquidated_profit_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Liquidators' bonus in USD since genesis. `null` where no liquidation paid a bonus."},"cumulative_protocol_revenue_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Protocol revenue in USD. Lifetime total since the protocol's genesis, from the hourly interest checkpoints. On Maker, which has none, it is summed from the request's `start_time`, so it restarts on every page (decided with product on 2026-10-22). `null` where the protocol publishes no supply index (Maker, for the earned side)."},"cumulative_interest_accumulated_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Interest earned by suppliers in USD. Lifetime total since the protocol's genesis, from the hourly interest checkpoints. On Maker, which has none, it is summed from the request's `start_time`, so it restarts on every page (decided with product on 2026-10-22). `null` where the protocol publishes no supply index (Maker, for the earned side)."},"cumulative_interest_earned_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Interest earned by suppliers in USD (the supplier side). Lifetime total since the protocol's genesis, from the hourly interest checkpoints. On Maker, which has none, it is summed from the request's `start_time`, so it restarts on every page (decided with product on 2026-10-22). `null` where the protocol publishes no supply index (Maker, for the earned side)."},"cumulative_interest_paid_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Interest paid by borrowers in USD. Lifetime total since the protocol's genesis, from the hourly interest checkpoints. On Maker, which has none, it is summed from the request's `start_time`, so it restarts on every page (decided with product on 2026-10-22). `null` where the protocol publishes no supply index (Maker, for the earned side)."},"interval_protocol_revenue_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Protocol revenue in USD over the bucket. `null` on Compound v3, on the first bucket when no earlier point exists, and on the first bucket of a window when that bucket opens before the start of the key's entitled data window."},"interval_interest_earned_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Supplier interest in USD over the bucket. `null` as `interval_protocol_revenue_usd` (including on the first bucket of a window that opens before the start of the key's entitled data window), and on Maker."},"interval_interest_paid_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Borrower interest in USD over the bucket. `null` as `interval_protocol_revenue_usd` (including on the first bucket of a window that opens before the start of the key's entitled data window)."},"interval_interest_accumulated_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Equal to `interval_interest_earned_usd`, kept from lending.v2: `null` where it is, on the first bucket of a window that opens before the start of the key's entitled data window included."},"interval_number_of_deposits":{"type":"integer","format":"int64","description":"Number of deposits in the bucket."},"interval_number_of_withdraws":{"type":"integer","format":"int64","description":"Number of withdraws in the bucket."},"interval_number_of_repays":{"type":"integer","format":"int64","description":"Number of repays in the bucket."},"interval_number_of_borrows":{"type":"integer","format":"int64","description":"Number of borrows in the bucket."},"interval_number_of_liquidations":{"type":"integer","format":"int64","description":"Number of liquidations in the bucket."},"interval_number_of_flash_loans":{"type":"integer","format":"int64","description":"Number of flash loans in the bucket."},"interval_number_of_users":{"type":"integer","format":"int64","description":"Distinct active addresses in the bucket; not additive across assets or buckets."},"interval_deposited_usd":{"type":"string","format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"USD deposited in the bucket, priced at each event's block. An unpriced event adds 0."},"interval_withdrawn_usd":{"type":"string","format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"USD withdrawn in the bucket, priced at each event's block. An unpriced event adds 0."},"interval_repaid_usd":{"type":"string","format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"USD repaid in the bucket, priced at each event's block. An unpriced event adds 0."},"interval_borrowed_usd":{"type":"string","format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"USD borrowed in the bucket, priced at each event's block. An unpriced event adds 0."},"interval_liquidated_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"USD liquidated in the bucket, priced at each event's block. `null` on Compound v2."},"interval_flash_loaned_usd":{"type":"string","format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"USD flash loaned in the bucket, priced at each event's block. An unpriced event adds 0."},"interval_liquidated_profit_usd":{"type":["string","null"],"format":"decimal","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$","description":"Liquidators' bonus in USD over the bucket. `null` as `cumulative_liquidated_profit_usd`, and on the first bucket of a window that opens before the start of the key's entitled data window."}}},"Meta":{"type":"object","description":"Metadata of a collection response.","required":["api_version","url","count","next_url"],"properties":{"api_version":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}(-preview)?$","description":"Version this endpoint served: its version released on or before the requested `api_version`, or its oldest version still served when the request omitted it. Suffixed `-preview` when a preview version served it."},"url":{"type":"string","format":"uri","description":"Absolute URL of the request that produced this response, as received: path and query string unchanged, defaults not filled in, except `api_version`, which is always present (the version served when the request omitted it). Lets a stored response say what it answers, in the shape it was answered."},"count":{"type":"integer","minimum":0,"description":"Number of items in `data` on this page."},"next_url":{"type":["string","null"],"format":"uri","description":"Absolute URL of the next page, `null` on the last page. It holds only public parameters: the original query with every default made explicit (`api_version` included) and the time bound moved past the last row, plus the dataset's tie-breaker (`after_<key>`) where timestamps can tie. An operation that pages on another keyset (a block position, a snapshot) says so in its description, and its `next_url` carries that keyset's parameters instead."}}},"Problem":{"type":"object","description":"RFC 9457 problem details. Served as application/problem+json.","required":["type","title","status","code"],"properties":{"type":{"type":"string","format":"uri-reference","const":"about:blank","description":"Always `about:blank`; the reason is carried by `code`."},"title":{"type":"string","description":"HTTP reason phrase."},"status":{"type":"integer","minimum":400,"maximum":599,"description":"HTTP status code, repeated for clients that lose the status line."},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence. Do not parse it."},"instance":{"type":"string","format":"uri-reference","description":"Request path and request id, to quote to support."},"code":{"type":"string","pattern":"^[a-z][a-z0-9_]*$","description":"Stable machine-readable reason. Clients branch on this. New values are additive; renaming one is breaking. Values in use: invalid_parameter, unsupported_api_version, missing_api_key, invalid_api_key, not_entitled, history_out_of_entitlement, unknown_instrument, pair_not_covered, unknown_asset, unknown_index, unsupported_blockchain, chain_capability_unsupported, token_not_found, unknown_contract, unknown_protocol, unknown_pool, query_too_large, snapshot_expired, resource_not_found, method_not_allowed, not_acceptable, rate_limited, internal_error, service_unavailable."},"errors":{"type":"array","description":"On 400, one entry per invalid parameter.","items":{"$ref":"#/components/schemas/ParameterError"}}}},"ParameterError":{"type":"object","description":"One invalid parameter in a 400 response.","required":["parameter","detail"],"properties":{"parameter":{"type":"string","description":"Name of the offending parameter."},"detail":{"type":"string","description":"What is wrong with it."}}}},"responses":{"BadRequest":{"description":"Invalid parameter, window or API version.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Unauthorized":{"description":"Missing or unknown X-Api-Key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"Forbidden":{"description":"The key is valid but not entitled to this product, instrument or history depth.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"NotAcceptable":{"description":"The Accept header excludes application/json.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"TooManyRequests":{"description":"Rate limited. Retry after the delay in Retry-After.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"InternalError":{"description":"Unexpected server failure.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"ServiceUnavailable":{"description":"A dependency is down or the data is not available yet.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":0}}}},"paths":{"/defi/lending/protocol-metrics":{"get":{"operationId":"ListLendingProtocolMetrics","tags":["Lending"],"summary":"What is this endpoint for?","description":"Protocol metrics give the activity of one lending protocol over time, hourly or daily: deposits, collateral and borrows, flows of deposits, withdrawals, borrows and repayments in US dollars, interest earned by suppliers and paid by borrowers, protocol revenue and liquidations. Use it to track a protocol's growth, revenue and risk.","parameters":[{"$ref":"#/components/parameters/BlockchainQuery"},{"$ref":"#/components/parameters/LendingProtocolRequiredQuery"},{"$ref":"#/components/parameters/StartTimeQuery"},{"$ref":"#/components/parameters/EndTimeQuery"},{"$ref":"#/components/parameters/LendingMetricsIntervalQuery"},{"$ref":"#/components/parameters/LendingMetricsSortQuery"},{"$ref":"#/components/parameters/PageSizeQuery"},{"$ref":"#/components/parameters/ApiVersionQuery"}],"responses":{"200":{"description":"One page of `LendingProtocolMetric` rows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListLendingProtocolMetricsResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"description":"The `blockchain` is not a Kaiko EVM chain, or no served lending protocol runs on it (`unsupported_blockchain`), or the `protocol` is unknown or does not run on `blockchain` (`unknown_protocol`).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"406":{"$ref":"#/components/responses/NotAcceptable"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kaiko.com/rest-api/defi-lending-and-borrowing-markets/market-data/events/lending-protocol-metrics.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
