simulate Transaction
Runs a transaction against current bank state without submitting it, returning logs, balance changes and any error.
simulateTransaction executes a transaction locally against current state and reports what would happen — compute units consumed, program logs, balance changes, and any error — without broadcasting or spending a fee. sendTransaction's own preflight check uses this internally.
By default the transaction must be fully and validly signed, as for sendTransaction. sigVerify: false simulates an unsigned or placeholder-signed transaction instead, useful while accounts and instructions are still being iterated on.
Parameters
params is a JSON array, with values in this order: transaction, config.
The transaction to simulate, wire-encoded per the encoding config field. Needs valid signatures unless sigVerify is set to false.
Optional configuration.
Show propertiesProperties
Bank state to simulate against.
finalizedconfirmedprocessedWhen true, the node verifies every signature and rejects the transaction if any are invalid or missing. When false (the default), signatures are not checked, so replaceRecentBlockhash becomes the only reliable way to guarantee a valid blockhash.
Replace the transaction's blockhash with the node's current latest blockhash before simulating. Requires sigVerify: false (a replaced blockhash would invalidate any real signatures).
Wire encoding of the transaction param.
base58base64Minimum slot the node must have processed before simulating.
When true, includes CPI (inner) instructions in the response's innerInstructions field. Off by default to keep the response smaller.
Request post-simulation account state for specific accounts, instead of only balance/log/error information.
Show propertiesProperties
Addresses to fetch post-simulation state for, base-58 encoded.
Encoding for the returned account data.
base58base64base64+zstdjsonParsedResult
Simulation outcome, wrapped with context.
Show propertiesProperties
Show propertiesProperties
Show propertiesProperties
Null if the transaction would succeed; a TransactionError otherwise.
Program log output from the simulated execution.
Fee, in lamports, the transaction would be charged.
Compute units the simulated execution consumed.
Data returned by the last program invoked via sol_set_return_data, if any: {programId, data: [base64String, "base64"]}.
Lamport balance of each account referenced, before simulated execution.
Lamport balance of each account referenced, after simulated execution.
Token balances before simulated execution, same shape as in getTransaction.
Token balances after simulated execution.
CPI instructions triggered during simulation, only present when config.innerInstructions was true.
Total bytes of account data loaded to run the simulation.
Present only when replaceRecentBlockhash was true: {blockhash, lastValidBlockHeight} for the blockhash actually used.
Post-simulation state for each address listed in config.accounts.addresses, in that order, or null for an address that doesn't exist. Only present when config.accounts was set.
Notes
- The transfer instruction succeeds, but the simulation fails because it would leave the destination account with a positive balance below the rent-exemption minimum: a System-owned account must end a transaction at 0 lamports or at least the rent-exempt minimum, nothing in between.
sigVerify: falsewithreplaceRecentBlockhash: trueis the standard combination for iterating on an unsigned transaction; the node fills in a current blockhash without needing a throwaway signer.- A successful simulation is not a landing guarantee — state can change between simulating and actually submitting, especially for accounts under contention.