marginpy.utp.zo.account module

class UtpZoAccount(client: MarginfiClient, marginfi_account: MarginfiAccount, account_data: UtpData)

Bases: UtpAccount

[internal] 01 proxy, encapsulating 01-specific interactions.

!! Do not instantiate on its own !!

property config

Gets 01-specific config.

async make_activate_ix() InstructionsWrapper
async activate() TransactionSignature
async make_deactivate_ix() InstructionsWrapper
async deactivate() TransactionSignature
async make_deposit_ix(ui_amount: float) InstructionsWrapper
async deposit(ui_amount: float) TransactionSignature
async make_withdraw_ix(ui_amount: float) InstructionsWrapper
async withdraw(ui_amount: float) TransactionSignature
async make_place_perp_order_ix(market_symbol: str, order_type: ZoOrderType, is_long: bool, price: float, size: float, limit: int = 10, client_id: int = 0) InstructionsWrapper
async place_perp_order(market_symbol: str, order_type: ZoOrderType, is_long: bool, price: float, size: float, limit: int = 10, client_id: int = 0) TransactionSignature
async make_cancel_perp_order_ix(market_symbol: str, order_id: Optional[int] = None, is_long: Optional[bool] = None, client_id: Optional[int] = None) InstructionsWrapper
async cancel_perp_order(market_symbol: str, order_id: Optional[int] = None, is_long: Optional[bool] = None, client_id: Optional[int] = None) TransactionSignature
async make_create_perp_open_orders_ix(market_symbol: str) InstructionsWrapper
async create_perp_open_orders(market_symbol: str) TransactionSignature
async make_settle_funds_ix(market_symbol: str) InstructionsWrapper
async settle_funds(market_symbol: str) TransactionSignature
async get_observation_accounts() List[AccountMeta]

Creates list of account metas required to observe a Zo account.

async observe() UtpObservation

Retrieves the 01 observation directly from the 01 accounts and refreshes the cache.

get_zo_margin_address(authority: PublicKey) Tuple[PublicKey, int]

[internal] Computes the 01 account PDA tied to the specified user.

async get_zo_client(margin_pk: Optional[PublicKey] = None) Zo
get_oo_adress_for_market(zo_control: PublicKey, market_address: PublicKey) Tuple[PublicKey, int]

[internal] Compute the 01 account PDA tied to the specified user.

get_logger() Logger