Mode analysis (on-chain)
GET/v1/data/lending/mode/analysis
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 (
nullif 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.
Plain-text reference — GET /v1/data/lending/mode/analysis
Parameters
| Parameter | 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
| Field | Type | Description |
|---|---|---|
success | True | |
data | object | Informational payload. null when the endpoint only builds calldata. |
actions | null |
Example response
{
"success": true,
"data": {}
}
Request
Responses
- 200
- 400
- 429
- 500
- 502
Mode analysis results
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.