How synpath-ai/synpath works
Synpath normalizes prediction-market access across Kalshi, Polymarket, and Polymarket US. A user can read markets through the unified client, submit orders through venue adapters, and consume typed live events; the optional-in-process execution engine adds risk checks, managed order types, routing, and durable order state. The server exposes read and authenticated trading APIs, while hosted history and market matching are additional capabilities. The map follows the README and sampled excerpts; unsampled subsystems are shown only where documented, with uncertain wiring omitted.
Main entry points: engine.py Engine · client.py Unified Client · ws Stream Adapters · trading.py Trading API
Components 25
Unified API
- Unified Client
synpath/client.py - Shared Types
synpath/types.py - Remote Client
synpath/remote.py - Hosted History
synpath/history.py - Hosted Auth
synpath/hosted_auth.py
Venue Adapters
- Market Data
synpath/kalshi.py - Polymarket Data
synpath/polymarket.py - US Market Data
synpath/polymarket_us.py - Trading Adapters
synpath/trading
Live Streams
- Stream Adapters
synpath/ws - gRPC Transport
synpath/ws/grpc.py - Typed Event Stream
synpath/ws/base.py
Execution Engine
- Engine
synpath/engine/engine.py - Risk Rules
synpath/engine/risk.py - Managed Orders
synpath/engine/orders/manager.py - Advanced Orders
synpath/engine/orders - Bucket Router
synpath/engine/router.py - Order Journal
synpath/engine/journal.py - Account Ledger
synpath/engine/ledger.py
Server APIs
- Read API
synpath/server/api.py - Trading API
synpath/server/trading.py - Server Store
synpath/server/store.py
Other components
- Application
- Exchange APIs
- Hosted API
Connections 32
- Application → Unified Client: calls
- Unified Client → Market Data: routes reads
- Unified Client → Polymarket Data: routes reads
- Unified Client → US Market Data: routes reads
- Market Data → Exchange APIs: reads markets
- Polymarket Data → Exchange APIs: reads markets
- US Market Data → Exchange APIs: reads markets
- Unified Client → Trading Adapters: routes orders
- Trading Adapters → Exchange APIs: places orders
- Application → Stream Adapters: subscribes
- Stream Adapters → Exchange APIs: opens streams
- Stream Adapters → gRPC Transport: uses transport
- Stream Adapters → Typed Event Stream: publishes events
- Application → Engine: submits orders
- Engine → Risk Rules: checks risk
- Engine → Managed Orders: supervises
- Managed Orders → Advanced Orders: runs order hooks
- Engine → Trading Adapters: sends orders
- Engine → Order Journal: persists orders
- Engine → Account Ledger: tracks account state
- Engine → Bucket Router: plans bucket legs
- Application → Read API: requests data
- Read API → Market Data: fetches venue data
- Application → Trading API: submits requests
- Trading API → Server Store: authenticates and audits
- Trading API → Engine: dispatches trading
- Unified Client → Remote Client: uses server mode
- Remote Client → Read API: requests data
- Remote Client → Trading API: sends trading requests
- Application → Hosted Auth: manages credentials
- Hosted Auth → Hosted API: authenticates
- Hosted History → Hosted API: queries history