Write a bot that makes markets in Phoenix SPCX (SpaceX) perps against competing makers and informed taker flow, on an offline copy of Solana mainnet.
harbor run -t solana-foundation/phoenix-market-makingharbor download solana-foundation/phoenix-market-makingThe agent writes a bot that makes markets in Phoenix SPCX perpetuals (SpaceX shares). The market is an offline copy of Solana mainnet: Phoenix's SPCX market, snapshotted on 2026-10-29 and restored into a Surfpool surfnet at the snapshot's slot and time.
What it measures. A good bot earns the spread from uninformed takers while reading its own fills: it skews against its inventory, and widens or steps back when flow turns one-sided, so the informed orders ahead of a jump don't run it over. A bot that quotes tight and symmetric fills the most and loses it all to jumps and trends; a bot that quotes too wide or too little fills nothing.
Trader::oracle_usd reads the same oracle.mth-botkit SDK, a starter
bot that builds and never trades, six practice scenarios, the scenario
generator (mth scenario generate --family market-making), and
mth-practice, which grades the bot exactly as the verifier does./app/bot and replays twelve hidden scenarios (three calm,
six with jumps, three trending), one at a time, each on a fresh surfnet.
Before the bot starts, the takers are onboarded, the makers widened, and
every cheatcode locked for good. The bot runs as an unprivileged user
behind an RPC proxy that forwards standard Solana methods only.clamp(Σ bot PnL / Σ bound, 0, 1). A scenario's bound is its
spread bound (every taker order filled at the competitor's half-spread
with nothing lost to informed flow, inventory or fees) plus its hindsight
bound (the 20 SPCX cap held the right way through every move). A maker
earns from both, the spread and the moves it trades or leans into, so a
bound on the spread alone was one a bot could pass: 0.7.0's was. No bot
reaches the sum. The reference is reported as a baseline.| Agent | Reward | What it shows |
|---|---|---|
| oracle (the reference maker) | ~0.01–0.02 | The task is solvable and the reference is calibrated |
| nop (starter bot) | 0.0 | Doing nothing earns nothing |
| cheater | 0.0 | Cheatcodes through the proxy disqualify; /tests is unreadable; writing the reward file counts as tampering; ignoring SIGTERM doesn't extend the session |
| sneaky | 0.0 | Cheatcodes, airdrops and exit on the surfnet's own port are refused |
The reference quotes one tick inside the competitor around the oracle, skews against inventory, leans with the drift, and backs off after one-sided fills. On the hidden set it made $19.62 against a $2,498 bound (reward ~0.01); in the 0.8.0 Harbor check it made $49.17 and won 11 of 12 sessions. The grader's maker reacts in real time, so the same bot's PnL moves with timing from run to run. Against that maker, simple quoting roughly breaks even: the headroom (faster requotes, sizing, reading the informed flow on the tape without being run over by it) is where agents separate.
The hidden scenarios ship in tests/scenarios with the task, so treat scores
on this public version as a development benchmark, not a held-out
evaluation.