previewCloseTrade(params) is the exit mirror of previewOpenTrade. It reports what a full or partial close would return at the live price, including the rollover the close settles.
pairId and idx come from getOpenPositions().
Parameters
Response schema
Partial closes
Size, collateral, PnL and rollover all scale withclosePercent: closing 25% releases a quarter of the collateral and settles a quarter of the accrued rollover.
oracleFee is a flat deposit the wallet must hold to submit the close. It is refunded on execution, so it is not deducted from received — but a ticket should show it, and block submission when the wallet cannot cover it.