Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

orders_by_user

All resting limit orders for one user, keyed by chain OrderId.

Returns only orders that have not been fully filled or cancelled; the count matches the user's open_order_count and the sum of reserved_margin across these orders equals user_state.reserved_margin.

Signature

def orders_by_user(self, user: Addr) -> dict[OrderId, dict[str, Any]]

Example

from dango.info import Info
from dango.utils.constants import MAINNET_API_URL
from dango.utils.types import Addr
 
info = Info(MAINNET_API_URL, skip_ws=True)
orders = info.orders_by_user(Addr("0x..."))
for oid, order in orders.items():
    print(oid, order["pair_id"], order["size"], order["limit_price"])

Parameters

userAddr. The user's account address.

Returns

dict[OrderId, dict[str, Any]] — map of order id to order details. The value shape matches QueryOrdersByUserResponseItem — cast to that TypedDict for typed access.

See also