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, draws seventy-two hidden sessions (eighteen
calm, thirty-six with jumps, eighteen trending) from the batch's secret (MTH_EVAL_SEED;
it refuses to grade without one), grades the reference maker on them, then
the bot, one session 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 surfnet serves RPC only at a secret path, so the
bot's only way in is an RPC proxy that forwards standard Solana methods
only.mth-turn-1): the takers' orders due trade against the
quotes the bot left, then the step's move lands, then the grader's maker
requotes, then the bot's turn. (Takers right after a move, before any
maker could requote, would pick off every quote: a sniper the task
doesn't describe.) The same bot on
the same session trades the same way every time; before 0.9.0, the
grader's maker raced the bot in real time, and the same reference made
$19.6 in one run and $49 in the next.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 | The task is solvable and the reference is calibrated (skill 1 by construction) |
| 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 | The surfnet's own port answers nothing without its secret path |
just ladder market-making grades the ladder (bench/checks/ladder) on
fresh hidden sets: naive and skewed quoters below the reference, the
reference below a flow oracle (told which taker orders are informed), and
the frozen exploit bots below the flow oracle.
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 that grow its inventory, leaning a few units the burst's way. On two fresh 72-session ladder sets it made $279 and $151; the naive quoter lost $11 and $41, and the flow oracle made 14–30× the reference: the headroom (reading the tape beyond its own fills, sizing the lean, telling bursts from noise) is where agents separate.
No hidden scenario ships with the task: each batch's are drawn inside the verifier from a secret the batch's runner holds, and reports carry only the secret's SHA-256. The generator is public (agents get it), so the family is known and the draws aren't. Every trial in a batch is graded on the same set.