What is a "loop unwind" and why does it cost more than building the loop?
A leveraged staking/restaking loop (e.g. stETH deposited, ETH borrowed against it, swapped back into more stETH, redeposited N times) is built gradually and mostly on-protocol at close to par. Unwinding it — especially in a hurry, to fix a falling Health Factor — means selling a large block of your LST for ETH on a DEX in a short window. That trade has to walk down a constant-product AMM curve exactly like any large swap, so the exit typically costs meaningfully more in slippage than the entry did, on top of any de-peg discount already sitting on the LST.
Why does splitting the unwind across more tranches or venues reduce cost — up to a point?
Constant-product AMM price impact is non-linear: a trade against a shallow slice of a pool costs disproportionately more than the same dollar amount spread across several similarly-deep venues, because each independent pool only has to absorb a fraction of the flow. Splitting into more tranches keeps shrinking that slippage cost — but each tranche is its own on-chain transaction with its own gas bill, so beyond a certain point extra tranches add more gas than they save in slippage. The calculator below scans tranche counts to find where total cost (slippage + gas) bottoms out.
What happens if I have to unwind during a de-peg, like stETH in June 2022?
De-peg and slippage stack, they don't offset. If the LST is already trading at a discount to ETH before you start (a de-peg), every unit you sell realizes that discount on top of the AMM price impact your own selling adds — and de-peg events are exactly when everyone else is also trying to unwind the same pools, making the venues you'd normally split across thinner and more correlated. Model the discount input above at 2-6% (roughly the range seen intraday in the worst LST de-peg events) to see how fast total unwind cost compounds versus a calm-market exit.
How is this different from the AMM / DEX Price Impact Calculator?
The AMM Price Impact Calculator prices a single swap against a single pool. This tool is built specifically for exiting a leveraged loop position: it takes the total debt that has to be repaid (not just one trade), lets you model a pre-existing de-peg discount on top of AMM impact, splits the exit across a chosen number of tranches/venues, and adds per-transaction gas cost — then finds the tranche count that minimizes combined slippage-plus-gas cost, which a single-swap calculator can't answer.