Skip to main content

Max debt swap range

GET 

/v1/data/loop/range/debt-swap

Compute the maximum amount for a debt swap.

The max swappable amount equals the user's total debt (variable + stable) in the source (input) asset.

Use denomination=exactInput (default) to base the range on the source debt, or exactOutput to base it on the target debt.

Requires positions[] in the POST body (or account for GET) to read the user's debt balances.

Plain-text reference — GET /v1/data/loop/range/debt-swap

Parameters

ParameterInTypeRequiredDescription
marketUidInquerystringnoMarket identifier for the input (debt/short) side.
marketUidOutquerystringnoMarket identifier for the output (collateral/long) side.
accountquerystringnoWallet address. Required for GET (on-chain balance fetch).
accountIdquerystringnoSub-account ID (e.g. Euler V2, Init Capital).
denominationqueryexactInput, exactOutputnoWhich side is the base denomination for the range.

Response 200

FieldTypeDescription
successTrue
dataobject[]Array of range results.
data[].chainIdstringEVM chain id, as a decimal string. See the ChainId schema.
data[].lenderstringProtocol identifier. See the LenderId schema.
data[].marketLongUidstringMarket UID of the collateral side
data[].marketShortUidstringMarket UID of the debt side
data[].marketNameLongstringDisplay name of the collateral market/vault (e.g. the Euler eVault name). Disambiguates rows that share the collateral/debt token symbols and lender.
data[].marketNameShortstringDisplay 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[].curatorNameLongstringCurator/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[].curatorNameShortstringCurator/brand of the debt (controller) market. Same semantics as curatorNameLong.
data[].assetLongstringCollateral asset address
data[].assetShortstringDebt asset address
data[].assetGroupLongstring
data[].assetGroupShortstring
data[].symbolLongstringCollateral token symbol
data[].nameLongstringCollateral token name
data[].symbolShortstringDebt token symbol
data[].nameShortstringDebt token name
data[].collateralFactorLongnumberLiquidation collateral factor for the long side
data[].borrowCollateralFactorLongnumberBorrow-adjusted collateral factor for the long side
data[].borrowFactorLongnumberBorrow factor for the long side
data[].collateralDisabledLongbooleanWhether collateral is disabled for the long asset
data[].debtDisabledLongbooleanWhether debt is disabled for the long asset
data[].collateralFactorShortnumberLiquidation collateral factor for the short side
data[].borrowCollateralFactorShortnumberBorrow-adjusted collateral factor for the short side
data[].borrowFactorShortnumberBorrow factor for the short side
data[].collateralDisabledShortbooleanWhether collateral is disabled for the short asset
data[].debtDisabledShortbooleanWhether debt is disabled for the short asset
data[].eModeConfigIdstringE-mode configuration ID
data[].eModestringE-mode category
data[].aprBasenumberBase APR (deposit - borrow + intrinsic, before rewards)
data[].aprTotalnumberTotal APR (base + rewards)
data[].maxLeveragenumberHighest leverage multiple reachable in this market.
data[].ltvnumberLoan-to-value ratio (0-1)
data[].depositRateLongnumber
data[].variableBorrowRateShortnumber
data[].intrinsicYieldLongnumber
data[].intrinsicYieldShortnumber
data[].variableBorrowDisabledShortbooleanTrue 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[].termsShortobject[]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

Max debt swap range