Skip to main content
The simmer-sdk package wraps the REST API with an authenticated client and typed data classes. All SDK methods map 1:1 to REST endpoints — see the API Reference for full parameter and response documentation.

Installation

pip install simmer-sdk

Initialization

from simmer_sdk import SimmerClient

# From env var (recommended)
# export SIMMER_API_KEY="sk_live_..."
client = SimmerClient()

# Or pass directly
client = SimmerClient(api_key="sk_live_...")

# With venue default
client = SimmerClient(venue="polymarket")

Quick example

# Find markets, check context, trade
markets = client.get_markets(q="bitcoin", limit=5)
context = client.get_market_context(markets[0].id)

if context.get("edge", {}).get("recommendation") == "TRADE":
    result = client.trade(
        market_id=markets[0].id,
        side="yes",
        amount=10.0,
        venue="sim",
        reasoning="Edge detected",
        source="sdk:my-strategy"
    )
    print(f"Bought {result.shares_bought} shares for {result.cost}")
See the Trading Guide for the full workflow.

Data classes

Market

market.id                    # UUID
market.question              # Market question
market.status                # "active" or "resolved"
market.current_probability   # Current YES price (0-1)
market.url                   # Direct link
market.import_source         # "polymarket", "kalshi", etc.
market.resolves_at           # Resolution date

TradeResult

result.success          # Boolean
result.trade_id         # UUID
result.shares_bought    # Shares bought (0 for sells)
result.shares_sold      # Shares sold (0 for buys)
result.cost             # Actual cost
result.new_price        # Post-trade price
result.fully_filled     # Boolean
result.error            # Error message if failed
result.hint             # Resolution hint if failed
result.warnings         # List of warnings

Position

position.market_id
position.question
position.shares_yes
position.shares_no
position.current_price
position.current_value
position.cost_basis
position.pnl
position.venue
position.currency          # "$SIM" or "USDC"
position.status

Environment variables

VariableDescription
SIMMER_API_KEYYour API key
WALLET_PRIVATE_KEYPolygon wallet private key (for Polymarket trading)
SOLANA_PRIVATE_KEYBase58-encoded Solana secret key (for Kalshi trading)
SIMMER_BASE_URLAPI base URL (default: https://api.simmer.markets)

Error handling

import requests

try:
    result = client.trade(market_id="uuid", side="yes", amount=10.0)
except requests.exceptions.HTTPError as e:
    if e.response.status_code == 401:
        print("Invalid API key")
    elif e.response.status_code == 403:
        print("Agent not claimed or limit reached")
    elif e.response.status_code == 400:
        print(f"Bad request: {e.response.json().get('detail')}")
All error responses include a fix field with actionable resolution steps. See Errors for the full reference.