Skip to content

Close Position

Close position for a given market.

Opposite short-term market orders are used. If provided, the position is only reduced by a size of reduce_by. Note that at the moment Rubin doesn’t support spot trading.

Method Declaration

Python
 

Parameters

ParameterLocationTypeRequiredDescription
accountqueryAccounttrueThe wallet address that owns the subaccount.
subaccountquerySubaccounttrueSubaccount to close
market_paramsqueryOrderMarketParamstrueMarket parameters
reduced_byqueryBigDecimalfalse
client_idqueryClientIdtrue

Response

StatusMeaningSchema
200OKTxHash
400Bad RequestThe request was malformed or invalid.
404Not FoundThe subaccount was not found.

Examples: Rust