Trading tasks for agents on Solana: bots trade DeFi markets replayed on offline mainnet snapshots with Surfpool.
harbor run -d solana-foundation/machine-tradingharbor download solana-foundation/machine-tradingMachine Trading is a workshop for researching trading strategies and evaluating AI models on Solana. Design a strategy, test it against simulated markets, and inspect how it behaves.
GitHub repository · Explore benchmark results · Documentation
The benchmark gives coding agents a trading objective, market interfaces, risk constraints and practice scenarios. Each agent builds a bot, which is then graded on hidden scenarios against an offline copy of Solana mainnet. Real protocol programs, transaction costs and task-specific risk rules shape the evaluation. Published strategies and trajectories let you inspect how each result was produced. These are simulated markets, not live-money trading results.
| Task | Market | A good bot… |
|---|---|---|
backrun-sol-usdc |
Orca Whirlpool and Raydium CLMM, SOL/USDC | reacts in the trigger's slot, sizes the cycle to the fee band through both curves, and bids only what it must to beat the other searchers |
backrun-thin-pools |
Orca Whirlpool and Raydium CLMM, ten pools over SOL, USDC, JitoSOL, JTO and GEOD | searches a graph of pools for the cycle that the latest swap opened, and skips cycles whose fees eat the gap |
flash-crash-nvda |
Phoenix NVDA perp | tells a shock from noise, rides the ones that keep going and cuts the ones that turn, and pays for every move it trades |
funding-carry-sol |
Phoenix SOL perp | prices the carry Phoenix will actually pay on the session's clock, weighs it against what trading costs, and reads how rich this session's basis is |
liquidation-flash |
Kamino main market, SOL/USDC | reads the price upstream of Kamino's oracle, sees an obligation cross its liquidation threshold before the oracle shows it, and pushes the update, liquidates with a flash loan and sells the collateral in one transaction, bidding only what it must to land ahead of competing liquidators |
market-making-cbrs |
Phoenix CBRS perp | earns the spread where the flow pays for it, and stays out of the way of informed flow and stale quotes |
weekend-gap-spcx |
Phoenix SPCX perp | knows what the reopen keeps of a weekend's move, tells the traders who know where it opens from the ones who don't, and sizes for the open's spread |
Agents receive a starter bot, the SDK and practice scenarios. They can build and experiment before submitting a WebAssembly strategy. An isolated verifier then runs the submitted artifact on hidden market scenarios and compares its behavior with task-specific reference strategies.
The evaluation accounts for trading costs, losses, drawdowns and rule violations. Current leaderboard task scores average raw scores across attempts, then clamp once to the 0–1 scale. The overall leaderboard gives each task equal weight. Scores are benchmark measurements, not investment returns.
Read how bots are graded for the exact scoring rules, risk limits and historical differences.
Follow the benchmark development guide for installation, evaluation and publication. Published task versions pin their images and inputs so results can be traced to the configuration that produced them. The hidden evaluation seed belongs only to the evaluator, never to the agent.
The benchmark explorer shows model comparisons, individual attempts, strategy source, trajectories and scenario replays. Interrupted agent sessions and completed grades are recorded separately; a saved strategy can have a grade even when its agent stopped early.