chemavxandClaude Fable 5 7f84bc3ec7 feat(strategy): GNews guardrail — clamp news-only shifts to prior±0.25
Post-mortem NVIDIA 631181: one uncorroborated high-weight signal (legacy
Manifold 0.13 at weight 0.6) flipped a 0.845 market to 0.431 and lost.
With Manifold observational-only and macro signals gated behind
is_non_price, GNews (weight 1.5) is the only live signal able to move
politics markets 20-30 pp against the order-book consensus.  This adds a
catastrophic fuse, not a fine calibration:

- apply_news_guardrail(): when |news_lo| >= NEWS_MATERIAL_LOGODDS_THRESHOLD
  (0.10) and every other signal (fg, mom, btc_dom, mfld) is below it,
  clamp the posterior to prior ± MAX_NEWS_ONLY_PROB_SHIFT (0.25).  Any
  corroborating material signal disables the clamp.  Config via env
  (NEWS_GUARDRAIL_ENABLED=true by default).
- edge_gross/edge_net computed from the clamped posterior; raw_final_prob
  preserved in reasoning (persisted via trades.reasoning — no schema
  migration) and in the NEWS_MATERIAL log line.
- guardrail_changed_trade_decision: raw edge crossed the regime gate but
  the clamped edge no longer does (fuse prevented a trade).  Note: with
  the default 0.25 band the clamped edge_net is 0.21, above every regime
  minimum, so the flag only fires with a tighter configured band.
- Observability gated on materiality: NEWS_MATERIAL per-market line and a
  compact NEWS SUMMARY cycle line, only when with_news > 0 — no flood
  from the ~145 news-less markets per cycle.
- 9 deterministic tests (extreme clamp, in-band passthrough, corroboration,
  inclusive threshold, disabled, changed_decision).

No changes to NEWS_LOGODDS_WEIGHT, Manifold flags, edge thresholds,
sizing, payout, resolution, or historical trades.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-01 20:26:02 +00:00
2026-05-20 13:52:53 +00:00

polymarket-bot

Bot de paper-trading para Polymarket con estrategia bayesiana, API FastAPI y dashboard React. Corre en k3s vía GitOps (Gitea Actions → registry → ArgoCD).

Componentes

Componente Código Imagen CMD
bot bot/ polymarket-bot python3 -m bot.main
api api/ (+ bot/ como librería) polymarket-bot-api uvicorn api.main:app
dashboard dashboard/ polymarket-bot-dashboard nginx estático

Dashboard: https://polymarket.chemavx.xyz

CI/CD

.gitea/workflows/ci.yml construye solo las imágenes cuyos ficheros cambiaron en el push (diff contra github.event.before):

  • bot/, api/, requirements.txt → bot + api (ambas imágenes copian las mismas fuentes Python; solo cambia el CMD)
  • Dockerfile → bot · Dockerfile.api → api · dashboard/ → dashboard
  • .gitea/workflows/ci.yml, primer push o force-push → todas (fallback seguro)
  • tests/, docs → ninguna (la CI no construye ni despliega nada)

Las imágenes se tagean con ${GITHUB_SHA::8}; el CI actualiza solo los deployments reconstruidos en k8s-manifests/polymarket-bot/ y ArgoCD sincroniza vía webhook en segundos.

Tests

python3 -m pytest tests/ -q
S
Description
Polymarket trading bot
Readme
2.6 MiB
2026-07-06 07:40:44 +00:00
Languages
Python 95.8%
JavaScript 2.9%
CSS 1.1%
Dockerfile 0.1%