> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nexroute.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Running Tests

> Reproduce benchmark test cases using our open-source replay tool

We've open-sourced our benchmark replay tool to enable independent verification of our results. The tool allows you to reproduce any historical benchmark by replaying trades against the same blockchain state we used.

## Benchmark Replay Repository

<Card title="nexroute/benchmark-replay" icon="github" href="https://github.com/nexroute/benchmark-replay">
  Open-source tool for reproducing benchmark results
</Card>

### Quick Start

1. **Clone the repository**
   ```bash theme={null}
   git clone https://github.com/nexroute/benchmark-replay.git
   cd benchmark-replay
   ```

2. **Install dependencies**
   ```bash theme={null}
   npm install
   ```

3. **Configure your environment**

   Create a `.env` file by copying the example:

   ```bash theme={null}
   cp .env.example .env
   ```

   Edit `.env` and set your archive node URI:

   ```bash theme={null}
   ARCHIVE_NODE_URI=https://your-archive-node-provider.com/bsc/your-api-key
   ```

   <Note>
     You must use an **archive node** to replay historical blockchain states. Regular RPC nodes will not work.
   </Note>

4. **Run a replay**
   ```bash theme={null}
   npm run replay
   ```

### What You Can Do

* **Reproduce Historical Trades**: Replay any benchmark trade against the exact blockchain state used in our tests
* **Verify Results**: Compare your local simulation results with our published data
* **Custom Analysis**: Download trade data and run your own analysis
* **Inspect Execution**: See detailed transaction traces and state changes

### Documentation

For detailed usage instructions, configuration options, and advanced features, see the repository's [README](https://github.com/nexroute/benchmark-replay#readme).

## Trade Data Access

To download benchmark trade data:

1. Go to the [benchmark platform](https://benchmark.nexroute.io)
2. Navigate to **Rankings → By Run**
3. Select a run to view its **Detailed Results**
4. Click the **⬇ download button** next to any test case to get its JSONL file

Each JSONL file contains a single test case with all solver quotes, calldata, and execution results. Everything needed to replay that exact trade.

When you run `npm run replay`, the script will:

1. Ask you for the path to the downloaded `.jsonl` file
2. Show you the list of solvers and ask you to pick one to replay
3. Fork the blockchain at the exact block and simulate the trade
