Signature
client.get_orders() -> Dict
Parameters
This method takes no parameters.
Returns
| Field | Type | Description |
|---|
orders | list | Array of open order objects |
count | int | Number of open orders |
Order Object Fields
| Field | Type | Description |
|---|
id | string | Unique order ID |
token_id | string | Outcome token identifier |
market_id | string | Market/condition ID |
side | string | "BUY" or "SELL" |
price | float | Limit price per share |
size | float | Total order size in shares |
filled_size | float | Shares already filled |
remaining_size | float | Shares still on the book |
status | string | "PLACED" or "PARTIALLY_FILLED" |
created_at | string | ISO timestamp of order creation |
updated_at | string | ISO timestamp of last update |
market_question | string | The market question text |
outcome_name | string | Name of the outcome (e.g., “Yes”, “No”) |
Example
from polyhush import PolyhushClient
client = PolyhushClient(api_key="your-api-key")
# Get all open orders
result = client.get_orders()
print(f"You have {result['count']} open orders")
for order in result['orders']:
remaining = order['remaining_size']
filled = order['filled_size']
total = order['size']
print(f"\n{order['side']} {remaining:.2f}/{total:.2f} @ ${order['price']:.2f}")
print(f" Market: {order['market_question']}")
print(f" Outcome: {order['outcome_name']}")
print(f" Status: {order['status']}")
if filled > 0:
print(f" Filled: {filled:.2f} shares ({filled/total*100:.1f}%)")
This only returns GTC (Good Till Cancelled) limit orders that are waiting on the order book.
Market orders (FOK/FAK) execute immediately and won’t appear here.
Use Cases
- Monitor pending orders - Check which orders are waiting to be filled
- Track partial fills - See how much of each order has been filled
- Build order management UI - Display user’s active orders
- Cancel stale orders - Identify and cancel old unfilled orders
# Find orders that are more than 50% filled
result = client.get_orders()
nearly_filled = [
order for order in result['orders']
if order['filled_size'] / order['size'] > 0.5
]
# Cancel all sell orders
for order in result['orders']:
if order['side'] == 'SELL':
client.cancel_orders(order_id=order['id'])