Smart Transactions
Use Helius Smart Transactions to optimize your Solana transactions for maximum success rate
What are Smart Transactions?
Smart Transactions is a feature from Helius that abstracts away the complexity of optimizing Solana transactions. At its core, Smart Transactions automatically handle blockhash management, compute unit optimization, priority fee calculation, and transaction confirmation status tracking.
Benefits
- Simplified Transaction Flow: Focus on your application logic rather than transaction optimization
- Increased Success Rate: Automatically applies best practices for transaction delivery
- Cost Optimization: Sets appropriate compute unit limits and priority fees
- Automatic Polling: Handles transaction confirmation status checking
How It Works
When you use Smart Transactions, Helius:
- Fetches the latest blockhash
- Builds the initial transaction
- Simulates the transaction to calculate optimal compute units
- Sets the compute unit limit with an appropriate margin
- Sets the recommended priority fee
- Sends the transaction via staked connections (when eligible)
- Polls the transaction status for confirmation
Available SDKs
Node.js SDK
The sendSmartTransaction
method is available in our Helius SDK for Node.js (versions >= 1.3.2). To update to the latest version, run:
Usage example:
Rust SDK
The send_smart_transaction
method is available in our Rust SDK (versions >= 0.1.5). To update to the latest version, run:
Usage example:
Implementation Without SDK
While we recommend using our SDKs for the simplest experience, you can also implement Smart Transactions manually:
Handling Transaction Status
Smart Transactions automatically poll for transaction confirmation. The sendSmartTransaction
method has a timeout period of 60 seconds and checks the transaction status every 5 seconds.
If you’re implementing your own polling logic: