Skip to article
Degrees of SatoshiFollow the connections.
Degrees of Satoshi/ Encyclopedia

Encyclopedia DeFi · Entry 354

Repaying with collateral: the swap inside the repayment

Theme
DeFi
Sources
3 cited records
Reading time
About 3 minutes
Automated verification
Substantive update
In this article

At a glance

Key facts

Key facts for Repaying with collateral: the swap inside the repayment
FactDetailSource
Two balancesThe operation consumes collateral while paying debt.[1]
Atomic pathThe cited adapter can coordinate the steps in one transaction.[1]
Alternative pathAave also documents a method without a flash loan when position checks permit.[1]
01

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.

02

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.

03

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.

Direct answers

Questions people ask

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.

Inspect the evidence

The answer and key facts have stable claim links. These records retain the scope and qualification when reused.

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: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T19:18:00.092Z.

Link to this claim
Two balances: The operation consumes collateral while paying debt.

Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T19:18:00.092Z.

Link to this claim
Atomic path: The cited adapter can coordinate the steps in one transaction.

Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T19:18:00.092Z.

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

Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T19:18:00.092Z.

Link to this claim
Revision history
  1. — First publication after primary-source research and separate automated verification.

Source register

Sources and references

Retrieval dates and locators are recorded individually.
  1. Aave v3 Swap FeaturesAave

    Documented adapter/flash-loan/DEX composition; availability varies by market.

    Locator: Repay with collateral; Collateral Swap; Debt Swap · Version / scope: Documentation retrieved for the 2026-10-02 editorial scope; content hash recorded · Retrieved: 2026-10-02T18:53:21.663ZOpen source
  2. Health Factor and LiquidationsAave

    Weighted liquidation thresholds; no universal safe ratio.

    Locator: Health Factor; Managing Health Factor · Version / scope: Documentation retrieved for the 2026-10-02 editorial scope; content hash recorded · Retrieved: 2026-10-02T18:53:21.960ZOpen source
  3. Aave v3 PoolAave

    Specific v3 write-method constraints and amount sentinel.

    Locator: repay; setUserUseReserveAsCollateral; withdraw; setUserEMode · Version / scope: Documentation retrieved for the 2026-10-02 editorial scope; content hash recorded · Retrieved: 2026-10-02T18:53:21.762ZOpen source
How this article was made

Research and drafting use AI assistance. A separate automated review checks claims against primary sources; no external expert or named human review is implied. Publication, substantive editing, source retrieval and verification are recorded separately. This version was independently checked by an automated reviewer on 2 October 2026.

Editorial method and corrections

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/