Closing a liquidity position into a long, a short, or neither
Exiting a Uniswap position normally leaves you holding two tokens and no view. Four operations let you name the position you become instead.
Closing a liquidity position is the easy half. You burn the NFT and two tokens land in your account — some WETH, some USDC, in whatever ratio the pool happened to be at.
Then you are standing there holding a pile of both, with no position and an opinion you have not expressed. The usual next move is three or four more transactions to become whatever you actually wanted to be.
Four operations skip that. You name what the position should become, and the exit builds it.
The four exits
- Both sides as collateral
- Repay the vault, burn the LP, supply both tokens to Aave, borrow back the flash asset. You end holding both assets as collateral with a USDC debt
- Into a long
- Supply both tokens, borrow USDC against them, sell WETH if the ratio needs it. You end long the asset, financed
- Into a short
- Supply the USDC side as collateral, borrow WETH against it, sell that WETH for USDC. You end short the asset you were just providing liquidity in
- Into a single collateral
- Swap one side into the other first, then supply only that. You choose which side is sold; the unsold one is the whole collateral
The short is the one worth reading twice. You were providing liquidity in a WETH/USDC pool — a position with no directional view — and in one transaction you leave it facing the other way, financed, without ever holding the proceeds in between.
Three places a zero is refused
Running through all four is a design decision that shows up three separate times: a parameter you might expect to have a sensible default instead refuses to run when you leave it empty.
- The loan-to-value ceiling
- The LTV your position may have after the Aave borrow. Zero is refused outright rather than treated as "no ceiling"
- The sale floor
- The least you will accept on the inner swap. Zero is refused as having no floor — and a 0.25% default that exists elsewhere in the system is deliberately not carried over
- The unwind minimums
- The least each side of the burn must return
That third one is not a convenience setting, and it is worth explaining why it cannot be skipped.
The attack the unwind minimums stop
When a liquidity position is burned, it settles at the pool’s current price, whatever that price happens to be at that instant. The minimums are the only bound on it.
So a zero there does not mean “no preference”. It means any ratio at all, which hands an attacker a straightforward round trip: push the pool price with borrowed money, let your unwind settle at the price they chose, push it back, keep the difference.
There is a general principle underneath the three, and it is the opposite of convenience. A default is a decision somebody else made on your behalf, and these three decide how much money you keep. Refusing to have an opinion is the safer behaviour, even though it means more required fields.
Three things it cannot do
- These land on Aave v3. There is no Aave v4 equivalent of them — the v4 operations here are supply, borrow, repay and withdraw, and none of them is an LP exit. The pair also has to be one the system already curates.
- Nothing is produced for a later step. These operations return nothing a following step can refer to, so a plan cannot chain something onto the position they create by reference — it has to name it.
- A Safe cannot run them, because every one is flash-funded and the callback needs a module.