Off-Chain Workers
Isolated least-privilege operational workers for Price Engine, INV-1 Solvency Watcher, MEV-protected Guardian, and AI Curator/Resolver.
All privileged off-chain automation lives in the isolated workers/ workspace (Bun + viem) and runs strictly as separate single-role processes. None of these keys ever exist in app/, agenticmarket/, or docs-site/.
Isolated Worker Modes (workers/src/index.ts)
| Mode Flag | Package Script | On-Chain Role | Allowed Operations |
|---|---|---|---|
--mode=watcher | bun run watcher | Read-only (no key) | Continuous INV-1 solvency audit (USDT.balanceOf >= 1e12 * accountedUnits), 1e12 boundary check, Vault & Leaky Bucket alerts |
--mode=keeper | bun run keeper | KEEPER | Deterministic BTC 1h/4h launchPriceMarketBatch, Chainlink bracketing (phaseId + 1 rollover), and settlement sweeps |
--mode=guardian | bun run guardian | GUARDIAN | Emergency pause(key) routed exclusively over MEV-protected private BSC RPC (PRIVATE_RPC_URL + fallback) |
--mode=curator | bun run curator | Off-chain / RESOLVER | 3-tier LLM trend curation & cross-source proposals gated by the deterministic firewall and Phase 0 DraftVetoQueue |
Add --once for single-tick cron or post-deploy verification runs:
cd workers
bun run src/index.ts --mode=watcher --once3-Tier LLM Failover & Validation Firewall
AI Curator and AI Resolver inference routes through structured JSON output mode (30s hard timeout):
- Primary: Nemotron 3 Ultra 550B
- Secondary Failover: NVIDIA NIM (hosted Nemotron 3 Ultra)
- Platform Failover: Gemini 3.5 Flash
Every draft and resolution output must pass workers/src/lib/validator.ts:
- Adaptive Seed Bounds (
OD-6):initialProbBpssums to10_000;[15%, 85%]for lean seeds (< 100 USDT);[10%, 90%]for deep seeds (>= 100 USDT); post-seedR_MIN >= 5 USDT. - MECE Enforcement: Requires slot 5 =
"Other"whenevercontestantsCount > 5. - Whitelisted Domains & Quorum: Rejects single-wiki or non-whitelisted URLs; requires
>= 2independent allowlisted sources for high-value cross-source resolution quorum and>= 10mpre-match cutoff buffers for sports/esports. - Prompt-Injection Sanitizer: Strips HTML scripts/hidden nodes and neutralizes imperative instruction strings inside untrusted external web content.
Verification (13 / 13 Passing)
cd workers
bun run typecheck
bun test # chainlink.test.ts, validator.test.ts, and live Cancun Anvil solvency-watcher.test.tsResponsible Disclosure
Security reporting process, in-scope targets, safe harbor guidelines, and coordinated vulnerability disclosure policy for Agentic Market.
BSC Testnet (97) Deployment Runbook
Step-by-step Operator runbook for dry-run simulation, BSC Testnet (97) broadcast, BscScan verification, Vault funding, and live INV-1 checks.