Skip to main content
Every adjustment uses build_manage_tx against a position’s on-chain id (from get_positions).

Find the position

Adjust

Close

Each returns the same { 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)

You exit holding the collateral token itself, never touching its market.
Don’t wait for close to throw. get_positions returns exitLiquidity.exceedsCleanExitSize per position — poll it and unwind while a route still exists.