# Repaying with collateral: the swap inside the repayment

Repay-with-collateral uses part of a supplied asset to obtain the debt asset and repay borrowing. Aave’s documented adapters can coordinate withdrawal, swap and repayment atomically, sometimes using a flash loan. The result reduces both debt and collateral, so the final health factor and costs must be evaluated together.

Evidence: [Aave v3 Swap Features](https://aave.com/docs/aave-v3/smart-contracts/swap-features); [Health Factor and Liquidations](https://aave.com/help/borrowing/liquidations)

Canonical: https://degreesofsatoshi.com/encyclopedia/repay-with-collateral/
Published: 2026-10-02
Substantively modified: 2026-10-02
Independently verified by an automated reviewer: 2026-10-02T19:18:00.092Z
Data current through: 2026-10-02

AI-assisted research and drafting with a separate automated source-verification pass; no external expert or named human review is implied.

## Key facts

- **Two balances:** The operation consumes collateral while paying debt. ([Aave v3 Swap Features](https://aave.com/docs/aave-v3/smart-contracts/swap-features))
- **Atomic path:** The cited adapter can coordinate the steps in one transaction. ([Aave v3 Swap Features](https://aave.com/docs/aave-v3/smart-contracts/swap-features))
- **Alternative path:** Aave also documents a method without a flash loan when position checks permit. ([Aave v3 Swap Features](https://aave.com/docs/aave-v3/smart-contracts/swap-features))

## Recompute both numerator and denominator

Take hypothetical collateral worth 1,000 with an 80% liquidation threshold and debt worth 600. Health factor is 800 / 600 ≈ 1.33. Selling 200 of collateral to repay 200 of debt, with no costs or price changes, leaves 800 collateral and 400 debt: 640 / 400 = 1.60.

Actual swap output, fees and the assets’ thresholds change the result. Do not subtract debt while pretending all collateral remains.

Evidence: [Health Factor and Liquidations](https://aave.com/help/borrowing/liquidations); [Aave v3 Swap Features](https://aave.com/docs/aave-v3/smart-contracts/swap-features)

## A flash loan can bridge the temporary state

The documented adapter can first use borrowed liquidity to repay debt, then obtain collateral, swap it and repay the flash loan. The atomic requirement means the required steps must succeed together. This is different from manually withdrawing collateral first, which can fail a health check.

Evidence: [Aave v3 Swap Features](https://aave.com/docs/aave-v3/smart-contracts/swap-features)

## Read what is spent and what debt remains

Review maximum collateral input, intended debt repayment, asset addresses, allowances and the post-operation position. Atomic execution protects against an incomplete sequence within that transaction; it does not guarantee a favorable swap or protect the remaining position from later price changes.

Evidence: [Aave v3 Swap Features](https://aave.com/docs/aave-v3/smart-contracts/swap-features)

## Questions

### Is this the same as paying from tokens already in my wallet?

No. It sells part of the supplied position. A wallet-funded repayment can reduce debt without consuming that collateral.

Evidence: [Aave v3 Swap Features](https://aave.com/docs/aave-v3/smart-contracts/swap-features); [Aave v3 Pool](https://aave.com/docs/aave-v3/smart-contracts/pool)

## Claims and scope

### repay-with-collateral-quick-answer

Repay-with-collateral uses part of a supplied asset to obtain the debt asset and repay borrowing. Aave’s documented adapters can coordinate withdrawal, swap and repayment atomically, sometimes using a flash loan. The result reduces both debt and collateral, so the final health factor and costs must be evaluated together.

Scope: {"collection":"defi","dataAsOf":"2026-10-02","blockHeight":null}

### repay-with-collateral-fact-two-balances

Two balances: The operation consumes collateral while paying debt.

Scope: {"collection":"defi","dataAsOf":"2026-10-02","blockHeight":null}

### repay-with-collateral-fact-atomic-path

Atomic path: The cited adapter can coordinate the steps in one transaction.

Scope: {"collection":"defi","dataAsOf":"2026-10-02","blockHeight":null}

### repay-with-collateral-fact-alternative-path

Alternative path: Aave also documents a method without a flash loan when position checks permit.

Scope: {"collection":"defi","dataAsOf":"2026-10-02","blockHeight":null}

## Sources

- [Aave v3 Swap Features](https://aave.com/docs/aave-v3/smart-contracts/swap-features) — Aave. Documented adapter/flash-loan/DEX composition; availability varies by market. Locator: Repay with collateral; Collateral Swap; Debt Swap. Retrieved: 2026-10-02T18:53:21.663Z.
- [Health Factor and Liquidations](https://aave.com/help/borrowing/liquidations) — Aave. Weighted liquidation thresholds; no universal safe ratio. Locator: Health Factor; Managing Health Factor. Retrieved: 2026-10-02T18:53:21.960Z.
- [Aave v3 Pool](https://aave.com/docs/aave-v3/smart-contracts/pool) — Aave. Specific v3 write-method constraints and amount sentinel. Locator: repay; setUserUseReserveAsCollateral; withdraw; setUserEMode. Retrieved: 2026-10-02T18:53:21.762Z.

## Revision history

- 2026-10-02: First publication after primary-source research and separate automated verification.

## Cite this entry

Degrees of Satoshi editorial project. “Repaying with collateral: the swap inside the repayment.” Published 2026-10-02; updated 2026-10-02. https://degreesofsatoshi.com/encyclopedia/repay-with-collateral/
