← All posts

Collecting fees you have already earned requires borrowing money

On a leveraged Uniswap position, taking the fees you are owed needs a flash loan first. Not a quirk of ours — a consequence of what collateral means.

Architecture2 min readDeFiLoops

Your liquidity position has earned three hundred dollars in fees. The fees are yours. Nobody disputes that they are yours.

If the position has been borrowed against, you cannot simply take them.

Why not

The position is collateral. Every part of it backs the loan, and the accrued fees are part of it. Withdrawing them makes the collateral smaller, and a lender that let you quietly shrink the thing securing its loan would not be a lender for long.

So the vault will not release the fees while the debt stands. The debt cannot be cleared without money. The money is, in part, the fees.

How it is done anyway

Borrow the repayment for the length of one transaction, clear the debt, take the fees, restore the borrowing, repay the loan. One press, and the fees arrive.

The borrowed money comes from Morpho, which lends flash for nothing while Aave charges a premium. One detail worth stating precisely: Morpho lends it to the adapter, not to your account. The borrowed sum never touches the account at any point in the transaction, so there is no instant at which it is yours and no instant at which it could go anywhere else.

The part that is worth internalising

There is a habit of thinking about leverage as something that affects your returns — bigger gains, bigger losses, a liquidation price to watch. It also changes what you are permitted to do with your own position, and that second cost is the one nobody prices in.

Under leverage, routine maintenance stops being routine:

Collecting fees
Needs the debt cleared first
Adding liquidity
Needs the debt cleared first
Moving the range
Needs the position burned, which needs the debt cleared first
Splitting the position
Same

Every one of those is a flash loan in this system, and the reason there are fourteen flash-funded operations rather than two.