Installation
Quick Start
Classes
PolyhushClient
Main client class for all API operations
PolyhushAPIError
Exception class for API errors
Method Categories
Account & Balance
| Method | Description |
|---|---|
get_balance() | Get USDC balance and portfolio summary |
Positions
| Method | Description |
|---|---|
get_positions() | Get current positions with optional P&L |
Orders
| Method | Description |
|---|---|
buy() | Place a buy order (limit or market) |
sell() | Place a sell order (limit or market) |
cancel_orders() | Cancel one or all open orders |
sync_orders() | Sync order status from Polymarket |
Market Data
| Method | Description |
|---|---|
get_ticker() | Get current price ticker for a token |
Order Type Constants
The client provides constants for order types:Error Handling
All methods raisePolyhushAPIError on failure:
Environment Variables
| Variable | Description |
|---|---|
POLYHUSH_API_KEY | Default API key (used if not passed to constructor) |
Type Hints
The SDK includes full type hints for IDE support:Thread Safety
ThePolyhushClient is not thread-safe. For multi-threaded applications, create a separate client instance per thread: