PositionOperations
PositionOperations¶
Info
Access via client.position property.
High-level position management operations.
Initialize order operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subaccount
|
Subaccount
|
Subaccount instance providing access to auth, config, and APIs |
required |
Functions¶
list
¶
list(
is_open: Optional[bool] = None,
currency: str | None = None,
) -> list[PositionResponseSchema]
Get all positions
transfer
¶
transfer(
*,
amount: Decimal,
instrument_name: str,
to_subaccount: int,
signature_expiry_sec: Optional[int] = None,
maker_nonce: Optional[int] = None,
taker_nonce: Optional[int] = None
) -> PrivateTransferPositionResultSchema
Transfers a positions from one subaccount to another, owned by the same wallet.
The transfer is executed as a pair of orders crossing each other.
The maker order is created first, followed by a taker order crossing it.
The order amounts, limit prices and instrument name must be the same for both orders.
Fee is not charged and a zero max_fee must be signed.
The maker order is forcibly considered to be reduce_only, meaning it can only
reduce the position size.
History: For position transfer history, use the private/get_trade_history RPC
(not private/get_erc20_transfer_history).
transfer_batch
¶
transfer_batch(
*,
positions: List[PositionTransfer],
direction: Direction,
to_subaccount: int,
signature_expiry_sec: Optional[int] = None,
maker_nonce: Optional[int] = None,
taker_nonce: Optional[int] = None
) -> PrivateTransferPositionsResultSchema
Transfers multiple positions from one subaccount to another, owned by the same wallet.
The transfer is executed as a an RFQ. A mock RFQ is first created from the taker parameters, followed by a maker quote and a taker execute.
The leg amounts, prices and instrument name must be the same in both param payloads.
Fee is not charged and a zero max_fee must be signed.
Every leg in the transfer must be a position reduction for either maker or taker (or both).
History: for position transfer history, use the private/get_trade_history RPC
(not private/get_erc20_transfer_history).