feat(polymarket): replace position-based ranking with quality-signal relevance

Polymarket results now rank by text similarity, volume, liquidity, price
movement, and competitive score instead of API return position. Also fixes
pagination (DEPTH_CONFIG now controls page count, not a no-op limit param)
and caps results after re-ranking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Van Horn
2026-02-25 23:07:43 -08:00
parent 994a4ab2ca
commit 9d9e7e89d9
5 changed files with 496 additions and 40 deletions
+3 -1
View File
@@ -275,8 +275,10 @@ def normalize_polymarket_items(
normalized = []
for i, item in enumerate(items):
# Prefer volume1mo (more stable) for engagement scoring, fall back to volume24hr
volume = item.get("volume1mo") or item.get("volume24hr", 0.0)
engagement = schema.Engagement(
volume=item.get("volume24hr", 0.0),
volume=volume,
liquidity=item.get("liquidity", 0.0),
)