Source
simulate_transactionParameters
Transaction, as an encoded string.
The transaction must include a recent blockhash unless
replaceRecentBlockhash is true, in which case the RPC node replaces it
before simulation. The transaction is not required to be signed unless
sigVerify is true.Configuration object containing the following fields:
Show propertiesHide properties
Show propertiesHide properties
Values:
processed, confirmed, finalizedCommitment level to simulate the transaction at. Default finalized.Solana RPC uses the following commitment levels:| Value | Description |
|---|---|
processed | Return data from the highest slot this node has processed. This is the newest view, but the block can still be skipped. |
confirmed | Return data from the same slot as finalized. Kept for compatibility and planned for removal in a later release. |
finalized | Return data from the highest slot with a finalization certificate, from votes by 80% of stake in one round or 60% of stake in each of two rounds. This is the strongest commitment level. |
Values:
The default
binary, base58, base64Encoding used for the transaction data.| Encoding | Notes |
|---|---|
base64 | Recommended |
base58 | Slow |
binary | ⚠️ Deprecated. Legacy alias for base58, retained for backwards compatibility |
base58 encoding is capped at 1,232 bytes and cannot carry a
v1 transaction
larger than that — use base64 for transactions over 1,232 bytes.Values:
true, falseIf true the transaction recent blockhash will be replaced with the most recent
blockhash (conflicts with sigVerify)Values:
true, falseIf true the transaction signatures will be verified (conflicts with
replaceRecentBlockhash)Example
{ "sigVerify": true }
The minimum slot that the request can be evaluated at
Example
{ "minContextSlot": 341197000 }
Values:
true, falseIf true the response will include CPI instructions (innerInstructions). Set
innerInstructionsEncoding to choose their format.See Inner Instructions for the
shared structure.Example
{ "innerInstructions": true }
Values:
json, jsonParsedEncoding for the inner instructions returned when innerInstructions is true.
Any other value returns an Invalid params error (-32602).| Encoding | Notes |
|---|---|
jsonParsed | Each inner instruction is fully parsed where a parser is available (System, Token, Associated Token Account, and others), otherwise partially decoded with base-58 encoded program and account addresses and base-58 data. |
json | Every inner instruction uses the compiled form: programIdIndex and accounts as indexes into the transaction’s account keys, plus base-58 data. This is the same shape getTransaction returns with json encoding. |
Available from Agave v4.5. Nodes running an earlier version ignore this
field and return the
jsonParsed form.Example
{ "innerInstructions": true, "innerInstructionsEncoding": "json" }
Accounts configuration object containing the following fields:
If
| Field | Type | Description |
|---|---|---|
addresses | array | Account addresses to return, as base-58 encoded strings. The list length must not exceed the number of account keys in the transaction. |
encoding | string | Encoding for returned account data. Default is base64. Supported values are base64, base64+zstd, and jsonParsed. base58 and binary are not supported for this method. If jsonParsed is requested, each returned account uses the stable wrapper {program, parsed, space}; if no parser is available, the RPC node falls back to [data, "base64"]. The nested parsed payload remains program-specific. |
Example
{
"addresses": ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"],
"encoding": "base64"
}
accounts.encoding is jsonParsed, the program field in each returned
account identifies the parser that produced parsed.For the shared account wrapper used by these entries, see
Account Data.program value | Parsed account type |
|---|---|
address-lookup-table | Address lookup table accounts |
bpf-upgradeable-loader | Upgradeable loader program and buffer accounts |
config | Config accounts |
nonce | Durable nonce accounts |
spl-token | SPL Token accounts |
spl-token-2022 | SPL Token 2022 accounts |
stake | Stake accounts |
sysvar | Sysvar accounts |
vote | Vote accounts |
Result
RpcResponse object containing:
Show propertiesHide properties
Show propertiesHide properties
Slot and API version the node used to answer this request.
| Field | Type | Description |
|---|---|---|
slot | u64 | Slot at which the node evaluated this request. |
apiVersion | string | RPC API version reported by the node. This field may be omitted by older nodes. |
Simulation result object containing:This value uses the shared
Simulation Results structure.
When
| Field | Type | Description |
|---|---|---|
accounts | array | null | Accounts requested in accounts.addresses. Each element is either null or an Account Data entry. |
err | object | string | null | Error if the transaction failed. null if the transaction succeeded. See Transaction Errors. |
innerInstructions | array | null | null unless innerInstructions was true. Otherwise this is a list of Inner Instructions groups. |
loadedAccountsDataSize | u32 | null | Total number of bytes loaded across all accounts used during simulation. |
logs | array | null | Program log messages emitted during execution. null if simulation failed before execution began. |
replacementBlockhash | object | null | Blockhash the RPC node used during simulation when replaceRecentBlockhash is enabled. |
returnData | object | null | Most recent instruction return data captured during simulation, when present. See Return Data. |
unitsConsumed | u64 | null | Compute units consumed during simulation. |
fee | u64 | null | Fee charged for the simulated transaction. |
preBalances | array | null | Lamport balances before simulation, indexed to the transaction account list. |
postBalances | array | null | Lamport balances after simulation, indexed to the transaction account list. |
preTokenBalances | array | null | Token balances before simulation. Each element uses Token Balances. |
postTokenBalances | array | null | Token balances after simulation. Each element uses Token Balances. |
loadedAddresses | object | null | Transaction addresses loaded from address lookup tables, when present. See Loaded Addresses. |
accounts[] fields| Field | Type | Description |
|---|---|---|
data | [string, encoding] | object | Account data. Binary forms depend on accounts.encoding. When accounts.encoding is jsonParsed, this field is {program, parsed, space}; if no parser is available, the RPC node falls back to [data, "base64"]. |
executable | bool | Whether the account contains a program and is therefore read-only. |
lamports | u64 | Lamports assigned to the account. |
owner | string | Program owner pubkey, as a base-58 encoded string. |
rentEpoch | u64 | Next epoch at which the account owes rent. |
space | u64 | null | Account data size in bytes. This may be null if the selected encoding omits it. |
accounts[].data is returned as an object, it contains:| Field | Type | Description |
|---|---|---|
program | string | Name of the parser that produced the decoded account data. |
parsed | object | Parser-specific JSON payload. Its structure depends on the owning program and account type. |
space | u64 | Account data size in bytes. |
err object form| Field | Type | Description |
|---|---|---|
<variantName> | array | object | string | null | Transaction error variant payload. Most variants serialize as strings. InstructionError serializes as [instructionIndex, instructionError]. |
innerInstructions[] fields| Field | Type | Description |
|---|---|---|
index | u8 | Zero-based index of the top-level instruction that produced these inner instructions. |
instructions | array | Inner instructions emitted while processing that top-level instruction. |
innerInstructions[].instructions[] compiled form fields (when
innerInstructionsEncoding is json)| Field | Type | Description |
|---|---|---|
programIdIndex | u8 | Index into the transaction’s account keys for the invoked program. |
accounts | array | Account indexes referenced by the instruction. |
data | string | Instruction data, base-58 encoded. |
stackHeight | u32 | null | Invocation stack height, when reported. |
innerInstructions[].instructions[] parsed form fields| Field | Type | Description |
|---|---|---|
program | string | Parser name that decoded the instruction. |
programId | string | Invoked program pubkey, as a base-58 encoded string. |
parsed | object | Program-specific parsed instruction payload. The exact schema depends on the program. |
stackHeight | u32 | null | Invocation stack height, when reported. |
innerInstructions[].instructions[] partially decoded form fields| Field | Type | Description |
|---|---|---|
programId | string | Invoked program pubkey, as a base-58 encoded string. |
accounts | array | Account addresses referenced by the instruction, in order. |
data | string | Instruction data, base-58 encoded. |
stackHeight | u32 | null | Invocation stack height, when reported. |
replacementBlockhash fields| Field | Type | Description |
|---|---|---|
blockhash | string | Blockhash used during simulation, as a base-58 encoded string. |
lastValidBlockHeight | u64 | Last block height at which that blockhash remains valid. |
returnData fields| Field | Type | Description |
|---|---|---|
programId | string | Program that generated the return data, as a base-58 encoded Pubkey. |
data | [string, encoding] | Return data payload and encoding. This field uses base-64 data with "base64" encoding. |
token balance fields| Field | Type | Description |
|---|---|---|
accountIndex | u8 | Index into the transaction account list for the token account whose balance is reported. |
mint | string | Token mint pubkey, as a base-58 encoded string. |
uiTokenAmount | object | Token amount object with raw and decimal-scaled representations. |
owner | string | Token account owner pubkey, when the validator recorded it. This field may be omitted. |
programId | string | SPL Token program pubkey for this account, when the validator recorded it. This field may be omitted. |
token balance.uiTokenAmount fields| Field | Type | Description |
|---|---|---|
uiAmount | number | null | Decimal-scaled amount as a floating-point number. Deprecated in favor of uiAmountString. |
decimals | u8 | Number of decimal places configured on the mint. |
amount | string | Raw token amount, as a base-10 integer string. |
uiAmountString | string | Decimal-scaled amount as a string. |
loadedAddresses fields| Field | Type | Description |
|---|---|---|
writable | array | Ordered list of writable loaded-account addresses, as base-58 encoded strings. |
readonly | array | Ordered list of readonly loaded-account addresses, as base-58 encoded strings. |
Example Result
- The
Parsedexample shows the simulation result for a transaction that creates an associated token account. - The
Partially Decodedexample shows the simulation result for a transaction with a CPI (innerInstructions) that can’t be parsed. Accounts are returned as base-58 encoded addresses, not indexes.
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "4.3.2",
"slot": 1282
},
"value": {
"accounts": null,
"err": null,
"fee": 5000,
"innerInstructions": [
{
"index": 0,
"instructions": [
{
"parsed": {
"info": {
"extensionTypes": ["immutableOwner"],
"mint": "AH2uKiJxRXuQbUZQpCoyeujLLKNHvUATXxBVEBWMof92"
},
"type": "getAccountDataSize"
},
"program": "spl-token",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"stackHeight": 2
},
{
"parsed": {
"info": {
"lamports": 2039280,
"newAccount": "Bgig53phxYuoiB2mveeBYGs9WpQPoUCJfDBGwpgWnkP",
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"source": "23g1K6sr2bevNwLYPoB79jzEQtErioYQ8mpUa76xA6yu",
"space": 165
},
"type": "createAccount"
},
"program": "system",
"programId": "11111111111111111111111111111111",
"stackHeight": 2
},
{
"parsed": {
"info": {
"account": "Bgig53phxYuoiB2mveeBYGs9WpQPoUCJfDBGwpgWnkP"
},
"type": "initializeImmutableOwner"
},
"program": "spl-token",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"stackHeight": 2
},
{
"parsed": {
"info": {
"account": "Bgig53phxYuoiB2mveeBYGs9WpQPoUCJfDBGwpgWnkP",
"mint": "AH2uKiJxRXuQbUZQpCoyeujLLKNHvUATXxBVEBWMof92",
"owner": "23g1K6sr2bevNwLYPoB79jzEQtErioYQ8mpUa76xA6yu"
},
"type": "initializeAccount3"
},
"program": "spl-token",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"stackHeight": 2
}
]
}
],
"loadedAccountsDataSize": 238800,
"loadedAddresses": {
"readonly": [],
"writable": []
},
"logs": [
"Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [1]",
"Program log: Create",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]",
"Program log: Instruction: GetAccountDataSize",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1595 of 193103 compute units",
"Program return: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA pQAAAAAAAAA=",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
"Program 11111111111111111111111111111111 invoke [2]",
"Program 11111111111111111111111111111111 success",
"Program log: Initialize the associated token account",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]",
"Program log: Instruction: InitializeImmutableOwner",
"Program log: Please upgrade to SPL Token 2022 for immutable owner support",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1405 of 186490 compute units",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]",
"Program log: Instruction: InitializeAccount3",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4214 of 182608 compute units",
"Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
"Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 21889 of 200000 compute units",
"Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success"
],
"postBalances": [996484120, 2039280, 1, 1461600, 731913600, 929020800],
"postTokenBalances": [
{
"accountIndex": 1,
"mint": "AH2uKiJxRXuQbUZQpCoyeujLLKNHvUATXxBVEBWMof92",
"owner": "23g1K6sr2bevNwLYPoB79jzEQtErioYQ8mpUa76xA6yu",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"uiTokenAmount": {
"amount": "0",
"decimals": 2,
"uiAmount": 0.0,
"uiAmountString": "0"
}
}
],
"preBalances": [998528400, 0, 1, 1461600, 731913600, 929020800],
"preTokenBalances": [],
"replacementBlockhash": {
"blockhash": "3ojhhRUVJAfsFhaJ3ka7cmwmAHQizYWvDtykiSVVnnET",
"lastValidBlockHeight": 1432
},
"returnData": null,
"unitsConsumed": 21889
}
},
"id": 1
}
{
"jsonrpc": "2.0",
"result": {
"context": {
"apiVersion": "4.3.2",
"slot": 1
},
"value": {
"accounts": [],
"err": null,
"fee": 5000,
"innerInstructions": [
{
"index": 0,
"instructions": [
{
"accounts": [
"CcmSqTwD2WYXBPdhgnsQNekvdz2vxdTnWrf5CdBP39UT",
"8vpJSGjxj6BND37FqkCJgrHE75zd6QgQ4LzM4h6jsJam",
"9kCz3JnmSXCr2wYTsLNtgG7HyULoL5qfyr6doA6tB2SQ"
],
"data": "8rzLfWGsaE6zkTU3f94HPD",
"programId": "FXCiN987MbLSkuHtTG6pSYjgNHQQJFwsKkRmNpB7YaYE",
"stackHeight": 2
}
]
}
],
"loadedAccountsDataSize": 366738,
"loadedAddresses": {
"readonly": [],
"writable": []
},
"logs": [
"Program GiBw3Ed2rnEtiM7AjtkS6jb9D6vvGvQ8pztVfvTRFX43 invoke [1]",
"Program log: Instruction: Initialize",
"Program FXCiN987MbLSkuHtTG6pSYjgNHQQJFwsKkRmNpB7YaYE invoke [2]",
"Program log: Instruction: CpiInstruction",
"Program log: Data: 1",
"Program FXCiN987MbLSkuHtTG6pSYjgNHQQJFwsKkRmNpB7YaYE consumed 1572 of 196283 compute units",
"Program FXCiN987MbLSkuHtTG6pSYjgNHQQJFwsKkRmNpB7YaYE success",
"Program GiBw3Ed2rnEtiM7AjtkS6jb9D6vvGvQ8pztVfvTRFX43 consumed 5560 of 200000 compute units",
"Program GiBw3Ed2rnEtiM7AjtkS6jb9D6vvGvQ8pztVfvTRFX43 success"
],
"postBalances": [499999999999995000, 0, 0, 0, 1141440, 1141440],
"postTokenBalances": [],
"preBalances": [500000000000000000, 0, 0, 0, 1141440, 1141440],
"preTokenBalances": [],
"replacementBlockhash": null,
"returnData": null,
"unitsConsumed": 5560
}
},
"id": 1
}