Skip to content

fix(polymarket): force live-history backtests and remove fixture overrides#66

Merged
taariq merged 6 commits intomainfrom
fix/polymarket-live-backtest-metrics
Mar 5, 2026
Merged

fix(polymarket): force live-history backtests and remove fixture overrides#66
taariq merged 6 commits intomainfrom
fix/polymarket-live-backtest-metrics

Conversation

@taariq
Copy link
Contributor

@taariq taariq commented Mar 5, 2026

Summary

This PR now enforces a strict backtest data-source policy for Polymarket maker skills and replaces weak-performing/removed strategies.

Current strategy set in this PR:

  • Added (replacement): polymarket/high-throughput-paired-basis-maker
  • Updated: polymarket/paired-market-basis-maker
  • Updated: polymarket/liquidity-paired-basis-maker
  • Updated: polymarket/maker-rebate-bot
  • Removed: polymarket/news-shock-guard-maker
  • Removed: polymarket/resolution-decay-maker

Data Source Enforcement (No Drift)

All backtests in the maker set are now locked to the Seren Polymarket Publisher, not direct Polymarket endpoints.

Runtime policy guards

  • Added SEREN_POLYMARKET_PUBLISHER_PREFIX hard checks in maker runtimes.
  • Any non-Seren URL now fails fast with:
    • policy_violation: backtest data source must use Seren Polymarket publisher ...
  • Backtest HTTP calls now require publisher auth header:
    • Authorization: Bearer $SEREN_API_KEY
  • Missing key fails fast with:
    • missing_seren_api_key: set SEREN_API_KEY to query Seren publishers.

Config lock

  • Backtest defaults now point to Seren publisher routes:
    • https://api.serendb.com/publishers/polymarket-data/markets
    • https://api.serendb.com/publishers/polymarket-data/prices-history

CI policy gate

  • Added workflow: .github/workflows/enforce-seren-polymarket-publisher.yml
  • CI now fails PRs if:
    • direct gamma-api.polymarket.com / clob.polymarket.com URLs appear in maker runtimes/configs
    • publisher endpoint defaults are missing
    • runtime source-policy guard or auth guard is missing

Other Reliability Fixes Retained

  • live backtest sample gate (events >= min_events)
  • pagination stop conditions + hard page caps
  • concurrent history fetch workers
  • output safety caps (total_return_pct >= -100%, max_drawdown_pct <= 100%)

Validation

  • Syntax compile passed:
    • python3 -m py_compile polymarket/maker-rebate-bot/scripts/agent.py polymarket/paired-market-basis-maker/scripts/agent.py polymarket/liquidity-paired-basis-maker/scripts/agent.py polymarket/high-throughput-paired-basis-maker/scripts/agent.py
  • Smoke tests passed:
    • pytest --import-mode=importlib polymarket/maker-rebate-bot/tests/test_smoke.py polymarket/paired-market-basis-maker/tests/test_smoke.py polymarket/liquidity-paired-basis-maker/tests/test_smoke.py polymarket/high-throughput-paired-basis-maker/tests/test_smoke.py
  • Local policy check passed (no direct Polymarket API domains in maker runtime/config paths).

@taariq taariq changed the title Fix all 3 Polymarket makers: live-universe backtests + sample gate + robust metrics fix(polymarket): force live-history backtests and remove fixture overrides Mar 5, 2026
@taariq taariq merged commit ac13e5b into main Mar 5, 2026
2 checks passed
@taariq taariq deleted the fix/polymarket-live-backtest-metrics branch March 5, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant