What You Can Do
- Search and inspect markets across Polymarket, Kalshi, and the Demo venue — retrieve order books, trade history, candles, and price ticks.
- Submit and manage orders — place limit and market orders, amend resting orders, cancel individually or in bulk, and query fills.
- Route intelligently — send orders directly to a specific venue instrument, find the best price across venues, or split size across venues automatically.
- Use complex order types — automate execution with iceberg, peg, stop, take-profit/stop-loss, and smart-route parent orders.
- Monitor your portfolio — query positions, balances, P&L, and fee schedules per subaccount.
- Enforce risk controls — read and set per-subaccount risk limits, and trigger a kill switch that cancels all open orders.
- Stream live data over WebSocket — subscribe to order updates, fills, position changes, balance snapshots, order book depth, and trade prints with the same Ed25519 authentication used for REST.
Architecture
Molecule sits between your trading system and the downstream venues. It acts as an execution proxy: it receives your signed API requests, translates them into venue-specific calls, and returns normalized responses. You retain direct ownership of your venue accounts — Molecule does not hold or move your funds.Session Modes
Molecule uses two distinct authentication modes. They are not interchangeable. Trading keys (Ed25519) authenticate execution requests — placing orders, reading the book, querying fills, and managing risk. You provision a key pair with Molecule, store the 32-byte Ed25519 seed as a base64 string, and supply it to the SDK viakey_id and private_key. Every request is signed locally before transmission.
JWT tokens authenticate account-management requests — creating subaccounts, managing key registrations, and other operations that require a human or service session. Pass a JWT via the token parameter. Sending a trading key to a management route returns 403 human_session_required.
A single
Molecule client instance operates in one mode at a time. Instantiate with key_id + private_key for trading, or with token for management.Next Steps
Quickstart
Install the SDK, configure credentials, and submit your first order in under five minutes.
Authentication
Understand Ed25519 key provisioning, request signing, and the JWT management session.
Market Data
Search markets, fetch order books, stream real-time prices, and read trade history.
