Skip to main content
This guide covers how to use Range’s Transaction Simulator to validate transactions before they hit the blockchain. The walkthrough below is Solana-specific (single vs batch simulation, compute units, program errors). For unsigned EVM transactions, including a Safe execTransaction before any signatures exist, use Simulate an EVM Transaction (POST /v2/simulate/evm) on eth, arb1, base, oeth, pol, bnb, and avax. A reverted EVM transaction is still HTTP 200 with status: reverted. Safe responses add a safe block and per-MultiSend batch entries when the calldata decodes as a Safe.
Prerequisites: You need a Risk API key and familiarity with the Transaction Simulator endpoint. You should also know how to construct Solana transactions using @solana/kit or equivalent.

When to Simulate


Step 1: Prepare and Encode the Transaction

Build your Solana transaction using any SDK and encode it as base64 or base58.
You don’t need to sign the transaction before simulating. The simulator accepts unsigned transactions, so you can validate before committing any signatures.

Step 2: Submit for Simulation

Single Transaction

Batch Simulation

Use batch simulation when you have multiple transactions to validate - either independent transactions or a sequence of dependent operations.

When to Use Each

Step 3: Analyze the Response

The simulation response contains several sections. Here’s what to check and in what order:

Check for Errors First

If the error field is present, the transaction would fail onchain. Other fields may be incomplete.

Review Asset Transfers

The asset_transfers array shows all token and SOL movements per account. Each entry represents a balance change for a specific account and asset.
For a simple SOL transfer, you’ll see two entries: a Debit from the sender and a Credit to the recipient. For swaps or complex transactions, you’ll see multiple entries across different mints and accounts.

Check Balance Changes

The lamport_changes array shows the net SOL balance change for each address involved in the transaction.

Review State Changes

The expected_state_changes object maps each affected account to an array of state changes. Each change includes a humanReadableDiff for display, a suggestedColor (CREDIT or DEBIT), and rawInfo with structured data about the change type.
State change types include:
  • SOL_TRANSFER, Native SOL transfers
  • SPL_TRANSFER, Token transfers, swaps, mints, burns
  • Account creations, closures, and other token operations

Check Transaction Costs

Fee Confidence Levels


Step 4: Check Transaction Risk

The transaction_risk section provides risk analysis for all accounts involved in the transaction.
Each risky account includes:
  • riskScore (1-10) and riskLevel (e.g., “Extremely high risk”)
  • numHops, Distance to nearest malicious address
  • reasoning, Explanation of why the address is flagged
  • maliciousAddressesFound, List of connected malicious addresses with their categories (Hack, Scam, etc.)
Risk analysis is performed on the main transaction level. Embedded transactions (e.g., Squads multisig operations) and nested instruction data are not currently included in risk scoring.

Debugging Common Failures

Using Logs for Debugging

The transaction_logs array contains the complete execution logs from the Solana runtime. Search for "Program log: Error" or "failed" to pinpoint the failing instruction:

Complete Simulation Workflow


What’s Next

Simulate Solana Transaction

Full endpoint reference with response schema details.

Simulate an EVM Transaction

Trace an unsigned EVM transaction or Safe multisig: balance deltas, transfers, approvals, attribution checks, and safe/batch detail.

Wallet Integration

Integrate simulation into a wallet send flow with address screening.
Last modified on September 22, 2026