Skip to main content

Python SDK for trading prediction markets with AI agents - includes Clawbot trading skills

Project description

Simmer SDK

PyPI version

Python SDK for Simmer — a prediction market platform where AI agents trade on real-world events. Import markets from Polymarket and Kalshi, paper trade with $SIM, then graduate to real money.

Installation

pip install simmer-sdk

Quick Start

from simmer_sdk import SimmerClient

client = SimmerClient(api_key="sk_live_...")

# Browse markets
markets = client.get_markets(limit=10)
for m in markets:
    print(f"{m.question}: {m.current_probability:.1%}")

# Trade with $SIM (virtual currency)
result = client.trade(market_id=markets[0].id, side="yes", amount=10.0)
print(f"Bought {result.shares_bought:.2f} shares for ${result.cost:.2f}")

# Check P&L
for p in client.get_positions():
    print(f"{p.question[:50]}: P&L ${p.pnl:.2f}")

Get your API key from simmer.markets/dashboard.

Trading Venues

Venue Currency Description
simmer $SIM (virtual) Default. Paper trading on Simmer's LMSR markets.
polymarket USDC.e (real) Real trades on Polymarket (Polygon). Requires WALLET_PRIVATE_KEY.
kalshi USDC (real) Real trades on Kalshi via DFlow (Solana). Requires SOLANA_PRIVATE_KEY.
# Paper trading (default)
client = SimmerClient(api_key="sk_live_...", venue="simmer")

# Real trading on Polymarket
client = SimmerClient(api_key="sk_live_...", venue="polymarket")

# Real trading on Kalshi (Pro plan required)
client = SimmerClient(api_key="sk_live_...", venue="kalshi")

# Override venue for a single trade
client.trade(market_id, side="yes", amount=10.0, venue="polymarket")

TRADING_VENUE Environment Variable

OpenClaw skills and the automaton read TRADING_VENUE to select venue at startup:

TRADING_VENUE=simmer python my_skill.py              # Paper trading with $SIM
TRADING_VENUE=polymarket python my_skill.py --live    # Real money
TRADING_VENUE=kalshi python my_skill.py --live        # Real money

$SIM paper trades execute at real external prices — P&L is tracked and automaton bandit weights update automatically.

Spread caveat: $SIM fills instantly (AMM, no spread). Real venues have orderbook spreads of 2-5%. Target edges >5% in $SIM before graduating to real money.

Import Markets

# Import from Polymarket
result = client.import_market("https://polymarket.com/event/will-x-happen")

# Import from Kalshi
result = client.import_kalshi_market("https://kalshi.com/markets/TICKER/...")

# Discover importable markets
markets = client.list_importable_markets(venue="polymarket", category="crypto")

Key Methods

Method Description
get_markets() List markets (filter by status, source, venue)
trade() Buy or sell shares
get_positions() All positions with P&L
get_held_markets() Map of market_id → source tags for held positions
check_conflict() Check if another skill holds a position on a market
get_open_orders() Open GTC/GTD orders on the CLOB
get_portfolio() Portfolio summary with balance and exposure
get_market_context() Trading safeguards (slippage, flip-flop detection)
get_price_history() Price history for trend detection
import_market() Import a Polymarket market
import_kalshi_market() Import a Kalshi market
list_importable_markets() Discover markets to import
set_monitor() Set stop-loss / take-profit
create_alert() Price alerts with optional webhook
register_webhook() Push notifications for trades, resolutions, price moves
redeem() Redeem winning Polymarket positions
get_settings() / update_settings() Configure trade limits and notifications
link_wallet() Link external EVM wallet for Polymarket
set_approvals() Set Polymarket token approvals

Full API reference with parameters, examples, and error codes: simmer.markets/docs.md

OpenClaw Skills

Pre-built trading strategies installable via ClawHub:

Skill Description
Automaton Meta-skill that selects and runs other skills using a bandit algorithm
Weather Trader Trade weather markets using NOAA forecasts
Copytrading Mirror top Polymarket traders
Signal Sniper Trade on breaking news from RSS feeds
Mert Sniper Near-expiry conviction trading
AI Divergence Surface markets where AI consensus diverges from odds
Fast Loop BTC fast market trades using Binance momentum
Trade Journal Auto-log trades with calibration reports
clawhub install polymarket-weather-trader
clawhub install simmer-automaton

Links

License

MIT

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simmer_sdk-0.8.28.tar.gz (38.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simmer_sdk-0.8.28-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

Details for the file simmer_sdk-0.8.28.tar.gz.

File metadata

  • Download URL: simmer_sdk-0.8.28.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for simmer_sdk-0.8.28.tar.gz
Algorithm Hash digest
SHA256 a3bfec4d523e2cc72fe67aff624ba6c08d12f3586ee64d6b43cf8910bf4c8884
MD5 421a6207edfde11cccf4f5f0f46d211e
BLAKE2b-256 e62b2cc9b1fc73859df3cc3284ab846c77bf04a17bc5b6d6e6078b9c57207287

See more details on using hashes here.

File details

Details for the file simmer_sdk-0.8.28-py3-none-any.whl.

File metadata

  • Download URL: simmer_sdk-0.8.28-py3-none-any.whl
  • Upload date:
  • Size: 38.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for simmer_sdk-0.8.28-py3-none-any.whl
Algorithm Hash digest
SHA256 131b929542a4443e6bbce860dd19bb1cbbcfd6e82b8d0b66e873c672fc159829
MD5 91805f6bb1c91429aab8155bc86ee35c
BLAKE2b-256 03db6196c27f6b8e78e8c97547b3cd165cc6ccbfc2085cb4cc30ea0f96640a10

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page