Levee

Testnet

Aave v3, signed on NEAR

Below your trigger, Levee repays your Aave debt from your own collateral

When your health factor falls below the trigger you set, a NEAR contract with no keys signs one call that sells just enough of your collateral to repay USDC debt back to your target. The position stays in your wallet. On Base, an ownerless helper checks the trigger and the price against Aave’s oracle before anything moves.

Live on Base Sepolia, 8 Nov 2026: 7 rescues from collateral and 1 the keeper refused, one after both contract accounts lost their last key. Nothing is on a mainnet. Every run

A real rescue from collateral, at real speed

Base Sepolia · 8 Nov 2026, 10:39:37 UTC · contracts with no keys · left to righttop to bottom is time

Below trigger1.48Trigger 1.50Signed by MPC6.20 s · took 4.92 sSold 0.003288 WETH, repaid 7.31 USDC1.80health factor · LeveeUnwind · block 56,062,575Below trigger1.48Trigger 1.50Signed by MPC, sent6.20 s · took 4.92 sLeveeUnwind sold0.003288 WETHRepaid 7.31 USDC1.80health factor
  1. Before the run, untimed: health factor falls from 1.80 to 1.48, below the trigger of 1.50.
  2. 0 s: the keeper reads health factor 1.4800 on Aave on Base Sepolia.
  3. 1.28 s: the rescue call is included on NEAR, and the Levee contract checks the caps.
  4. 6.20 s: the MPC network returns the signature, 4.92 s after the call.
  5. 6.22 s: the keeper checks the signer and sends the call to LeveeUnwind.
  6. 6.67 s: the call is included in block 56,062,575. LeveeUnwind checks the trigger, the collateral and pool, and the price against Aave’s oracle, sells 0.003288 WETH and repays 7.31 USDC. Health factor is 1.80.

Stop by stop

You set the terms once. Then every rescue runs the same line. Times are medians from the 7 testnet rescues from collateral. The helper’s stop is square, like the terminus it is.

  1. Your position

    You set the terms

    Once, on Base: authorize LeveeUnwind with your trigger, target, price bound, collateral and pool, and approve a capped amount of its aToken.

  2. Keeper

    Reads health factor

    Every 5 seconds, from two RPCs. Acts only when they agree within 0.5% and the reads are under 30 seconds old.

  3. Keeper

    Sizes and quotes the sale

    Below your trigger, it works out the USDC repay that reaches your target and quotes the sale on Uniswap. Past your bound, it stops.

  4. Levee contract

    Checks your caps

    Per-rescue cap, daily cap, cooldown, fee ceilings. Then it writes the transaction itself.

    1.6 s to NEAR

  5. MPC network

    Signs it

    Chain Signatures sign LeveeUnwind.unwind for the rescuer address derived for your position.

    5.2 s to signature

  6. Your position

    The helper checks and sells

    On Base, LeveeUnwind checks your trigger, collateral, pool and bound, repays the USDC and sells just enough collateral.

    0.5 s to inclusion

  7. Keeper

    Writes the record

    Every attempt, landed or not, goes to the evidence folder with its timings.

One terminus

LeveeUnwind.unwind(borrower, collateral, amount, poolFee, maxSold)

The only call a rescue from collateral can make. The keeper sends a position id, an amount, max_sold and fees, and the borrower, collateral and pool are fixed at registration. On Base, before anything moves, the helper checks:

  • health factor is below your trigger
  • the collateral and pool are the ones you authorized
  • the sale is within your bound against Aave’s oracle, and within max_sold
  • health factor rose, and did not pass far beyond your target

LeveeUnwind has no owner and cannot be upgraded.

Who can do what

Each actor has one job. The helper on Base and the contract on NEAR enforce the limits, so a stolen keeper key stays inside them.

Borrower

Your wallet, on the lending chain

Can

  • Authorize LeveeUnwind with your trigger, target, price bound, collateral and pool
  • Set the aToken allowance to it
  • Revoke at once, without NEAR

