xrtm-data 0.7.1__tar.gz → 0.7.2__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.
- {xrtm_data-0.7.1/src/xrtm_data.egg-info → xrtm_data-0.7.2}/PKG-INFO +1 -1
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/pyproject.toml +1 -1
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/providers/online/polymarket.py +3 -2
- {xrtm_data-0.7.1 → xrtm_data-0.7.2/src/xrtm_data.egg-info}/PKG-INFO +1 -1
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_online_sources.py +35 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/LICENSE +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/README.md +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/setup.cfg +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/__init__.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/__init__.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/interfaces.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/schemas/__init__.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/schemas/forecast.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/schemas/market.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/schemas/prior.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/schemas/resolution.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/core/schemas/trade.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/corpora/__init__.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/corpora/_builtin_corpora.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/corpora/real_binary.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/corpora/registry.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/providers/__init__.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/providers/online/__init__.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/providers/online/kalshi.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/providers/online/manifold.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/providers/online/metaculus.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm/data/version.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm_data.egg-info/SOURCES.txt +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm_data.egg-info/dependency_links.txt +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm_data.egg-info/requires.txt +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/src/xrtm_data.egg-info/top_level.txt +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_corpus_registry.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_market_snapshot.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_prior_schemas.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_real_binary_corpus.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_resolution_schemas.py +0 -0
- {xrtm_data-0.7.1 → xrtm_data-0.7.2}/tests/test_schemas.py +0 -0
|
@@ -79,8 +79,9 @@ class PolymarketSource(DataSource, ResolutionSource):
|
|
|
79
79
|
try:
|
|
80
80
|
data = self._get_json(url)
|
|
81
81
|
except DataSourceError:
|
|
82
|
-
#
|
|
83
|
-
|
|
82
|
+
# Fallback: same markets endpoint without the volume ordering,
|
|
83
|
+
# which some Gamma deployments reject.
|
|
84
|
+
url = f"{self.api_base}/markets?limit={min(limit, 100)}&closed=false"
|
|
84
85
|
data = self._get_json(url)
|
|
85
86
|
|
|
86
87
|
# Gamma API may wrap in "markets" key or return list directly
|
|
@@ -194,3 +194,38 @@ async def test_kalshi_fetch_resolved_paginates_cursor(monkeypatch):
|
|
|
194
194
|
|
|
195
195
|
assert len(resolved) == 250
|
|
196
196
|
assert calls["count"] == 2
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
@pytest.mark.asyncio
|
|
200
|
+
async def test_polymarket_fetch_questions_fallback_uses_markets(monkeypatch):
|
|
201
|
+
from xrtm.data.core import DataSourceError
|
|
202
|
+
|
|
203
|
+
source = PolymarketSource()
|
|
204
|
+
calls = {"urls": []}
|
|
205
|
+
|
|
206
|
+
def _get_json(url):
|
|
207
|
+
calls["urls"].append(url)
|
|
208
|
+
if "order=volume24hr" in url:
|
|
209
|
+
raise DataSourceError("volume ordering unsupported")
|
|
210
|
+
return [
|
|
211
|
+
{
|
|
212
|
+
"id": "m1",
|
|
213
|
+
"question": "Will X happen?",
|
|
214
|
+
"description": "d",
|
|
215
|
+
"outcomes": '["Yes", "No"]',
|
|
216
|
+
"outcomePrices": '["0.6", "0.4"]',
|
|
217
|
+
"volume": 1000,
|
|
218
|
+
"liquidity": 500,
|
|
219
|
+
"endDate": "2026-12-31T00:00:00Z",
|
|
220
|
+
"slug": "will-x",
|
|
221
|
+
"closed": False,
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
|
|
225
|
+
monkeypatch.setattr(source, "_get_json", _get_json)
|
|
226
|
+
|
|
227
|
+
questions = await source.fetch_questions(limit=1)
|
|
228
|
+
|
|
229
|
+
assert len(calls["urls"]) == 2
|
|
230
|
+
assert "/markets?" in calls["urls"][1]
|
|
231
|
+
assert questions and questions[0].id == "polymarket-m1"
|
|
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
|