Skip to main content

Parameters

string
required
Transaction to simulate, as a base-64 encoded string
object
Configuration object containing:
boolean
If true, verify transaction signatures
string
Commitment level (processed, confirmed, finalized)
string
Encoding format for the transaction (base58, base64, json)
boolean
If true, replace the transaction’s recent blockhash with the most recent blockhash
object
Accounts configuration object containing:
string
Encoding format for account data (base58, base64, json)
array
Array of account addresses to return data for
number
The minimum slot that the request can be evaluated at

Response

object
Object containing:
string | null
Error if transaction simulation failed, null if simulation succeeded
array
Array of log messages the transaction instructions output during execution
array
Array of accounts with their data (if requested)
number
Number of compute units consumed by the transaction
object
Program return data from the simulation

Code Examples

Basic Request

Using web3.js

Notes

  1. Simulates sending a transaction without actually sending it
  2. The response includes execution logs and errors
  3. The simulation is performed on the current state
  4. No state changes are persisted
  5. Useful for testing and debugging transactions

Best Practices

  1. Use simulation before sending real transactions
  2. Check compute unit consumption
  3. Analyze program logs for errors
  4. Verify account states after simulation
  5. Handle simulation errors appropriately

Common Errors

Use Cases

  1. Transaction Analysis
  2. Transaction Validation
  3. Transaction Optimization