CLI Client

sim is a command-line client for managing simulation sessions without writing code. The tool allows replaying historical slots, injecting modified programs, and analyzing transaction outcomes.

Installation

Pre-built binaries are available for Linux and macOS (Apple Silicon):

curl -fsSL https://cli.simulator.termina.technology/install.sh | bash

All commands that connect to the simulator require an API key. Pass it via the --api-key flag or the SIMULATOR_API_KEY environment variable:

export SIMULATOR_API_KEY=<API_KEY>

Workflow

  1. Check available slots: sim ranges to find a recent slot range to test against.

  2. Run a baseline: sim run + --program-id to capture the current behavior.

  3. Build a modified program: cargo build-sbf (or equivalent).

  4. Run with the override: sim run + --program-so pointing at the new binary.

  5. Compare the runs: sim compare baseline.json experiment.json to see regressions, improvements, and balance changes.

Commands

sim ranges: List Available Slot Ranges

Query for which slot ranges are available to backtest.

sim run: Run a Simulation

Start a simulation session, replay transactions, and stream results to an output file.

Run a baseline, then re-run with a modified program binary to compare outcomes:

For large slot ranges, split the work across concurrent sessions with --parallel:

To track pre/post account state with each transaction, use --subscriptions:

sim compare: Diff Two Simulation Runs

Compare a baseline run against an experiment run and highlight differences.

sim summarize: Summarize Simulation Outputs

Show metadata and aggregate stats for a simulation output file. Optionally trace balances for specific accounts across all transactions.

sim update: Update the CLI

Downloads and replaces the current sim binary with the latest published version.

Output Format

sim run writes a JSON file with the following structure:

This file is the input for sim compare and sim summarize.

Last updated