Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions mock_data/polymarket/up_down_15min_BTC.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"slug": "btc-updown-15m-1772204400",
"start_price": 68176.05,
"current_time": "2026-02-27T15:04:21+00:00",
"current_price": 67936.60,
"current_outcome": "Down",
"synth_probability_up": 0.0969,
"synth_outcome": "Down",
"polymarket_probability_up": 0.475,
"polymarket_outcome": "Down",
"event_start_time": "2026-02-27T15:00:00+00:00",
"event_end_time": "2026-02-27T15:15:00+00:00",
"best_bid_price": 0.47,
"best_ask_price": 0.48,
"best_bid_size": 218.0,
"best_ask_size": 445.47,
"polymarket_last_trade_time": "2026-02-27T14:59:57+00:00",
"polymarket_last_trade_price": 0.4582,
"polymarket_last_trade_outcome": "Down"
}
20 changes: 20 additions & 0 deletions mock_data/polymarket/up_down_15min_ETH.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"slug": "eth-updown-15m-1772204400",
"start_price": 3245.12,
"current_time": "2026-02-27T15:04:21+00:00",
"current_price": 3238.45,
"current_outcome": "Down",
"synth_probability_up": 0.3521,
"synth_outcome": "Down",
"polymarket_probability_up": 0.42,
"polymarket_outcome": "Down",
"event_start_time": "2026-02-27T15:00:00+00:00",
"event_end_time": "2026-02-27T15:15:00+00:00",
"best_bid_price": 0.41,
"best_ask_price": 0.43,
"best_bid_size": 156.0,
"best_ask_size": 312.5,
"polymarket_last_trade_time": "2026-02-27T14:58:32+00:00",
"polymarket_last_trade_price": 0.42,
"polymarket_last_trade_outcome": "Down"
}
20 changes: 20 additions & 0 deletions mock_data/polymarket/up_down_15min_SOL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"slug": "sol-updown-15m-1772204400",
"start_price": 142.85,
"current_time": "2026-02-27T15:04:21+00:00",
"current_price": 141.92,
"current_outcome": "Down",
"synth_probability_up": 0.2845,
"synth_outcome": "Down",
"polymarket_probability_up": 0.38,
"polymarket_outcome": "Down",
"event_start_time": "2026-02-27T15:00:00+00:00",
"event_end_time": "2026-02-27T15:15:00+00:00",
"best_bid_price": 0.37,
"best_ask_price": 0.39,
"best_bid_size": 89.0,
"best_ask_size": 201.3,
"polymarket_last_trade_time": "2026-02-27T14:57:18+00:00",
"polymarket_last_trade_price": 0.38,
"polymarket_last_trade_outcome": "Down"
}
20 changes: 20 additions & 0 deletions mock_data/polymarket/up_down_5min_BTC.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"slug": "btc-updown-5m-1772205000",
"start_price": 67980.25,
"current_time": "2026-02-27T15:16:21+00:00",
"current_price": 67945.80,
"current_outcome": "Down",
"synth_probability_up": 0.4215,
"synth_outcome": "Down",
"polymarket_probability_up": 0.485,
"polymarket_outcome": "Down",
"event_start_time": "2026-02-27T15:15:00+00:00",
"event_end_time": "2026-02-27T15:20:00+00:00",
"best_bid_price": 0.48,
"best_ask_price": 0.49,
"best_bid_size": 125.0,
"best_ask_size": 267.3,
"polymarket_last_trade_time": "2026-02-27T15:15:42+00:00",
"polymarket_last_trade_price": 0.485,
"polymarket_last_trade_outcome": "Down"
}
20 changes: 20 additions & 0 deletions mock_data/polymarket/up_down_5min_ETH.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"slug": "eth-updown-5m-1772205000",
"start_price": 3240.50,
"current_time": "2026-02-27T15:16:21+00:00",
"current_price": 3242.15,
"current_outcome": "Up",
"synth_probability_up": 0.5832,
"synth_outcome": "Up",
"polymarket_probability_up": 0.52,
"polymarket_outcome": "Up",
"event_start_time": "2026-02-27T15:15:00+00:00",
"event_end_time": "2026-02-27T15:20:00+00:00",
"best_bid_price": 0.51,
"best_ask_price": 0.53,
"best_bid_size": 98.0,
"best_ask_size": 184.2,
"polymarket_last_trade_time": "2026-02-27T15:15:38+00:00",
"polymarket_last_trade_price": 0.52,
"polymarket_last_trade_outcome": "Up"
}
20 changes: 20 additions & 0 deletions mock_data/polymarket/up_down_5min_SOL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"slug": "sol-updown-5m-1772205000",
"start_price": 141.95,
"current_time": "2026-02-27T15:16:21+00:00",
"current_price": 142.08,
"current_outcome": "Up",
"synth_probability_up": 0.5124,
"synth_outcome": "Up",
"polymarket_probability_up": 0.48,
"polymarket_outcome": "Down",
"event_start_time": "2026-02-27T15:15:00+00:00",
"event_end_time": "2026-02-27T15:20:00+00:00",
"best_bid_price": 0.47,
"best_ask_price": 0.49,
"best_bid_size": 72.0,
"best_ask_size": 145.8,
"polymarket_last_trade_time": "2026-02-27T15:15:29+00:00",
"polymarket_last_trade_price": 0.48,
"polymarket_last_trade_outcome": "Down"
}
21 changes: 21 additions & 0 deletions mock_data/polymarket/up_down_daily_ETH.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"slug": "ethereum-up-or-down-on-february-26",
"start_price": 3280.45,
"current_time": "2026-02-25T23:45:17.526062+00:00",
"current_price": 3245.82,
"current_outcome": "Down",
"synth_probability_up": 0.3825,
"synth_outcome": "Down",
"polymarket_probability_up": 0.415,
"polymarket_outcome": "Down",
"event_start_time": "2026-02-25T17:00:00+00:00",
"event_end_time": "2026-02-26T17:00:00+00:00",
"event_creation_time": "2026-02-24T17:02:40.731726+00:00",
"best_bid_price": 0.41,
"best_ask_price": 0.42,
"best_bid_size": 890.0,
"best_ask_size": 1250.0,
"polymarket_last_trade_time": "2026-02-25T23:42:15+00:00",
"polymarket_last_trade_price": 0.415,
"polymarket_last_trade_outcome": "Down"
}
21 changes: 21 additions & 0 deletions mock_data/polymarket/up_down_daily_SOL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"slug": "solana-up-or-down-on-february-26",
"start_price": 145.62,
"current_time": "2026-02-25T23:45:17.526062+00:00",
"current_price": 142.18,
"current_outcome": "Down",
"synth_probability_up": 0.3142,
"synth_outcome": "Down",
"polymarket_probability_up": 0.38,
"polymarket_outcome": "Down",
"event_start_time": "2026-02-25T17:00:00+00:00",
"event_end_time": "2026-02-26T17:00:00+00:00",
"event_creation_time": "2026-02-24T17:02:40.731726+00:00",
"best_bid_price": 0.37,
"best_ask_price": 0.39,
"best_bid_size": 520.0,
"best_ask_size": 780.0,
"polymarket_last_trade_time": "2026-02-25T23:40:32+00:00",
"polymarket_last_trade_price": 0.38,
"polymarket_last_trade_outcome": "Down"
}
21 changes: 21 additions & 0 deletions mock_data/polymarket/up_down_hourly_ETH.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"slug": "ethereum-up-or-down-february-25-6pm-et",
"start_price": 3252.80,
"current_time": "2026-02-25T23:45:23.586996+00:00",
"current_price": 3245.82,
"current_outcome": "Down",
"synth_probability_up": 0.2845,
"synth_outcome": "Down",
"polymarket_probability_up": 0.32,
"polymarket_outcome": "Down",
"event_start_time": "2026-02-25T23:00:00+00:00",
"event_end_time": "2026-02-26T00:00:00+00:00",
"event_creation_time": "2026-02-23T23:02:47.889891+00:00",
"best_bid_price": 0.31,
"best_ask_price": 0.33,
"best_bid_size": 145.0,
"best_ask_size": 210.5,
"polymarket_last_trade_time": "2026-02-25T23:43:18+00:00",
"polymarket_last_trade_price": 0.32,
"polymarket_last_trade_outcome": "Down"
}
21 changes: 21 additions & 0 deletions mock_data/polymarket/up_down_hourly_SOL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"slug": "solana-up-or-down-february-25-6pm-et",
"start_price": 143.25,
"current_time": "2026-02-25T23:45:23.586996+00:00",
"current_price": 142.18,
"current_outcome": "Down",
"synth_probability_up": 0.3521,
"synth_outcome": "Down",
"polymarket_probability_up": 0.40,
"polymarket_outcome": "Down",
"event_start_time": "2026-02-25T23:00:00+00:00",
"event_end_time": "2026-02-26T00:00:00+00:00",
"event_creation_time": "2026-02-23T23:02:47.889891+00:00",
"best_bid_price": 0.39,
"best_ask_price": 0.41,
"best_bid_size": 98.0,
"best_ask_size": 156.2,
"polymarket_last_trade_time": "2026-02-25T23:41:45+00:00",
"polymarket_last_trade_price": 0.40,
"polymarket_last_trade_outcome": "Down"
}
52 changes: 46 additions & 6 deletions synth_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,28 +219,68 @@ def get_lp_probabilities(self, asset: str) -> dict:

