synpath 0.10.0__tar.gz → 0.12.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.
Files changed (152) hide show
  1. {synpath-0.10.0 → synpath-0.12.0}/PKG-INFO +8 -8
  2. {synpath-0.10.0 → synpath-0.12.0}/README.md +7 -7
  3. {synpath-0.10.0 → synpath-0.12.0}/pyproject.toml +1 -1
  4. {synpath-0.10.0 → synpath-0.12.0}/synpath/__init__.py +4 -4
  5. {synpath-0.10.0 → synpath-0.12.0}/synpath/azuro.py +15 -1
  6. {synpath-0.10.0 → synpath-0.12.0}/synpath/client.py +12 -0
  7. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/__main__.py +24 -17
  8. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/feeds.py +14 -8
  9. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/orders/__init__.py +3 -3
  10. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/orders/manager.py +3 -2
  11. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/orders/taker.py +4 -4
  12. {synpath-0.10.0 → synpath-0.12.0}/synpath/server/serve.py +2 -2
  13. {synpath-0.10.0 → synpath-0.12.0}/synpath/smarkets.py +2 -2
  14. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/__init__.py +8 -1
  15. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/__main__.py +5 -5
  16. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/azuro.py +585 -46
  17. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/azuro_signing.py +157 -9
  18. synpath-0.12.0/synpath/trading/betfair.py +1172 -0
  19. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/credentials.py +89 -10
  20. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/gemini.py +205 -3
  21. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/init.py +7 -6
  22. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/instruments.py +11 -10
  23. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/myriad.py +642 -34
  24. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/myriad_signing.py +114 -1
  25. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/novig.py +1 -1
  26. synpath-0.12.0/synpath/trading/novig_rfq.py +1219 -0
  27. synpath-0.12.0/synpath/trading/novig_rfq_signing.py +187 -0
  28. synpath-0.12.0/synpath/trading/smarkets.py +921 -0
  29. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/types.py +10 -1
  30. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/__init__.py +5 -5
  31. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/betfair.py +421 -71
  32. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/gemini.py +345 -2
  33. synpath-0.12.0/synpath/ws/novig_rfq.py +251 -0
  34. {synpath-0.10.0 → synpath-0.12.0}/Cargo.toml +0 -0
  35. {synpath-0.10.0 → synpath-0.12.0}/LICENSE +0 -0
  36. {synpath-0.10.0 → synpath-0.12.0}/bindings/python/Cargo.lock +0 -0
  37. {synpath-0.10.0 → synpath-0.12.0}/bindings/python/Cargo.toml +0 -0
  38. {synpath-0.10.0 → synpath-0.12.0}/bindings/python/src/kalshi.rs +0 -0
  39. {synpath-0.10.0 → synpath-0.12.0}/bindings/python/src/lib.rs +0 -0
  40. {synpath-0.10.0 → synpath-0.12.0}/bindings/python/src/objects.rs +0 -0
  41. {synpath-0.10.0 → synpath-0.12.0}/bindings/python/src/polymarket.rs +0 -0
  42. {synpath-0.10.0 → synpath-0.12.0}/bindings/python/src/pyjson.rs +0 -0
  43. {synpath-0.10.0 → synpath-0.12.0}/bindings/python/src/router.rs +0 -0
  44. {synpath-0.10.0 → synpath-0.12.0}/bindings/python/src/signing.rs +0 -0
  45. {synpath-0.10.0 → synpath-0.12.0}/bindings/python/src/venues.rs +0 -0
  46. {synpath-0.10.0 → synpath-0.12.0}/build_backend/synpath_build.py +0 -0
  47. {synpath-0.10.0 → synpath-0.12.0}/crates/synpath-core/Cargo.lock +0 -0
  48. {synpath-0.10.0 → synpath-0.12.0}/crates/synpath-core/Cargo.toml +0 -0
  49. {synpath-0.10.0 → synpath-0.12.0}/crates/synpath-core/examples/decode_timing.rs +0 -0
  50. {synpath-0.10.0 → synpath-0.12.0}/crates/synpath-core/src/book.rs +0 -0
  51. {synpath-0.10.0 → synpath-0.12.0}/crates/synpath-core/src/kalshi.rs +0 -0
  52. {synpath-0.10.0 → synpath-0.12.0}/crates/synpath-core/src/lib.rs +0 -0
  53. {synpath-0.10.0 → synpath-0.12.0}/crates/synpath-core/src/opinion.rs +0 -0
  54. {synpath-0.10.0 → synpath-0.12.0}/crates/synpath-core/src/polymarket.rs +0 -0
  55. {synpath-0.10.0 → synpath-0.12.0}/crates/synpath-core/src/polymarket_us.rs +0 -0
  56. {synpath-0.10.0 → synpath-0.12.0}/crates/synpath-core/src/router.rs +0 -0
  57. {synpath-0.10.0 → synpath-0.12.0}/crates/synpath-core/src/signing.rs +0 -0
  58. {synpath-0.10.0 → synpath-0.12.0}/crates/synpath-core/src/wire.rs +0 -0
  59. {synpath-0.10.0 → synpath-0.12.0}/synpath/__main__.py +0 -0
  60. {synpath-0.10.0 → synpath-0.12.0}/synpath/_deprecated.py +0 -0
  61. {synpath-0.10.0 → synpath-0.12.0}/synpath/_native.py +0 -0
  62. {synpath-0.10.0 → synpath-0.12.0}/synpath/base.py +0 -0
  63. {synpath-0.10.0 → synpath-0.12.0}/synpath/betfair.py +0 -0
  64. {synpath-0.10.0 → synpath-0.12.0}/synpath/bucket.py +0 -0
  65. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/__init__.py +0 -0
  66. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/alerts.py +0 -0
  67. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/engine.py +0 -0
  68. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/eod.py +0 -0
  69. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/events.py +0 -0
  70. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/fair_values.py +0 -0
  71. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/journal.py +0 -0
  72. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/ledger.py +0 -0
  73. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/orders/base.py +0 -0
  74. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/orders/day.py +0 -0
  75. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/orders/iceberg.py +0 -0
  76. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/orders/oco.py +0 -0
  77. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/orders/peg.py +0 -0
  78. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/orders/routed.py +0 -0
  79. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/orders/stop.py +0 -0
  80. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/orders/twap.py +0 -0
  81. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/paper.py +0 -0
  82. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/reconcile.py +0 -0
  83. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/risk.py +0 -0
  84. {synpath-0.10.0 → synpath-0.12.0}/synpath/engine/router.py +0 -0
  85. {synpath-0.10.0 → synpath-0.12.0}/synpath/errors.py +0 -0
  86. {synpath-0.10.0 → synpath-0.12.0}/synpath/gemini.py +0 -0
  87. {synpath-0.10.0 → synpath-0.12.0}/synpath/history.py +0 -0
  88. {synpath-0.10.0 → synpath-0.12.0}/synpath/hosted.py +0 -0
  89. {synpath-0.10.0 → synpath-0.12.0}/synpath/hosted_auth.py +0 -0
  90. {synpath-0.10.0 → synpath-0.12.0}/synpath/hyperliquid.py +0 -0
  91. {synpath-0.10.0 → synpath-0.12.0}/synpath/ids.py +0 -0
  92. {synpath-0.10.0 → synpath-0.12.0}/synpath/kalshi.py +0 -0
  93. {synpath-0.10.0 → synpath-0.12.0}/synpath/limitless.py +0 -0
  94. {synpath-0.10.0 → synpath-0.12.0}/synpath/matchbook.py +0 -0
  95. {synpath-0.10.0 → synpath-0.12.0}/synpath/matching.py +0 -0
  96. {synpath-0.10.0 → synpath-0.12.0}/synpath/myriad.py +0 -0
  97. {synpath-0.10.0 → synpath-0.12.0}/synpath/novig.py +0 -0
  98. {synpath-0.10.0 → synpath-0.12.0}/synpath/opinion.py +0 -0
  99. {synpath-0.10.0 → synpath-0.12.0}/synpath/polymarket.py +0 -0
  100. {synpath-0.10.0 → synpath-0.12.0}/synpath/polymarket_us.py +0 -0
  101. {synpath-0.10.0 → synpath-0.12.0}/synpath/predict_fun.py +0 -0
  102. {synpath-0.10.0 → synpath-0.12.0}/synpath/prophetx.py +0 -0
  103. {synpath-0.10.0 → synpath-0.12.0}/synpath/remote.py +0 -0
  104. {synpath-0.10.0 → synpath-0.12.0}/synpath/server/__init__.py +0 -0
  105. {synpath-0.10.0 → synpath-0.12.0}/synpath/server/__main__.py +0 -0
  106. {synpath-0.10.0 → synpath-0.12.0}/synpath/server/api.py +0 -0
  107. {synpath-0.10.0 → synpath-0.12.0}/synpath/server/errors.py +0 -0
  108. {synpath-0.10.0 → synpath-0.12.0}/synpath/server/local.py +0 -0
  109. {synpath-0.10.0 → synpath-0.12.0}/synpath/server/models.py +0 -0
  110. {synpath-0.10.0 → synpath-0.12.0}/synpath/server/store.py +0 -0
  111. {synpath-0.10.0 → synpath-0.12.0}/synpath/server/trading.py +0 -0
  112. {synpath-0.10.0 → synpath-0.12.0}/synpath/sx_bet.py +0 -0
  113. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/base.py +0 -0
  114. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/errors.py +0 -0
  115. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/hyperliquid.py +0 -0
  116. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/hyperliquid_signing.py +0 -0
  117. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/kalshi.py +0 -0
  118. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/limiter.py +0 -0
  119. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/limitless.py +0 -0
  120. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/limitless_signing.py +0 -0
  121. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/matchbook.py +0 -0
  122. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/money.py +0 -0
  123. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/novig_signing.py +0 -0
  124. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/opinion.py +0 -0
  125. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/opinion_signing.py +0 -0
  126. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/polymarket.py +0 -0
  127. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/polymarket_signing.py +0 -0
  128. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/polymarket_us.py +0 -0
  129. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/polymarket_us_exchange.py +0 -0
  130. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/predict_fun.py +0 -0
  131. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/predict_fun_signing.py +0 -0
  132. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/prophetx.py +0 -0
  133. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/sx_bet.py +0 -0
  134. {synpath-0.10.0 → synpath-0.12.0}/synpath/trading/sx_bet_signing.py +0 -0
  135. {synpath-0.10.0 → synpath-0.12.0}/synpath/types.py +0 -0
  136. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/azuro.py +0 -0
  137. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/base.py +0 -0
  138. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/grpc.py +0 -0
  139. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/hyperliquid.py +0 -0
  140. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/kalshi.py +0 -0
  141. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/limitless.py +0 -0
  142. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/matchbook.py +0 -0
  143. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/myriad.py +0 -0
  144. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/novig.py +0 -0
  145. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/opinion.py +0 -0
  146. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/polymarket.py +0 -0
  147. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/polymarket_us.py +0 -0
  148. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/polymarket_us_exchange.py +0 -0
  149. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/predict_fun.py +0 -0
  150. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/prophetx.py +0 -0
  151. {synpath-0.10.0 → synpath-0.12.0}/synpath/ws/smarkets.py +0 -0
  152. {synpath-0.10.0 → synpath-0.12.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.10.0
3
+ Version: 0.12.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
@@ -127,21 +127,21 @@ No silent gaps: if we weren't recording at a moment, you get the reason instead
127
127
  | | [Limitless](https://limitless.exchange) | `limitless` | ✓ | ✓ | WebSocket | one book per market, both sides read it |
128
128
  | | [SX Bet](https://sx.bet) | `sx_bet` | ✓ sports | ✓ | WebSocket | one book per market, both sides read it |
129
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 |
130
+ | | [Betfair Exchange](https://www.betfair.com/exchange) | `betfair` | ✓ your own account and app key (delayed key: 1-180 s late, 3 levels) | ✓ your own account and a live app key | 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) | ✓ your own login, with Smarkets' approved API access | polled from REST quotes | one book per contract, bids are YES bids |
132
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
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
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
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 |
136
+ | | [Myriad](https://myriad.markets) | `myriad` | ✓ order-book and AMM markets, sports | ✓ order book; AMM as market orders | WebSocket (no key) | one book per market, both sides read it; AMM books built from the pool |
137
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).
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 (betting needs Betfair's live key; the free delayed one reads), 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
139
 
140
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
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).
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 logs in with your own Smarkets username and password, and placing orders needs Smarkets' approved API access (a one-off £150 fee). Smarkets' API terms allow viewing prices and betting on your own account, and prohibit odds scraping. See [capabilities](docs/capabilities.md#smarkets).
143
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).
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 is supported from the liquidity provider's side: `NovigPricer` prices and last-looks parlays for a registered LP account ([trading](docs/trading.md#novig-parlay-rfq)). See [capabilities](docs/capabilities.md#novig).
145
145
 
146
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
147
 
@@ -149,7 +149,7 @@ ProphetX, a US peer-to-peer sports exchange, is read the way SX Bet is: each lin
149
149
 
150
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
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).
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 covers both: signed orders on the order book, and market orders against a pool, each sent as one on-chain transaction from the wallet. See [capabilities](docs/capabilities.md#myriad).
153
153
 
154
154
  ## Why Synpath
155
155
 
@@ -81,21 +81,21 @@ No silent gaps: if we weren't recording at a moment, you get the reason instead
81
81
  | | [Limitless](https://limitless.exchange) | `limitless` | ✓ | ✓ | WebSocket | one book per market, both sides read it |
82
82
  | | [SX Bet](https://sx.bet) | `sx_bet` | ✓ sports | ✓ | WebSocket | one book per market, both sides read it |
83
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 |
84
+ | | [Betfair Exchange](https://www.betfair.com/exchange) | `betfair` | ✓ your own account and app key (delayed key: 1-180 s late, 3 levels) | ✓ your own account and a live app key | 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) | ✓ your own login, with Smarkets' approved API access | polled from REST quotes | one book per contract, bids are YES bids |
86
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
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
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
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 |
90
+ | | [Myriad](https://myriad.markets) | `myriad` | ✓ order-book and AMM markets, sports | ✓ order book; AMM as market orders | WebSocket (no key) | one book per market, both sides read it; AMM books built from the pool |
91
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).
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 (betting needs Betfair's live key; the free delayed one reads), 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
93
 
94
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
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).
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 logs in with your own Smarkets username and password, and placing orders needs Smarkets' approved API access (a one-off £150 fee). Smarkets' API terms allow viewing prices and betting on your own account, and prohibit odds scraping. See [capabilities](docs/capabilities.md#smarkets).
97
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).
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 is supported from the liquidity provider's side: `NovigPricer` prices and last-looks parlays for a registered LP account ([trading](docs/trading.md#novig-parlay-rfq)). See [capabilities](docs/capabilities.md#novig).
99
99
 
100
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
101
 
@@ -103,7 +103,7 @@ ProphetX, a US peer-to-peer sports exchange, is read the way SX Bet is: each lin
103
103
 
104
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
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).
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 covers both: signed orders on the order book, and market orders against a pool, each sent as one on-chain transaction from the wallet. See [capabilities](docs/capabilities.md#myriad).
107
107
 
108
108
  ## Why Synpath
109
109
 
@@ -9,7 +9,7 @@ backend-path = ["build_backend"]
9
9
 
10
10
  [project]
11
11
  name = "synpath"
12
- version = "0.10.0"
12
+ version = "0.12.0"
13
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"
@@ -88,7 +88,7 @@ from .types import (
88
88
  TradesRangeResponse,
89
89
  )
90
90
 
91
- __version__ = "0.10.0"
91
+ __version__ = "0.12.0"
92
92
 
93
93
  exchanges: dict[str, type[Exchange]] = {
94
94
  "kalshi": Kalshi,
@@ -127,7 +127,7 @@ def exchange(venue: str, **kwargs) -> Exchange:
127
127
  # keeps working. Imported last, after the read API it builds on.
128
128
  from .trading import (
129
129
  TradingExchange, KalshiTrading, PolymarketTrading, PolymarketUSTrading, PolymarketUSExchangeTrading,
130
- OpinionTrading, HyperliquidTrading, PredictFunTrading, LimitlessTrading, SxBetTrading, NovigTrading, MatchbookTrading, ProphetXTrading, AzuroTrading, MyriadTrading, GeminiTrading,
130
+ OpinionTrading, HyperliquidTrading, PredictFunTrading, LimitlessTrading, SxBetTrading, BetfairTrading, SmarketsTrading, NovigTrading, MatchbookTrading, ProphetXTrading, AzuroTrading, MyriadTrading, GeminiTrading,
131
131
  Account, Balance, EditRequest, FeeEstimate, Fill, HeldBy, Liquidity,
132
132
  Order, OrderRequest, OrderStatus, OrderType, Position, PositionSide,
133
133
  Precision, Settlement, SettlementState, Side, TimeInForce, TriggerSource,
@@ -157,7 +157,7 @@ _STREAM_CLASSES = (
157
157
  "PolymarketUSExchangeMarketDataStream", "PolymarketUSExchangeBalanceLedgerStream",
158
158
  "OpinionMarketStream", "OpinionUserStream", "HyperliquidMarketStream", "HyperliquidUserStream",
159
159
  "PredictFunMarketStream", "PredictFunUserStream", "LimitlessMarketStream", "LimitlessUserStream", "SxBetMarketStream", "SxBetUserStream",
160
- "BetfairMarketStream", "SmarketsMarketStream", "NovigMarketStream", "NovigUserStream", "MatchbookMarketStream", "ProphetXMarketStream", "ProphetXUserStream", "AzuroMarketStream", "MyriadMarketStream", "MyriadUserStream", "GeminiMarketStream", "GeminiUserStream",
160
+ "BetfairMarketStream", "BetfairUserStream", "SmarketsMarketStream", "NovigMarketStream", "NovigUserStream", "MatchbookMarketStream", "ProphetXMarketStream", "ProphetXUserStream", "AzuroMarketStream", "MyriadMarketStream", "MyriadUserStream", "GeminiMarketStream", "GeminiUserStream", "GeminiRfqStream",
161
161
  )
162
162
  _SERVER_NAMES = ("create_app", "create_trading_app", "VenueRegistry", "ControlStore", "Principal")
163
163
 
@@ -196,7 +196,7 @@ __all__ = [
196
196
  "MarketNotFound", "NotSupported", "AuthenticationError",
197
197
  # order entry
198
198
  "TradingExchange", "KalshiTrading", "PolymarketTrading", "PolymarketUSTrading", "PolymarketUSExchangeTrading",
199
- "OpinionTrading", "HyperliquidTrading", "PredictFunTrading", "LimitlessTrading", "SxBetTrading", "NovigTrading", "MatchbookTrading", "ProphetXTrading", "AzuroTrading", "MyriadTrading", "GeminiTrading",
199
+ "OpinionTrading", "HyperliquidTrading", "PredictFunTrading", "LimitlessTrading", "SxBetTrading", "BetfairTrading", "SmarketsTrading", "NovigTrading", "MatchbookTrading", "ProphetXTrading", "AzuroTrading", "MyriadTrading", "GeminiTrading",
200
200
  "Account", "Balance", "EditRequest", "FeeEstimate", "Fill", "HeldBy", "Liquidity",
201
201
  "Order", "OrderRequest", "OrderStatus", "OrderType", "Position", "PositionSide",
202
202
  "Precision", "Settlement", "SettlementState", "Side", "TimeInForce", "TriggerSource",
@@ -115,7 +115,7 @@ CHAINS: dict[str, Chain] = {
115
115
  core="0xF9548Be470A4e130c90ceA8b179FCD66D2972AC7", relayer="0x8dA05c0021e6b35865FDC959c54dCeF3A4AbBa9d",
116
116
  lp="0x0FA7FB5407eA971694652E6E16C12A52625DE1b8", cashout="0x4a2BB4211cCF9b9eA6eF01D0a61448154ED19095",
117
117
  token="0xc2132d05d31c914a87c6611c10748aeb04b58e8f", symbol="USDT", decimals=6,
118
- rpc_url="https://polygon-rpc.com",
118
+ rpc_url="https://polygon-bor-rpc.publicnode.com",
119
119
  ),
120
120
  "base": Chain(
121
121
  "base", 8453, "BaseWETH", "base",
@@ -690,6 +690,20 @@ class Azuro(Exchange):
690
690
  rows = (data or {}).get("conditions") or [] if isinstance(data, dict) else []
691
691
  return [r for r in rows if isinstance(r, dict) and r.get("conditionId")]
692
692
 
693
+ def fetch_conditions(self, condition_ids: list[str]) -> dict[str, dict[str, Any]]:
694
+ """Many conditions by id, each as its game's condition listing has it
695
+ (`/market-manager/conditions-by-game-ids`): state, outcomes and odds,
696
+ the game, and `isExpressForbidden`. A condition whose id names no game
697
+ is read from the condition batch, without those last two."""
698
+ wanted = list(dict.fromkeys(str(c) for c in condition_ids))
699
+ games = list(dict.fromkeys(g for g in (game_of_condition(c) for c in wanted) if g))
700
+ found = {str(row["conditionId"]): row for rows in self._conditions(games).values() for row in rows
701
+ if str(row["conditionId"]) in wanted}
702
+ missing = [c for c in wanted if c not in found]
703
+ if missing:
704
+ found.update({str(row["conditionId"]): row for row in self.fetch_condition_states(missing)})
705
+ return {c: found[c] for c in wanted if c in found}
706
+
693
707
  def condition_outcomes(self, condition_ids: list[str]) -> dict[str, list[str]]:
694
708
  """Each condition's outcome ids, lowest first: what decides its
695
709
  markets' ids and which outcome is YES."""
@@ -388,6 +388,16 @@ def _novig(creds: Credentials) -> TradingExchange:
388
388
  return NovigTrading(creds) # type: ignore[arg-type]
389
389
 
390
390
 
391
+ def _betfair(creds: Credentials) -> TradingExchange:
392
+ from .trading.betfair import BetfairTrading
393
+ return BetfairTrading(creds) # type: ignore[arg-type]
394
+
395
+
396
+ def _smarkets(creds: Credentials) -> TradingExchange:
397
+ from .trading.smarkets import SmarketsTrading
398
+ return SmarketsTrading(creds) # type: ignore[arg-type]
399
+
400
+
391
401
  def _matchbook(creds: Credentials) -> TradingExchange:
392
402
  from .trading.matchbook import MatchbookTrading
393
403
  return MatchbookTrading(creds) # type: ignore[arg-type]
@@ -417,6 +427,8 @@ _TRADING = {
417
427
  "kalshi": _kalshi, "polymarket": _polymarket, "polymarket_us": _polymarket_us, "opinion": _opinion,
418
428
  "hyperliquid": _hyperliquid, "predict_fun": _predict_fun, "limitless": _limitless, "sx_bet": _sx_bet,
419
429
  "novig": _novig,
430
+ "betfair": _betfair,
431
+ "smarkets": _smarkets,
420
432
  "matchbook": _matchbook,
421
433
  "prophetx": _prophetx,
422
434
  "azuro": _azuro,
@@ -66,6 +66,8 @@ ADAPTERS = {
66
66
  "limitless": ("..trading.limitless", "LimitlessTrading"),
67
67
  "sx_bet": ("..trading.sx_bet", "SxBetTrading"),
68
68
  "novig": ("..trading.novig", "NovigTrading"),
69
+ "betfair": ("..trading.betfair", "BetfairTrading"),
70
+ "smarkets": ("..trading.smarkets", "SmarketsTrading"),
69
71
  "matchbook": ("..trading.matchbook", "MatchbookTrading"),
70
72
  "prophetx": ("..trading.prophetx", "ProphetXTrading"),
71
73
  "azuro": ("..trading.azuro", "AzuroTrading"),
@@ -182,23 +184,28 @@ async def run(args: argparse.Namespace) -> int:
182
184
  loop.create_task(_status_loop(engine, float(config.get("status_interval_s", 60))), name="status"),
183
185
  ]
184
186
  waiter = loop.create_task(stopping.wait())
185
- done, _ = await asyncio.wait([*tasks, waiter], return_when=asyncio.FIRST_COMPLETED)
186
- for task in tasks:
187
- task.cancel()
188
- failure = next((t for t in done if t is not waiter and t.exception()), None)
189
- if failure is not None:
190
- log.error("synpath.engine: %s stopped the engine: %s", failure.get_name(), failure.exception())
191
- if config.get("halt_on_exit", True):
192
- await engine.halt("the engine is shutting down", policy=engine_config.halt_policy)
193
- if feeds is not None:
194
- await feeds.close()
195
- await engine.stop()
196
- for adapter in adapters.values():
197
- try:
198
- await adapter.close()
199
- except Exception:
200
- pass
201
- print("engine stopped; the lease is released")
187
+ failure = None
188
+ try:
189
+ done, _ = await asyncio.wait([*tasks, waiter], return_when=asyncio.FIRST_COMPLETED)
190
+ failure = next((t for t in done if t is not waiter and t.exception()), None)
191
+ if failure is not None:
192
+ log.error("synpath.engine: %s stopped the engine: %s", failure.get_name(), failure.exception())
193
+ finally:
194
+ # Also when Ctrl-C cancels this coroutine rather than setting `stopping`,
195
+ # which is what it does where the loop takes no signal handlers (Windows).
196
+ for task in tasks:
197
+ task.cancel()
198
+ if config.get("halt_on_exit", True):
199
+ await engine.halt("the engine is shutting down", policy=engine_config.halt_policy)
200
+ if feeds is not None:
201
+ await feeds.close()
202
+ await engine.stop()
203
+ for adapter in adapters.values():
204
+ try:
205
+ await adapter.close()
206
+ except Exception:
207
+ pass
208
+ print("engine stopped; the lease is released")
202
209
  return 0 if failure is None else 4
203
210
 
204
211
 
@@ -168,10 +168,14 @@ def _trading_streams(adapters: Mapping[str, Any], credentials: Mapping[str, Any]
168
168
  private=MyriadUserStream(address=address, token=token) if address and token else None,
169
169
  )
170
170
  elif venue == "betfair" and creds is not None:
171
- # Market data only: no Betfair order entry, so no account stream.
172
- # Every Betfair stream, books included, logs in with the account.
173
- from ..ws.betfair import BetfairMarketStream
174
- out[venue] = VenueStreams(market=BetfairMarketStream(credentials=creds), private=None)
171
+ # Every Betfair stream, books included, logs in with the account;
172
+ # both share the trading adapter's session, so one login serves all.
173
+ from ..ws.betfair import BetfairMarketStream, BetfairUserStream
174
+ session = getattr(adapter, "session", None)
175
+ out[venue] = VenueStreams(
176
+ market=BetfairMarketStream(credentials=creds, session=session),
177
+ private=BetfairUserStream(credentials=creds, session=session),
178
+ )
175
179
  elif venue == "gemini":
176
180
  # Books are public; the account stream signs its handshake with
177
181
  # the API key, which must be account-scoped and time-based.
@@ -182,11 +186,13 @@ def _trading_streams(adapters: Mapping[str, Any], credentials: Mapping[str, Any]
182
186
  private=GeminiUserStream(creds) if creds is not None else None,
183
187
  )
184
188
  elif venue == "smarkets":
185
- # Market data only, and public: a polled stream on REST quotes
186
- # (Smarkets' socket stream is for approved market makers). The
187
- # login, when configured, only undelays the quotes.
189
+ # A polled stream on REST quotes (Smarkets' socket stream is for
190
+ # approved market makers), on the trading adapter's session when
191
+ # there is one, so the login undelays the quotes. No account
192
+ # stream; the engine polls the orders.
188
193
  from ..ws.smarkets import SmarketsMarketStream
189
- out[venue] = VenueStreams(market=SmarketsMarketStream(credentials=creds), private=None)
194
+ session = getattr(adapter, "session", None)
195
+ out[venue] = VenueStreams(market=SmarketsMarketStream(credentials=creds, session=session), private=None)
190
196
  elif venue == "novig":
191
197
  # The websocket takes a subaccount's trading key; without one the
192
198
  # market stream polls the public book.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Stops (market, limit, trailing), icebergs, one-cancels-the-other and
4
4
  brackets, TWAP, pegs, and the two taking types: an engine-held market order
5
- that walks the book inside a price bound, and a smart taker that does it in
5
+ that walks the book inside a price bound, and a clip taker that does it in
6
6
  clips over time. Day is not here: it is rewritten to a venue-held GTD at the
7
7
  session end, because an expiry must outlive the process (`day.py`).
8
8
 
@@ -32,11 +32,11 @@ from .oco import OCO, Bracket
32
32
  from .peg import Peg
33
33
  from .routed import RoutedLimit
34
34
  from .stop import StopLimit, StopMarket, TrailingStop
35
- from .taker import MarketOrder, SmartTaker
35
+ from .taker import MarketOrder, ClipTaker
36
36
  from .twap import TWAP
37
37
 
38
38
  __all__ = [
39
39
  "ManagedOrder", "ManagedOrders", "Context", "Child", "State", "register", "REGISTRY",
40
40
  "StopMarket", "StopLimit", "TrailingStop", "Iceberg", "OCO", "Bracket", "TWAP", "Peg",
41
- "MarketOrder", "SmartTaker", "as_gtd", "session_expiry",
41
+ "MarketOrder", "ClipTaker", "as_gtd", "session_expiry",
42
42
  ]
@@ -24,7 +24,7 @@ import logging
24
24
  from decimal import Decimal
25
25
  from typing import Any, Iterable, Mapping, Type
26
26
 
27
- from ...trading.types import Fill, Order, OrderRequest, OrderType
27
+ from ...trading.types import LEGACY_CLIP_TAKER, Fill, Order, OrderRequest, OrderType
28
28
  from .base import Child, Context, ManagedOrder, State, now_ms
29
29
 
30
30
  log = logging.getLogger("synpath.engine.orders")
@@ -211,7 +211,8 @@ class ManagedOrders:
211
211
  """Bring back every parent that was still live, after a restart."""
212
212
  restored = 0
213
213
  for snapshot in await self.engine.journal.managed(states=("waiting", "working", "cancelling")):
214
- cls = REGISTRY.get(snapshot.get("kind", ""))
214
+ kind = snapshot.get("kind", "")
215
+ cls = REGISTRY.get("clip_taker" if kind == LEGACY_CLIP_TAKER else kind)
215
216
  if cls is None:
216
217
  log.warning("synpath.engine.orders: no implementation for %s; leaving %s alone",
217
218
  snapshot.get("kind"), snapshot.get("id"))
@@ -9,7 +9,7 @@ protection price or when `max_slippage` from the first touch is spent. What
9
9
  it cannot buy within that range it reports unfilled, because the alternative
10
10
  is paying any price at all.
11
11
 
12
- **Smart taker** is the same walk with patience: clips of `clip` contracts,
12
+ **Clip taker** is the same walk with patience: clips of `clip` contracts,
13
13
  `interval_s` apart, up to `limit`. It exists because taking two hundred
14
14
  contracts in one clip pays for depth that would have refilled in thirty
15
15
  seconds. Between clips it does nothing, which is the point; if the market
@@ -133,11 +133,11 @@ class MarketOrder(_Taker):
133
133
 
134
134
 
135
135
  @register
136
- class SmartTaker(_Taker):
136
+ class ClipTaker(_Taker):
137
137
  """`params`: `clip`, `interval_s`, `limit`, `max_slippage`, `expires_s`."""
138
138
 
139
- kind = "smart_taker"
140
- order_type = OrderType.SMART_TAKER
139
+ kind = "clip_taker"
140
+ order_type = OrderType.CLIP_TAKER
141
141
 
142
142
  def __init__(self, *args: Any, **kwargs: Any):
143
143
  super().__init__(*args, **kwargs)
@@ -35,8 +35,8 @@ 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", "sx_bet", "novig",
39
- "matchbook", "prophetx", "azuro", "myriad", "gemini")
38
+ VENUES = ("kalshi", "polymarket", "polymarket_us", "opinion", "hyperliquid", "predict_fun", "limitless", "sx_bet", "betfair",
39
+ "smarkets", "novig", "matchbook", "prophetx", "azuro", "myriad", "gemini")
40
40
 
41
41
 
42
42
  def venues_config(config: dict[str, Any], credentials: dict[str, Any]) -> dict[str, Any]:
@@ -7,8 +7,8 @@ by how much) and the rate limits are lower; every book and quote read here
7
7
  records which in its `info` (`delayed`). An optional login
8
8
  (`SMARKETS_USERNAME`, `SMARKETS_PASSWORD`) sends a session token for
9
9
  undelayed quotes and the account's own limits; see `SmarketsSession`.
10
- Betting needs approved API access from Smarkets (a one-off £150 fee) and is
11
- not offered here yet.
10
+ Order entry is `synpath.trading.smarkets.SmarketsTrading`, on the same login;
11
+ placing orders needs approved API access from Smarkets (a one-off £150 fee).
12
12
 
13
13
  Five things about this venue that shape the adapter:
14
14
 
@@ -84,6 +84,12 @@ def __getattr__(name: str):
84
84
  if name == "NovigTrading":
85
85
  from .novig import NovigTrading
86
86
  return NovigTrading
87
+ if name == "BetfairTrading":
88
+ from .betfair import BetfairTrading
89
+ return BetfairTrading
90
+ if name == "SmarketsTrading":
91
+ from .smarkets import SmarketsTrading
92
+ return SmarketsTrading
87
93
  if name == "MatchbookTrading":
88
94
  from .matchbook import MatchbookTrading
89
95
  return MatchbookTrading
@@ -105,7 +111,8 @@ def __getattr__(name: str):
105
111
  __all__ = [
106
112
  "TradingExchange", "KalshiTrading", "PolymarketTrading", "PolymarketUSTrading", "PolymarketUSExchangeTrading",
107
113
  "OpinionTrading", "HyperliquidTrading", "PredictFunTrading", "LimitlessTrading", "SxBetTrading", "NovigTrading",
108
- "MatchbookTrading", "ProphetXTrading", "AzuroTrading", "MyriadTrading", "GeminiTrading",
114
+ "BetfairTrading", "SmarketsTrading", "MatchbookTrading", "ProphetXTrading", "AzuroTrading", "MyriadTrading",
115
+ "GeminiTrading",
109
116
  "Account", "Balance", "EditRequest", "FeeEstimate", "Fill", "HeldBy", "Liquidity",
110
117
  "Order", "OrderRequest", "OrderStatus", "OrderType", "Position", "PositionSide",
111
118
  "Precision", "Settlement", "SettlementState", "Side", "TimeInForce", "TriggerSource",
@@ -61,9 +61,9 @@ def doctor(dotenv: str | None) -> int:
61
61
  for venue, creds in loaded.items():
62
62
  if creds is None and venue == "smarkets":
63
63
  # Optional: Smarkets serves its market data without a login.
64
- rows.append((venue, "no login (optional)", "market data needs none; set SMARKETS_USERNAME / "
65
- "SMARKETS_PASSWORD for undelayed quotes, or run synpath init. Betting needs Smarkets' "
66
- "approved API access (£150 one-off), not supported yet"))
64
+ rows.append((venue, "not configured", "market data needs no login; set SMARKETS_USERNAME / "
65
+ "SMARKETS_PASSWORD to bet and for undelayed quotes, or run synpath init. Placing orders "
66
+ "needs Smarkets' approved API access"))
67
67
  continue
68
68
  if creds is None and venue == "matchbook":
69
69
  # Market data is public; the login is for betting.
@@ -130,7 +130,7 @@ def doctor(dotenv: str | None) -> int:
130
130
  # The application key is a secret too; the username names the account.
131
131
  stage = creds.jurisdiction
132
132
  login = "certificate" if creds.cert_path else "interactive"
133
- identity = f"user {creds.username}, app key loaded, {login} login"
133
+ identity = f"user {creds.username}, app key loaded, {login} login (betting needs a live key)"
134
134
  elif venue == "prophetx":
135
135
  stage = "sandbox" if creds.sandbox else "production"
136
136
  affiliate = "; affiliate key loaded: market data from the Market Data API" if creds.affiliate_key else ""
@@ -144,7 +144,7 @@ def doctor(dotenv: str | None) -> int:
144
144
  identity = f"api key {creds.api_key[:12]}…{sub} (account-scoped, time-based nonce for streams)"
145
145
  elif venue == "smarkets":
146
146
  stage = "login"
147
- identity = f"user {creds.username}: undelayed quotes; betting needs approved API access, not supported yet"
147
+ identity = f"user {creds.username}: undelayed quotes and the account; placing orders needs approved API access"
148
148
  elif venue == "matchbook":
149
149
  stage = "login"
150
150
  identity = f"user {creds.username}"