
Surfpool is a drop-in replacement for solana-test-validator, purpose-built for Solana developers who need to simulate mainnet conditions locally. This tool enables realistic mainnet simulation for testing trading strategies, DeFi protocols, and smart contracts without spending real SOL or risking assets. At its core, Surfpool provides the power of Solana's mainnet environment on a developer's own machine, offering full control over network state, accounts, and token balances. It is designed for those who require precise, repeatable testing scenarios that mirror production, from individual instruction testing to complex multi-program workflows. The primary value is delivering a safe, cost-free sandbox that behaves identically to mainnet, accelerating development and reducing financial exposure.
Traditional Solana development involves significant friction: testnets lack real account states and token liquidity, while mainnet testing incurs transaction fees and risks of irreversible losses. Developers often resort to hacky workarounds or incomplete simulations that fail to catch edge cases. This pain point is especially acute for trading strategy researchers, DeFi developers, and auditors who must verify behavior against live market conditions, token distributions, and program interactions. Without accurate local simulation, bugs can slip into production, leading to financial exploits or failed strategies. Surfpool eliminates these risks by cloning real mainnet state—including programs, token balances, and account data—so developers can test with absolute fidelity, identify issues early, and iterate rapidly without consequences.
The first major feature is Mainnet Forking, which allows cloning any account, program, or token balance directly from Solana mainnet to the local network. This is not a simulation of state; it's an exact copy, including the full history of account data and program bytecode. Developers specify which accounts or programs to fork, and Surfpool fetches the live state in real time. The why is clear: testing against real USDC balances, actual Jupiter pool configurations, or a deployed Metaplex contract ensures that every interaction behaves as it would on mainnet. This feature is critical for regression testing, validating upgrades, and simulating trades that depend on precise token amounts and program authority structures.
The second major feature group is Cheatcodes, exposed via surfnet RPC methods that give developers superpowers over their local network. These include surfnet_setAccount for arbitrarily modifying any account's data, surfnet_timeTravel to advance the clock or warp to any slot, surfnet_setTokenBalance to set SOL or SPL token balances instantly, and surfnet_resetNetwork to restart cleanly. Each cheatcode is an RPC method that integrates seamlessly with existing tooling—standard Solana RPC calls continue to work alongside them. The utility is immense: developers can instantly simulate a token crash, test time-dependent oracles, or replay a sequence of transactions with manipulated state. This turns testing from a passive observation into an active, controlled experiment.
admin
The third feature group is Infrastructure as Code (IaC) capabilities. When Surfpool runs inside an Anchor or Pinocchio project, it automatically generates deploy configurations and manages program deployment and upgrades declaratively. The IaC is defined in a `deploy.tx` file using simple action blocks that chain deployments, transfers, and program calls. This approach is designed local-first but extends to devnet and mainnet with best-practice security—on-disk keypairs are avoided in production. Composable actions allow developers to build complex workflows from simple, reusable primitives, reducing manual steps and increasing repeatability. The benefit is a reproducible, auditable deployment pipeline that mirrors how cloud infrastructure is managed.
Surfpool's overall workflow is straightforward: start the validator with a single curl command, fork the desired mainnet state, then interact with it via standard Solana CLI tools or custom scripts. The local network runs exactly like a mainnet node—same RPC endpoints, same account structure, same consensus simulation—but with added cheatcode RPCs. Surfpool Studio, an embedded real-time dashboard, opens automatically at a local URL, providing a transaction inspector, byte-level diffs before and after each transaction, compute unit (CU) profiling at the instruction level, and a live transaction log. Developers can inspect decoded instructions, account changes, and logs all in one view, enabling deep debugging without additional tooling.
Concrete use cases include simulating a trading strategy that relies on Jupiter swaps: a developer forks the Jupiter program and a handful of token accounts, then uses surfnet_setTokenBalance to set USDC and USDT amounts, executes a swap via a script, and inspects the byte-level diffs to verify correct output. Another scenario involves testing a time-dependent lending protocol: using surfnet_timeTravel, the developer advances the clock by days to test interest accrual and liquidation conditions. For deployment, after testing locally, the same IaC configuration can be applied to devnet or mainnet with minimal changes. Outcomes include faster iteration cycles (no waiting for testnet or mainnet confirmations), reduced financial risk (no accidental SOL loss), and higher confidence before production deployment.
Surfpool is built for Solana developers, DeFi protocol engineers, quantitative trading researchers, and smart contract auditors who need a reliable, feature-rich local test environment. It runs on macOS, Linux, and Windows (via WSL), integrates with Anchor and Pinocchio toolchains, and is fully open source on GitHub (repo: txtx/surfpool). Pricing is free—there is no paid tier, as the project is community-driven and built in public. The documentation, blog, and Discord community provide extensive support. In summary, Surfpool enables mainnet simulation with unmatched fidelity and control, making it an essential tool for any serious Solana developer aiming to build safe, robust applications.
Solana developers building dApps, DeFi protocols, or trading strategies who need to test against real mainnet state without risk. Quantitative researchers simulating algorithmic trading strategies on Solana. Smart contract auditors verifying program correctness through controlled edge-case testing. Solana infrastructure engineers debugging complex multi-program interactions or multi-signature workflows. Anyone responsible for deploying and maintaining Anchor or Pinocchio projects who requires a reproducible, Infrastructure-as-Code approach to local and remote deployment.