Max close range (with body)
POST/v1/data/loop/range/close
Compute the maximum amount for closing (deleveraging) a position.
The max closeable amount is bounded by the smaller of the user's collateral and debt. amountIn = collateral withdrawn, amountOut = debt repaid.
Use denomination=exactInput (default) to base the range on collateral, or exactOutput to base it on debt.
Requires positions[] in the POST body (or account for GET) to read collateral and debt balances.
POST accepts a JSON body with the user's current portfolio state, avoiding an on-chain fetch.
Request
Responses
- 200
- 400
Max close range
Validation error