Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.
New API

Positions

This data is included in the following Kaiko packages:

  • Level 1 & Level 2 Data [Level 1 Tick-Level]

  • Level 1 & Level 2 Data [Level 2 Aggregations]

  • Level 1 & Level 2 Data [Level 2 Tick-Level]

Subscriptions with "DeFi Lending & Borrowing" as the market type.

What is this endpoint for?

get

Lending positions show what one wallet supplies to and borrows from a lending protocol: each supplied and borrowed asset, totals in US dollars, health factor, remaining borrowing capacity, accrued interest and rewards. Read the current position, the position at any past point, or its evolution over time, to monitor liquidation risk or rebuild a wallet's lending history.

Authorizations
X-Api-KeystringRequired

Your Kaiko API key. Sent on every request. Never in a query parameter.

Query parameters
blockchainstringRequired

Kaiko blockchain code. An unknown chain is a 404 unsupported_blockchain.

Example: {"value":"ethereum"}Pattern: ^[a-z0-9_]+$
protocolstringRequired

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.

Example: {"value":"aav3"}Pattern: ^[a-z0-9]{1,16}$
addressesstring[] · min: 1 · max: 1Required

The account to read, 0x-prefixed hex, matched in any letter case. One address in this version: a list parameter, so that a higher maximum later is an additive change.

Example: {"value":["0x9205a569b0ff45df1e4f5ae48e21bc7f0656f0bb"]}
at_timestring · date-timeOptional

Read the state as of this instant: the last state at or before the last block at or before it. ISO 8601 UTC, millisecond precision. Not with at_block, a window or interval (400). Before the key's entitled history it returns 403, as it does for a key whose history does not cover the last 90 days (a known limit).

Example: {"value":"2026-09-01T00:00:00.000Z"}
at_blockinteger · int64 · min: 1Optional

Read the position as of this block: the last one at or before it. Not with at_time, a window or interval (400). A block past the newest one indexed returns an empty data.

Example: {"value":23600000}
start_timestring · date-timeOptional

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.

Example: 2026-09-24T00:00:00.000Z
end_timestring · date-timeOptional

Exclusive end of the window, ISO 8601 UTC, at the precision the endpoint documents. Defaults to now. Must be after start_time.

Example: 2026-09-25T00:00:00.000Z
intervalstring · enumOptional

Grid step of a positions read.

Example: 1hPossible values:
sortstring · enumOptional

Order on the time axis.

Default: descExample: descPossible values:
page_sizeinteger · min: 1 · max: 1000Optional

Rows per page. A value above the maximum returns 400, never a silent cap. Endpoints needing other bounds define their own PageSize<Resource>Query.

Default: 100Example: {"value":100}
api_versionstringOptional

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.

Example: 2026-10-01Pattern: ^\d{4}-\d{2}-\d{2}(-preview)?$
Responses
200

One page of LendingPosition rows.

application/json

One page of LendingPosition rows.

get/defi/lending/positions
GET /defi/lending/positions?blockchain=text&protocol=text&addresses=text HTTP/1.1
Host: api.kaiko.io
X-Api-Key: YOUR_API_KEY
Accept: */*
{
  "data": [
    {
      "user_address": "0x9205a569b0ff45df1e4f5ae48e21bc7f0656f0bb",
      "blockchain": "ethereum",
      "protocol": "aav3",
      "block_number": 26248541,
      "timestamp": "2026-10-22T12:25:47.000Z",
      "emode_category_id": 0,
      "emode_category_label": null,
      "health_factor": "1.908451",
      "total_collateral_usd": "48302.77",
      "total_supplied_usd": "48302.77",
      "total_debt_usd": "21004.77",
      "available_borrows_usd": "17878.96",
      "net_worth_usd": "27298.00",
      "net_apy": "0.000548",
      "price_unavailable_assets": [],
      "total_supply_accrued_interest_usd": "1175.23",
      "total_borrow_accrued_interest_usd": "640.02",
      "total_principal_supplied_usd": "47127.54",
      "total_principal_borrowed_usd": "20364.75",
      "roi": "0.020018",
      "change_in_lend_interest_usd": null,
      "change_in_borrow_interest_usd": null,
      "market_value_lend_interest_usd": "1175.23",
      "market_value_borrow_interest_usd": "640.02",
      "cumulative_lend_interest_usd": "1175.23",
      "cumulative_borrow_interest_usd": "640.02",
      "lifetime_rewards_usd": null,
      "unclaimed_rewards_usd": null,
      "supplies": [
        {
          "asset": "weth",
          "asset_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
          "market_id": "aave/v3/weth",
          "position_ref": null,
          "supplied_amount": "12.504113572931140212",
          "supplied_amount_usd": "48302.77",
          "principal_supplied": "12.2",
          "principal_supplied_usd": "47127.54",
          "accrued_interest": "0.304113572931140212",
          "accrued_interest_usd": "1175.23",
          "roi": "0.024927",
          "atoken_address": "0x4d5f47fa6a74757f35c14fd3a6ef8e3c9bc514e8",
          "scaled_balance": "11860661210773550612",
          "supply_apy": "0.018188",
          "current_liquidity_rate": "0.018026",
          "is_collateral": true,
          "liquidation_threshold": "0.830000",
          "ltv": "0.805000"
        }
      ],
      "borrows": [
        {
          "asset": "usdc",
          "asset_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
          "market_id": "aave/v3/usdc",
          "position_ref": null,
          "borrowed_amount": "21004.771823",
          "borrowed_amount_usd": "21004.77",
          "principal_borrowed": "20364.75",
          "principal_borrowed_usd": "20364.75",
          "accrued_interest": "640.021823",
          "accrued_interest_usd": "640.02",
          "roi": "0.031428",
          "variable_debt_token_address": "0x72e95b8931767c79ba4eee721354d6e99a61d004",
          "stable_debt_token_address": null,
          "borrow_type": "variable",
          "scaled_debt_balance": "17694528113",
          "variable_borrow_rate": "0.040307",
          "stable_borrow_rate": null,
          "borrow_apy": "0.041130"
        }
      ],
      "total_liquidity_eth": "12.50411357",
      "total_collateral_eth": "12.50411357",
      "total_borrowed_eth": "5.43741002",
      "available_to_borrow_eth": "4.62832178",
      "net_worth_eth": "7.06670355",
      "total_lend_interest_eth": "0.30423117",
      "total_borrow_interest_eth": "0.16568112",
      "cumulative_lend_interest_eth": "0.30423117",
      "cumulative_borrow_interest_eth": "0.16568112",
      "lifetime_rewards_eth": null,
      "unclaimed_rewards_eth": null
    }
  ],
  "meta": {
    "api_version": "2026-10-01",
    "url": "https://api.kaiko.io/defi/lending/positions?blockchain=ethereum&protocol=aav3&addresses=0x9205a569b0ff45df1e4f5ae48e21bc7f0656f0bb&api_version=2026-10-01",
    "count": 1,
    "next_url": null
  }
}

Last updated

Was this helpful?