Freeboard Finance

For Aave borrowers: a basket that shifts into your debt asset as health factor falls, and pays you.

Visit Repo
Freeboard Finance banner

About

Freeboard Finance is a no-cliff liquidation guard for Aave v3 borrowers: a basket beside the loan that shifts into the debt asset as the health factor falls, and pays the borrower a spread for every step.

THE PROBLEM

Protecting a leveraged position today is binary. Nothing happens until a threshold is crossed, then collateral is dumped all at once, at the worst moment, into the thinnest market. Stop-losses, keeper bots and liquidation guards all share that cliff.

THE INSIGHT

A rebalance and a deleverage are the same operation at different urgency: sell some of X for Y according to a rule. An index rebalances toward target weights; a guard moves toward solvency. So Freeboard makes the target weights a function of the health factor. With ETH, BTC and USDC beside a USDC loan, the curve the borrower signs reads: HF 2.00 → 50/30/20, HF 1.60 → 40/24/36, HF 1.30 → 30/16/54, HF 1.15 → 20/10/70. As the health factor falls, the target slides toward the asset she owes. Trades that move the basket toward its target are priced attractively; trades that move it away are priced expensively. Arbitrageurs do the rebalancing, a little at a time, and pay the borrower a spread to do it. Deleveraging starts early, intensifies continuously, and is paid for the whole way down. By the time the loan is in danger she already holds the USDC to repay it.

HOW THE HEALTH FACTOR GETS INTO THE PRICE The basket is a 1inch Aqua position. The strategy executes on the production AquaSwapVMRouter (0x111111338c…, swap-vm v1.0.2, matched to the tag by bytecode) through the router's own _extruction instruction, opcode 0x20, calling FreeboardExtruction, an immutable view contract. Inside the pricing path, on every quote and every swap, it staticcalls Aave v3's getUserAccountData for the maker, decodes the curve from the program bytes, interpolates the target at that health factor, reads the other basket legs from Aqua, and prices the fill by how much closer or farther from target the basket ends up. No router source is modified, no redeploy, nothing off-chain in the loop. Because Aave's read is deterministic within a block, quote and swap always agree; swap-vm's own invariant suite runs against the Freeboard program on the deployed router with every check on.

WHY A PUBLIC CURVE CANNOT BE FRONT-RUN

Front-running a rule needs a moment worth waiting for, and a continuous curve has none: the basket sells a little at every health factor, so there is no cliff. The health factor cannot be pushed; it moves with Aave's oracle and the borrower's own debt, neither of which is flash-loanable. Front-running another taker's fill hurts that taker, not the borrower. No fill ever beats the oracle, so there is no price below fair to drain at. And a public curve means more takers compete for the same fill, which is what protects the borrower.

THE PER-FILL CAP

One fill can move at most maxShiftBps of the basket's value (500 bps in the demo), checked after pricing on the amounts that actually settle. A wrong health factor, a bug, or a greedy taker cannot restructure the basket in one fill; a fill past the cap reverts with FreeboardFillExceedsMaxShift(shift, maxShift). If Aave cannot compute the health factor at all, the fill reverts rather than pricing from a number Aave would not stand behind; Aave cannot liquidate in that state either, so refusing costs the borrower nothing.

LEDGER: THE HUMAN APPROVES THE CURVE

The curve and the cap are bytes inside the SwapVM program, and the program is what Aqua.ship() commits to, indexed by its hash. So the transaction the borrower signs on her Ledger is the approval of her risk policy, not just a key. She signed it on a Nano X through the official @ledgerhq/wallet-cli, and it is on Ethereum mainnet: tx 0xc13c55e1…70c4, against FreeboardExtruction at 0x8804F353…0f41. A test decodes that transaction and asserts its calldata is byte-for-byte the program every fork test prices; flip one byte of the curve and the deployed router refuses it on quote and on swap. The device screen is a blind-signed contract call today; readable rows need an ERC-7730 descriptor, which is not done, and the README says so.

THE AI AGENT: BOUNDED BY THE CHAIN, NOT BY A PROMPT The taker is an LLM agent (Claude, on the Strands Agents TypeScript SDK) with exactly three tools: read the position, quote a trade, fill it. No rule in code picks the pair, the size or the moment; the model does. Its RPC URL, taker key and API key are decrypted from Ledger's Key Ring into memory at start-up, never on disk or in the environment. In the judged run the operator told it to deleverage Alice "all of it, in ONE fill." It sent the whole 5,855 USDC gap; the router refused it, FreeboardFillExceedsMaxShift(945, 500). It then filled 3,100 USDC → 0.058883 WBTC, equal to its quote to the wei, toward target, and ended its report by explaining that the cap comes from the curve Alice signed on her Ledger, which no operator, prompt or agent can raise. That is Ledger's threshold model for agents, set once and enforced on-chain: autonomous under the cap, a new device signature above it.

WHAT IT DOES FOR THE BORROWER, MEASURED

Same wallet, same Aave position, same oracle path from HF 2.00 to 1.10, same taker, the same $80,000 through the deployed Aqua and router, with one instruction of difference: swap-vm's stock constant-product swap or Freeboard's curve. The stock basket buys the falling asset and pays its takers -$395.83 to do it; it reaches the bottom worth $53,703, holding 17,888 USDC. Freeboard earns +$24.47 in spread, arrives worth $56,328, holding 39,435 USDC of the debt asset, $5,128 ahead of holding the shipped basket untouched. When she repays with what the basket handed her, her health factor is 1.37 instead of 1.21. Every fill is real ERC-20 movement on a mainnet fork at block 25,900,000, against the deployed contracts' own bytecode.

WHAT IT NEVER DOES

Freeboard never touches the Aave position. No supply, borrow or repay; the collateral and the debt stay exactly where they are. It only changes what the basket beside the loan is made of, so that as her margin thins she is converted, and paid, into the asset she would need to repay. Repaying stays her action.

The demo page draws the signed curve decoded from the program bytes, slides the cursor as the health factor falls, and counts the spread up fill by fill; it replays the committed run by default and reads a live anvil walking the same path when one is present. Every claim above names the test that pins it, in the README.

From the public ETHGlobal showcase page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

QuietLast push 83 days ago

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.