Rate-at-depth (rate vs borrow/supply amount)
GET/v1/data/lending/irm/depth
Return rate-at-depth data — the amount-axis complement of /v1/data/lending/irm (rate vs utilization).
Two shapes, both optional:
- grid (default): a
borrow/supplysweep from 0 to the fillable ceiling — for charts. Disable withgrid=false. - rateAtAmount: pass
amount(s)(token units) and/oramount(s)Usd(USD) to get the rate + resulting utilization + fillable ceiling at each specific size — the answer to "what rate to borrow X".
For a utilization pool the whole balance re-prices to one rate, so rateAtAmount is the marginal spot rate at the post-action utilization (marginal == average). Order-book venues (Midnight) fill best-first, so their rateAtAmount is a volume-weighted average over the consumed ladder. Lista's brokered borrow leg is a flat fixed rate up to capacity. Rates are APR %.
Caching: computed grids/points cached server-side for 1 hour (keyed by UIDs + side + points + amounts).
Plain-text reference — GET /v1/data/lending/irm/depth
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
marketUids | query | string | yes | Comma-separated market UIDs, e.g. GEARBOX_V3_0x…:9745:0x… |
side | query | string | no | borrow | supply | both (default borrow) |
dataPoints | query | integer | no | Samples per grid (1–60, default 24) |
amounts | query | string | no | Comma-separated sizes in TOKEN units → adds rateAtAmount[]. amount is accepted as a singular alias. |
amountsUsd | query | string | no | Comma-separated sizes in USD (converted per market via its price). amountUsd alias accepted. |
grid | query | string | no | Set false to drop the 0→max grid sweep (points-only). |
Response 200
| Field | Type | Description |
|---|---|---|
success | True | |
data | object | Informational payload. null when the endpoint only builds calldata. |
data.count | integer | Number of entries in items. |
data.items | object[] | The result set for this response. |
data.items[].marketUid | string | Market identifier, formatted lender:chainId:address. |
data.items[].protocol | string | |
data.items[].lenderKey | string | |
data.items[].chainId | string | EVM chain id, as a decimal string. See the ChainId schema. |
data.items[].underlyingAddress | string | |
data.items[].utilization | number | Current utilization (0–1) |
data.items[].variableBorrowRate | number | Current 0-notional borrow APR % |
data.items[].borrow | object | Rate-vs-amount sweep from size 0 to fillable. |
data.items[].borrow.side | borrow, supply | |
data.items[].borrow.currentUtilization | number | |
data.items[].borrow.currentBorrowAprPct | number | |
data.items[].borrow.currentDepositAprPct | number | |
data.items[].borrow.fillable | number | Largest size sampled — the depth ceiling (token units). |
data.items[].borrow.fillableUsd | number | |
data.items[].borrow.points | object[] | |
data.items[].supply | object | Rate-vs-amount sweep from size 0 to fillable. |
data.items[].supply.side | borrow, supply | |
data.items[].supply.currentUtilization | number | |
data.items[].supply.currentBorrowAprPct | number | |
data.items[].supply.currentDepositAprPct | number | |
data.items[].supply.fillable | number | Largest size sampled — the depth ceiling (token units). |
data.items[].supply.fillableUsd | number | |
data.items[].supply.points | object[] | |
data.items[].rateAtAmount | object[] | Rate + fillable at each requested size (present only when amount(s)/amount(s)Usd is passed). |
data.items[].rateAtAmount[].side | borrow, supply | |
data.items[].rateAtAmount[].size | number | Requested size (token units) |
data.items[].rateAtAmount[].amountUsd | number | |
data.items[].rateAtAmount[].utilization | number | Post-action utilization (0 for order books) |
data.items[].rateAtAmount[].borrowAprPct | number | |
data.items[].rateAtAmount[].depositAprPct | number | |
data.items[].rateAtAmount[].fillable | number | Max borrowable/suppliable before a cap binds (token units) |
data.items[].rateAtAmount[].capped | boolean | True when size exceeds fillable — rate is reported at the ceiling. |
actions | null |
Example response
{
"success": true,
"data": {
"count": 1,
"items": [
{
"marketUid": "AAVE_V3:1:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"protocol": "string",
"lenderKey": "AAVE_V3",
"chainId": "1",
"underlyingAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"utilization": 1.0,
"variableBorrowRate": 1.0,
"borrow": {
"side": "borrow",
"currentUtilization": 1.0,
"currentBorrowAprPct": 1.0,
"currentDepositAprPct": 1.0,
"fillable": 1.0,
"fillableUsd": 1.0,
"points": [
{
"size": 1.0,
"sizeUsd": 1.0,
"utilization": 1.0,
"borrowAprPct": 1.0,
"depositAprPct": 1.0
}
]
},
"supply": {
"side": "borrow",
"currentUtilization": 1.0,
"currentBorrowAprPct": 1.0,
"currentDepositAprPct": 1.0,
"fillable": 1.0,
"fillableUsd": 1.0,
"points": [
{
"size": 1.0,
"sizeUsd": 1.0,
"utilization": 1.0,
"borrowAprPct": 1.0,
"depositAprPct": 1.0
}
]
},
"rateAtAmount": [
{
"side": "borrow",
"size": 1.0,
"amountUsd": 1.0,
"utilization": 1.0,
"borrowAprPct": 1.0,
"depositAprPct": 1.0,
"fillable": 1.0,
"capped": true
}
]
}
]
}
}
Request
Responses
- 200
- 400
- 429
- 500
- 502
Depth grids and/or rate-at-amount points per market
Validation error
Rate limited. Unauthenticated callers share a per-IP budget; send an x-api-key header to lift it. Retry with exponential backoff.
Unexpected server error. Safe to retry with backoff.
An upstream data source or protocol origin failed (error.code is ORIGIN_FAILED). error.details carries the per-origin status. This is also what a missing or malformed required parameter currently returns, rather than a 400.