LeveeUnwind

The helper on Base. No owner

Can

  • Sell your authorized collateral, in your authorized pool, to repay your USDC debt, below your trigger

Can’t

  • Act for anyone else
  • Change its terms
  • Be upgraded

Keeper

Key limited to rescue_from_collateral

Can

  • Ask for a repay within caps
  • Set max_sold
  • Fire early

Can’t

  • Change the destination, asset, pool or borrower
  • Exceed caps
  • Loosen your price bound
  • Withdraw

Levee contract

levee-core-v2-1503.testnet

Can

  • Sign unwind to the registered helper
  • Sign approve, repay and transfer, each to a fixed target

Can’t

  • Sign arbitrary payloads
  • Change its code: it has no keys

MPC network

NEAR Chain Signatures

Can

  • Sign for the derived rescuer address

Trusted with

  • Custody of the rescuer key. Levee puts no limit on it, and that trust stays.

Owner

The NEAR account that registers

Can

  • Register a position, set caps, pause
  • Approve, and withdraw float only to the registered borrower

Worst caseA stolen keeper key can act only while your health factor is below your trigger, only on the collateral and pool you named, and not much past your target. Each sale is at most your bound worse than Aave’s oracle, up to the daily cap. It can also burn rescuer gas up to the fee ceiling. revoke() or a zero allowance stops it at once.

Timetable of 22 testnet runs

Repay from collateral: 7 landed and 1 stopped itself, 8 Nov 2026, median 7.9 s from detection to inclusion. Repay from a reserve: 13 landed and 1 stopped itself, 7 Nov 2026, median 8.4 s from detection to inclusion. One test position on Base Sepolia. Nothing here has run on a mainnet.

Every landed run, stop by stop

Each line is one run. Steeper means faster. The blue line is the run replayed above.

Departures UTC, 7 and 8 Nov 2026

Repay from collateralv0.2 · 8 Nov 2026

  1. 12:00:197.5 sLandedNEARBase
  2. 10:39:376.7 sLanded· replayedNEARBaseLanded after both contract accounts lost their last key.
  3. 10:19:558.7 sLandedNEARBase
  4. 10:19:26noneStopped itselfThe pool asked 0.36% more WETH than the borrower’s price bound allows, so the keeper refused before asking NEAR, and nothing was sent.
  5. 10:16:598.2 sLandedNEARBase
  6. 10:15:569.2 sLandedNEARBase
  7. 10:14:437.6 sLandedNEARBase
  8. 10:13:297.9 sLandedNEARBase

Repay from a reservev0.1 · 7 Nov 2026

  1. 19:27:577.9 sLandedNEARBase
  2. 19:27:388.4 sLandedNEARBase
  3. 19:27:188.6 sLandedNEARBase
  4. 19:26:598.6 sLandedNEARBase
  5. 19:26:398.8 sLandedNEARBase
  6. 19:26:34noneStopped itselfTwo RPCs disagreed on the reserve balance by more than 0.5%, so the keeper did nothing.
  7. 19:26:167.5 sLandedNEARBase
  8. 19:25:559.6 sLandedNEARBase
  9. 19:25:377.3 sLandedNEARBase
  10. 19:25:1610.2 sLandedNEARBase
  11. 19:24:527.6 sLandedNEARBase
  12. 19:24:338.5 sLandedNEARBase
  13. 19:24:148.2 sLandedNEARBase
  14. 19:23:358.2 sLandedNEARBase

Signing on its own

15 of 15 signed on NEAR testnet, median 6.6 s, slowest 7.1 s. Signature only. Nothing was broadcast. Time from the keeper sending rescue to holding a verified signature.

Backtest over two crashes and a calm month

Every native USDC borrower on Aave v3 Base and Arbitrum, through two crashes and a calm month, replayed with trigger 1.20, target 1.50 and a 60 second delay. Each sale is priced from a real Uniswap v3 quote at its landing block, against Aave’s oracle in the same block. A simulation: it assumes the keeper, RPCs, NEAR and the MPC network all worked.

