Oracle3
Open-source trading engine and MCP server for prediction markets. Fee-aware no-arbitrage trading across related contracts, live on Kalshi, Polymarket and Solana or on paper.
Track paper-trading performance, positions, and decisions against benchmarks
Translation pending
AI summary · website and README
FinancePython · ShellGitHub @philipbergman6-glitchOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Loading the full README. The saved excerpt is shown below.
A paper-trading research platform: an agent proposes decisions, a deterministic
risk engine checks orders, and broker state must be reconciled before the
results can be trusted. The primary objective is to learn and prove the system
before using real money. There is no live-trading override.
For development sessions, start with AGENTS.md and the current
engineering handoff. Claude uses the same instructions
through CLAUDE.md.Read the full README ↗An AI-assisted paper-trading system that runs itself every market day. A Claude agent researches the market, proposes trades, and writes the reports. A deterministic Python risk engine decides whether any order is allowed to reach the broker. Nothing trades without passing the engine.
Live dashboard · Architecture · Strategy spec · Results audit · Decision records
| Running since | 2026-04-27 on an Alpaca paper account ($100,000 start) |
| Scheduled routines | Four per trading day, every trading day, plus a Friday review |
| Risk engine | Pure Python, no I/O, every money value a Decimal |
| Tests | 979 (958 offline, 21 against a real Postgres in CI) |
| Monitoring | Independent protection monitor plus a daily heartbeat that emails on any miss |
| Execution | One coordinator: account-wide lease, intents recorded before the broker sees them, recovery that only restores coverage |
| Broker safety | Paper endpoints only, hard-coded; every mutation re-validated against its exact payload |
Each routine is a markdown instruction file the cloud agent reads fresh on every run. The agent proposes. The scripts decide.
routines/pre-market.md): catalysts, macro context, two or
three candidate ideas. Default answer is HOLD.routines/market-open.md): each candidate goes through
validate_order.py and, if accepted, submit_entry.py. A buy is always a
bracket: market entry plus a fixed protective stop in one atomic order.routines/midday.md): cut losers at the rule threshold, tighten
stops on winners through replace_stop.py, re-check each thesis.routines/daily-summary.md): P&L, equity snapshot to the
trade log, one email.Every run commits its log to memory/. The dashboard is rebuilt from those
logs by GitHub Actions, so what you see on the page is what the agent wrote.
/conviction and research routines never place
orders. Only submit_entry.py, close_position.py and replace_stop.py
touch the broker, and each one validates first.risk_engine/ has no network, database or clock
access. It takes a snapshot and a proposal and returns accept or reject with
a reason. Float input is rejected at the boundary.scripts/alpaca.sh refuses any non-paper
endpoint before credentials are loaded, and re-runs validate_mutation.py on
the exact JSON body of every order, cancel or replace.STRATEGY_VERSION selects a frozen parameter set in
risk_engine/versions.py. The rulebook file is sha256-pinned, and
strategy_version.py hard-fails before any order if version and pin disagree.coordinator.py
(ADR 0010): an account-wide lease in a committed, append-only state file,
the intent pushed to main before the broker sees it, capacity reserved
from recorded intents, and recovery of unfinished intents that may only
restore a stop, never open exposure. Each run leaves a run record (ADR 0012)
with the code SHA, outcome, actions and refusals.| Component | Responsibility |
|---|---|
risk_engine/ | Rules, sizing, order and protection payloads, coverage checks, fill-based blotter, equity accounting |
scripts/validate_order.py | Pre-flight for a proposed buy: cash, sizing, sector cap, cooldown, stop distance |
scripts/validate_mutation.py | Validate the exact broker payload against current account and asset data |
scripts/submit_entry.py | Idempotent buy with protective leg |
scripts/close_position.py | Recovered exit: cancel stop, confirm, sell, confirm |
scripts/replace_stop.py | Resumable stop replacement with restore on failure |
scripts/coordinator.py | Lease, intent recording, reservations and recovery around every broker mutation |
scripts/state_store.py, scripts/run_record.py | Committed append-only state (state/events.jsonl): intents, leases, per-run provenance |
scripts/protection_monitor.py | Scheduled coverage check and actions without Claude |
scripts/heartbeat.py | Daily liveness check, emails on a miss |
scripts/blotter.py | FIFO round trips, cooldowns and sector streaks from broker fills |
scripts/reconcile_equity.py | Daily cash, holdings and equity reconciliation against the broker (exit 4 on an unexplained difference) |
scripts/alpaca.sh | The only broker transport: paper-only, mutation gate, bounded timeouts |
ledger/ | Optional Postgres record of decisions, broker responses and audit events |
memory/ | Strategy rulebook, trade log, research log, weekly reviews |
routines/ | The instruction files the scheduled agent runs |
docs/dashboard/ | Generated dashboard, published through GitHub Pages |
Equity, benchmark comparison and the open book are on the dashboard, rebuilt nightly from the logs. The full order, fill and fee history was pulled read-only and reconciled to equity exactly in research 0006. The strategy assessment grades each rule keep/modify/discontinue, and STRATEGY-SPEC.md freezes v1 and specifies v2 so that forward results can be scored per version.
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/python -m pytest -q -m 'not integration'
.venv/bin/python scripts/doctor.py
.venv/bin/python scripts/build_dashboard_data.py --check
doctor.py checks log parsing and dashboard consistency. Add --broker to
compare the paper account's positions and open orders against expected
protection (read-only). Configuration names are in env.template.
Broker calls default to the production paper account; ALPACA_PROFILE=drill
selects the isolated drill account (docs/ACCOUNTS.md; provision it with
scripts/setup_drill_account.sh).
Ledger tests run against an isolated Postgres:
.venv/bin/pip install -e ".[dev,ledger]"
docker compose up -d
DATABASE_URL=postgresql://trading:trading@localhost:5433/trading .venv/bin/python -m pytest -q
Start with AGENTS.md, which maps each kind of task to the files
and tests that own it, and the current
engineering handoff. Durable design decisions live in
docs/adr/. Both Codex and Claude follow the same instructions
through CLAUDE.md.
v1-baseline (2026-10-13). Next: provision the
Cloudflare cron dispatcher so the protection monitor meets its 90-minute
service level (#130).