Open a leveraged loop
Open a leveraged loop into an Aave or Morpho market in ONE atomic transaction.
Repeatedly supplies collateral, borrows at the requested loan-to-value, and swaps the borrow back to collateral. Each iteration’s supply uses the swap’s GUARANTEED minimum output (enforced on-chain), so a fill anywhere within the slippage tolerance can never break a later step; any positive surplus stays in the Credit Account (the preview reports the bound as estimated_max_dust). Very large loops relative to pool depth can still exceed the slippage tolerance through their own cumulative price impact — size accordingly or raise max_slippage_percent. Conversely, the geometric tail can shrink below the swap router’s minimum routable size; when it does the loop simply ends early on that supply — the achieved multiplier is still guaranteed within 0.5% of the request or the call returns a clean 400.
When the collateral token is itself an ERC-4626 vault share (e.g. a Morpho vault token like steakUSDC), each conversion swaps the borrow token to the vault’s underlying asset and mints the shares via the vault’s own deposit at net asset value instead of swapping the share token on a DEX — share tokens have no honest DEX route. A direct share-token route is only ever used when it prices within 1% of net asset value.
The Credit Account must already hold initial_collateral_amount of collateral_token. For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets.
Body
Open a leveraged loop: repeatedly supply collateral, borrow, and swap the borrow back to collateral — all in ONE atomic transaction from the Credit Account.
The address that owns the Credit Account.
"0x5e5b00ed886A6879C2B934612D2312975427fcAf"
Blockchain network.
arbitrum, base, bsc, ethereum, hyperevm, tempo "ethereum"
Token supplied as collateral each iteration. Must already be in the Credit Account for the initial amount. For MORPHO it must be the market's collateral token.
"wstETH"
"WETH"
Token borrowed each iteration and swapped back to the collateral token. For MORPHO it must be the market's loan token.
"WETH"
"USDC"
Collateral (in token units) already held in the Credit Account to seed the loop.
x > 01.5
Target leverage: total collateral exposure = multiplier × initial_collateral_amount. Must be achievable at the requested loan_to_value (max ≈ 0.9 / (1 − LTV)).
x > 12
Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
0 < x <= 10070
Lending protocol to loop into: AAVE, MORPHO, or EULER.
AAVE, EULER, MORPHO "AAVE"
Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
Euler only: the EVK vault address collateral is supplied to (from /v2/credit/euler_markets). Required when protocol=EULER.
Euler only: the EVK vault address borrowed from (the sub-account's controller). Required when protocol=EULER.
Euler only: the EVC sub-account (0-255) holding this isolated looped position. 0 is the Credit Account itself.
0 <= x <= 255Per-swap slippage tolerance in percent. Loop dust is bounded by this per iteration, so tighter slippage means less dust.
0 < x <= 100.3
Aave only: e-mode category to enable before looping (higher LTV for correlated pairs, e.g. ETH-correlated).
x >= 0If true, returns EIP-712 typed data for gas-sponsored execution instead of an unsigned transaction.
false
If true, build a display ESTIMATE: swap legs always route through the default aggregator and no firm RFQ quotes are requested (quote_expires_at stays null). Set it on every call made while a user is exploring parameters, and leave it false only for the build they actually intend to sign — firm quotes are single-use maker commitments, and requesting them for displays that are never executed degrades the pricing this API is offered.
Response
Successful Response
The atomic loop transaction plus its guaranteed-floor preview.
Projected end state, computed on guaranteed swap floors.
Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false — except firm-priced previews (preview=true with swap_provider='bebop'), which carry numbers only: the firm quotes are fetched at execution time, so there is no payload to sign yet.
EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true.
Which venue priced the swap leg(s): 'one_inch' (iterative loop, slippage-bounded floors) or 'bebop' (firm zero-slippage quotes, one per swap leg, each partially filled at the leg's size — exact fills, zero dust). On preview=true responses, 'bebop' means the numbers are INDICATIVE, computed from the firm venue's live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks.
one_inch, bebop Deadline of the firm swap quotes (the earliest across the loop's swap legs) — sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Present only on executable swap_provider='bebop' builds; null on previews (no quote is spent for a preview).
Multiplier bound firm zero-slippage quotes can fill for the requested position size, LTV and target (estimated without spending any quote). The requested multiplier is firm-servable iff it is <= this value; above it the loop executes at market rate with slippage-bounded floors instead. Present only on preview=true responses when a firm-quote venue covers the pair; null otherwise. Recompute per parameter change - minimum-size floors make reachability target-dependent.