synpath 0.6.0__tar.gz → 0.7.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.6.0 → synpath-0.7.0}/PKG-INFO +62 -6
- {synpath-0.6.0 → synpath-0.7.0}/README.md +61 -5
- {synpath-0.6.0 → synpath-0.7.0}/pyproject.toml +1 -1
- {synpath-0.6.0 → synpath-0.7.0}/synpath/__init__.py +7 -5
- {synpath-0.6.0 → synpath-0.7.0}/synpath/client.py +6 -1
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/__main__.py +1 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/feeds.py +9 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/ids.py +1 -1
- {synpath-0.6.0 → synpath-0.7.0}/synpath/server/serve.py +1 -1
- synpath-0.7.0/synpath/sx_bet.py +631 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/__init__.py +4 -1
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/__main__.py +4 -1
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/credentials.py +45 -1
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/init.py +15 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/instruments.py +4 -0
- synpath-0.7.0/synpath/trading/sx_bet.py +655 -0
- synpath-0.7.0/synpath/trading/sx_bet_signing.py +172 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/types.py +5 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/ws/__init__.py +4 -1
- synpath-0.7.0/synpath/ws/sx_bet.py +499 -0
- {synpath-0.6.0 → synpath-0.7.0}/Cargo.toml +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/LICENSE +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/bindings/python/Cargo.lock +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/bindings/python/Cargo.toml +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/bindings/python/src/kalshi.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/bindings/python/src/lib.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/bindings/python/src/objects.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/bindings/python/src/polymarket.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/bindings/python/src/pyjson.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/bindings/python/src/router.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/bindings/python/src/signing.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/bindings/python/src/venues.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/build_backend/synpath_build.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/crates/synpath-core/Cargo.lock +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/crates/synpath-core/Cargo.toml +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/crates/synpath-core/examples/decode_timing.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/crates/synpath-core/src/book.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/crates/synpath-core/src/kalshi.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/crates/synpath-core/src/lib.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/crates/synpath-core/src/opinion.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/crates/synpath-core/src/polymarket.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/crates/synpath-core/src/polymarket_us.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/crates/synpath-core/src/router.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/crates/synpath-core/src/signing.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/crates/synpath-core/src/wire.rs +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/__main__.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/_native.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/base.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/bucket.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/__init__.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/alerts.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/engine.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/eod.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/events.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/fair_values.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/journal.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/ledger.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/orders/__init__.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/orders/base.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/orders/day.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/orders/iceberg.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/orders/manager.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/orders/oco.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/orders/peg.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/orders/routed.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/orders/stop.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/orders/taker.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/orders/twap.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/paper.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/reconcile.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/risk.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/engine/router.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/errors.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/history.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/hosted.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/hosted_auth.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/hyperliquid.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/kalshi.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/limitless.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/matching.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/opinion.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/polymarket.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/polymarket_us.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/predict_fun.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/remote.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/server/__init__.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/server/__main__.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/server/api.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/server/errors.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/server/local.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/server/models.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/server/store.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/server/trading.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/base.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/errors.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/hyperliquid.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/hyperliquid_signing.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/kalshi.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/limiter.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/limitless.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/limitless_signing.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/money.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/opinion.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/opinion_signing.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/polymarket.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/polymarket_signing.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/polymarket_us.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/polymarket_us_exchange.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/predict_fun.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/predict_fun_signing.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/trading/types.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/ws/base.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/ws/grpc.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/ws/hyperliquid.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/ws/kalshi.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/ws/limitless.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/ws/opinion.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/ws/polymarket.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/ws/polymarket_us.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/ws/polymarket_us_exchange.py +0 -0
- {synpath-0.6.0 → synpath-0.7.0}/synpath/ws/predict_fun.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: synpath
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.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
|
|
@@ -59,10 +59,56 @@ One open-source API across Kalshi, Polymarket, Polymarket US and Opinion: market
|
|
|
59
59
|
|
|
60
60
|
</div>
|
|
61
61
|
|
|
62
|
-
**🆕 New:
|
|
63
|
-
|
|
62
|
+
**🆕 New: free tick-level Kalshi order book history.**<br/>
|
|
63
|
+
Every public Kalshi market, full depth, every change and every trade, straight from Kalshi's live feed. Sign up from your terminal and query it in one line of Python. **[Get it in 60 seconds ↓](#free-kalshi-tick-data-in-60-seconds)**
|
|
64
64
|
|
|
65
|
-
⭐ **
|
|
65
|
+
⭐ **[Star Synpath on GitHub](https://github.com/Synpath-ai/synpath)** if the data saves you money. Stars are how we decide what to open up next.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Free Kalshi tick data in 60 seconds
|
|
70
|
+
|
|
71
|
+
**1. Install**
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pip install synpath
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**2. Sign up**: opens Google sign-in in your browser, then returns to the terminal. Free, no card.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
synpath login
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**3. Create your API key**: it's saved on your machine and Python picks it up automatically.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
synpath keys create my-laptop
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**4. Query any moment**
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
import synpath
|
|
93
|
+
|
|
94
|
+
t = 1790776800000 # any moment, in Unix milliseconds
|
|
95
|
+
|
|
96
|
+
# The full book exactly as it stood at that millisecond
|
|
97
|
+
snap = synpath.fetch_order_book_at("kalshi:KXQUANTUM-30", as_of_ms=t)
|
|
98
|
+
print(snap.book.bids[0].price, snap.book.asks[0].price, len(snap.book.bids), "bid levels")
|
|
99
|
+
|
|
100
|
+
# Every change over an hour: a starting book, then each update in arrival order
|
|
101
|
+
changes = synpath.fetch_order_book_range("kalshi:KXQUANTUM-30", start_ms=t, end_ms=t + 3_600_000)
|
|
102
|
+
|
|
103
|
+
# Every trade: price, size and taker side
|
|
104
|
+
trades = synpath.fetch_trades_range("kalshi:KXQUANTUM-30", start_ms=t, end_ms=t + 3_600_000)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
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
|
+
|
|
109
|
+
> ⭐ **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.
|
|
110
|
+
|
|
111
|
+
**Also new: smart order routing across Kalshi and Polymarket.** One order, both order books combined, filled from the cheapest price after fees. [See how it works →](https://www.synpath.dev/docs/concepts/buckets)
|
|
66
112
|
|
|
67
113
|
---
|
|
68
114
|
|
|
@@ -77,6 +123,7 @@ One order, both order books combined, filled from the cheapest price after fees.
|
|
|
77
123
|
| | [Hyperliquid](https://app.hyperliquid.xyz) | `hyperliquid` | ✓ outcome markets (HIP-4) | ✓ | WebSocket (no key) | one book per market, both sides read it |
|
|
78
124
|
| | [predict.fun](https://predict.fun) | `predict_fun` | ✓ (API key) | ✓ | WebSocket (API key) | one book per market, both sides read it |
|
|
79
125
|
| | [Limitless](https://limitless.exchange) | `limitless` | ✓ | ✓ | WebSocket | one book per market, both sides read it |
|
|
126
|
+
| | [SX Bet](https://sx.bet) | `sx_bet` | ✓ sports | ✓ | WebSocket | one book per market, both sides read it |
|
|
80
127
|
|
|
81
128
|
## Why Synpath
|
|
82
129
|
|
|
@@ -95,7 +142,7 @@ pip install "synpath[grpc]" # + Polymarket US exchange gRPC streams
|
|
|
95
142
|
|
|
96
143
|
Python 3.10 or newer. The hot paths (order books, reading the venues' book streams, order signing and the order router) run on a Rust core that ships prebuilt inside the wheel for Linux, macOS and Windows; nothing else to install.
|
|
97
144
|
|
|
98
|
-
**Hosted API.** Run `synpath login`, then `synpath keys create
|
|
145
|
+
**Hosted API.** Run `synpath login`, then `synpath keys create` ([step by step ↑](#free-kalshi-tick-data-in-60-seconds)). It serves tick-level Kalshi order book and trade history, and cross-venue market matching. Trading stays on your machine: Synpath never holds your keys or funds.
|
|
99
146
|
|
|
100
147
|
## Quick Start
|
|
101
148
|
|
|
@@ -126,7 +173,7 @@ fee.estimate(price=0.50, contracts=100) # 1.75
|
|
|
126
173
|
**Same code, every venue**
|
|
127
174
|
|
|
128
175
|
```python
|
|
129
|
-
for venue_id in synpath.exchanges: # ['kalshi', 'polymarket', 'polymarket_us', 'opinion', 'hyperliquid', 'predict_fun', 'limitless']
|
|
176
|
+
for venue_id in synpath.exchanges: # ['kalshi', 'polymarket', 'polymarket_us', 'opinion', 'hyperliquid', 'predict_fun', 'limitless', 'sx_bet']
|
|
130
177
|
with synpath.exchange(venue_id) as venue:
|
|
131
178
|
page = venue.fetch_markets(limit=5)
|
|
132
179
|
|
|
@@ -159,6 +206,15 @@ async with PolymarketMarketStream() as stream:
|
|
|
159
206
|
print(event.market_id, event.side, event.best_bid, event.best_ask)
|
|
160
207
|
```
|
|
161
208
|
|
|
209
|
+
**Cross-venue matching: the same market on other venues**
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
synpath.match_market("kalshi:KXHIGHTATL-26SEP23-B80") # .matched: the same question on another venue, or None
|
|
213
|
+
synpath.match_event("kalshi:KXHIGHTATL-26SEP23") # each venue's events on the same event
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Matching is hosted at `api.synpath.dev` and needs a Synpath API key (`synpath login`, then `synpath keys create`). A match is a deterministic parse both listings land on, not a similarity score, and `side_map` says when one venue asks the question the other way round. Crypto up-or-down markets are never matched, since each venue sets its own price to beat. Browse matched events at [synpath.dev](https://www.synpath.dev); API: [match a market](https://www.synpath.dev/docs/api-reference/matching/market), [match an event](https://www.synpath.dev/docs/api-reference/matching/event).
|
|
217
|
+
|
|
162
218
|
**Smart order routing: one order across Kalshi and Polymarket**
|
|
163
219
|
|
|
164
220
|
```python
|
|
@@ -13,10 +13,56 @@ One open-source API across Kalshi, Polymarket, Polymarket US and Opinion: market
|
|
|
13
13
|
|
|
14
14
|
</div>
|
|
15
15
|
|
|
16
|
-
**🆕 New:
|
|
17
|
-
|
|
16
|
+
**🆕 New: free tick-level Kalshi order book history.**<br/>
|
|
17
|
+
Every public Kalshi market, full depth, every change and every trade, straight from Kalshi's live feed. Sign up from your terminal and query it in one line of Python. **[Get it in 60 seconds ↓](#free-kalshi-tick-data-in-60-seconds)**
|
|
18
18
|
|
|
19
|
-
⭐ **
|
|
19
|
+
⭐ **[Star Synpath on GitHub](https://github.com/Synpath-ai/synpath)** if the data saves you money. Stars are how we decide what to open up next.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Free Kalshi tick data in 60 seconds
|
|
24
|
+
|
|
25
|
+
**1. Install**
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install synpath
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**2. Sign up**: opens Google sign-in in your browser, then returns to the terminal. Free, no card.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
synpath login
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**3. Create your API key**: it's saved on your machine and Python picks it up automatically.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
synpath keys create my-laptop
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**4. Query any moment**
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
import synpath
|
|
47
|
+
|
|
48
|
+
t = 1790776800000 # any moment, in Unix milliseconds
|
|
49
|
+
|
|
50
|
+
# The full book exactly as it stood at that millisecond
|
|
51
|
+
snap = synpath.fetch_order_book_at("kalshi:KXQUANTUM-30", as_of_ms=t)
|
|
52
|
+
print(snap.book.bids[0].price, snap.book.asks[0].price, len(snap.book.bids), "bid levels")
|
|
53
|
+
|
|
54
|
+
# Every change over an hour: a starting book, then each update in arrival order
|
|
55
|
+
changes = synpath.fetch_order_book_range("kalshi:KXQUANTUM-30", start_ms=t, end_ms=t + 3_600_000)
|
|
56
|
+
|
|
57
|
+
# Every trade: price, size and taker side
|
|
58
|
+
trades = synpath.fetch_trades_range("kalshi:KXQUANTUM-30", start_ms=t, end_ms=t + 3_600_000)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
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
|
+
|
|
63
|
+
> ⭐ **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.
|
|
64
|
+
|
|
65
|
+
**Also new: smart order routing across Kalshi and Polymarket.** One order, both order books combined, filled from the cheapest price after fees. [See how it works →](https://www.synpath.dev/docs/concepts/buckets)
|
|
20
66
|
|
|
21
67
|
---
|
|
22
68
|
|
|
@@ -31,6 +77,7 @@ One order, both order books combined, filled from the cheapest price after fees.
|
|
|
31
77
|
| | [Hyperliquid](https://app.hyperliquid.xyz) | `hyperliquid` | ✓ outcome markets (HIP-4) | ✓ | WebSocket (no key) | one book per market, both sides read it |
|
|
32
78
|
| | [predict.fun](https://predict.fun) | `predict_fun` | ✓ (API key) | ✓ | WebSocket (API key) | one book per market, both sides read it |
|
|
33
79
|
| | [Limitless](https://limitless.exchange) | `limitless` | ✓ | ✓ | WebSocket | one book per market, both sides read it |
|
|
80
|
+
| | [SX Bet](https://sx.bet) | `sx_bet` | ✓ sports | ✓ | WebSocket | one book per market, both sides read it |
|
|
34
81
|
|
|
35
82
|
## Why Synpath
|
|
36
83
|
|
|
@@ -49,7 +96,7 @@ pip install "synpath[grpc]" # + Polymarket US exchange gRPC streams
|
|
|
49
96
|
|
|
50
97
|
Python 3.10 or newer. The hot paths (order books, reading the venues' book streams, order signing and the order router) run on a Rust core that ships prebuilt inside the wheel for Linux, macOS and Windows; nothing else to install.
|
|
51
98
|
|
|
52
|
-
**Hosted API.** Run `synpath login`, then `synpath keys create
|
|
99
|
+
**Hosted API.** Run `synpath login`, then `synpath keys create` ([step by step ↑](#free-kalshi-tick-data-in-60-seconds)). It serves tick-level Kalshi order book and trade history, and cross-venue market matching. Trading stays on your machine: Synpath never holds your keys or funds.
|
|
53
100
|
|
|
54
101
|
## Quick Start
|
|
55
102
|
|
|
@@ -80,7 +127,7 @@ fee.estimate(price=0.50, contracts=100) # 1.75
|
|
|
80
127
|
**Same code, every venue**
|
|
81
128
|
|
|
82
129
|
```python
|
|
83
|
-
for venue_id in synpath.exchanges: # ['kalshi', 'polymarket', 'polymarket_us', 'opinion', 'hyperliquid', 'predict_fun', 'limitless']
|
|
130
|
+
for venue_id in synpath.exchanges: # ['kalshi', 'polymarket', 'polymarket_us', 'opinion', 'hyperliquid', 'predict_fun', 'limitless', 'sx_bet']
|
|
84
131
|
with synpath.exchange(venue_id) as venue:
|
|
85
132
|
page = venue.fetch_markets(limit=5)
|
|
86
133
|
|
|
@@ -113,6 +160,15 @@ async with PolymarketMarketStream() as stream:
|
|
|
113
160
|
print(event.market_id, event.side, event.best_bid, event.best_ask)
|
|
114
161
|
```
|
|
115
162
|
|
|
163
|
+
**Cross-venue matching: the same market on other venues**
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
synpath.match_market("kalshi:KXHIGHTATL-26SEP23-B80") # .matched: the same question on another venue, or None
|
|
167
|
+
synpath.match_event("kalshi:KXHIGHTATL-26SEP23") # each venue's events on the same event
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Matching is hosted at `api.synpath.dev` and needs a Synpath API key (`synpath login`, then `synpath keys create`). A match is a deterministic parse both listings land on, not a similarity score, and `side_map` says when one venue asks the question the other way round. Crypto up-or-down markets are never matched, since each venue sets its own price to beat. Browse matched events at [synpath.dev](https://www.synpath.dev); API: [match a market](https://www.synpath.dev/docs/api-reference/matching/market), [match an event](https://www.synpath.dev/docs/api-reference/matching/event).
|
|
171
|
+
|
|
116
172
|
**Smart order routing: one order across Kalshi and Polymarket**
|
|
117
173
|
|
|
118
174
|
```python
|
|
@@ -9,7 +9,7 @@ backend-path = ["build_backend"]
|
|
|
9
9
|
|
|
10
10
|
[project]
|
|
11
11
|
name = "synpath"
|
|
12
|
-
version = "0.
|
|
12
|
+
version = "0.7.0"
|
|
13
13
|
description = "One API for prediction markets. Kalshi and Polymarket, normalized, with every price labelled by source and time."
|
|
14
14
|
readme = "README.md"
|
|
15
15
|
requires-python = ">=3.10"
|
|
@@ -46,6 +46,7 @@ from .opinion import Opinion
|
|
|
46
46
|
from .hyperliquid import Hyperliquid
|
|
47
47
|
from .predict_fun import PredictFun
|
|
48
48
|
from .limitless import Limitless
|
|
49
|
+
from .sx_bet import SxBet
|
|
49
50
|
from .matching import match_event, match_market
|
|
50
51
|
from .history import fetch_order_book_at, fetch_order_book_range, fetch_trades_range
|
|
51
52
|
from .bucket import Bucket, BucketMember, BucketOrderReport, BucketPosition
|
|
@@ -79,7 +80,7 @@ from .types import (
|
|
|
79
80
|
TradesRangeResponse,
|
|
80
81
|
)
|
|
81
82
|
|
|
82
|
-
__version__ = "0.
|
|
83
|
+
__version__ = "0.7.0"
|
|
83
84
|
|
|
84
85
|
exchanges: dict[str, type[Exchange]] = {
|
|
85
86
|
"kalshi": Kalshi,
|
|
@@ -89,6 +90,7 @@ exchanges: dict[str, type[Exchange]] = {
|
|
|
89
90
|
"hyperliquid": Hyperliquid,
|
|
90
91
|
"predict_fun": PredictFun,
|
|
91
92
|
"limitless": Limitless,
|
|
93
|
+
"sx_bet": SxBet,
|
|
92
94
|
}
|
|
93
95
|
"""Every venue this library speaks, by id."""
|
|
94
96
|
|
|
@@ -109,7 +111,7 @@ def exchange(venue: str, **kwargs) -> Exchange:
|
|
|
109
111
|
# keeps working. Imported last, after the read API it builds on.
|
|
110
112
|
from .trading import (
|
|
111
113
|
TradingExchange, KalshiTrading, PolymarketTrading, PolymarketUSTrading, PolymarketUSExchangeTrading,
|
|
112
|
-
OpinionTrading, HyperliquidTrading, PredictFunTrading, LimitlessTrading,
|
|
114
|
+
OpinionTrading, HyperliquidTrading, PredictFunTrading, LimitlessTrading, SxBetTrading,
|
|
113
115
|
Account, Balance, EditRequest, FeeEstimate, Fill, HeldBy, Liquidity,
|
|
114
116
|
Order, OrderRequest, OrderStatus, OrderType, Position, PositionSide,
|
|
115
117
|
Precision, Settlement, SettlementState, Side, TimeInForce,
|
|
@@ -138,7 +140,7 @@ _STREAM_CLASSES = (
|
|
|
138
140
|
"PolymarketUSExchangeInstrumentStream", "PolymarketUSExchangePositionStream",
|
|
139
141
|
"PolymarketUSExchangeMarketDataStream", "PolymarketUSExchangeBalanceLedgerStream",
|
|
140
142
|
"OpinionMarketStream", "OpinionUserStream", "HyperliquidMarketStream", "HyperliquidUserStream",
|
|
141
|
-
"PredictFunMarketStream", "PredictFunUserStream", "LimitlessMarketStream", "LimitlessUserStream",
|
|
143
|
+
"PredictFunMarketStream", "PredictFunUserStream", "LimitlessMarketStream", "LimitlessUserStream", "SxBetMarketStream", "SxBetUserStream",
|
|
142
144
|
)
|
|
143
145
|
_SERVER_NAMES = ("create_app", "create_trading_app", "VenueRegistry", "ControlStore", "Principal")
|
|
144
146
|
|
|
@@ -160,7 +162,7 @@ def __getattr__(name: str):
|
|
|
160
162
|
|
|
161
163
|
|
|
162
164
|
__all__ = [
|
|
163
|
-
"Kalshi", "Polymarket", "PolymarketUS", "Opinion", "Hyperliquid", "PredictFun", "Limitless", "Exchange", "exchange", "exchanges",
|
|
165
|
+
"Kalshi", "Polymarket", "PolymarketUS", "Opinion", "Hyperliquid", "PredictFun", "Limitless", "SxBet", "Exchange", "exchange", "exchanges",
|
|
164
166
|
"Capability", "HttpClient", "RateLimiter",
|
|
165
167
|
"Market", "Event", "Outcome", "Quote", "MarketStats", "OrderBook",
|
|
166
168
|
"OrderLevel", "Trade", "Candle", "FeeSchedule", "Series", "Page",
|
|
@@ -177,7 +179,7 @@ __all__ = [
|
|
|
177
179
|
"MarketNotFound", "NotSupported", "AuthenticationError",
|
|
178
180
|
# order entry
|
|
179
181
|
"TradingExchange", "KalshiTrading", "PolymarketTrading", "PolymarketUSTrading", "PolymarketUSExchangeTrading",
|
|
180
|
-
"OpinionTrading", "HyperliquidTrading", "PredictFunTrading", "LimitlessTrading",
|
|
182
|
+
"OpinionTrading", "HyperliquidTrading", "PredictFunTrading", "LimitlessTrading", "SxBetTrading",
|
|
181
183
|
"Account", "Balance", "EditRequest", "FeeEstimate", "Fill", "HeldBy", "Liquidity",
|
|
182
184
|
"Order", "OrderRequest", "OrderStatus", "OrderType", "Position", "PositionSide",
|
|
183
185
|
"Precision", "Settlement", "SettlementState", "Side", "TimeInForce",
|
|
@@ -373,7 +373,12 @@ def _limitless(creds: Credentials) -> TradingExchange:
|
|
|
373
373
|
return LimitlessTrading(creds) # type: ignore[arg-type]
|
|
374
374
|
|
|
375
375
|
|
|
376
|
+
def _sx_bet(creds: Credentials) -> TradingExchange:
|
|
377
|
+
from .trading.sx_bet import SxBetTrading
|
|
378
|
+
return SxBetTrading(creds) # type: ignore[arg-type]
|
|
379
|
+
|
|
380
|
+
|
|
376
381
|
_TRADING = {
|
|
377
382
|
"kalshi": _kalshi, "polymarket": _polymarket, "polymarket_us": _polymarket_us, "opinion": _opinion,
|
|
378
|
-
"hyperliquid": _hyperliquid, "predict_fun": _predict_fun, "limitless": _limitless,
|
|
383
|
+
"hyperliquid": _hyperliquid, "predict_fun": _predict_fun, "limitless": _limitless, "sx_bet": _sx_bet,
|
|
379
384
|
}
|
|
@@ -64,6 +64,7 @@ ADAPTERS = {
|
|
|
64
64
|
"hyperliquid": ("..trading.hyperliquid", "HyperliquidTrading"),
|
|
65
65
|
"predict_fun": ("..trading.predict_fun", "PredictFunTrading"),
|
|
66
66
|
"limitless": ("..trading.limitless", "LimitlessTrading"),
|
|
67
|
+
"sx_bet": ("..trading.sx_bet", "SxBetTrading"),
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
|
|
@@ -102,6 +102,15 @@ def default_streams(adapters: Mapping[str, Any], credentials: Mapping[str, Any])
|
|
|
102
102
|
market=LimitlessMarketStream(),
|
|
103
103
|
private=LimitlessUserStream(token_id=token_id, secret=secret, catalog=catalog) if token_id and secret else None,
|
|
104
104
|
)
|
|
105
|
+
elif venue == "sx_bet" and creds is not None:
|
|
106
|
+
# Every SX Bet channel, public ones included, needs the API key.
|
|
107
|
+
from ..ws.sx_bet import SxBetMarketStream, SxBetUserStream
|
|
108
|
+
testnet = bool(getattr(creds, "testnet", False))
|
|
109
|
+
catalog = getattr(adapter, "catalog", None)
|
|
110
|
+
out[venue] = VenueStreams(
|
|
111
|
+
market=SxBetMarketStream(api_key=creds.api_key, testnet=testnet, catalog=catalog),
|
|
112
|
+
private=SxBetUserStream(api_key=creds.api_key, testnet=testnet, address=creds.address),
|
|
113
|
+
)
|
|
105
114
|
else:
|
|
106
115
|
log.info("synpath.engine.feeds: no stream for %s; its orders reach the engine by polling", venue)
|
|
107
116
|
return out
|
|
@@ -15,7 +15,7 @@ The colon is safe as a separator: no venue's native id contains one.
|
|
|
15
15
|
"""
|
|
16
16
|
from __future__ import annotations
|
|
17
17
|
|
|
18
|
-
VENUES: tuple[str, ...] = ("kalshi", "polymarket", "polymarket_us", "opinion", "hyperliquid", "predict_fun", "limitless")
|
|
18
|
+
VENUES: tuple[str, ...] = ("kalshi", "polymarket", "polymarket_us", "opinion", "hyperliquid", "predict_fun", "limitless", "sx_bet")
|
|
19
19
|
"""Every venue this library speaks, by id. `synpath.exchanges` is the same
|
|
20
20
|
list with the adapter classes attached; this one exists so the id helpers do
|
|
21
21
|
not import the adapters."""
|
|
@@ -35,7 +35,7 @@ from . import local
|
|
|
35
35
|
|
|
36
36
|
log = logging.getLogger("synpath.serve")
|
|
37
37
|
|
|
38
|
-
VENUES = ("kalshi", "polymarket", "polymarket_us", "opinion", "hyperliquid", "predict_fun", "limitless")
|
|
38
|
+
VENUES = ("kalshi", "polymarket", "polymarket_us", "opinion", "hyperliquid", "predict_fun", "limitless", "sx_bet")
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
def venues_config(config: dict[str, Any], credentials: dict[str, Any]) -> dict[str, Any]:
|