# ─── Polymarket ──────────────────────────────────────────────────

def get_polymarket_daily(self) -> dict:
def get_polymarket_daily(self, asset: str = "BTC") -> dict:
"""
Get daily up/down comparison between Synth forecasts and Polymarket prices.

Args:
asset: Asset symbol (BTC, ETH, SOL). Default: BTC

Returns:
Dict with Synth vs Polymarket probability comparison (BTC)
Dict with Synth vs Polymarket probability comparison
"""
return self._get(
"/insights/polymarket/up-down/daily",
["polymarket", "up_down_daily.json"],
["polymarket", f"up_down_daily_{asset}.json"],
params={"asset": asset},
)

def get_polymarket_hourly(self) -> dict:
def get_polymarket_hourly(self, asset: str = "BTC") -> dict:
"""
Get hourly up/down comparison between Synth forecasts and Polymarket prices.

Args:
asset: Asset symbol (BTC, ETH, SOL). Default: BTC

Returns:
Dict with Synth vs Polymarket probability comparison (BTC)
Dict with Synth vs Polymarket probability comparison
"""
return self._get(
"/insights/polymarket/up-down/hourly",
["polymarket", "up_down_hourly.json"],
["polymarket", f"up_down_hourly_{asset}.json"],
params={"asset": asset},
)

