Reference trading bots for Vision — an on-chain parimutuel prediction-market layer running on Index L3 (Arbitrum Orbit, chainId 111222333).
Each subdirectory is a standalone bot for one Vision source. When no source is specified, twitch is the default. Bring a testnet wallet, pick a strategy, trade.
| Path | Source | Markets | Tick | Notes |
|---|---|---|---|---|
twitch/ |
twitch |
~8200 streamer + game viewership markets | 60 s | XGBoost + Claude + rolling ensemble |
polymarket/ |
polymarket |
Polymarket events mirrored on Vision (poly_*) |
60 s | Same skeleton as twitch/. Different signal. |
visualizer/ |
— | shared local web app | — | React + Vite. Reads any bot's pnl.json, renders dashboard, asset list, price + PnL charts. |
More sources incoming — crypto price thresholds, weather, others. The transport is source-agnostic; only the strategy layer cares.
git clone https://github.com/General-Market/vision-bot-examples
cd vision-bot-examples
./setup.sh --auto-fund # defaults to twitch
.venv/bin/python twitch/live_trader.py --deposit 0.1 --max-joins 1The root ./setup.sh forwards to twitch/setup.sh when no source is given. Pass --source <name> or set SOURCE=<name> when other bots ship.
Full bootstrap + trading flow is documented in AGENTS.md — the canonical guide, including wallet funding, model training, two-wallet racing, and troubleshooting.
| URL | |
|---|---|
| L3 RPC | http://142.132.164.24/ |
| Chain ID | 111222333 |
| Vision contract | 0x94d540bb45975bd5a0c7ba9a15a0d34e378f6c61 |
| L3 WUSDC | self-discover via vision.USDC() |
| Data-node (cached) | https://generalmarket.io/bot-api |
| Oracles (3) | http://116.203.156.98/oracle{1,2,3} |
All reachable over public HTTP — no VPN, no credentials for reads.
- Bitmap is always 1024 bytes. Padded with zero bits, MSB-first. Short bitmaps hash to the wrong commitment and the oracle rejects — your deposit sits in the pool with no pick.
- L3 USDC is 18 decimals. Not 6. Don't copy-paste Ethereum mainnet math.
- Minimum deposit is 0.1 USDC (
1e17wei). Lower joins revert. - Pool totals are not queryable. Bots trade blind — edge comes from the predictor, not the pool.
- Bitmap reveal to oracles must follow the on-chain join. Reveal first, rejected.
- Deployment JSON files can lag. The chain is truth. Check
eth_getCode(vision_address)before trusting a hard-coded address. - Data-node config vs on-chain config can differ during tick rotation. Only the value returned by
getBatch(batch_id)goes intojoinBatchDirect— never the one from/batches/recommendedwhen they disagree.
Not yet measured. Every accuracy / lift number in this repo is offline classification against historical data (97% overall, ~0.5 pp over the sticky baseline). No wallet has signed a real joinBatchDirect and observed PlayerSettled. To produce a real PnL number, see the racing harness in AGENTS.md — race.sh spawns two funded wallets on two strategies and race_report.py diffs the cumulative PnL.
- Never commit
.env. Each example ships with.env.example— copy, fill locally. - Testnet funds only. Don't reuse a mainnet key.
- The bot's only on-chain action is
approve+joinBatchDirectagainst the configured Vision contract. No arbitrary external calls.
MIT.