synpath 0.8.1__tar.gz → 0.10.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {synpath-0.8.1 → synpath-0.10.0}/PKG-INFO +34 -8
- {synpath-0.8.1 → synpath-0.10.0}/README.md +31 -5
- {synpath-0.8.1 → synpath-0.10.0}/pyproject.toml +3 -3
- {synpath-0.8.1 → synpath-0.10.0}/synpath/__init__.py +21 -4
- synpath-0.10.0/synpath/azuro.py +1086 -0
- synpath-0.10.0/synpath/betfair.py +1093 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/client.py +39 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/__main__.py +9 -2
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/feeds.py +113 -3
- synpath-0.10.0/synpath/gemini.py +874 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/history.py +11 -10
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ids.py +11 -3
- synpath-0.10.0/synpath/matchbook.py +1029 -0
- synpath-0.10.0/synpath/myriad.py +1111 -0
- synpath-0.10.0/synpath/novig.py +797 -0
- synpath-0.10.0/synpath/prophetx.py +949 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/server/api.py +7 -2
- {synpath-0.8.1 → synpath-0.10.0}/synpath/server/serve.py +20 -5
- synpath-0.10.0/synpath/smarkets.py +1137 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/sx_bet.py +7 -3
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/__init__.py +20 -1
- synpath-0.10.0/synpath/trading/__main__.py +178 -0
- synpath-0.10.0/synpath/trading/azuro.py +722 -0
- synpath-0.10.0/synpath/trading/azuro_signing.py +316 -0
- synpath-0.10.0/synpath/trading/credentials.py +1190 -0
- synpath-0.10.0/synpath/trading/gemini.py +807 -0
- synpath-0.10.0/synpath/trading/init.py +510 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/instruments.py +50 -0
- synpath-0.10.0/synpath/trading/matchbook.py +842 -0
- synpath-0.10.0/synpath/trading/myriad.py +938 -0
- synpath-0.10.0/synpath/trading/myriad_signing.py +299 -0
- synpath-0.10.0/synpath/trading/novig.py +766 -0
- synpath-0.10.0/synpath/trading/novig_signing.py +258 -0
- synpath-0.10.0/synpath/trading/prophetx.py +773 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/sx_bet.py +40 -13
- {synpath-0.8.1 → synpath-0.10.0}/synpath/types.py +78 -11
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ws/__init__.py +25 -0
- synpath-0.10.0/synpath/ws/azuro.py +263 -0
- synpath-0.10.0/synpath/ws/betfair.py +548 -0
- synpath-0.10.0/synpath/ws/gemini.py +540 -0
- synpath-0.10.0/synpath/ws/matchbook.py +397 -0
- synpath-0.10.0/synpath/ws/myriad.py +563 -0
- synpath-0.10.0/synpath/ws/novig.py +982 -0
- synpath-0.10.0/synpath/ws/prophetx.py +631 -0
- synpath-0.10.0/synpath/ws/smarkets.py +420 -0
- synpath-0.8.1/synpath/trading/__main__.py +0 -93
- synpath-0.8.1/synpath/trading/credentials.py +0 -660
- synpath-0.8.1/synpath/trading/init.py +0 -322
- {synpath-0.8.1 → synpath-0.10.0}/Cargo.toml +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/LICENSE +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/bindings/python/Cargo.lock +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/bindings/python/Cargo.toml +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/bindings/python/src/kalshi.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/bindings/python/src/lib.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/bindings/python/src/objects.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/bindings/python/src/polymarket.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/bindings/python/src/pyjson.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/bindings/python/src/router.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/bindings/python/src/signing.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/bindings/python/src/venues.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/build_backend/synpath_build.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/crates/synpath-core/Cargo.lock +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/crates/synpath-core/Cargo.toml +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/crates/synpath-core/examples/decode_timing.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/crates/synpath-core/src/book.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/crates/synpath-core/src/kalshi.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/crates/synpath-core/src/lib.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/crates/synpath-core/src/opinion.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/crates/synpath-core/src/polymarket.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/crates/synpath-core/src/polymarket_us.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/crates/synpath-core/src/router.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/crates/synpath-core/src/signing.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/crates/synpath-core/src/wire.rs +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/__main__.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/_deprecated.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/_native.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/base.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/bucket.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/__init__.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/alerts.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/engine.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/eod.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/events.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/fair_values.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/journal.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/ledger.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/orders/__init__.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/orders/base.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/orders/day.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/orders/iceberg.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/orders/manager.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/orders/oco.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/orders/peg.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/orders/routed.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/orders/stop.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/orders/taker.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/orders/twap.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/paper.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/reconcile.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/risk.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/engine/router.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/errors.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/hosted.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/hosted_auth.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/hyperliquid.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/kalshi.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/limitless.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/matching.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/opinion.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/polymarket.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/polymarket_us.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/predict_fun.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/remote.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/server/__init__.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/server/__main__.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/server/errors.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/server/local.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/server/models.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/server/store.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/server/trading.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/base.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/errors.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/hyperliquid.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/hyperliquid_signing.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/kalshi.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/limiter.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/limitless.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/limitless_signing.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/money.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/opinion.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/opinion_signing.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/polymarket.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/polymarket_signing.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/polymarket_us.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/polymarket_us_exchange.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/predict_fun.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/predict_fun_signing.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/sx_bet_signing.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/trading/types.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ws/base.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ws/grpc.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ws/hyperliquid.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ws/kalshi.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ws/limitless.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ws/opinion.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ws/polymarket.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ws/polymarket_us.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ws/polymarket_us_exchange.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ws/predict_fun.py +0 -0
- {synpath-0.8.1 → synpath-0.10.0}/synpath/ws/sx_bet.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: synpath
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.0
|
|
4
4
|
Classifier: Development Status :: 3 - Alpha
|
|
5
5
|
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -32,8 +32,8 @@ Provides-Extra: server
|
|
|
32
32
|
Provides-Extra: trading
|
|
33
33
|
Provides-Extra: ws
|
|
34
34
|
License-File: LICENSE
|
|
35
|
-
Summary: One API for prediction markets
|
|
36
|
-
Keywords: prediction-markets,kalshi,polymarket,unified-api,trading,market-data
|
|
35
|
+
Summary: One API for 16 prediction markets and sports exchanges: Kalshi, Polymarket, Polymarket US, Opinion, Hyperliquid, predict.fun, Limitless, SX Bet, Myriad, Gemini, Betfair, Smarkets, Novig, Matchbook, ProphetX and Azuro. Market data, streaming, self-hosted trading and smart order routing.
|
|
36
|
+
Keywords: prediction-markets,kalshi,polymarket,polymarket-us,opinion,hyperliquid,predict-fun,limitless,sx-bet,unified-api,trading,market-data
|
|
37
37
|
Author: Synpath
|
|
38
38
|
License: MIT
|
|
39
39
|
Requires-Python: >=3.10
|
|
@@ -51,7 +51,7 @@ Project-URL: Repository, https://github.com/Synpath-ai/synpath
|
|
|
51
51
|
# Synpath – One API for prediction markets <a href="https://x.com/Synpath_Dev"><img src="https://img.shields.io/twitter/url?url=https%3A%2F%2Fx.com%2FSynpath_Dev&style=social&label=Follow" alt="Follow @Synpath_Dev on X" height="28"></a>
|
|
52
52
|
|
|
53
53
|
**Build on prediction markets without building against each one.**<br/>
|
|
54
|
-
One open-source API across Kalshi, Polymarket, Polymarket US and
|
|
54
|
+
One open-source API across 16 venues (Kalshi, Polymarket, Polymarket US, Opinion, Hyperliquid, predict.fun, Limitless, SX Bet, Myriad and Gemini, and the sports betting venues Betfair, Smarkets, Novig, Matchbook, ProphetX and Azuro): market data, order entry, live streams, and an execution engine that remembers what it sent. In-process from Python, over REST and WebSocket from anywhere.
|
|
55
55
|
|
|
56
56
|
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
|
|
57
57
|
<a href="https://pepy.tech/projects/synpath"><img src="https://img.shields.io/pepy/dt/synpath?label=Total%20Downloads&color=blue" alt="Total Downloads"></a>
|
|
@@ -91,19 +91,21 @@ synpath keys create my-laptop
|
|
|
91
91
|
```python
|
|
92
92
|
import synpath
|
|
93
93
|
|
|
94
|
-
t =
|
|
94
|
+
t = 1792065600000 # 2026-10-15 12:00 UTC, in venue Unix milliseconds
|
|
95
95
|
|
|
96
96
|
# The full book exactly as it stood at that millisecond
|
|
97
97
|
snap = synpath.fetch_order_book_at("kalshi:KXQUANTUM-30", as_of_ms=t)
|
|
98
98
|
print(snap.book.bids[0].price, snap.book.asks[0].price, len(snap.book.bids), "bid levels")
|
|
99
99
|
|
|
100
|
-
# Every change over an hour: a starting book, then each update in
|
|
100
|
+
# Every change over an hour: a starting book, then each update in venue-time order
|
|
101
101
|
changes = synpath.fetch_order_book_range("kalshi:KXQUANTUM-30", start_ms=t, end_ms=t + 3_600_000)
|
|
102
102
|
|
|
103
103
|
# Every trade: price, size and taker side
|
|
104
104
|
trades = synpath.fetch_trades_range("kalshi:KXQUANTUM-30", start_ms=t, end_ms=t + 3_600_000)
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
+
Request windows use Kalshi venue time (`metadata.time_basis="venue"`); `observed_at_ms` is the separate recorder receive time.
|
|
108
|
+
|
|
107
109
|
No silent gaps: if we weren't recording at a moment, you get the reason instead of an empty book. Up to an hour per request; plain HTTP works too (`Authorization: Bearer <key>`). More: **[synpath.dev/tick-data](https://www.synpath.dev/tick-data)** · **[API reference](https://www.synpath.dev/docs/api-reference/history/book-at)**
|
|
108
110
|
|
|
109
111
|
> ⭐ **Free data stays free as long as people use it.** If this saves you a data bill, [star the repo](https://github.com/Synpath-ai/synpath). It takes one click and it's how other traders find it.
|
|
@@ -124,10 +126,34 @@ No silent gaps: if we weren't recording at a moment, you get the reason instead
|
|
|
124
126
|
| | [predict.fun](https://predict.fun) | `predict_fun` | ✓ (API key) | ✓ | WebSocket (API key) | one book per market, both sides read it |
|
|
125
127
|
| | [Limitless](https://limitless.exchange) | `limitless` | ✓ | ✓ | WebSocket | one book per market, both sides read it |
|
|
126
128
|
| | [SX Bet](https://sx.bet) | `sx_bet` | ✓ sports | ✓ | WebSocket | one book per market, both sides read it |
|
|
129
|
+
| | [Gemini Predictions](https://www.gemini.com/predictions) | `gemini` | ✓ no account, sports taxonomy | ✓ US accounts with Prediction Markets access | WebSocket (no key for books) | one book per contract, in YES space |
|
|
130
|
+
| | [Betfair Exchange](https://www.betfair.com/exchange) | `betfair` | ✓ your own account and app key (delayed key: 1-180 s late, 3 levels) | — | Exchange Stream API (TLS socket) | one book per runner, back and lay read as YES |
|
|
131
|
+
| | [Smarkets](https://smarkets.com) | `smarkets` | ✓ no account (quotes delayed without a login) | — | polled from REST quotes | one book per contract, bids are YES bids |
|
|
132
|
+
| | [Novig](https://novig.com) | `novig` | ✓ sports, no key | ✓ (US, identity and location checks; Paper for play money) | WebSocket (trading key), else polled from the public book | one book per market, both sides read it |
|
|
133
|
+
| | [Matchbook](https://www.matchbook.com) | `matchbook` | ✓ no account | ✓ your own login | polled from REST | one book per runner, back and lay read as YES |
|
|
134
|
+
| | [ProphetX](https://www.prophetx.co) | `prophetx` | ✓ sports (Trading API key pair, or a Market Data API key) | ✓ | WebSocket (Trading API key pair) | one book per line, both sides read it |
|
|
135
|
+
| | [Azuro](https://azuro.org) | `azuro` | ✓ sports, no key | ✓ bets with a worst price | WebSocket (no key) | no book: the pool's quoted odds, one level a side sized by its limits |
|
|
136
|
+
| | [Myriad](https://myriad.markets) | `myriad` | ✓ order-book and AMM markets, sports | ✓ order book | WebSocket (no key) | one book per market, both sides read it; AMM books built from the pool |
|
|
137
|
+
|
|
138
|
+
Betfair is a betting exchange, not a prediction market, read here the same way: each runner (selection) is a yes/no market, `betfair:1.234567890-47972`, and the Betfair market holding the runners is the event. Every Betfair call needs your own Betfair account and application key, and the API is refused from several countries (the US, Germany, France, the Netherlands, Singapore, India, Turkey, the UAE and others). Betfair's keys are for your own betting: showing its prices to anyone else needs a data licence from Betfair. See [capabilities](docs/capabilities.md#betfair).
|
|
139
|
+
|
|
140
|
+
Gemini Predictions is Gemini Titan's CFTC-registered event-contract exchange. Each contract is a yes/no market named by its instrument symbol, `gemini:GEMI-NBA-2610232000-CHI-MIL-M-MIL`, and the Gemini event holding the contracts is the event. Sports events carry Gemini's taxonomy (moneyline, spread, total, prop; the sport, scope and statistic), which listings filter on. Market data needs no account; trading needs a Gemini account with Prediction Markets access (US) and an API key. See [capabilities](docs/capabilities.md#gemini).
|
|
141
|
+
|
|
142
|
+
Smarkets, a UK betting exchange, is read the same way: each contract is a yes/no market, `smarkets:164973231-456060183`, and the Smarkets market holding the contracts is the event. Its market data needs no account (quotes are delayed without a login); betting needs Smarkets' approved API access, which this library does not use yet. Smarkets' API terms allow viewing prices and betting on your own account, and prohibit odds scraping. See [capabilities](docs/capabilities.md#smarkets).
|
|
143
|
+
|
|
144
|
+
Novig, a US sports exchange, lists two-outcome markets (a moneyline, a spread, a total, a Yes/No prop), each one yes/no market, `novig:01a1577c-d666-7e81-852e-68bed1446801`, under its game as the event. Its catalog, books and trades are public and need no key. Trading signs each request with a subaccount's key; Production trades real money for verified US customers outside Arizona, Michigan and Nevada, and Paper (`NOVIG_ENV=paper`) is the same API with play money. Novig's parlay RFQ, for registered liquidity providers, is not supported yet. See [capabilities](docs/capabilities.md#novig).
|
|
145
|
+
|
|
146
|
+
Matchbook, a betting exchange licensed in the UK and Alderney, is read the same way: each runner is a yes/no market, `matchbook:<event id>-<market id>-<runner id>`, and the Matchbook market holding the runners is the event. Its market data needs no account; betting logs in with your own Matchbook username and password. Every GET is chargeable on Matchbook's API plans (£100 per million a month), and its terms allow viewing prices and betting on your own account only. See [capabilities](docs/capabilities.md#matchbook).
|
|
147
|
+
|
|
148
|
+
ProphetX, a US peer-to-peer sports exchange, is read the way SX Bet is: each line (a moneyline, or a spread or total at one number) is a yes/no market whose first side is YES, `prophetx:44285780-90de769f4f4977a04446ed203e957351` (the event, then the YES side's strike id), and the game is the event. Prices are American odds, converted exactly to probabilities. Every call needs a key: the Trading API key pair, which any KYC-approved ProphetX account generates under API Integration, or a Market Data API key issued by ProphetX on request. See [capabilities](docs/capabilities.md#prophetx).
|
|
149
|
+
|
|
150
|
+
Azuro is an onchain sports betting protocol: a shared liquidity pool takes every bet at the odds it quotes, so there is no order book and nothing rests. A two-outcome condition ("Total Goals Over/Under 2.5") is one yes/no market, `azuro:<conditionId>`, with the lower outcome id as YES; a condition with three or more outcomes (1X2, correct score) is one market per outcome, `azuro:<conditionId>-<outcomeId>`, where only YES can be bought. The game is the event. Prices are `1 / odds`. Ids are the same on every chain; `Azuro(chain=...)` picks the pool read (Polygon USDT by default, Base WETH). Bets are EIP-712 messages signed by your wallet and placed on chain by Azuro's relayer. Azuro's bet API and streams are refused from some regions. See [capabilities](docs/capabilities.md#azuro).
|
|
151
|
+
|
|
152
|
+
Myriad runs order-book markets on BNB Chain and AMM (pool) markets on BNB Chain, Abstract and Linea behind one API. A market id carries its network, and `amm` for a pool market, since the two kinds number their markets separately: `myriad:56-2385` is an order-book market, `myriad:56-amm-2385` an unrelated pool market. Order entry is on the order book; a pool trade is an on-chain transaction this library does not send. See [capabilities](docs/capabilities.md#myriad).
|
|
127
153
|
|
|
128
154
|
## Why Synpath
|
|
129
155
|
|
|
130
|
-
- **Liquidity is fragmented. Your time shouldn't be.** The same market trades on Kalshi, Polymarket, Polymarket US and
|
|
156
|
+
- **Liquidity is fragmented. Your time shouldn't be.** The same market trades on Kalshi, Polymarket, Polymarket US, Opinion, Hyperliquid, predict.fun, Limitless, SX Bet, Myriad and Gemini, and the sports betting venues Betfair, Smarkets, Novig, Matchbook, ProphetX and Azuro, each with its own API, units and quirks. Synpath gives you one interface for all of them, and smart order routing buys from whichever book is cheapest. Spend your time on alpha, not plumbing.
|
|
131
157
|
|
|
132
158
|
- **Traders deserve advanced order types.** Stops, trailing stops, icebergs, OCO, brackets, TWAP and pegs, on every venue, even where the exchange has none. Orders are journaled before they're sent, so a crash never places one twice.
|
|
133
159
|
|
|
@@ -173,7 +199,7 @@ fee.estimate(price=0.50, contracts=100) # 1.75
|
|
|
173
199
|
**Same code, every venue**
|
|
174
200
|
|
|
175
201
|
```python
|
|
176
|
-
for venue_id in synpath.exchanges: # ['
|
|
202
|
+
for venue_id in synpath.exchanges: # [..., 'betfair', 'smarkets', 'novig', 'matchbook', 'prophetx', 'azuro', 'myriad', 'gemini'] (Betfair, predict.fun and ProphetX need keys)
|
|
177
203
|
with synpath.exchange(venue_id) as venue:
|
|
178
204
|
page = venue.fetch_markets(limit=5)
|
|
179
205
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# Synpath – One API for prediction markets <a href="https://x.com/Synpath_Dev"><img src="https://img.shields.io/twitter/url?url=https%3A%2F%2Fx.com%2FSynpath_Dev&style=social&label=Follow" alt="Follow @Synpath_Dev on X" height="28"></a>
|
|
6
6
|
|
|
7
7
|
**Build on prediction markets without building against each one.**<br/>
|
|
8
|
-
One open-source API across Kalshi, Polymarket, Polymarket US and
|
|
8
|
+
One open-source API across 16 venues (Kalshi, Polymarket, Polymarket US, Opinion, Hyperliquid, predict.fun, Limitless, SX Bet, Myriad and Gemini, and the sports betting venues Betfair, Smarkets, Novig, Matchbook, ProphetX and Azuro): market data, order entry, live streams, and an execution engine that remembers what it sent. In-process from Python, over REST and WebSocket from anywhere.
|
|
9
9
|
|
|
10
10
|
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
|
|
11
11
|
<a href="https://pepy.tech/projects/synpath"><img src="https://img.shields.io/pepy/dt/synpath?label=Total%20Downloads&color=blue" alt="Total Downloads"></a>
|
|
@@ -45,19 +45,21 @@ synpath keys create my-laptop
|
|
|
45
45
|
```python
|
|
46
46
|
import synpath
|
|
47
47
|
|
|
48
|
-
t =
|
|
48
|
+
t = 1792065600000 # 2026-10-15 12:00 UTC, in venue Unix milliseconds
|
|
49
49
|
|
|
50
50
|
# The full book exactly as it stood at that millisecond
|
|
51
51
|
snap = synpath.fetch_order_book_at("kalshi:KXQUANTUM-30", as_of_ms=t)
|
|
52
52
|
print(snap.book.bids[0].price, snap.book.asks[0].price, len(snap.book.bids), "bid levels")
|
|
53
53
|
|
|
54
|
-
# Every change over an hour: a starting book, then each update in
|
|
54
|
+
# Every change over an hour: a starting book, then each update in venue-time order
|
|
55
55
|
changes = synpath.fetch_order_book_range("kalshi:KXQUANTUM-30", start_ms=t, end_ms=t + 3_600_000)
|
|
56
56
|
|
|
57
57
|
# Every trade: price, size and taker side
|
|
58
58
|
trades = synpath.fetch_trades_range("kalshi:KXQUANTUM-30", start_ms=t, end_ms=t + 3_600_000)
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
+
Request windows use Kalshi venue time (`metadata.time_basis="venue"`); `observed_at_ms` is the separate recorder receive time.
|
|
62
|
+
|
|
61
63
|
No silent gaps: if we weren't recording at a moment, you get the reason instead of an empty book. Up to an hour per request; plain HTTP works too (`Authorization: Bearer <key>`). More: **[synpath.dev/tick-data](https://www.synpath.dev/tick-data)** · **[API reference](https://www.synpath.dev/docs/api-reference/history/book-at)**
|
|
62
64
|
|
|
63
65
|
> ⭐ **Free data stays free as long as people use it.** If this saves you a data bill, [star the repo](https://github.com/Synpath-ai/synpath). It takes one click and it's how other traders find it.
|
|
@@ -78,10 +80,34 @@ No silent gaps: if we weren't recording at a moment, you get the reason instead
|
|
|
78
80
|
| | [predict.fun](https://predict.fun) | `predict_fun` | ✓ (API key) | ✓ | WebSocket (API key) | one book per market, both sides read it |
|
|
79
81
|
| | [Limitless](https://limitless.exchange) | `limitless` | ✓ | ✓ | WebSocket | one book per market, both sides read it |
|
|
80
82
|
| | [SX Bet](https://sx.bet) | `sx_bet` | ✓ sports | ✓ | WebSocket | one book per market, both sides read it |
|
|
83
|
+
| | [Gemini Predictions](https://www.gemini.com/predictions) | `gemini` | ✓ no account, sports taxonomy | ✓ US accounts with Prediction Markets access | WebSocket (no key for books) | one book per contract, in YES space |
|
|
84
|
+
| | [Betfair Exchange](https://www.betfair.com/exchange) | `betfair` | ✓ your own account and app key (delayed key: 1-180 s late, 3 levels) | — | Exchange Stream API (TLS socket) | one book per runner, back and lay read as YES |
|
|
85
|
+
| | [Smarkets](https://smarkets.com) | `smarkets` | ✓ no account (quotes delayed without a login) | — | polled from REST quotes | one book per contract, bids are YES bids |
|
|
86
|
+
| | [Novig](https://novig.com) | `novig` | ✓ sports, no key | ✓ (US, identity and location checks; Paper for play money) | WebSocket (trading key), else polled from the public book | one book per market, both sides read it |
|
|
87
|
+
| | [Matchbook](https://www.matchbook.com) | `matchbook` | ✓ no account | ✓ your own login | polled from REST | one book per runner, back and lay read as YES |
|
|
88
|
+
| | [ProphetX](https://www.prophetx.co) | `prophetx` | ✓ sports (Trading API key pair, or a Market Data API key) | ✓ | WebSocket (Trading API key pair) | one book per line, both sides read it |
|
|
89
|
+
| | [Azuro](https://azuro.org) | `azuro` | ✓ sports, no key | ✓ bets with a worst price | WebSocket (no key) | no book: the pool's quoted odds, one level a side sized by its limits |
|
|
90
|
+
| | [Myriad](https://myriad.markets) | `myriad` | ✓ order-book and AMM markets, sports | ✓ order book | WebSocket (no key) | one book per market, both sides read it; AMM books built from the pool |
|
|
91
|
+
|
|
92
|
+
Betfair is a betting exchange, not a prediction market, read here the same way: each runner (selection) is a yes/no market, `betfair:1.234567890-47972`, and the Betfair market holding the runners is the event. Every Betfair call needs your own Betfair account and application key, and the API is refused from several countries (the US, Germany, France, the Netherlands, Singapore, India, Turkey, the UAE and others). Betfair's keys are for your own betting: showing its prices to anyone else needs a data licence from Betfair. See [capabilities](docs/capabilities.md#betfair).
|
|
93
|
+
|
|
94
|
+
Gemini Predictions is Gemini Titan's CFTC-registered event-contract exchange. Each contract is a yes/no market named by its instrument symbol, `gemini:GEMI-NBA-2610232000-CHI-MIL-M-MIL`, and the Gemini event holding the contracts is the event. Sports events carry Gemini's taxonomy (moneyline, spread, total, prop; the sport, scope and statistic), which listings filter on. Market data needs no account; trading needs a Gemini account with Prediction Markets access (US) and an API key. See [capabilities](docs/capabilities.md#gemini).
|
|
95
|
+
|
|
96
|
+
Smarkets, a UK betting exchange, is read the same way: each contract is a yes/no market, `smarkets:164973231-456060183`, and the Smarkets market holding the contracts is the event. Its market data needs no account (quotes are delayed without a login); betting needs Smarkets' approved API access, which this library does not use yet. Smarkets' API terms allow viewing prices and betting on your own account, and prohibit odds scraping. See [capabilities](docs/capabilities.md#smarkets).
|
|
97
|
+
|
|
98
|
+
Novig, a US sports exchange, lists two-outcome markets (a moneyline, a spread, a total, a Yes/No prop), each one yes/no market, `novig:01a1577c-d666-7e81-852e-68bed1446801`, under its game as the event. Its catalog, books and trades are public and need no key. Trading signs each request with a subaccount's key; Production trades real money for verified US customers outside Arizona, Michigan and Nevada, and Paper (`NOVIG_ENV=paper`) is the same API with play money. Novig's parlay RFQ, for registered liquidity providers, is not supported yet. See [capabilities](docs/capabilities.md#novig).
|
|
99
|
+
|
|
100
|
+
Matchbook, a betting exchange licensed in the UK and Alderney, is read the same way: each runner is a yes/no market, `matchbook:<event id>-<market id>-<runner id>`, and the Matchbook market holding the runners is the event. Its market data needs no account; betting logs in with your own Matchbook username and password. Every GET is chargeable on Matchbook's API plans (£100 per million a month), and its terms allow viewing prices and betting on your own account only. See [capabilities](docs/capabilities.md#matchbook).
|
|
101
|
+
|
|
102
|
+
ProphetX, a US peer-to-peer sports exchange, is read the way SX Bet is: each line (a moneyline, or a spread or total at one number) is a yes/no market whose first side is YES, `prophetx:44285780-90de769f4f4977a04446ed203e957351` (the event, then the YES side's strike id), and the game is the event. Prices are American odds, converted exactly to probabilities. Every call needs a key: the Trading API key pair, which any KYC-approved ProphetX account generates under API Integration, or a Market Data API key issued by ProphetX on request. See [capabilities](docs/capabilities.md#prophetx).
|
|
103
|
+
|
|
104
|
+
Azuro is an onchain sports betting protocol: a shared liquidity pool takes every bet at the odds it quotes, so there is no order book and nothing rests. A two-outcome condition ("Total Goals Over/Under 2.5") is one yes/no market, `azuro:<conditionId>`, with the lower outcome id as YES; a condition with three or more outcomes (1X2, correct score) is one market per outcome, `azuro:<conditionId>-<outcomeId>`, where only YES can be bought. The game is the event. Prices are `1 / odds`. Ids are the same on every chain; `Azuro(chain=...)` picks the pool read (Polygon USDT by default, Base WETH). Bets are EIP-712 messages signed by your wallet and placed on chain by Azuro's relayer. Azuro's bet API and streams are refused from some regions. See [capabilities](docs/capabilities.md#azuro).
|
|
105
|
+
|
|
106
|
+
Myriad runs order-book markets on BNB Chain and AMM (pool) markets on BNB Chain, Abstract and Linea behind one API. A market id carries its network, and `amm` for a pool market, since the two kinds number their markets separately: `myriad:56-2385` is an order-book market, `myriad:56-amm-2385` an unrelated pool market. Order entry is on the order book; a pool trade is an on-chain transaction this library does not send. See [capabilities](docs/capabilities.md#myriad).
|
|
81
107
|
|
|
82
108
|
## Why Synpath
|
|
83
109
|
|
|
84
|
-
- **Liquidity is fragmented. Your time shouldn't be.** The same market trades on Kalshi, Polymarket, Polymarket US and
|
|
110
|
+
- **Liquidity is fragmented. Your time shouldn't be.** The same market trades on Kalshi, Polymarket, Polymarket US, Opinion, Hyperliquid, predict.fun, Limitless, SX Bet, Myriad and Gemini, and the sports betting venues Betfair, Smarkets, Novig, Matchbook, ProphetX and Azuro, each with its own API, units and quirks. Synpath gives you one interface for all of them, and smart order routing buys from whichever book is cheapest. Spend your time on alpha, not plumbing.
|
|
85
111
|
|
|
86
112
|
- **Traders deserve advanced order types.** Stops, trailing stops, icebergs, OCO, brackets, TWAP and pegs, on every venue, even where the exchange has none. Orders are journaled before they're sent, so a crash never places one twice.
|
|
87
113
|
|
|
@@ -127,7 +153,7 @@ fee.estimate(price=0.50, contracts=100) # 1.75
|
|
|
127
153
|
**Same code, every venue**
|
|
128
154
|
|
|
129
155
|
```python
|
|
130
|
-
for venue_id in synpath.exchanges: # ['
|
|
156
|
+
for venue_id in synpath.exchanges: # [..., 'betfair', 'smarkets', 'novig', 'matchbook', 'prophetx', 'azuro', 'myriad', 'gemini'] (Betfair, predict.fun and ProphetX need keys)
|
|
131
157
|
with synpath.exchange(venue_id) as venue:
|
|
132
158
|
page = venue.fetch_markets(limit=5)
|
|
133
159
|
|
|
@@ -9,13 +9,13 @@ backend-path = ["build_backend"]
|
|
|
9
9
|
|
|
10
10
|
[project]
|
|
11
11
|
name = "synpath"
|
|
12
|
-
version = "0.
|
|
13
|
-
description = "One API for prediction markets
|
|
12
|
+
version = "0.10.0"
|
|
13
|
+
description = "One API for 16 prediction markets and sports exchanges: Kalshi, Polymarket, Polymarket US, Opinion, Hyperliquid, predict.fun, Limitless, SX Bet, Myriad, Gemini, Betfair, Smarkets, Novig, Matchbook, ProphetX and Azuro. Market data, streaming, self-hosted trading and smart order routing."
|
|
14
14
|
readme = "README.md"
|
|
15
15
|
requires-python = ">=3.10"
|
|
16
16
|
license = { text = "MIT" }
|
|
17
17
|
authors = [{ name = "Synpath" }]
|
|
18
|
-
keywords = ["prediction-markets", "kalshi", "polymarket", "unified-api", "trading", "market-data"]
|
|
18
|
+
keywords = ["prediction-markets", "kalshi", "polymarket", "polymarket-us", "opinion", "hyperliquid", "predict-fun", "limitless", "sx-bet", "unified-api", "trading", "market-data"]
|
|
19
19
|
classifiers = [
|
|
20
20
|
"Development Status :: 3 - Alpha",
|
|
21
21
|
"Intended Audience :: Financial and Insurance Industry",
|
|
@@ -47,6 +47,14 @@ from .hyperliquid import Hyperliquid
|
|
|
47
47
|
from .predict_fun import PredictFun
|
|
48
48
|
from .limitless import Limitless
|
|
49
49
|
from .sx_bet import SxBet
|
|
50
|
+
from .myriad import Myriad
|
|
51
|
+
from .betfair import Betfair
|
|
52
|
+
from .smarkets import Smarkets
|
|
53
|
+
from .novig import Novig
|
|
54
|
+
from .matchbook import Matchbook
|
|
55
|
+
from .prophetx import ProphetX
|
|
56
|
+
from .azuro import Azuro
|
|
57
|
+
from .gemini import Gemini
|
|
50
58
|
from .matching import match_event, match_market
|
|
51
59
|
from .history import fetch_order_book_at, fetch_order_book_range, fetch_trades_range
|
|
52
60
|
from .bucket import Bucket, BucketMember, BucketOrderReport, BucketPosition
|
|
@@ -80,7 +88,7 @@ from .types import (
|
|
|
80
88
|
TradesRangeResponse,
|
|
81
89
|
)
|
|
82
90
|
|
|
83
|
-
__version__ = "0.
|
|
91
|
+
__version__ = "0.10.0"
|
|
84
92
|
|
|
85
93
|
exchanges: dict[str, type[Exchange]] = {
|
|
86
94
|
"kalshi": Kalshi,
|
|
@@ -91,6 +99,14 @@ exchanges: dict[str, type[Exchange]] = {
|
|
|
91
99
|
"predict_fun": PredictFun,
|
|
92
100
|
"limitless": Limitless,
|
|
93
101
|
"sx_bet": SxBet,
|
|
102
|
+
"betfair": Betfair,
|
|
103
|
+
"smarkets": Smarkets,
|
|
104
|
+
"novig": Novig,
|
|
105
|
+
"matchbook": Matchbook,
|
|
106
|
+
"prophetx": ProphetX,
|
|
107
|
+
"azuro": Azuro,
|
|
108
|
+
"myriad": Myriad,
|
|
109
|
+
"gemini": Gemini,
|
|
94
110
|
}
|
|
95
111
|
"""Every venue this library speaks, by id."""
|
|
96
112
|
|
|
@@ -111,7 +127,7 @@ def exchange(venue: str, **kwargs) -> Exchange:
|
|
|
111
127
|
# keeps working. Imported last, after the read API it builds on.
|
|
112
128
|
from .trading import (
|
|
113
129
|
TradingExchange, KalshiTrading, PolymarketTrading, PolymarketUSTrading, PolymarketUSExchangeTrading,
|
|
114
|
-
OpinionTrading, HyperliquidTrading, PredictFunTrading, LimitlessTrading, SxBetTrading,
|
|
130
|
+
OpinionTrading, HyperliquidTrading, PredictFunTrading, LimitlessTrading, SxBetTrading, NovigTrading, MatchbookTrading, ProphetXTrading, AzuroTrading, MyriadTrading, GeminiTrading,
|
|
115
131
|
Account, Balance, EditRequest, FeeEstimate, Fill, HeldBy, Liquidity,
|
|
116
132
|
Order, OrderRequest, OrderStatus, OrderType, Position, PositionSide,
|
|
117
133
|
Precision, Settlement, SettlementState, Side, TimeInForce, TriggerSource,
|
|
@@ -141,6 +157,7 @@ _STREAM_CLASSES = (
|
|
|
141
157
|
"PolymarketUSExchangeMarketDataStream", "PolymarketUSExchangeBalanceLedgerStream",
|
|
142
158
|
"OpinionMarketStream", "OpinionUserStream", "HyperliquidMarketStream", "HyperliquidUserStream",
|
|
143
159
|
"PredictFunMarketStream", "PredictFunUserStream", "LimitlessMarketStream", "LimitlessUserStream", "SxBetMarketStream", "SxBetUserStream",
|
|
160
|
+
"BetfairMarketStream", "SmarketsMarketStream", "NovigMarketStream", "NovigUserStream", "MatchbookMarketStream", "ProphetXMarketStream", "ProphetXUserStream", "AzuroMarketStream", "MyriadMarketStream", "MyriadUserStream", "GeminiMarketStream", "GeminiUserStream",
|
|
144
161
|
)
|
|
145
162
|
_SERVER_NAMES = ("create_app", "create_trading_app", "VenueRegistry", "ControlStore", "Principal")
|
|
146
163
|
|
|
@@ -162,7 +179,7 @@ def __getattr__(name: str):
|
|
|
162
179
|
|
|
163
180
|
|
|
164
181
|
__all__ = [
|
|
165
|
-
"Kalshi", "Polymarket", "PolymarketUS", "Opinion", "Hyperliquid", "PredictFun", "Limitless", "SxBet", "Exchange", "exchange", "exchanges",
|
|
182
|
+
"Kalshi", "Polymarket", "PolymarketUS", "Opinion", "Hyperliquid", "PredictFun", "Limitless", "SxBet", "Betfair", "Smarkets", "Novig", "Matchbook", "ProphetX", "Azuro", "Myriad", "Gemini", "Exchange", "exchange", "exchanges",
|
|
166
183
|
"Capability", "HttpClient", "RateLimiter",
|
|
167
184
|
"Market", "Event", "Outcome", "Quote", "MarketStats", "OrderBook",
|
|
168
185
|
"OrderLevel", "Trade", "Candle", "FeeSchedule", "Series", "Page",
|
|
@@ -179,7 +196,7 @@ __all__ = [
|
|
|
179
196
|
"MarketNotFound", "NotSupported", "AuthenticationError",
|
|
180
197
|
# order entry
|
|
181
198
|
"TradingExchange", "KalshiTrading", "PolymarketTrading", "PolymarketUSTrading", "PolymarketUSExchangeTrading",
|
|
182
|
-
"OpinionTrading", "HyperliquidTrading", "PredictFunTrading", "LimitlessTrading", "SxBetTrading",
|
|
199
|
+
"OpinionTrading", "HyperliquidTrading", "PredictFunTrading", "LimitlessTrading", "SxBetTrading", "NovigTrading", "MatchbookTrading", "ProphetXTrading", "AzuroTrading", "MyriadTrading", "GeminiTrading",
|
|
183
200
|
"Account", "Balance", "EditRequest", "FeeEstimate", "Fill", "HeldBy", "Liquidity",
|
|
184
201
|
"Order", "OrderRequest", "OrderStatus", "OrderType", "Position", "PositionSide",
|
|
185
202
|
"Precision", "Settlement", "SettlementState", "Side", "TimeInForce", "TriggerSource",
|