Tech

Transaction Simulation Failed on Solana: How to Fix It

The useful part of a simulation error is the code after the colon. How to decode it, reproduce it outside the wallet, and fix the common causes.

Amir Ali

Founder of Solsmint

10 min read
Share this article𝕏✈
Transaction Simulation Failed on Solana: How to Fix It

Not financial advice. Solsmint publishes educational content about crypto assets. Prices are volatile, and nothing here is a recommendation to buy, sell, or invest. Verify every contract, authority, and fee yourself before you transact.

Last updated: November 26, 2026

“Transaction simulation failed” is not one error. It is a wrapper around a program response, and the useful information is in the line after it. A wallet that says simulation failed has usually run the transaction against the current chain state, received a rejection from a program, and stopped before spending your fee. The fix depends entirely on which program rejected it and why.

This guide decodes the common error strings, shows how to reproduce a simulation outside the wallet, and lists the causes that account for most failures: a missing token account, insufficient rent, a stale blockhash, a slip in price, and a compute limit set too low.

This article is for informational purposes only and is not financial, legal, or investment advice. Not financial advice. DYOR.

Key takeaways

  • Simulation runs your transaction against current state without submitting it. It returns an error, logs and the compute units consumed.
  • The first line names the instruction; the line after it names the program and its error code. Decode that code before changing anything.
  • 0x1 from the system program is usually insufficient lamports for a transfer, a fee or rent.
  • 0x1771 from a swap program is usually a slippage rejection, not a broken route.
  • A simulation that passes is not a guarantee of landing; state can change between simulation and submission.
  • Wallets simulate to protect you, but their warnings are conservative. Read the logs rather than disabling the check.

Anatomy of the error

A typical message looks like this:

Transaction simulation failed: Error processing Instruction 0:
custom program error: 0x1

Three pieces matter. “Instruction 0” tells you which instruction in the transaction failed, counting from zero. “Custom program error” tells you the failure came from a program, not from the runtime. “0x1” is the program’s own error code, in hexadecimal.

If the message instead says “account not found”, “insufficient funds for rent” or “blockhash not found”, the failure is at the runtime level and the fix is different. Decoding starts with identifying which layer rejected the transaction.

The failures you will actually see

MessageWhat it usually meansFirst thing to try
custom program error: 0x1 from the system programNot enough lamports for the transfer, fee or rentAdd SOL to the fee payer and check the rent-exempt minimum
custom program error: 0x1771Swap slippage tolerance exceededRefresh the quote, reduce size, or widen tolerance slightly
Account not foundA required account does not exist, often an associated token accountCreate the token account idempotently before the transfer
Insufficient funds for rentThe new account cannot cover its rent-exempt balanceFund the payer for rent plus fees
Blockhash not foundThe transaction waited too long and its blockhash expiredFetch a fresh blockhash and rebuild
Exceeded maximum number of instructions or computeThe compute limit or transaction size was too smallRaise the compute limit and check instruction count
Owner does not matchThe account is owned by a different program than expectedCheck the program ID and the account derivation

The hex codes are program-specific. Anchor-based programs start their custom errors at 6000, so 0x1770 is the first custom error in the program’s enum, 0x1771 is the second, and so on. Jupiter’s slippage error sits at 6001 in its enum, which is why it appears as 0x1771. A different program can use 6001 for something else entirely, so decode against the right IDL.

Reproduce it outside the wallet

Wallet messages truncate logs. Reproduce the simulation with an RPC call and read the full output.

const simulation = await connection.simulateTransaction(transaction, {
  sigVerify: false,
  replaceRecentBlockhash: true,
  commitment: "confirmed",
})

console.log(simulation.value.err)
console.log(simulation.value.logs?.join("\n"))
console.log(simulation.value.unitsConsumed)

Three settings matter. sigVerify: false lets you simulate a transaction before every signature is in place. replaceRecentBlockhash: true removes the blockhash expiry problem from the test, so a pass means the instruction logic is sound. unitsConsumed gives you the number to use when you set a compute limit.

