diff --git a/polymarket-bot/cronjob-outcomes.yaml b/polymarket-bot/cronjob-outcomes.yaml new file mode 100644 index 0000000..82b66f5 --- /dev/null +++ b/polymarket-bot/cronjob-outcomes.yaml @@ -0,0 +1,46 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: outcomes-joiner + namespace: polymarket-bot +spec: + # Daily at 00:30 UTC (after metrics-retention at 00:10, no overlap): fetch + # UMA-final resolutions for archived markets from the Gamma API into + # market_outcomes, then print the calibration report (Brier/log-loss of the + # model vs the market price). Replay R2 joiner — analysis only: reads the + # signals archive, writes only market_outcomes, never touches trading + # tables. Safe to also run by hand any time (kubectl create job --from=...): + # the upsert is idempotent per market_id (ON CONFLICT DO UPDATE) and the + # fetch only queries markets that still lack an outcome. + schedule: "30 0 * * *" + concurrencyPolicy: Forbid + successfulJobsHistoryLimit: 3 + failedJobsHistoryLimit: 3 + jobTemplate: + spec: + backoffLimit: 2 + # A hung Gamma call must not block tomorrow's run through Forbid + activeDeadlineSeconds: 900 + template: + spec: + restartPolicy: OnFailure + imagePullSecrets: + - name: gitea-registry-infisical + containers: + - name: outcomes + # Same image as the bot deployment; CI bumps this tag on every + # bot image build (see polymarket-bot repo .gitea/workflows/ci.yml) + image: git.chemavx.xyz/chemavx/polymarket-bot:2b326ad5 + imagePullPolicy: Always + command: ["python3", "-m", "bot.outcomes"] + envFrom: + - secretRef: + name: bot-secrets-infisical + - configMapRef: + name: bot-config + resources: + requests: + cpu: 25m + memory: 64Mi + limits: + memory: 256Mi