How bennyjo/phil works
Phil is an AI prediction-market trader whose paper cycles discover and screen markets, research candidates, record forecasts, and place simulated bets; resolutions then feed calibration and retrospectives that inform strategy changes. A separately enabled real-money path twins eligible paper bets through Pearl Connect under operator-controlled caps. The README documents the hourly, watcher, and daily-retrospective roles; only selected source excerpts were available, so uncertain internal call wiring is omitted.
Main entry points: real.py Real execution · scan.py Market discovery · ledger.jsonl Paper ledger · loop.sh Cycle launcher
Components 20
Trading cycle
- Cycle launcher
loop.sh - Market watchers
core/watch.py - Market discovery
core/scan.py - Market screening
core/screen.py
Strategy and research
- Discovery queries
strategy/discovery.py - Trading playbook
strategy/playbook.md - Research tools
strategy/tools - Betting policy
strategy/policy.py - Operator proposals
journal/proposals.md
Evidence and learning
- Forecast journal
journal/forecasts.jsonl - Outcome resolution
core/resolve.py - Calibration scoring
core/score.py - Daily retrospectives
journal/retros
Trade execution
- Paper ledger
journal/ledger.jsonl - Real execution
core/real.py - Execution caps
config/protected.json
Other components
- Human operator
- Claude Code agent
- Polymarket
- Pearl Connect
Connections 27
- Human operator → Cycle launcher: starts cycles
- Cycle launcher → Claude Code agent: launches agent
- Claude Code agent → Market discovery: runs discovery
- Market discovery → Discovery queries: gets queries
- Market discovery → Polymarket: fetches markets
- Market discovery → Market screening: passes markets
- Claude Code agent → Market screening: screens markets
- Claude Code agent → Trading playbook: uses guidance
- Claude Code agent → Research tools: uses research
- Claude Code agent → Forecast journal: records beliefs
- Claude Code agent → Betting policy: chooses bets
- Betting policy → Paper ledger: records paper bets
- Outcome resolution → Polymarket: checks resolutions
- Outcome resolution → Paper ledger: settles positions
- Calibration scoring → Paper ledger: reads results
- Calibration scoring → Forecast journal: scores forecasts
- Claude Code agent → Daily retrospectives: writes retrospectives
- Daily retrospectives → Trading playbook: informs revisions
- Claude Code agent → Operator proposals: requests changes
- Human operator → Operator proposals: reviews requests
- Market watchers → Polymarket: checks listings
- Market watchers → Cycle launcher: triggers cycles
- Real execution → Execution caps: reads caps
- Real execution → Polymarket: places orders
- Real execution → Pearl Connect: requests signatures
- Human operator → Real execution: enables real mode
- Real execution → Paper ledger: records fills