Optimization Best Practices
A condensed summary of the 25 most important transaction optimization practices drawn from every page in this section.
Search across all documentation pages
A condensed summary of the 25 most important transaction optimization practices drawn from every page in this section.
Simulate every mainnet template: Read unitsConsumed and errors before send (Estimating Compute Units).
Set compute unit limit with headroom: 110% of simulated CU minimum.
Compute budget instructions first: set_compute_unit_limit and set_compute_unit_price precede program ixs (Transaction Assembly).
Dynamic priority fees on mainnet: Target p75-p90 with hard cap (Setting Priority Fees).
Refresh fees per send batch: Stale samples underprice during spikes.
Track signature status: sendTransaction success is not landing (Why Transactions Fail to Land).
Use WebSocket confirmation: signatureNotifications beats tight polling loops.
Retry with fresh blockhash: Re-sign after expiry; do not infinite rebroadcast stale txs (Retries & Blockhash Management).
Respect lastValidBlockHeight: Stop rebroadcasting dead signatures.
Use v0 + ALTs for large metas: Legacy size failures are silent drops (Address Lookup Tables in Practice).
Wait ALT activation slot: After extend before compiling v0 message.
Idempotent ATA creates in same tx: Reduces multi-transaction partial failure.
Provider RPC for sends: Public RPC drops packets under load.
skipPreflight false by default: Catch errors before burning user trust.
Cap maximum priority fee: Protect users from fee spikes.
Show all-in fee estimate: Base + priority + (optional) Jito tip in UI.
Jito bundles for competitive mints: Atomicity + tip when native path fails SLO (Jito Bundles).
Simulate bundles before send: Reduce failed bundle submission rate.
Do not retry landed failures: Fix program/account issue first.
Idempotent on-chain effects: Retries safer when blockhash changes.
Profile CU in LiteSVM/local validator: Catch regressions before mainnet.
Surfpool simulate DeFi paths: Mainnet-fork accuracy for complex routes.
Monitor landing rate SLO: Alert when confirmation p95 degrades.
Document landing playbook: Incident runbook for mint day congestion.
Devnet does not prove mainnet landing: Validate policy with dust mainnet probes.
Simulate CU + dynamic priority fee + confirmed subscription + blockhash retry with cap.
Never mandatory - adopt when native path misses SLO during peak events.
getRecentPrioritizationFees and simulateTransaction are RPC concerns - see RPC Best Practices.
Stack versions: This page was written for Agave 4.1.1, Solana CLI 3.0.10, Anchor 0.32.1, anchor-lang 0.32.1, Rust 1.91.1, @solana/kit 7.0.0, Surfpool 0.12.0, and LiteSVM 0.6.x.
Reviewed by Chris St. John·Last updated Jul 16, 2026