Skip to main content
Bookie simulates every transaction before presenting it for approval, preventing failures and unexpected outcomes.

How Simulation Works

Before you see a transaction in your wallet, Bookie runs it through Solana’s simulation engine:
1

Build Transaction

Construct transaction with all instructions and accounts
2

Simulate Execution

Run transaction against current blockchain state
3

Analyze Results

Check for errors, compute usage, and balance changes
4

Present to User

Only show transaction if simulation succeeds

What Simulation Catches

Insufficient Balance

Not enough tokens or SOL for transaction

Slippage Exceeded

Price moved beyond acceptable range

Account Errors

Missing or invalid token accounts

Program Failures

Smart contract execution errors

Simulation API

Bookie uses Solana’s simulateTransaction RPC method:

Simulation Response

A successful simulation returns:

Error Types

Common simulation errors and their meanings:

Insufficient Funds

Cause: Not enough SOL or tokens in wallet Solution: Add funds before retrying

Slippage Tolerance Exceeded

Cause: Price moved more than allowed slippage Solution: Increase slippage or wait for better price

Account Not Found

Cause: Token account doesn’t exist Solution: Bookie automatically creates account (adds ~0.002 SOL to cost)

Blockhash Expired

Cause: Transaction took too long to build Solution: Bookie automatically rebuilds with fresh blockhash

Compute Budget Optimization

Simulation reveals exact compute units needed:
Benefits:
  • Prevents out-of-compute errors
  • Optimizes transaction fees
  • Improves success rate

Balance Change Preview

Simulation shows expected balance changes: Before Simulation:
  • SOL: 10.5
  • USDC: 100
Simulated Swap: 1 SOL → USDC After Simulation:
  • SOL: 9.499995 (1 SOL + 0.000005 fee)
  • USDC: 250.43 (received from swap)
Actual execution may differ slightly from simulation due to price movements between simulation and execution.

Simulation Limitations

Simulation cannot predict:
  • Price Changes: Market moves between simulation and execution
  • Network Congestion: Transaction may fail due to congestion
  • MEV Attacks: Sandwich attacks happen after simulation
  • Concurrent Transactions: Other transactions affecting same accounts
Simulation success does not guarantee execution success. Always monitor transactions after submission.

Performance

Advanced Features

Preflight Commitment

Bookie uses confirmed commitment for simulation:
Options:
  • processed: Fastest, least reliable
  • confirmed: Balanced (default)
  • finalized: Slowest, most reliable

Signature Verification

Disabled during simulation for speed:
Signatures are verified during actual execution.

Debugging Failed Simulations

If simulation fails, Bookie provides detailed logs:
Use these logs to understand why a transaction would fail.

Solana RPC Methods

Learn more about simulateTransaction RPC method