Bookie simulates every transaction before presenting it for approval, preventing failures and unexpected outcomes.Documentation Index
Fetch the complete documentation index at: https://docs.pixiedefi.space/llms.txt
Use this file to discover all available pages before exploring further.
How Simulation Works
Before you see a transaction in your wallet, Bookie runs it through Solana’s simulation engine: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’ssimulateTransaction RPC method:
Simulation Response
A successful simulation returns:| Field | Description |
|---|---|
err | Error object (null if successful) |
logs | Program execution logs |
unitsConsumed | Compute units used |
accounts | Post-transaction account states |
Error Types
Common simulation errors and their meanings:Insufficient Funds
Slippage Tolerance Exceeded
Account Not Found
Blockhash Expired
Compute Budget Optimization
Simulation reveals exact compute units needed:- 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
- 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
Performance
| Metric | Value |
|---|---|
| Simulation Time (p50) | 12ms |
| Simulation Time (p99) | 28ms |
| Success Rate | 99.7% |
| False Positives | 0.3% |
Advanced Features
Preflight Commitment
Bookie usesconfirmed commitment for simulation:
processed: Fastest, least reliableconfirmed: Balanced (default)finalized: Slowest, most reliable
Signature Verification
Disabled during simulation for speed:Debugging Failed Simulations
If simulation fails, Bookie provides detailed logs:Solana RPC Methods
Learn more about simulateTransaction RPC method