Collateral swap
Rotating collateral normally means repaying the debt, withdrawing, re-supplying and re-borrowing — four transactions, and a window in the middle where the position is unhealthy. This is one transaction, and the health factor never dips.
The new collateral is supplied before the old is withdrawn. That ordering is the entire point: the obvious implementation withdraws first, and for the few seconds in between, the position is under-collateralised and a liquidator is watching.
Because it is one atomic transaction, a liquidator cannot act between the steps at all. And the contract enforces a minimum health factor after the swap — if the new collateral would leave the position weaker than you specified, the whole thing reverts and nothing has moved except gas.
Free. The receiver contract charges nothing for this. You pay the flash premium, the swap, and gas.
Live on Ethereum and Base. Free to use.
See the API