Skip to Content
Simulations

Simulations

Simulations rapidly run large volumes of transactions against an isolated fork of your main Stagenet. This lets you test the long-term contract behaviour of your contracts.

They are performed via a simple flow:

  1. Define simulation
    Select the transactions to run and the on-chain data to track during your simulation.

  2. Run at scale
    Rapidly execute the transactions an isolated clone of your main Stagenet.

  3. Analyse results
    Inspect how your tracked data changed during the simulation.

What simulations are for

Use simulations to explore how your contracts behave over time and at scale. For example:

  • Vault performance — run thousands of swaps through a pool and measure whether a vault actually accumulates yield.
  • Fee validation — simulate sustained trading to check whether fees are captured as expected.
  • Accounting drift — repeatedly deposit and withdraw to verify balances, shares, and totals stay consistent.
  • Load-related bugs — surface issues that only appear after hundreds or thousands of transactions.

How to run a simulation

To start a simulation, go to the platform’s Simulations page, via the sidebar, and click Create Simulation. This will take you to your new simulation’s dashboard.

Before running the simulation, you need to do two things:

  1. Select the transactions you want to execute during the simulation.
  2. Choose the on-chain data you want to track during the simulation.

Configure these on your new simulation’s dashboard. You can track native and ERC20 token balances, function return values, and storage variables during your simulation.

For example, you could run 1,000 swaps through a DEX deployed on your Stagenet and track the fees it earns during the simulation.

When you start the simulation, an isolated fork of your main Stagenet is created. The specified transactions are executed on this fork, and the tracked on-chain data is recorded as it changes throughout the run.

Last updated on