Skip to main content

Welcome to Polyhush

The Polyhush SDK is a Python client that provides a simple, intuitive interface for trading on prediction markets through the Polyhush API.

Features

Place buy and sell orders with a clean, Pythonic API. Support for both limit orders and market orders.
# Limit order
client.buy(token_id="...", shares=10, price=0.55)

# Market order
client.market_buy(token_id="...", usdc_amount=50)
Monitor your positions with detailed P&L information, including unrealized gains and current market values.
positions = client.get_position_details()
for pos in positions:
    print(f"{pos['market_question']}: ${pos['unrealized_pnl']:.2f}")
Easily settle resolved markets and claim your winnings with built-in settlement methods.
# Settle all winning positions
results = client.settle_all_positions()
total = sum(r['payout'] for r in results if r['settled'])
Full order lifecycle management including creation, cancellation, syncing, and history tracking.

Installation

Install the Polyhush SDK using pip:
pip install polyhush

Quick Example

from polyhush import PolyhushClient

# Initialize the client
client = PolyhushClient(api_key="your-api-key")

# Check your balance
balance = client.get_balance()
print(f"Available: ${balance['available_balance']:.2f}")

# Place a limit buy order
result = client.buy(
    token_id="your-token-id",
    shares=10,
    price=0.55
)
print(f"Order placed: {result['order_id']}")

Support

Need help? We’re here for you.