Max leverage range (with body)
POST/v1/data/loop/range/leverage
Compute the maximum amount that can be opened in a leverage position.
Single-pair mode (provide marketUidIn + marketUidOut): returns the max open amount for one specific pair.
Multi-pair mode (provide lender + chainId): returns the max open amount for all leverage pairs of a lender, optionally filtered by marketUidIn / marketUidOut.
Zap mode: If payAmount and payPriceUSD are provided, the calculation includes the deposited amount as additional collateral before computing the leverage range.
GET fetches user balances on-chain (requires account). POST accepts a SimulationBody in the request body.
POST accepts a JSON body with the user's current portfolio state, avoiding an on-chain fetch.
Plain-text reference — POST /v1/data/loop/range/leverage
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
marketUidIn | query | string | no | Market identifier for the input (debt/short) side. |
marketUidOut | query | string | no | Market identifier for the output (collateral/long) side. |
account | query | string | no | Wallet address. Required for GET (on-chain balance fetch). |
accountId | query | string | no | Sub-account ID (e.g. Euler V2, Init Capital). |
lender | query | string | no | Lender identifier. Required for multi-pair mode. See the LenderId schema for the full set of accepted values. |
chainId | query | string | no | Chain ID. Required for multi-pair mode. See the ChainId schema for the full set of supported chains. |
payAmount | query | string | no | Amount of the pay asset to deposit (for zap calculation). Triggers zap mode when present. |
payPriceUSD | query | string | no | USD price of the pay asset. If omitted, defaults to the long (collateral) asset price from the pair. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
balanceData | object | yes | Aggregated balance data for a sub-account. |
balanceData.deposits | number | no | Total deposits in USD |
balanceData.debt | number | no | Total debt in USD |
balanceData.adjustedDebt | number | no | Debt adjusted for borrow factors |
balanceData.collateral | number | no | Collateral value in USD |
balanceData.collateralAllActive | number | no | Collateral if all assets were enabled |
balanceData.borrowDiscountedCollateral | number | no | Collateral discounted by borrow factors |
balanceData.borrowDiscountedCollateralAllActive | number | no | Discounted collateral if all enabled |
balanceData.nav | number | no | Net asset value (deposits - debt) |
balanceData.deposits24h | number | no | Deposits 24h ago (for change calculation) |
balanceData.debt24h | number | no | Debt 24h ago |
balanceData.nav24h | number | no | NAV 24h ago |
balanceData.rewards | object[] | no | Pending reward token claims. Each entry represents a single reward program. |
balanceData.rewards[].asset | string | no | Reward token contract address |
balanceData.rewards[].totalRewards | number | no | Total accumulated rewards (token units) |
balanceData.rewards[].claimableRewards | number | no | Immediately claimable rewards (token units) |
aprData | object | yes | APR breakdown for a sub-account. |
aprData.apr | number | no | Net APR (deposit - borrow) |
aprData.depositApr | number | no | Weighted deposit APR |
aprData.borrowApr | number | no | Weighted borrow APR |
aprData.rewardApr | number | no | Total reward APR |
aprData.rewardDepositApr | number | no | Reward APR on deposits |
aprData.rewardBorrowApr | number | no | Reward APR on borrows |
aprData.intrinsicApr | number | no | Intrinsic yield APR (e.g., stETH staking) |
aprData.intrinsicDepositApr | number | no | Intrinsic yield APR portion from deposits |
aprData.intrinsicBorrowApr | number | no | Intrinsic yield APR portion from borrows |
aprData.rewards | object | no | Per-reward-token APR breakdown. Keys are reward token addresses. |
modeId | string | no | Mode/config key from userConfig.selectedMode (defaults to "0") |
positions | object[] | no | Current lending positions from the matching sub-account's positions array. The full LendingPosition objects returned by user-positions are accepted — only the fields in SimulationPosition are used. Always include this for accurate health-factor and borrow-capacity projections. |
positions[].marketUid | string | yes | Unique market identifier (format: {lender}:{chainId}:{address}) |
positions[].depositsUSD | number | yes | Deposit amount in USD |
positions[].debtUSD | number | yes | Variable debt in USD |
positions[].debtStableUSD | number | yes | Stable debt in USD |
positions[].collateralEnabled | boolean | yes | Whether this asset is enabled as collateral |
Response 200
| Field | Type | Description |
|---|---|---|
success | True | |
data | object[] | Array of range results. |
data[].chainId | string | EVM chain id, as a decimal string. See the ChainId schema. |
data[].lender | string | Protocol identifier. See the LenderId schema. |
data[].marketLongUid | string | Market UID of the collateral side |
data[].marketShortUid | string | Market UID of the debt side |
data[].marketNameLong | string | Display name of the collateral market/vault (e.g. the Euler eVault name). Disambiguates rows that share the collateral/debt token symbols and lender. |
data[].marketNameShort | string | Display name of the debt market/vault. For Euler this is the controller (debt) eVault — the primary way to tell otherwise-identical WETH→USDC rows apart. |
data[].curatorNameLong | string | Curator/brand of the collateral market (Euler: resolved from the vault governor). Null for lenders without a curator, or until the curator registry is seeded. Render as "curatorName + symbol", falling back to marketNameLong. |
data[].curatorNameShort | string | Curator/brand of the debt (controller) market. Same semantics as curatorNameLong. |
data[].assetLong | string | Collateral asset address |
data[].assetShort | string | Debt asset address |
data[].assetGroupLong | string | |
data[].assetGroupShort | string | |
data[].symbolLong | string | Collateral token symbol |
data[].nameLong | string | Collateral token name |
data[].symbolShort | string | Debt token symbol |
data[].nameShort | string | Debt token name |
data[].collateralFactorLong | number | Liquidation collateral factor for the long side |
data[].borrowCollateralFactorLong | number | Borrow-adjusted collateral factor for the long side |
data[].borrowFactorLong | number | Borrow factor for the long side |
data[].collateralDisabledLong | boolean | Whether collateral is disabled for the long asset |
data[].debtDisabledLong | boolean | Whether debt is disabled for the long asset |
data[].collateralFactorShort | number | Liquidation collateral factor for the short side |
data[].borrowCollateralFactorShort | number | Borrow-adjusted collateral factor for the short side |
data[].borrowFactorShort | number | Borrow factor for the short side |
data[].collateralDisabledShort | boolean | Whether collateral is disabled for the short asset |
data[].debtDisabledShort | boolean | Whether debt is disabled for the short asset |
data[].eModeConfigId | string | E-mode configuration ID |
data[].eMode | string | E-mode category |
data[].aprBase | number | Base APR (deposit - borrow + intrinsic, before rewards) |
data[].aprTotal | number | Total APR (base + rewards) |
data[].maxLeverage | number | Highest leverage multiple reachable in this market. |
data[].ltv | number | Loan-to-value ratio (0-1) |
data[].depositRateLong | number | |
data[].variableBorrowRateShort | number | |
data[].intrinsicYieldLong | number | |
data[].intrinsicYieldShort | number | |
data[].variableBorrowDisabledShort | boolean | True when the debt (short) market is a Lista DAO brokered market — it cannot be looped at a variable rate, only at one of the fixed terms in termsShort. variableBorrowRateShort is 0/undefined for such pairs. |
data[].termsShort | object[] | Fixed-term rate card for the debt (short) side when it is a Lista DAO brokered market. Each entry is one loop option — see the per-term net-APR recipe. null/empty for regular variable-rate pairs. For Term Finance an empty card means "not borrowable right now" rather than "no offers" — read fixedTerm.auction for why. |
Example response
{
"success": true,
"data": [
{
"chainId": "1",
"lender": "AAVE_V3",
"marketLongUid": "string",
"marketShortUid": "string",
"marketNameLong": "string",
"marketNameShort": "string",
"curatorNameLong": "string",
"curatorNameShort": "string",
"assetLong": "string",
"assetShort": "string",
"assetGroupLong": "string",
"assetGroupShort": "string",
"symbolLong": "string",
"nameLong": "string",
"symbolShort": "string",
"nameShort": "string",
"collateralFactorLong": 0.94,
"borrowCollateralFactorLong": 0.92,
"borrowFactorLong": 1,
"collateralDisabledLong": true,
"debtDisabledLong": true,
"collateralFactorShort": 0.94,
"borrowCollateralFactorShort": 0.92,
"borrowFactorShort": 1,
"collateralDisabledShort": true,
"debtDisabledShort": true,
"eModeConfigId": "string",
"eMode": "string",
"aprBase": 1.0,
"aprTotal": 1.0,
"maxLeverage": 1.0,
"ltv": 1.0,
"depositRateLong": 1.0,
"variableBorrowRateShort": 1.0,
"intrinsicYieldLong": 1.0,
"intrinsicYieldShort": 1.0,
"variableBorrowDisabledShort": true,
"termsShort": [
{
"termId": 2,
"depositApr": 1.0,
"available": 1.0,
"durationDays": 7,
"durationSecs": 604800,
"apr": 3.85,
"aprAtAmount": 1.0,
"fillable": 1.0,
"capped": true,
"ladder": [
{
"apr": 1.0,
"units": "string",
"assets": 1.0
}
]
}
],
"fixedTerm": {
"model": "term",
"maturity": 1,
"fees": {},
"earlyRepay": {},
"provider": {},
"auction": {
"status": "open",
"canBorrow": true,
"canLend": true,
"secondsUntilClose": 263000,
"implications": [
"string"
],
"id": "string",
"startTime": 1,
"revealTime": 1,
"endTime": 1,
"minBorrowAmount": "1000000000",
"minLendAmount": "1000000000"
}
},
"rewardAprLong": 1.0,
"rewardAprShort": 1.0,
"rewardsLong": [
{}
],
"rewardsShort": [
{}
],
"totalDepositsLong": 1.0,
"totalDebtLong": 1.0,
"totalLiquidityLong": 1.0,
"totalDepositsShort": 1.0,
"totalDebtShort": 1.0,
"totalLiquidityShort": 1.0,
"totalDepositsUsdLong": 1.0,
"totalDebtUsdLong": 1.0,
"totalLiquidityUsdLong": 1.0,
"totalDepositsUsdShort": 1.0,
"totalDebtUsdShort": 1.0,
"totalLiquidityUsdShort": 1.0,
"borrowLiquidityShort": 1.0,
"withdrawLiquidityLong": 1.0,
"depositableLong": 1.0,
"utilizationLong": 1.0,
"utilizationShort": 1.0,
"underlyingInfoLong": {
"asset": {},
"prices": {},
"oraclePrice": {}
},
"underlyingInfoShort": {
"asset": {},
"prices": {},
"oraclePrice": {}
}
}
]
}
Request
Responses
- 200
- 400
- 429
- 500
- 502
Max open range for one or more leverage pairs
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.