Skip to main content

Mode analysis (with body)

POST 

/v1/data/lending/mode/analysis

Evaluate all mode-switching options for a user sub-account.

Input: POST a UserDataForSubAccount object (the same shape returned by /user-positions per sub-account).

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.

Plain-text reference — POST /v1/data/lending/mode/analysis

Parameters

ParameterInTypeRequiredDescription
lenderquerystringyesProtocol identifier See the LenderId schema for the full set of accepted values.
chainquerystringyesChain ID

Request body

FieldTypeRequiredDescription
accountIdstringno
healthnumberno
borrowCapacityUSDnumberno
balanceDataobjectyesBalance data for the sub-account. collateral and adjustedDebt are required for health factor calculation.
balanceData.collateralnumberyes
balanceData.adjustedDebtnumberyes
balanceData.depositsnumberno
balanceData.debtnumberno
balanceData.borrowDiscountedCollateralnumberno
balanceData.navnumberno
aprDataobjectno
positionsobject[]yes
positions[].marketUidstringnoMarket identifier, formatted lender:chainId:address.
positions[].depositsUSDnumberno
positions[].debtUSDnumberno
positions[].debtStableUSDnumberno
positions[].collateralEnabledbooleanno
userConfigobjectyes
userConfig.selectedModestringyesCurrent mode/config key
userConfig.idstringno
userConfig.isWhitelistedbooleanno

Response 200

FieldTypeDescription
successTrue
dataobjectInformational payload. null when the endpoint only builds calldata.
actionsnull

Example response

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

Request

Responses

Mode analysis results