Liquidated positions saved

Of the borrowers really liquidated in each period. The reserve and the upfront repay hold 30% of debt in USDC; repaying from collateral holds none.

Crash 10 to 11 Oct 202549,685 borrowers, 952 liquidated
  1. Doing nothing0 saved. All 952 paid $1.40M of bonus
  2. From collateral, 1% bound635 66.7%
  3. From collateral, 3% bound654 68.7%
  4. Reserve, 30% of debt720 75.6%
  5. Same USDC repaid upfront731 76.8%

Net from collateral: +$174.7k at 1%, +$77.8k at 3%

Crash 31 Jan to 6 Feb 202654,479 borrowers, 4,077 liquidated
  1. Doing nothing0 saved. All 4,077 paid $1.42M of bonus
  2. From collateral, 1% bound3,424 84.0%
  3. From collateral, 3% bound3,547 87.0%
  4. Reserve, 30% of debt3,541 86.9%
  5. Same USDC repaid upfront3,541 86.9%

Net from collateral: +$774.0k at 1%, +$473.0k at 3%

Calm month 3 Dec 2025 to 1 Jan 202658,170 borrowers, 229 liquidated
  1. Doing nothing0 saved. All 229 paid $26.1k of bonus
  2. From collateral, 1% bound114 49.8%
  3. From collateral, 3% bound114 49.8%
  4. Reserve, 30% of debt189 82.5%
  5. Same USDC repaid upfront191 83.4%

Net from collateral: −$122.0k at 1%, −$290.1k at 3%

  • In both crashes, repaying from collateral avoided more liquidation bonus than it cost, at both bounds.
  • In the calm month it cost more than it avoided: net −$122.0k at the 1% bound. Each of the 51,430 borrowers armed above the trigger paid $1.60 in swap cost and gas over 30 days, and sold 2.0% of their collateral.
  • At the 1% bound it saved fewer liquidated positions than the reserve or the same USDC repaid upfront, in every period. Both of those need the cash in hand. The looser bound saved as many or more once: 3,547 against 3,541 at the 3% bound, 31 Jan to 6 Feb 2026.
  • In 10 to 11 Oct 2025, at the 1% bound, positions under $10k of debt lost $312.7k, with $401.0k spent on their gas. Larger positions made $487.4k.

Read these with the figures

  • Saved counts include positions already below the trigger when armed, which unwind at once. At the 1% bound: 416 of 635 in 10 to 11 Oct 2025, 1,735 of 3,424 in 31 Jan to 6 Feb 2026, 73 of 114 in 3 Dec 2025 to 1 Jan 2026.
  • The 10 to 11 Oct 2025 swap cost includes gains from pools that lagged a falling oracle. Counting no sale better than the oracle, it is $180.9k at the 1% bound, and the net is +$82.5k.
  • The replayed keeper resends a reverted unwind every minute. In 10 to 11 Oct 2025 gas was high during a spike on Arbitrum, and 63% of it went on reverted unwinds. The live keeper quotes before sending; with no gas on reverts, the net at the 1% bound would be +$501.7k.
  • Each sale fills at its quote, alone in its block. Infrastructure is up, with a fixed 60 second delay. Two crashes say nothing about how often crashes happen, so none of this is annualised.

Every figure by period, the misses, the split by size and the reserve mode’s own backtest are on the proof page.

Read any address

Free and read-only. Levee reads Aave on Base and Arbitrum, and Hyperliquid, and places each position on one line by its distance from liquidation. It repays only on Aave.

Example0x972b0F9cDE1266e860E546ac92E783741769400Fread 8 Nov 2026, 12:48 UTC · distance on a square-root scale

Both Aave positions are under 1.20, the trigger the backtest used. Repaying $117,327 would bring Aave on Base to 1.50.

For Aave the distance is a fall in collateral price, for the Hyperliquid shorts a rise in price. Levee has no relationship with this address, and nothing is repaying it.