synpath 0.8.0__tar.gz → 0.9.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.0 → synpath-0.9.0}/PKG-INFO +16 -8
- {synpath-0.8.0 → synpath-0.9.0}/README.md +13 -5
- {synpath-0.8.0 → synpath-0.9.0}/pyproject.toml +3 -3
- {synpath-0.8.0 → synpath-0.9.0}/synpath/__init__.py +7 -2
- synpath-0.9.0/synpath/betfair.py +1093 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/client.py +3 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/__main__.py +3 -2
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/feeds.py +56 -3
- {synpath-0.8.0 → synpath-0.9.0}/synpath/history.py +15 -8
- {synpath-0.8.0 → synpath-0.9.0}/synpath/ids.py +3 -2
- {synpath-0.8.0 → synpath-0.9.0}/synpath/server/api.py +7 -2
- {synpath-0.8.0 → synpath-0.9.0}/synpath/server/serve.py +18 -4
- synpath-0.9.0/synpath/smarkets.py +1137 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/sx_bet.py +7 -3
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/__main__.py +35 -4
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/credentials.py +236 -35
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/init.py +145 -65
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/instruments.py +14 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/sx_bet.py +40 -13
- {synpath-0.8.0 → synpath-0.9.0}/synpath/types.py +30 -6
- {synpath-0.8.0 → synpath-0.9.0}/synpath/ws/__init__.py +7 -0
- synpath-0.9.0/synpath/ws/betfair.py +548 -0
- synpath-0.9.0/synpath/ws/smarkets.py +420 -0
- {synpath-0.8.0 → synpath-0.9.0}/Cargo.toml +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/LICENSE +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/bindings/python/Cargo.lock +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/bindings/python/Cargo.toml +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/bindings/python/src/kalshi.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/bindings/python/src/lib.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/bindings/python/src/objects.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/bindings/python/src/polymarket.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/bindings/python/src/pyjson.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/bindings/python/src/router.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/bindings/python/src/signing.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/bindings/python/src/venues.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/build_backend/synpath_build.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/crates/synpath-core/Cargo.lock +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/crates/synpath-core/Cargo.toml +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/crates/synpath-core/examples/decode_timing.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/crates/synpath-core/src/book.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/crates/synpath-core/src/kalshi.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/crates/synpath-core/src/lib.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/crates/synpath-core/src/opinion.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/crates/synpath-core/src/polymarket.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/crates/synpath-core/src/polymarket_us.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/crates/synpath-core/src/router.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/crates/synpath-core/src/signing.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/crates/synpath-core/src/wire.rs +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/__main__.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/_deprecated.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/_native.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/base.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/bucket.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/__init__.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/alerts.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/engine.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/eod.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/events.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/fair_values.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/journal.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/ledger.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/orders/__init__.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/orders/base.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/orders/day.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/orders/iceberg.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/orders/manager.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/orders/oco.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/orders/peg.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/orders/routed.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/orders/stop.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/orders/taker.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/orders/twap.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/paper.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/reconcile.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/risk.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/engine/router.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/errors.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/hosted.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/hosted_auth.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/hyperliquid.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/kalshi.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/limitless.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/matching.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/opinion.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/polymarket.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/polymarket_us.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/predict_fun.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/remote.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/server/__init__.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/server/__main__.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/server/errors.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/server/local.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/server/models.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/server/store.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/server/trading.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/__init__.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/base.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/errors.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/hyperliquid.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/hyperliquid_signing.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/kalshi.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/limiter.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/limitless.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/limitless_signing.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/money.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/opinion.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/opinion_signing.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/polymarket.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/polymarket_signing.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/polymarket_us.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/polymarket_us_exchange.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/predict_fun.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/predict_fun_signing.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/sx_bet_signing.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/trading/types.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/ws/base.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/ws/grpc.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/ws/hyperliquid.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/ws/kalshi.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/ws/limitless.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/ws/opinion.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/ws/polymarket.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/ws/polymarket_us.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/ws/polymarket_us_exchange.py +0 -0
- {synpath-0.8.0 → synpath-0.9.0}/synpath/ws/predict_fun.py +0 -0
- {synpath-0.8.0 → synpath-0.9.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.9.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 8 prediction markets: Kalshi, Polymarket, Polymarket US, Opinion, Hyperliquid, predict.fun, Limitless and SX Bet. 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 8 venues (Kalshi, Polymarket, Polymarket US, Opinion, Hyperliquid, predict.fun, Limitless and SX Bet): 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,16 @@ 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
|
+
| | [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 |
|
|
130
|
+
| | [Smarkets](https://smarkets.com) | `smarkets` | ✓ no account (quotes delayed without a login) | — | polled from REST quotes | one book per contract, bids are YES bids |
|
|
131
|
+
|
|
132
|
+
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).
|
|
133
|
+
|
|
134
|
+
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).
|
|
127
135
|
|
|
128
136
|
## Why Synpath
|
|
129
137
|
|
|
130
|
-
- **Liquidity is fragmented. Your time shouldn't be.** The same market trades on Kalshi, Polymarket, Polymarket US and
|
|
138
|
+
- **Liquidity is fragmented. Your time shouldn't be.** The same market trades on Kalshi, Polymarket, Polymarket US, Opinion, Hyperliquid, predict.fun, Limitless and SX Bet, 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
139
|
|
|
132
140
|
- **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
141
|
|
|
@@ -173,7 +181,7 @@ fee.estimate(price=0.50, contracts=100) # 1.75
|
|
|
173
181
|
**Same code, every venue**
|
|
174
182
|
|
|
175
183
|
```python
|
|
176
|
-
for venue_id in synpath.exchanges: # [
|
|
184
|
+
for venue_id in synpath.exchanges: # [..., 'sx_bet', 'betfair', 'smarkets'] (Betfair and predict.fun need keys)
|
|
177
185
|
with synpath.exchange(venue_id) as venue:
|
|
178
186
|
page = venue.fetch_markets(limit=5)
|
|
179
187
|
|
|
@@ -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 8 venues (Kalshi, Polymarket, Polymarket US, Opinion, Hyperliquid, predict.fun, Limitless and SX Bet): 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,16 @@ 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
|
+
| | [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 |
|
|
84
|
+
| | [Smarkets](https://smarkets.com) | `smarkets` | ✓ no account (quotes delayed without a login) | — | polled from REST quotes | one book per contract, bids are YES bids |
|
|
85
|
+
|
|
86
|
+
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).
|
|
87
|
+
|
|
88
|
+
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).
|
|
81
89
|
|
|
82
90
|
## Why Synpath
|
|
83
91
|
|
|
84
|
-
- **Liquidity is fragmented. Your time shouldn't be.** The same market trades on Kalshi, Polymarket, Polymarket US and
|
|
92
|
+
- **Liquidity is fragmented. Your time shouldn't be.** The same market trades on Kalshi, Polymarket, Polymarket US, Opinion, Hyperliquid, predict.fun, Limitless and SX Bet, 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
93
|
|
|
86
94
|
- **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
95
|
|
|
@@ -127,7 +135,7 @@ fee.estimate(price=0.50, contracts=100) # 1.75
|
|
|
127
135
|
**Same code, every venue**
|
|
128
136
|
|
|
129
137
|
```python
|
|
130
|
-
for venue_id in synpath.exchanges: # [
|
|
138
|
+
for venue_id in synpath.exchanges: # [..., 'sx_bet', 'betfair', 'smarkets'] (Betfair and predict.fun need keys)
|
|
131
139
|
with synpath.exchange(venue_id) as venue:
|
|
132
140
|
page = venue.fetch_markets(limit=5)
|
|
133
141
|
|
|
@@ -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.9.0"
|
|
13
|
+
description = "One API for 8 prediction markets: Kalshi, Polymarket, Polymarket US, Opinion, Hyperliquid, predict.fun, Limitless and SX Bet. 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,8 @@ 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 .betfair import Betfair
|
|
51
|
+
from .smarkets import Smarkets
|
|
50
52
|
from .matching import match_event, match_market
|
|
51
53
|
from .history import fetch_order_book_at, fetch_order_book_range, fetch_trades_range
|
|
52
54
|
from .bucket import Bucket, BucketMember, BucketOrderReport, BucketPosition
|
|
@@ -80,7 +82,7 @@ from .types import (
|
|
|
80
82
|
TradesRangeResponse,
|
|
81
83
|
)
|
|
82
84
|
|
|
83
|
-
__version__ = "0.
|
|
85
|
+
__version__ = "0.9.0"
|
|
84
86
|
|
|
85
87
|
exchanges: dict[str, type[Exchange]] = {
|
|
86
88
|
"kalshi": Kalshi,
|
|
@@ -91,6 +93,8 @@ exchanges: dict[str, type[Exchange]] = {
|
|
|
91
93
|
"predict_fun": PredictFun,
|
|
92
94
|
"limitless": Limitless,
|
|
93
95
|
"sx_bet": SxBet,
|
|
96
|
+
"betfair": Betfair,
|
|
97
|
+
"smarkets": Smarkets,
|
|
94
98
|
}
|
|
95
99
|
"""Every venue this library speaks, by id."""
|
|
96
100
|
|
|
@@ -141,6 +145,7 @@ _STREAM_CLASSES = (
|
|
|
141
145
|
"PolymarketUSExchangeMarketDataStream", "PolymarketUSExchangeBalanceLedgerStream",
|
|
142
146
|
"OpinionMarketStream", "OpinionUserStream", "HyperliquidMarketStream", "HyperliquidUserStream",
|
|
143
147
|
"PredictFunMarketStream", "PredictFunUserStream", "LimitlessMarketStream", "LimitlessUserStream", "SxBetMarketStream", "SxBetUserStream",
|
|
148
|
+
"BetfairMarketStream", "SmarketsMarketStream",
|
|
144
149
|
)
|
|
145
150
|
_SERVER_NAMES = ("create_app", "create_trading_app", "VenueRegistry", "ControlStore", "Principal")
|
|
146
151
|
|
|
@@ -162,7 +167,7 @@ def __getattr__(name: str):
|
|
|
162
167
|
|
|
163
168
|
|
|
164
169
|
__all__ = [
|
|
165
|
-
"Kalshi", "Polymarket", "PolymarketUS", "Opinion", "Hyperliquid", "PredictFun", "Limitless", "SxBet", "Exchange", "exchange", "exchanges",
|
|
170
|
+
"Kalshi", "Polymarket", "PolymarketUS", "Opinion", "Hyperliquid", "PredictFun", "Limitless", "SxBet", "Betfair", "Smarkets", "Exchange", "exchange", "exchanges",
|
|
166
171
|
"Capability", "HttpClient", "RateLimiter",
|
|
167
172
|
"Market", "Event", "Outcome", "Quote", "MarketStats", "OrderBook",
|
|
168
173
|
"OrderLevel", "Trade", "Candle", "FeeSchedule", "Series", "Page",
|