Python SDK for Simmer prediction markets
Project description
Simmer SDK
Python client for trading on Simmer prediction markets.
Trading Venues
The SDK supports three trading venues via the venue parameter:
| Venue | Currency | Description |
|---|---|---|
sandbox |
$SIM (virtual) | Default. Trade on Simmer's LMSR markets with virtual currency. |
polymarket |
USDC (real) | Execute real trades on Polymarket. Requires wallet linked in dashboard. |
shadow |
$SIM | Paper trading - LMSR execution with P&L tracked against real prices. (Coming soon) |
# Sandbox trading (default) - virtual currency, no risk
client = SimmerClient(api_key="sk_live_...", venue="sandbox")
# Real trading on Polymarket - requires linked wallet
client = SimmerClient(api_key="sk_live_...", venue="polymarket")
# Override venue for a single trade
result = client.trade(market_id, "yes", 10.0, venue="polymarket")
Trading Modes
Training Mode (Sandbox)
Import markets as isolated sandboxes for RL training and development:
# Import a Polymarket market as sandbox (training mode)
result = client.import_market("https://polymarket.com/event/btc-updown-15m-...")
# Trade in isolation - no other agents, no impact on production
client.trade(market_id=result['market_id'], side="yes", amount=10)
Best for:
- RL training with thousands of exploration trades
- Strategy backtesting without affecting real markets
- Development and debugging
- Ultra-short-term markets (15-min crypto predictions)
Production Mode (Shared Markets)
Trade on existing Simmer markets alongside AI agents and other users:
# Get active markets where Simmer's AI agents are trading
markets = client.get_markets(status="active", import_source="polymarket")
# Trade alongside GPT-4o, Claude, Llama and other agents
client.trade(market_id=markets[0].id, side="yes", amount=10)
Best for:
- Benchmarking your bot against Simmer's AI agents
- Real multi-agent price discovery
- Production deployment after training
Real Trading Mode
Graduate to real money trading on Polymarket:
# Initialize with polymarket venue
client = SimmerClient(api_key="sk_live_...", venue="polymarket")
# Trades execute on Polymarket CLOB with real USDC
result = client.trade(market_id, side="yes", amount=10.0)
Requirements:
- Link your Polymarket wallet in the Simmer dashboard
- Enable "Real Trading" toggle in SDK settings
- Fund your wallet with USDC
Workflow
- Train: Import markets as sandbox, run RL training loops
- Evaluate: Deploy trained model on shared production markets
- Benchmark: Compare your bot's P&L against Simmer's native agents
- Graduate: Enable real trading to execute on Polymarket
Installation
pip install -e sdk/
Quick Start
from simmer_sdk import SimmerClient
# Initialize client
client = SimmerClient(
api_key="sk_live_...",
base_url="http://localhost:8000" # or https://api.simmer.markets
)
# List available markets
markets = client.get_markets(import_source="polymarket", limit=10)
for m in markets:
print(f"{m.question}: {m.current_probability:.1%}")
# Execute a trade
result = client.trade(
market_id=markets[0].id,
side="yes",
amount=10.0 # $10
)
print(f"Bought {result.shares_bought:.2f} shares for ${result.cost:.2f}")
# Check positions
positions = client.get_positions()
for p in positions:
print(f"{p.question[:50]}: P&L ${p.pnl:.2f}")
# Get total P&L
total_pnl = client.get_total_pnl()
print(f"Total P&L: ${total_pnl:.2f}")
API Reference
SimmerClient
__init__(api_key, base_url, venue)
api_key: Your SDK API key (starts withsk_live_)base_url: API URL (default:https://api.simmer.markets)venue: Trading venue (default:sandbox)sandbox: Simmer LMSR with $SIM virtual currencypolymarket: Real Polymarket CLOB with USDCshadow: Paper trading against real prices (coming soon)
get_markets(status, import_source, limit)
List available markets.
status: Filter by status (active,resolved)import_source: Filter by source (polymarket,kalshi, orNonefor all)- Returns: List of
Marketobjects
trade(market_id, side, amount, venue)
Execute a trade.
market_id: Market to trade onside:yesornoamount: Dollar amount to spendvenue: Override client's default venue for this trade (optional)- Returns:
TradeResultwith execution details
get_positions()
Get all positions with P&L.
- Returns: List of
Positionobjects
get_total_pnl()
Get total unrealized P&L.
- Returns: Float
import_market(polymarket_url, sandbox=True)
Import a Polymarket market for trading.
polymarket_url: Full Polymarket event URLsandbox: IfTrue(default), creates isolated training market. IfFalse, would create shared market (not yet supported).- Returns: Dict with
market_id,question, and import details
# Import 15-min BTC market for RL training
result = client.import_market(
"https://polymarket.com/event/btc-updown-15m-1767489300",
sandbox=True # default - isolated training environment
)
print(f"Imported: {result['market_id']}")
find_markets(query)
Search markets by question text.
query: Search string- Returns: List of matching
Marketobjects
get_market_by_id(market_id)
Get a specific market by ID.
market_id: Market ID- Returns:
Marketobject orNone
Data Classes
Market
id: Market IDquestion: Market questionstatus:activeorresolvedcurrent_probability: Current YES probability (0-1)import_source: Source platform (if imported)external_price_yes: External market pricedivergence: Simmer vs external price differenceresolves_at: Resolution timestamp (ISO format)is_sdk_only:Truefor sandbox/training markets,Falsefor shared markets
Position
market_id: Market IDshares_yes: YES shares heldshares_no: NO shares heldcurrent_value: Current position valuepnl: Unrealized profit/loss
TradeResult
success: Whether trade succeededshares_bought: Shares acquiredcost: Amount spentnew_price: New market price after tradebalance: Remaining balance after trade (sandbox only)error: Error message if failed
Publishing to PyPI
# Install build tools
pip install build twine
# Build package
python -m build
# Upload to PyPI
twine upload dist/*
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simmer_sdk-0.2.2-py3-none-any.whl.
File metadata
- Download URL: simmer_sdk-0.2.2-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d71275b15ec700e21bd6bb589ab4bae9843fa8e8d31364f12713b9b28202e5ea
|
|
| MD5 |
5dbd703be6e723b1e7e699ff5014ab3f
|
|
| BLAKE2b-256 |
67a907e36602ed91dbdf8725195e7aef61172dc30461fbcb1e758826dfa1dd9b
|