simulateTransaction - Solana

simulateTransaction. Simulates the execution of a transaction without submitting it to the network

simulateTransaction - solana [Value: 11CU]
Simulates the execution of a transaction without submitting it to the network
Use cases

Use cases

  • Simulate a transaction to verify outcomes before broadcasting
  • Analyze potential transaction errors without actual execution
  • Ensure transaction validity and estimate fees accurately
Constraints

Constraints

  • Requires a valid base64-encoded transaction
  • Simulation results may not match network conditions
  • High request frequency may trigger rate limiting
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --location --request POST 'https://solana.drpc.org' \
--header 'Content-Type: application/json' \
--data-raw '{
    "method": "simulateTransaction",
    "jsonrpc": "2.0",
    "params": [
        "AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMCAgiFt0xk+FyHf76k7/dkz9vjFqSY8vhrizSEx2GWidkQ5ewAKY7OUUt6ZEIryxOHEx1w1mGioe0SGujvGtbbPvaSDCG6EGTb0+Q1B98oAxfD0GiOZwOLQW1IkeOC71yX0NQm+LOK6+h53IwvrgMD9JNZme6u7PeARqlqZzOD4iRLRnyGE+3cPqKW5IiU66yIZZOgOtO4B9TYReBdaWsp+Dx5lyxj0FXRm/6oiIDpU9abZ6qIYeIKRR96fuhXeHpmjwUMJxNk9vhCZs3zhxL/0CZLdm0EbWEwrD4A7KBrPOYP2gbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCph9Yfdu8NCN6d9KtOQeMPovh7jKgKo56yxXQO8eTA6XUBBgcAAgEDBQQH4gMobmZ0X2FjY291bnQ6ICI5enlMTjVDUXd4V3JFUGl0MXNGeTVEWjV4TXFKZk5RVExpcUJWU2Z2UHZXWSIsCiAgICBkYXRhX2FjY291bnQ6ICIzZDhTcG5abnRtR0t0dlVtaHVhazdLU3U2WFQ3QVVNaW51VURtYTVobWlCWCIsCiAgICBjb2luX3NyY19hY2N0OiAiQkI3cGN0UGVWQ1FQalhNR2RrRFg5QURUOTk1Z1hDVkx5SEpVeWdwSlBOMngiLAogICAgY29pbl9kZXN0X2FjY3Q6ICI5UDY4a2J2VzlLelBIc1pURnE0eVFyUlZrWXNmNUNRRmc5aFZoeUJaZHBQMiIsCiAgICB0cmFuc2Zlcl9hdXRob3JpdHk6ICJwTWludFRaNUNFa0hVaGdydXJQZ29pTW50b0xnRndic0tkYnFOclhzcmR5IiwKICAgIGFjdGl2aXR5OiAxLCAKICAgIHBheV9wZXJpb2Q6IDYwNDgwMC4wMDAwMDAsIAogICAgcGF5X3JhdGU6IDguMDAwMDAwLAogICAgdGltZXN0YW1wOiAxNjU1MTg0ODYwLAogICAgbXVsdGlwbGllcjogMS4wLAogICAgbWF4X3BheW91dDogMTYuMDAwMDAwKQ==",
        {
            "encoding": "base64",
            "commitment": "recent",
            "sigVerify": false,
            "accounts": {
                "addresses": [
                    "9zyLN5CQwxWrEPit1sFy5DZ5xMqJfNQTLiqBVSfvPvWY",
                    "GtFMtrW31RdCeSdW4ot3jNVuoLtFywJGGTiF1Q8Uopky",
                    "pMintTZ5CEkHUhgrurPgoiMntoLgFwbsKdbqNrXsrdy",
                    "3d8SpnZntmGKtvUmhuak7KSu6XT7AUMinuUDma5hmiBX",
                    "9P68kbvW9KzPHsZTFq4yQrRVkYsf5CQFg9hVhyBZdpP2",
                    "BB7pctPeVCQPjXMGdkDX9ADT995gXCVLyHJUygpJPN2x",
                    "pSTAkE7Z2guBmSheg6tHdHk3rT1wmF1Mfuf52tnWeAd",
                    "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
                ]
            }
        }
    ],
    "id": "ea57afc0-7db8-4aa3-8ddb-a28c6099153c"
}'
Copy
Response
200
{
    "jsonrpc": "2.0",
    "result": {
        "context": {
            "slot": 137569919
        },
        "value": {
            "accounts": [
                null,
                null,
                null,
                null,
                null,
                null,
                null,
                null
            ],
            "err": "BlockhashNotFound",
            "logs": [],
            "unitsConsumed": 0
        }
    },
    "id": "ea57afc0-7db8-4aa3-8ddb-a28c6099153c"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray
array
transactionstring
The transaction as an encoded string. It must have a valid blockhash but does not need to be signed.
configobject
Configuration options for the simulation
array
sigVerifyboolean
If true, the transaction signatures will be verified (default: false). This conflicts with replaceRecentBlockhash.
commitmentstring
Configures the commitment level for queried blocks. Options include "finalized", "confirmed", and "processed".
encodingstring
Encoding used for the transaction data. Options are "base58" (slow, DEPRECATED) or "base64" (default: "base58").
replaceRecentBlockhashboolean
If true, replaces the transaction's recent blockhash with the most recent one (default: false). This conflicts with sigVerify.
accountsobject
Configuration object for accounts
array
encodingstring
Data encoding for each returned transaction. Options include "base64" (default), "base64+zstd", or "jsonParsed".
addressesarray_of_strings
An array of accounts to return.
minContextSlotinteger
The minimum slot at which the request can be evaluated

Response

200
The simulation result, including details such as the status, logs, and any errors encountered during the simulation

Response params

object
idinteger
jsonrpcstring
resultstring
object
errorobject
Contains error information if the transaction failed, or null if the transaction succeeded.
logsarray
Array of log messages generated by transaction instructions during execution. Null if the simulation failed before execution (e.g., due to an invalid blockhash or signature verification failure).
accountsobject
Contains error information if the transaction failed, or null if the transaction succeeded.
object
lamportsint64
The number of lamports (smallest unit of SOL) assigned to this account.
ownerstring
Base-58 encoded public key of the program assigned to this account
datastring
Data associated with the account, either as encoded binary data or in JSON format, depending on the specified encoding. Format: [data, encoding] or JSON object
executablestring
dicates if the account contains a program and is read-only.
rentEpochstring
The epoch at which this account will next owe rent.
unitsConsumedinteger
Indicates the total compute budget units utilized during the execution of the transaction.
innerInstructionsarray
A collection of inner instructions executed within the transaction.
returnDataobject
The latest return data produced by an instruction in the transaction, including
object
programIdstring
The public key of the program that generated the return data, encoded in base-58.
dataarray
A collection of inner instructions executed within the transaction.