build_manage_tx against a position’s on-chain id (from get_positions).
Find the position
Adjust
Close
{ approvals, tx, meta } bundle — sign approvals first, then the tx. Verify with get_positions after it confirms.
Unwinding when exit liquidity is gone
close needs a live swap route. If it’s gone the build fails closed — but you can still exit in-kind, because these two need no swap:
1
Repay the debt (no swap)
2
Withdraw the collateral (no swap)