synpath 0.7.0__tar.gz → 0.7.1__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.7.0 → synpath-0.7.1}/PKG-INFO +1 -1
- {synpath-0.7.0 → synpath-0.7.1}/pyproject.toml +1 -1
- {synpath-0.7.0 → synpath-0.7.1}/synpath/__init__.py +1 -1
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/polymarket.py +23 -5
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/polymarket_signing.py +9 -3
- {synpath-0.7.0 → synpath-0.7.1}/Cargo.toml +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/LICENSE +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/README.md +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/bindings/python/Cargo.lock +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/bindings/python/Cargo.toml +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/bindings/python/src/kalshi.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/bindings/python/src/lib.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/bindings/python/src/objects.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/bindings/python/src/polymarket.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/bindings/python/src/pyjson.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/bindings/python/src/router.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/bindings/python/src/signing.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/bindings/python/src/venues.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/build_backend/synpath_build.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/crates/synpath-core/Cargo.lock +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/crates/synpath-core/Cargo.toml +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/crates/synpath-core/examples/decode_timing.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/crates/synpath-core/src/book.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/crates/synpath-core/src/kalshi.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/crates/synpath-core/src/lib.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/crates/synpath-core/src/opinion.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/crates/synpath-core/src/polymarket.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/crates/synpath-core/src/polymarket_us.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/crates/synpath-core/src/router.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/crates/synpath-core/src/signing.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/crates/synpath-core/src/wire.rs +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/__main__.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/_native.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/base.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/bucket.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/client.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/__init__.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/__main__.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/alerts.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/engine.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/eod.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/events.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/fair_values.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/feeds.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/journal.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/ledger.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/orders/__init__.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/orders/base.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/orders/day.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/orders/iceberg.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/orders/manager.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/orders/oco.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/orders/peg.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/orders/routed.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/orders/stop.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/orders/taker.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/orders/twap.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/paper.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/reconcile.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/risk.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/engine/router.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/errors.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/history.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/hosted.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/hosted_auth.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/hyperliquid.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ids.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/kalshi.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/limitless.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/matching.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/opinion.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/polymarket.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/polymarket_us.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/predict_fun.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/remote.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/server/__init__.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/server/__main__.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/server/api.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/server/errors.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/server/local.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/server/models.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/server/serve.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/server/store.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/server/trading.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/sx_bet.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/__init__.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/__main__.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/base.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/credentials.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/errors.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/hyperliquid.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/hyperliquid_signing.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/init.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/instruments.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/kalshi.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/limiter.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/limitless.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/limitless_signing.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/money.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/opinion.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/opinion_signing.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/polymarket_us.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/polymarket_us_exchange.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/predict_fun.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/predict_fun_signing.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/sx_bet.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/sx_bet_signing.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/trading/types.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/types.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ws/__init__.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ws/base.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ws/grpc.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ws/hyperliquid.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ws/kalshi.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ws/limitless.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ws/opinion.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ws/polymarket.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ws/polymarket_us.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ws/polymarket_us_exchange.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ws/predict_fun.py +0 -0
- {synpath-0.7.0 → synpath-0.7.1}/synpath/ws/sx_bet.py +0 -0
|
@@ -9,7 +9,7 @@ backend-path = ["build_backend"]
|
|
|
9
9
|
|
|
10
10
|
[project]
|
|
11
11
|
name = "synpath"
|
|
12
|
-
version = "0.7.
|
|
12
|
+
version = "0.7.1"
|
|
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"
|
|
@@ -499,7 +499,22 @@ def error_of(message: str, *, body: Any = None, status: int | None = None) -> Ex
|
|
|
499
499
|
ones."""
|
|
500
500
|
text = message.lower()
|
|
501
501
|
if "not enough balance" in text or "allowance" in text:
|
|
502
|
+
if "allowance is not enough" in text:
|
|
503
|
+
message += " -- an approval is missing; run approve_trading() once from this wallet"
|
|
502
504
|
return InsufficientFunds(message, body=body, status=status)
|
|
505
|
+
if "deposit wallet flow" in text:
|
|
506
|
+
# A legacy proxy or Safe wallet: the CLOB takes API orders only from a Deposit Wallet now,
|
|
507
|
+
# whatever the docs' wallet table still lists (seen 2026-10-13).
|
|
508
|
+
return OrderRejected(
|
|
509
|
+
f"{message} -- this account trades from a legacy wallet, and the exchange now takes API orders only "
|
|
510
|
+
"from a Deposit Wallet: deploy the signer's Deposit Wallet, move the pUSD into it, approve trading, "
|
|
511
|
+
"then set POLYMARKET_SIGNATURE_TYPE=3 and POLYMARKET_FUNDER to it",
|
|
512
|
+
reason="deposit_wallet_required", info=body if isinstance(body, dict) else {}, body=body, status=status)
|
|
513
|
+
if "signer address has to be the address of the api key" in text:
|
|
514
|
+
return OrderRejected(
|
|
515
|
+
f"{message} -- POLYMARKET_FUNDER is not this signer's account wallet: copy the address from the "
|
|
516
|
+
"profile menu on polymarket.com, not the deposit address the Deposit window shows",
|
|
517
|
+
reason="funder_not_signers_wallet", info=body if isinstance(body, dict) else {}, body=body, status=status)
|
|
503
518
|
if "tick size" in text or "lower than the minimum" in text or "invalid expiration" in text:
|
|
504
519
|
return InvalidOrder(message)
|
|
505
520
|
if "cancel-only" in text or "post-only mode" in text or "trading is currently disabled" in text \
|
|
@@ -1117,10 +1132,12 @@ class PolymarketTrading(TradingExchange):
|
|
|
1117
1132
|
return {spender: from_poly_raw_amount(value) for spender, value in ((raw or {}).get("allowances") or {}).items()}
|
|
1118
1133
|
|
|
1119
1134
|
async def check_approvals(self) -> dict[str, bool]:
|
|
1120
|
-
"""Whether each
|
|
1121
|
-
|
|
1135
|
+
"""Whether each contract an order needs may spend the wallet's pUSD:
|
|
1136
|
+
both exchanges and the neg-risk adapter. Missing ones are what
|
|
1137
|
+
`approve_trading` fixes."""
|
|
1122
1138
|
allowances = {k.lower(): v for k, v in (await self.fetch_allowances()).items()}
|
|
1123
|
-
return {spender: allowances.get(spender.lower(), Decimal("0")) > 0
|
|
1139
|
+
return {spender: allowances.get(spender.lower(), Decimal("0")) > 0
|
|
1140
|
+
for spender in (sig.EXCHANGE, sig.NEG_RISK_EXCHANGE, sig.NEG_RISK_ADAPTER)}
|
|
1124
1141
|
|
|
1125
1142
|
async def sync_allowances(self, *, token_id: str | None = None) -> None:
|
|
1126
1143
|
"""Tell the CLOB to re-read on-chain balances and allowances, after an
|
|
@@ -1133,11 +1150,12 @@ class PolymarketTrading(TradingExchange):
|
|
|
1133
1150
|
async def approve_trading(self, *, include_adapters: bool = True) -> dict[str, Any]:
|
|
1134
1151
|
"""Grant every approval trading needs, in one wallet transaction.
|
|
1135
1152
|
|
|
1136
|
-
pUSD and the conditional tokens for both exchanges
|
|
1153
|
+
pUSD and the conditional tokens for both exchanges and the neg-risk
|
|
1154
|
+
adapter (orders on a neg-risk market need it), and with
|
|
1137
1155
|
`include_adapters` for both collateral adapters that split, merge and
|
|
1138
1156
|
redeem use. Idempotent: an approval already granted is granted again.
|
|
1139
1157
|
"""
|
|
1140
|
-
spenders = [sig.EXCHANGE, sig.NEG_RISK_EXCHANGE]
|
|
1158
|
+
spenders = [sig.EXCHANGE, sig.NEG_RISK_EXCHANGE, sig.NEG_RISK_ADAPTER]
|
|
1141
1159
|
if include_adapters:
|
|
1142
1160
|
spenders += [sig.CTF_COLLATERAL_ADAPTER, sig.NEG_RISK_CTF_COLLATERAL_ADAPTER]
|
|
1143
1161
|
calls = sig.trading_approval_calls(spenders)
|
|
@@ -41,6 +41,11 @@ CONDITIONAL_TOKENS = "0x4D97DCd97eC945f40cF65F87097ACe5EA0476045"
|
|
|
41
41
|
PUSD = "0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB"
|
|
42
42
|
CTF_COLLATERAL_ADAPTER = "0xAdA100Db00Ca00073811820692005400218FcE1f"
|
|
43
43
|
NEG_RISK_CTF_COLLATERAL_ADAPTER = "0xadA2005600Dec949baf300f4C6120000bDB6eAab"
|
|
44
|
+
NEG_RISK_ADAPTER = "0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296"
|
|
45
|
+
"""The CLOB checks the wallet's pUSD allowance to this adapter before it accepts
|
|
46
|
+
an order on a neg-risk market (several outcomes of one event), as well as the
|
|
47
|
+
neg-risk exchange's (seen 2026-10-13: an order refused with `spender:
|
|
48
|
+
0xd91E…, allowance: 0`)."""
|
|
44
49
|
DEPOSIT_WALLET_FACTORY = "0x00000000000Fb5C9ADea0298D729A0CB3823Cc07"
|
|
45
50
|
"""Addresses from the venue's contract page, Polygon mainnet, CLOB V2."""
|
|
46
51
|
|
|
@@ -483,9 +488,10 @@ def collateral_adapter_for(neg_risk: bool) -> str:
|
|
|
483
488
|
|
|
484
489
|
def trading_approval_calls(spenders: list[str] | None = None) -> list[dict[str, str]]:
|
|
485
490
|
"""Unlimited pUSD and conditional-token approvals for each spender: by
|
|
486
|
-
default both exchanges (trading) and both
|
|
487
|
-
merge, redeem)."""
|
|
488
|
-
spenders = spenders or [EXCHANGE, NEG_RISK_EXCHANGE, CTF_COLLATERAL_ADAPTER,
|
|
491
|
+
default both exchanges and the neg-risk adapter (trading) and both
|
|
492
|
+
collateral adapters (split, merge, redeem)."""
|
|
493
|
+
spenders = spenders or [EXCHANGE, NEG_RISK_EXCHANGE, NEG_RISK_ADAPTER, CTF_COLLATERAL_ADAPTER,
|
|
494
|
+
NEG_RISK_CTF_COLLATERAL_ADAPTER]
|
|
489
495
|
calls = [{"target": PUSD, "value": "0", "data": approve_calldata(spender)} for spender in spenders]
|
|
490
496
|
calls += [{"target": CONDITIONAL_TOKENS, "value": "0", "data": set_approval_for_all_calldata(spender)} for spender in spenders]
|
|
491
497
|
return calls
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|