Read the logs from the bottom up. The last program log before the error is usually the program that rejected the transaction, and the message above it often names the missing account or the failed check.

The missing token account

The most common failure for a new token is a transfer to a wallet that has no associated token account. The token program requires an account to hold the balance, and a plain transfer does not create one.

The fix is to create the account idempotently in the same transaction:

import {
  getAssociatedTokenAddress,
  createAssociatedTokenAccountIdempotentInstruction,
} from "@solana/spl-token"

const ata = await getAssociatedTokenAddress(mint, recipient)
transaction.add(
  createAssociatedTokenAccountIdempotentInstruction(
    payer,
    ata,
    recipient,
    mint,
  ),
)

The idempotent instruction is the right choice because it succeeds whether or not the account already exists. The non-idempotent version fails when the account is present, which turns a retry into a new error.

Remember that the payer funds the rent for a new account, currently around 0.002 SOL. A wallet with just enough SOL for the transfer can fail here, and the error will look like insufficient funds rather than a missing account.

Rent, fees and the real balance

A wallet balance is not the amount available for a transfer. The fee payer needs to cover the base fee, the priority fee, any rent for new accounts and the transfer amount itself. A balance that looks sufficient in the wallet can still fail simulation by a few thousand lamports.

The base fee is 5,000 lamports per signature. The priority fee is the compute limit multiplied by your price, divided by one million. New accounts need a rent-exempt deposit. Add all three before you decide the wallet has enough.

This is also why a transaction can succeed on one attempt and fail on the next. A priority fee set in a hurry, a new account created in between, or a slightly different route can push the total over the balance.

Slippage and price-based failures

Swaps fail simulation because the execution price moved outside the tolerance before the transaction was built. The error is not a bug in the route; it is the protection working. The fix is a fresh quote, a smaller size, or a tolerance that reflects the pair’s liquidity.

The mistake is to raise the tolerance until the simulation passes. That converts a price check into a subsidy for anyone moving the pool, and on a thin token it can turn a failed swap into a very bad fill. Refresh the quote first, and change the tolerance only when you understand why the price moved.

The same logic applies to perps and limit orders. A simulation failure on a leverage adjustment is often a margin check, not a routing problem.

Blockhash and timing

Solana transactions carry a recent blockhash. If the transaction sits in a wallet, a queue or a retry loop for too long, the blockhash expires and the transaction can never land. The error appears as “blockhash not found” or an expiry message.

A fresh blockhash cannot be patched into an already-signed transaction without invalidating the signature. Rebuild the transaction, re-sign and resubmit. Retry loops that reuse the same signed bytes are the usual cause of a transaction that “keeps failing” while the logs show nothing wrong with the instructions.

The practical pattern is to rebuild on every retry, fetch the blockhash immediately before signing, and give the transaction a short window rather than letting it sit.

Compute limits and transaction size

A transaction that exceeds its compute budget fails with a runtime error rather than a program error. The default is 200,000 units per instruction, and the transaction cap is 1.4 million. A complex route with several hops can exceed the budget even when each instruction is valid.

Simulation tells you the units consumed. Add a buffer of 10% to 20%, set the limit, and resubmit. Do not set the limit to the maximum by default: the priority fee is charged on the limit you request, so an inflated limit costs more on every attempt.

Transaction size is a separate limit. A transaction is capped at 1,232 bytes, and accounts, signatures and instruction data all count. A transfer with a large proof, a long list of accounts or several signatures can exceed the cap even when the compute budget is fine.

Why the wallet blocks it

Wallets simulate before signing and warn when the result is a failure. That warning is a service, not a bug. It catches obvious mistakes: a wrong network, a missing account, a token that would be frozen on receipt.

The warning can also be conservative. A transaction that depends on state changing between simulation and submission can simulate as a failure and still be valid a moment later, and a transaction that touches an unusual program can trigger a generic warning. Disabling simulation to force it through removes the protection that would have caught a genuine problem.

A better response is to read the logs. Most wallets expose them behind a details link. If the logs name an error code, decode it. If they do not, reproduce the simulation with an RPC call and read the full output.

