Repay / Loop-out
Repay debt and exit linked exposure through a single route.
Last updated
Repay debt and exit linked exposure through a single route.
Repay / Loop-out is the Terminal 1 workflow for exiting an existing position by repaying debt and unwinding linked exposure using a flash-loan-backed route. Terminal 1 composes the required steps into a single atomic execution flow so users do not need to manually sequence repays, swaps, collateral movements, and venue interactions.

You want to exit a fixed-term position cleanly without manually unwinding intermediate steps.
You want to unwind looping exposure (repay + deleverage) in one execution flow.
You want to close without pre-funding all intermediate tokens in your wallet.
A repay / loop-out route generally:
takes flash liquidity to source repayment funds,
repays the debt and releases the position’s collateral,
performs any required swaps to repay the flash loan,
unwinds linked exposure created by prior looping paths (where applicable),
returns remaining assets to the user per route outputs and constraints.
Terminal 1 uses a solver to construct an optimal repay / loop-out route given your position and available venues. The solver searches supported routes (including swaps and ERC‑4626 withdrawals where applicable) to maximize net token returns and minimize unnecessary slippage, subject to route constraints and execution safety checks.
source repayment funds
repay debt
unlock or return collateral
swap or transfer released assets as needed
Required approvals/permits are missing or insufficient.
Swap execution is stale or worse than expected and the flash repayment cannot be satisfied.
Route constraints fail (fees, buffers, deadlines, or venue constraints).
External venue conditions change during execution (liquidity moved, quote expired).
Close / Loop-out is an execution workflow. It does not change core protocol mechanics, fees, or penalties; it changes how actions are composed into a single atomic route.
Last updated