Turn a long into a short without closing it
A leveraged position's direction is a setting, not a thing you rebuild. Long, short or delta-neutral, changed inside one transaction.
You are long ETH: wstETH posted as collateral, USDC borrowed against it. You have changed your mind and you want to be short.
The ordinary way is to take the whole thing apart. Repay the USDC, withdraw the wstETH, sell it, buy USDC, post that as collateral, borrow ETH, sell the ETH. Seven steps, seven fees, and the market moves under you the entire time.
Worse, the first step is already blocked. To repay the loan you need your collateral back. To get your collateral back you must repay the loan. By hand that is not slow — it is closed.
Direction is a setting
One operation carries a required choice of what the position should be when it finishes.
- long
- An ordinary leveraged long. Collateral one asset, debt another, exposure to the difference
- short
- A true reversal of the market being left. Not an unwind and a re-entry — the position ends up facing the other way
- neutral
- The same asset is lent and borrowed, so there is no price exposure at all
That last one is worth sitting with. Delta-neutral is a mode here, not a strategy you assemble. The position keeps its structure and stops having a view, in one press, and the same operation gives the view back later.
Why it can be one transaction
The deadlock is broken with borrowed money you never touch.
Money is borrowed for the length of the transaction, the old debt is cleared, the position is rebuilt facing the other way, and the borrowing is repaid out of what the new side borrows. The mechanics are the same ones a migration uses, set out step by step there.
What matters for a reversal specifically is the seven-step manual version it replaces. In that one there is a long middle where you hold a large pile of cash and no position at all — no long, no short, no view — while the price you have just formed an opinion about carries on moving. That window is not a fee you pay. It is a position you did not choose to have, held at the worst possible moment, and doing it atomically is what deletes it.
What it will not do
- Both ends must be a curated market. It reaches only listed pairs, named at both ends. This is not a route to an arbitrary pair.
- You cannot take the flash loan yourself. There is no
flash.borrowoperation — it is a means inside fourteen of the sixty-one operations, never a step of its own. Arbitrage and liquidating other people’s positions, the two things flash loans are famous for, are not available here. - A Safe cannot do it, for the reason set out in the migration post: the callback.
One practical detail: clear the debt exactly. A fixed repayment leaves the interest accrued since the plan was written, and dust debt blocks the withdrawal that follows.