Skip to main content
[ DOCS · OVERVIEW ]

Riptide Docs

Start here. These docs cover installing Riptide, running a scenario, using Studio, reading the evidence pack, and wiring it into CI.

What Is Riptide?

Riptide is an economic stress-test framework for Solana programs. It runs your compiled program against scripted market conditions — whales concentrating positions, oracles lagging, prices shocking, withdrawal queues forming — and checks whether the properties you care about (solvency, backing, margin safety, etc.) still hold.

Instead of asking does my code compile or do unit tests pass, it asks does the economy this program defines behave how I expect when real users push on it? Every run is deterministic: same inputs and seed produce the same output, so a failure is something you can reproduce, share, and investigate.

Concepts to know

  • Adapter — a TOML file that tells Riptide what your program is (bytes, IDL, accounts, actions, optional decoders) and what properties should hold (invariants).
  • Harness — optional Rust setup code that runs before tick 0 to write real account bytes, SPL mints and vaults, PDAs, external accounts, or sibling programs.
  • Guided simulation — optional Rust flow code under .riptide/sim/ for dynamic remaining_accounts, multi-instruction transactions, forked snapshots, and project-owned external dependency services.
  • Scenario — a config file describing who acts, how many ticks run, how many seeds to sweep, and what market conditions apply. One seed is one rerunnable experiment.
  • Persona — a deterministic behavior policy for one class of actor (steady LP, panic whale, arb bot, liquidator). Personas live as [personas.<slug>] blocks in the adapter and are referenced by scenario run configs.
  • Agent — one simulated user inside a run. The scenario's agents field is a population count; each agent is assigned a persona and acts independently per tick.
  • Tick — one simulated step (≈ one Solana slot ≈ 400 ms simulated). Every persona evaluates and may submit an action per tick; observations and invariants are evaluated after.
  • Invariant — a machine-checkable property declared on the adapter that should hold every tick (no bad debt, health factor stays above the floor). When one fires, the run records the tick and the engine exits non-zero so CI can gate on it.
  • Evidence pack — what every run emits: manifest.json, summary.md, trace.md, rerun.sh, path indexes, and a canonical hash. This is what you hand to reviewers or CI.
  • Studio — the localhost visual control plane started by riptide studio. It can bootstrap a thin workspace, drive local Agent chat, inspect artifacts, queue allowlisted jobs, and open run/replay dashboards.
PersonasWhaleArbitrageurLiquidatorSteady LPProgram{}InvariantsCollateral HealthLP SolvencyMargin SafetyReserve BackingScenario Sweepbaselineprice shockseed sweep

Quick Path

The first pass through Riptide is: install it, scaffold .riptide/ in your repo, fill the adapter, add a harness when setup needs real account bytes, use guided sims when external state must evolve during flows, smoke one seed, then run the scenario sweep or guided artifact and inspect the evidence. Open riptide studio when you want a browser surface for that loop.

Trust boundary: Riptide produces simulation evidence, not a broad review result and not a broad safety result. A run collection and pack are useful because their committed inputs, seed, invariant firings, coverage checks, trace, rerun command, and canonical hash can be inspected and rerun.

Step 01 Install Hosted installer, repository build path, verification, and Docker alternative. Step 02 Quickstart Initialize Riptide in your repo, fill in the adapter and harness, then run your first simulation against your own program. Step 03 Studio Open the localhost visual control plane for workspaces, Agent chat, evidence, reports, jobs, and setup handoff. Step 04 Adapter The adapter TOML: program bytes, IDL, accounts, decoders, actions, observations, personas, and invariants. Step 05 Harness Pre-tick setup for account bytes, SPL mints and vaults, PDAs, sibling programs, and smoke runs with --harness. Step 06 Guided Sims Manual Rust-authored flows for external accounts, fork caches, services, artifacts, and review when static TOML is not enough. Step 07 Personas Catalog of every shipped persona archetype, plus the authoring guide for writing your own. Step 08 Invariants Catalog of invariants the shipped fixture adapters declare per protocol class, plus the authoring guide. Step 09 Scenarios Run configs, seeds, persona mixes, sweeps, harnessed smoke checks, and invariant coverage. Step 10 Replay Artifacts Evidence packs, manifest.json, summary.md, trace.md, rerun.sh, path indexes, and canonical hash. Step 11 Failure Patterns Illustrative failure-class explainers with deterministic reruns and explicit claim boundaries. Step 12 CI Handoff How to forward a green workflow URL and evidence pack to reviewers. Step 13 FAQ Trust boundary, LiteSVM caveats, supported bundles, .riptide discovery, and install availability. Examples Case Studies Read Riptide's deterministic failure-shape and incident economic-shape case studies with canonical hash, deterministic rerun, and explicit claim boundaries.

Deep Reference

These landing docs are the MVP path. The repo docs remain the source material for detailed implementation behavior, toolchain pins, and reviewer handoff mechanics.