# Rate-at-depth (rate vs borrow/supply amount)

Endpoint reference for the 1delta API. Index: https://docs.1delta.io/llms.txt · every endpoint: https://docs.1delta.io/llms-full.txt

---

### GET /v1/data/lending/irm/depth

- operationId: `rate-at-depth-rate-vs-borrow-supply-amount`
- docs: https://docs.1delta.io/1delta-api/rate-at-depth-rate-vs-borrow-supply-amount/
- markdown: https://docs.1delta.io/1delta-api/rate-at-depth-rate-vs-borrow-supply-amount.md
- tags: Lending (Data)

Rate-at-depth (rate vs borrow/supply amount)

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`/`supply` sweep from 0 to the fillable ceiling — for charts. Disable with `grid=false`.
- **rateAtAmount**: pass `amount(s)` (token units) and/or `amount(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).

**Parameters**

| Name | 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`** — Depth grids and/or rate-at-amount points per market

| 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[].borrow.points[].size` | number | Cumulative size (token units) |
| `data.items[].borrow.points[].sizeUsd` | number |  |
| `data.items[].borrow.points[].utilization` | number | Market utilization, as a fraction between 0 and 1. |
| `data.items[].borrow.points[].borrowAprPct` | number |  |
| `data.items[].borrow.points[].depositAprPct` | number |  |
| `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[].supply.points[].size` | number | Cumulative size (token units) |
| `data.items[].supply.points[].sizeUsd` | number |  |
| `data.items[].supply.points[].utilization` | number | Market utilization, as a fraction between 0 and 1. |
| `data.items[].supply.points[].borrowAprPct` | number |  |
| `data.items[].supply.points[].depositAprPct` | number |  |
| `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**

```json
{
  "success": true,
  "data": {
    "count": 1,
    "items": [
      {
        "marketUid": "AAVE_V3:1:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "protocol": "string",
        "lenderKey": "AAVE_V3",
        "chainId": "1",
        "underlyingAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "utilization": 1,
        "variableBorrowRate": 1,
        "borrow": {
          "side": "borrow",
          "currentUtilization": 1,
          "currentBorrowAprPct": 1,
          "currentDepositAprPct": 1,
          "fillable": 1,
          "fillableUsd": 1,
          "points": [
            {
              "size": 1,
              "sizeUsd": 1,
              "utilization": 1,
              "borrowAprPct": 1,
              "depositAprPct": 1
            }
          ]
        },
        "supply": {
          "side": "borrow",
          "currentUtilization": 1,
          "currentBorrowAprPct": 1,
          "currentDepositAprPct": 1,
          "fillable": 1,
          "fillableUsd": 1,
          "points": [
            {
              "size": 1,
              "sizeUsd": 1,
              "utilization": 1,
              "borrowAprPct": 1,
              "depositAprPct": 1
            }
          ]
        },
        "rateAtAmount": [
          {
            "side": "borrow",
            "size": 1,
            "amountUsd": 1,
            "utilization": 1,
            "borrowAprPct": 1,
            "depositAprPct": 1,
            "fillable": 1,
            "capped": true
          }
        ]
      }
    ]
  }
}
```

**Response `400`** — Validation error

**Response `429`** — Rate limited. Unauthenticated callers share a per-IP budget; send an `x-api-key` header to lift it. Retry with exponential backoff.

**Response `500`** — Unexpected server error. Safe to retry with backoff.

**Response `502`** — 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.