A debugging checklist

  1. Identify the layer: runtime error, program error or wallet warning.
  2. Read the instruction index and the program name.
  3. Decode the custom error against the program’s IDL, not against a generic list.
  4. Check the fee payer balance, including fees and rent.
  5. Confirm the associated token account exists or is created idempotently.
  6. Refresh the blockhash and rebuild the transaction.
  7. Compare the compute limit with the simulated consumption.
  8. Re-run the simulation with full logs before changing any instruction.

This order moves from cheap checks to expensive ones. Most failures resolve at step two or three, before anyone edits code.

What to do in production

Simulate before you send, and log the result. A failed simulation is cheaper to handle than a failed transaction, because it costs nothing and produces the same logs.

Add a small compute buffer, retry with a fresh blockhash, and surface the decoded error to the user rather than a generic message. “Slippage exceeded, refresh the quote” is actionable; “transaction failed” is not.

Track error codes over time. A rise in one code is an early signal: a new program version, a change in account layout, or a liquidity shift. That is more useful than a dashboard of success rates, because it tells you what to fix.

What we still don’t know

How closely wallet simulations match the RPC’s simulation is not documented consistently. Different providers run different software versions and different commitment levels, so a transaction can pass in one client and fail in another without either being wrong.

The share of simulation failures caused by state changes between simulation and submission is also unmeasured. It is clearly a real category, and it is hard to separate from ordinary slippage and stale accounts in public data.

And error taxonomies are fragmented. Anchor programs expose structured codes, native programs return their own, and wallets add their own wrappers. A universal decoder does not exist, which is why reading the logs remains the most reliable method.

What is settled is the workflow: reproduce, read the logs, decode the code, fix the cause. A simulation failure is information, not a dead end.

FAQ: Solana transaction simulation failed

What does “transaction simulation failed” mean?

A wallet or RPC ran the transaction against current chain state without submitting it, and a program rejected it. The message after the colon usually names the instruction and the program error code.

What is custom program error 0x1?

From the system program, it usually means insufficient lamports for a transfer, a fee or rent. Check the fee payer balance, the priority fee and the rent-exempt minimum for any new account.

Why does my swap fail with 0x1771?

That code is commonly a slippage rejection from a swap program. The execution price moved outside your tolerance. Refresh the quote and reduce the size before widening the tolerance.

Does a failed simulation cost anything?

No. Simulation does not submit a transaction, so no fee is charged. A transaction that is included in a block and fails on execution does cost the base fee and priority fee.

Why does the simulation pass but the transaction fail?

State changed between simulation and submission: the price moved, an account was closed, or the blockhash expired. Rebuild the transaction with fresh state and a fresh blockhash.

Should I disable simulation in my wallet?

No. The check protects you from transfers that would fail or lose funds. Read the logs and fix the cause instead of bypassing the warning.

How do I get the full error logs?

Call simulateTransaction with sigVerify: false and replaceRecentBlockhash: true, then read err, logs and unitsConsumed. The logs contain the program messages that wallets truncate.

Continue reading

Disclaimer: This article is for information and education only and is not financial, investment, or tax advice. Crypto assets are volatile and you can lose money. Always verify token authorities and contract details yourself before interacting with any asset.

Ready to create your own token?

Launch an SPL token on Solana in minutes. No code, 0.05 SOL total, metadata and authorities handled for you.

Create a token

Amir Ali

Founder of Solsmint | Solana Ecosystem Builder | Crypto & Web3 Enthusiast

Amir Ali is the founder of Solsmint, a Solana-based platform focused on making token launches and on-chain tools more accessible. He writes about Solana, crypto, memecoins, blockchain technology, and the evolving Web3 ecosystem.

Through Solsmint, Amir aims to simplify token creation and liquidity management by building practical, affordable tools for creators, developers, and crypto communities. His work focuses on making blockchain technology easier to use and helping builders turn their ideas into reality.

Follow Amir and explore his work at Solsmint.com.

Last updated: