marginpy.utp.zo.utils.client.dex module

decode_field(ty, v)
strip_padding(b: bytes) bytes
decode_namedtuple(cls, fmt: str, b: bytes)
class AccountFlag(value)

Bases: IntFlag

An enumeration.

INITIALIZED = 1
MARKET = 2
OPEN_ORDERS = 4
REQUEST_QUEUE = 8
EVENT_QUEUE = 16
BIDS = 32
ASKS = 64
DISABLED = 128
CLOSED = 256
PERMISSIONED = 512
class Market(account_flags, own_address, quote_fees_accrued, req_q, event_q, bids, asks, base_lot_size, quote_lot_size, fee_rate_bps, referrer_rebates_accrued, funding_index, last_updated, strike, perp_type, base_decimals, open_interest, open_orders_authority, prune_authority)

Bases: NamedTuple

account_flags: AccountFlag

Alias for field number 0

own_address: PublicKey

Alias for field number 1

quote_fees_accrued: int

Alias for field number 2

req_q: PublicKey

Alias for field number 3

event_q: PublicKey

Alias for field number 4

bids: PublicKey

Alias for field number 5

asks: PublicKey

Alias for field number 6

base_lot_size: int

Alias for field number 7

quote_lot_size: int

Alias for field number 8

fee_rate_bps: int

Alias for field number 9

referrer_rebates_accrued: int

Alias for field number 10

funding_index: i128

Alias for field number 11

last_updated: int

Alias for field number 12

strike: int

Alias for field number 13

perp_type: int

Alias for field number 14

base_decimals: int

Alias for field number 15

open_interest: int

Alias for field number 16

open_orders_authority: PublicKey

Alias for field number 17

prune_authority: PublicKey

Alias for field number 18

property quote_decimals
classmethod from_bytes(b: bytes)
classmethod from_base64(b: str)
class SlabNode

Bases: object

class Uninitialized

Bases: NamedTuple

class Inner(prefix_len, key, l, r)

Bases: NamedTuple

prefix_len: int

Alias for field number 0

key: u128

Alias for field number 1

l: int

Alias for field number 2

r: int

Alias for field number 3

class Leaf(owner_slot, fee_tier, key, control, quantity, client_order_id)

Bases: NamedTuple

owner_slot: int

Alias for field number 0

fee_tier: int

Alias for field number 1

key: u128

Alias for field number 2

control: PublicKey

Alias for field number 3

quantity: int

Alias for field number 4

client_order_id: int

Alias for field number 5

class Free(next)

Bases: NamedTuple

next: int

Alias for field number 0

class LastFree

Bases: NamedTuple

class Order(owner_slot, fee_tier, order_id, control, size_lots, client_order_id, price, size, side)

Bases: NamedTuple

owner_slot: int

Alias for field number 0

fee_tier: int

Alias for field number 1

order_id: u128

Alias for field number 2

control: PublicKey

Alias for field number 3

size_lots: int

Alias for field number 4

client_order_id: int

Alias for field number 5

price: float

Alias for field number 6

size: float

Alias for field number 7

side: Literal['bid', 'ask']

Alias for field number 8

class Slab(account_flags, bump_index, free_list_len, free_list_head, root, leaf_count, nodes)

Bases: NamedTuple

account_flags: AccountFlag

Alias for field number 0

bump_index: int

Alias for field number 1

free_list_len: int

Alias for field number 2

free_list_head: int

Alias for field number 3

root: int

Alias for field number 4

leaf_count: int

Alias for field number 5

nodes: list[marginpy.utp.zo.utils.client.dex.SlabNode]

Alias for field number 6

property side: Literal['bid', 'ask']
min()
max()
classmethod from_bytes(b: bytes)
classmethod from_base64(b: str)
class Orderbook(bids: Slab, asks: Slab, mkt: Market)

Bases: object

bids: list[marginpy.utp.zo.utils.client.dex.Order]
asks: list[marginpy.utp.zo.utils.client.dex.Order]