Close (or partially close) a perp position
Build unsigned transaction(s) to close a position. Set entire_position=true
for a full close, otherwise pass size_usd_delta_e6 for a partial close.
Idempotent on client_order_id (60s window).
Authorizations
Body
1Position PDA being closed.
Side of the open position. Required so the builder picks the correct collateral custody account; without it a short close is rejected on-chain.
long, short True = full close. When true, size_usd_delta_e6 is ignored.
USD notional to close in USDC micros. Required when entire_position=false on a Jupiter market.
Phoenix only. Percent of the position to close, in basis points
(10000 = full) — Phoenix closes are base-unit/percent oriented, not
USD-notional like Jupiter. Omitted, entire_position maps to 10000;
a PARTIAL Phoenix close without this field is rejected. Ignored on
Jupiter markets, which use size_usd_delta_e6.
