Oracle3
Oracle3: 예측시장 거래 엔진·MCP 서버
Pearl Connect로 코딩 에이전트가 온체인 서비스용 지갑을 사용하고, 거래를 로컬에서 서명해 키는 사용자에게 보관됩니다
With Pearl Connect, your coding agent can use a wallet for on-chain services. Pearl is designed to sign each transaction locally, while the keys stay with you.
금융Python · ShellGitHub @bennyjo온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Phil is a self-improving trader: an AI agent that trades short-term prediction markets and rewrites his own strategy after every settled bet. Paper 24/7 in the cloud; small capped real stakes via Pearl Connect.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
Phil is a self-improving trader: an AI agent that trades short-term
prediction markets and rewrites its own strategy after every resolved
bet. Paper trading is the 24/7 learning engine. Real money runs alongside
it, deliberately small: capped stakes through
Pearl Connect, only in edge classes
whose settled evidence has earned it.
The name honors the man who relived the same day until he'd learned enough
to win it, and the groundhog who makes forecasts.README 전문 보기 ↗Phil is a self-improving trader: an AI agent that trades short-term prediction markets and rewrites its own strategy after every resolved bet. Paper trading is the 24/7 learning engine. Real money runs alongside it, deliberately small: capped stakes through Pearl Connect, only in edge classes whose settled evidence has earned it.
The name honors the man who relived the same day until he'd learned enough to win it, and the groundhog who makes forecasts.
Claude Code gets a simulated $1,000 bankroll and the short-term Polymarket
universe: earnings beats, daily sports, pre-match esports, official economic
prints, near-term news. Crypto up-or-down coin-flips are banned. Every cycle
it settles yesterday's bets against official resolutions and scores its own
calibration against the market price it paid. It writes a retrospective when
bets have settled. A swarm of cheap screening subagents scores ~300 markets
per full cycle against the live price (core/screen.py), and the agent
spends its research slots on the largest divergences. It edits its own
playbook, risk policy, tooling, sensing (the market-discovery queries and
the screening prompt) and pacing (which hourly ticks deserve a full
cycle). Then it commits the diff, researches, and bets again.
Three layers keep it honest:
core/watch.py) that check every ~15
minutes for new listings and price moves on the agent's watchlist and
trigger an early cycle when something fires;core/, the caps,
the cycle procedure). Evidence flows in through
journal/operator-notes.md. Asks flow out through journal/proposals.md
for changes only the operator can make.The strategy's git log is the product: every commit is a lesson the agent
paid for (in paper). The honest metric is brier_delta, not just P&L: is
the agent's probability a better forecast than the market's own price?
The learning engine is paper. An always-on cloud loop cycles hourly across the whole market universe, with watcher ticks every ~15 minutes in between, because hundreds of simulated feedback loops cost nothing and answer the question that matters: in which market categories does fast AI research actually beat the price?
Real execution rides on top, deliberately small. When the operator's machine
is on and Pearl Connect's local signer is healthy (./loop.sh --real),
paper bets in edge classes with positive settled evidence get a real
twin on Polymarket (Polygon). Orders go through core/real.py, the only
code that touches funds, and the sizing is all config: per-bet, per-day and
open-position caps live in config/protected.json (currently $1 per bet),
with hard ceilings that CI enforces. The Safe holds only what the operator
chooses to fund; its balance is the final cap no code can exceed. The agent
never holds keys; every signature goes through Pearl Connect's audited
local choke point. Real fills feed back into the journal so retros can
measure what paper can't: actual fill quality versus the simulated
cross-the-spread model.
Pearl Connect is Pearl's BYOA signing service. It lets any agent harness, Claude Code included, act as an Olas Pearl agent without ever holding keys. To run it yourself, download Pearl at pearl.you/connect.
core/, config/protected.json).
loop.sh reverts any attempt, and CI independently fails any agent
commit that touches protected files. Caps: $10/bet max, 60 open positions,
no market resolving under 20 minutes out, no entries outside 2¢ to 95¢.The operator owns the engine, and the agent owns its strategy and its record. The following table lists who owns each path:
| Path | What it holds | Owner |
|---|---|---|
core/ | The engine: market scan, screening, ledger and fills, settlement, scoring, real execution (real.py), the runner lease, integrity tripwires (validate.py), and offline tests (test_*.py) | Operator |
config/protected.json | Bankroll, stake and position caps, banned question patterns, screener tunables, and the real-execution caps | Operator |
CYCLE.md, REAL.md | The procedure the agent follows each cycle, and the addendum for real mode | Operator |
loop.sh | Runs cycles headlessly with Claude Code and reverts agent edits to operator-owned paths | Operator |
.github/, .claude/ | CI, the boundary guard, community files, and subagent definitions | Operator |
strategy/ | Playbook, risk policy, discovery queries, screener prompt, pacing schedule, watchlist, and tools | Agent |
journal/ | Ledger, forecasts, retrospectives, cycle log, operator notes, and proposals | Agent, with ledger rows written only through core/ and operator notes by the operator |
The engine is Python 3 standard library only, so there is nothing to install. CI runs on Python 3.12. These commands work on a fresh clone:
git clone https://github.com/bennyjo/phil.git
cd phil
python3 -m unittest discover -s core -p 'test_*.py' # offline tests
python3 core/validate.py # integrity tripwires
python3 core/score.py # calibration and P&L report
core/score.py fetches live prices to mark open positions to market. To run
it offline, add --skip-mtm. Market data needs no API key; it comes from
Polymarket's public gamma and CLOB endpoints.
A cycle is a headless Claude Code session
that follows CYCLE.md. loop.sh runs cycles one after another:
./loop.sh 10 45 # 10 paper cycles, 45 minutes apart
./loop.sh 1 45 --real # one cycle with real twins via Pearl Connect
python3 core/real.py doctor # is the real-execution path ready?
Before you run loop.sh, know what it does:
claude on your PATH, and each cycle uses your Claude Code
account. loop.sh pins the model per cycle (claude-opus-5-5, or
claude-sonnet-5-5 when the pacing schedule makes the tick light) and runs
the session with --permission-mode acceptEdits and a fixed tool
allowlist that includes web search and web fetch.loop.sh pushes to main on your origin
remote. Before each cycle it takes the runner lease (core/lease.py),
which is also a push to origin. On a clone that can't push to origin,
such as a clone without write access, every tick is skipped with
WARNING: runner lease not taken. To run your own Phil, fork the
repository and clone your fork. To run locally without pushing anywhere,
remove the remote with git remote remove origin; without an origin
remote, the lease and the push are both skipped.--real,
PEARL_CONNECT_STORE is set, the local Pearl Connect signer is healthy,
and python3 core/real.py doctor reports ready. real_trading_enabled is
true in this repository's config/protected.json; to turn real mode off
in code, set it to false.PEARL_CONNECT_STORE set and the signer up, paper cycles can also buy
second-opinion predictions from the Olas mech marketplace, about $0.01
USDC each, paid from the service Safe (CYCLE.md step 5a).In Phil's own deployment, the hourly cycle, the watcher, and the daily deep
retro run as scheduled cloud routines that the operator configures outside
this repository. loop.sh is the runner that ships with it.
Caps and engine settings live in config/protected.json; the agent's sizing
policy lives in strategy/risk.json, inside those caps. All environment
variables are optional:
| Variable | Read by | Purpose |
|---|---|---|
PEARL_CONNECT_STORE | loop.sh, core/real.py | Pearl Connect workspace directory (contains .mcp.json). Enables mech second opinions and, with --real, real twins. |
CONNECT_POLYMARKET_VENV | core/real.py | Virtual environment of the connect-polymarket skill scripts. Defaults to ~/.cache/connect-polymarket/venv. |
ODDS_API_KEY | core/odds.py | Key for the bookmaker-odds benchmark from the-odds-api.com. Falls back to ~/.config/phil/odds-api-key. |
HEADLINE_ARENA_AGENT_ID, HEADLINE_ARENA_CLIENT_SECRET | core/headline_arena.py | Credentials for Headline Arena daily questions. Fall back to ~/.config/phil/headline-arena.json. Without them, the step is off. |
PHIL_RUNNER | core/screen.py, core/lease.py | Runner name for the lease and the screener quota. Defaults to operator under loop.sh, else cloud. |
Keep keys and tokens outside the repository. The journal and strategy are public, and every cycle commits them.
Phil is a running experiment, not a versioned release. The agent commits to
main many times a day, and main is the only supported version. For the
current score, run python3 core/score.py or read the newest retrospective
in journal/retros/.
This is a research experiment in agent self-improvement. Most trading is
simulated. A small real-money leg runs through Pearl Connect only when the
operator deliberately enables it: per-bet and daily stakes are capped in
config/protected.json, and the wallet holds only what the operator funds.
Nothing here is financial, investment, or betting advice. Past performance,
paper or real, predicts nothing. Prediction-market trading is restricted or
unlawful in some jurisdictions. Know your own rules before running any of
this with real funds.
Apache-2.0. The journal and strategy files are part of the experiment's record and are covered by the same license.