# Mode analysis (on-chain)

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/mode/analysis

- operationId: `mode-analysis-on-chain`
- docs: https://docs.1delta.io/1delta-api/mode-analysis-on-chain/
- markdown: https://docs.1delta.io/1delta-api/mode-analysis-on-chain.md
- tags: Lending (Data)

Mode analysis (on-chain)

Evaluate all mode-switching options for a user. The API fetches the user's current positions and balance data on-chain via multicall — no request body needed.

**Output:** For each available mode on the specified lender/chain, returns:
- **healthFactor** — the hypothetical health factor if the user switches to that mode (`null` if no debt)
- **supportedAssets** — which marketUids are eligible as collateral or for borrowing in that mode
- **canSwitch** — whether the switch is safe (health factor > 1 and no incompatible debt)

Mode categories are cached server-side (1 hour TTL). Market configs are cached (3 minute TTL).

The "mode" terminology is the protocol-agnostic generalization of Aave V3's "e-mode" (efficiency mode); other lenders expose analogous category mechanisms.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `lender` | query | string | yes | Protocol identifier See the `LenderId` schema for the full set of accepted values. |
| `chain` | query | string | yes | Chain ID |
| `operator` | query | string | yes | Wallet address of the user |
| `accountId` | query | string | no | Sub-account ID (for multi-subaccount lenders like Init Capital). Defaults to first sub-account. |

**Response `200`** — Mode analysis results

| Field | Type | Description |
| --- | --- | --- |
| `success` | true |  |
| `data` | object | Informational payload. `null` when the endpoint only builds calldata. |
| `actions` | null |  |

**Example response**

```json
{
  "success": true,
  "data": {}
}
```

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