def get_polymarket_15min(self, asset: str = "BTC") -> dict:
"""
Get 15-minute up/down comparison between Synth forecasts and Polymarket prices.

Args:
asset: Asset symbol (BTC, ETH, SOL). Default: BTC

Returns:
Dict with Synth vs Polymarket probability comparison
"""
return self._get(
"/insights/polymarket/up-down/15min",
["polymarket", f"up_down_15min_{asset}.json"],
params={"asset": asset},
)

def get_polymarket_5min(self, asset: str = "BTC") -> dict:
"""
Get 5-minute up/down comparison between Synth forecasts and Polymarket prices.

Args:
asset: Asset symbol (BTC, ETH, SOL). Default: BTC

Returns:
Dict with Synth vs Polymarket probability comparison
"""
return self._get(
"/insights/polymarket/up-down/5min",
["polymarket", f"up_down_5min_{asset}.json"],
params={"asset": asset},
)

def get_polymarket_range(self) -> list:
Expand Down
13 changes: 8 additions & 5 deletions tools/synth-overlay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ Chrome extension that uses Chrome's **native Side Panel** to show Synth market c

## Synth API usage

- `get_polymarket_daily()` — daily up/down (24h) Synth vs Polymarket.
- `get_polymarket_hourly()` — hourly up/down (1h).
- `get_polymarket_daily(asset)` — daily up/down (24h) Synth vs Polymarket.
- `get_polymarket_hourly(asset)` — hourly up/down (1h).
- `get_polymarket_15min(asset)` — 15-minute up/down (15m).
- `get_polymarket_5min(asset)` — 5-minute up/down (5m).
- `get_polymarket_range()` — range brackets with synth vs polymarket probability per bracket.
- `get_prediction_percentiles(asset, horizon)` — used for confidence scoring (forecast spread) and optional bias in explanations; wired for both up/down and range.
- `get_prediction_percentiles(asset, horizon)` — used for confidence scoring (forecast spread) and optional bias in explanations.

## Run locally

Expand All @@ -41,8 +43,9 @@ Chrome extension that uses Chrome's **native Side Panel** to show Synth market c
You should see JSON with `"signal"`, `"edge_pct"`, etc. If you see `"error"` or 404, the slug is not supported for the current mock/API.

2. **Open the exact URL** in Chrome (with the extension loaded from `extension/`):
- Daily (mock): `https://polymarket.com/event/bitcoin-up-or-down-on-february-26`
- Hourly (mock): `https://polymarket.com/event/bitcoin-up-or-down-february-25-6pm-et`
- Daily (BTC): `https://polymarket.com/event/bitcoin-up-or-down-on-february-26`
- Hourly (ETH): `https://polymarket.com/event/ethereum-up-or-down-february-25-6pm-et`
- 15-Min (SOL): `https://polymarket.com/event/sol-updown-15m-1772204400`
- The side panel requests the slug from the page and fetches Synth data from the local API. If API returns 200, panel fields populate.

3. **Interaction:**
Expand Down
Loading