- Crate:
helius(crates.io) - Version: 1.x (uses
solana-client3.0,solana-sdk3.0) - Runtime: Async (
tokio1.x) - Rust: 1.85+ (edition 2021)
- HTTP Client:
reqwest - License: MIT
Installation
native-tls. For pure-Rust TLS (useful when OpenSSL is unavailable), use:
Quick Start
Client Constructors
Helius::new — Basic sync client
.await needed. Provides RPC methods, webhooks, Enhanced Transactions, smart transactions, and Wallet API. No async Solana client or WebSocket support.
Helius::new_async — Full-featured async client
.await because it establishes a WebSocket connection.
Helius::new_with_url — Custom RPC endpoint
HeliusBuilder — Advanced configuration
HeliusFactory — Multi-cluster
Accessing embedded Solana clients
Recommendations for Agents
Use get_transactions_for_address instead of two-step lookup
get_transactions_for_address combines signature lookup and transaction fetching into a single call with server-side filtering.
Use send_smart_transaction for standard sends
It automatically simulates, estimates compute units, fetches priority fees, and confirms. Do not manually build ComputeBudget instructions — the SDK adds them automatically.
Use Helius Sender for ultra-low latency
For time-sensitive transactions (arbitrage, sniping, liquidations), usesend_smart_transaction_with_sender. It routes through Helius’s multi-region infrastructure and Jito.
Use get_asset_batch for multiple assets
When fetching more than one asset, batch them. Do not call get_asset in a loop.
Use webhooks instead of polling
Do not pollget_transactions_for_address in a loop. Use webhooks for server-to-server notifications.
Pagination
Token/Cursor-Based (RPC V2 Methods)
Page-Based (DAS API)
token_accounts Filter
When querying get_transactions_for_address, the token_accounts filter controls whether token account activity is included:
| Value | Behavior | Use When |
|---|---|---|
None | Only transactions directly involving the address | You only care about SOL transfers and program calls |
BalanceChanged | Also includes token transactions that changed a balance | Recommended for most agents — shows token sends/receives without noise |
All | Includes all token account transactions | You need complete token activity (can return many results) |
changed_since_slot — Incremental Account Fetching
changed_since_slot returns only accounts modified after a given slot. Useful for syncing or indexing workflows. Supported by get_program_accounts_v2, get_token_accounts_by_owner_v2, get_account_info, get_multiple_accounts, get_program_accounts, and get_token_accounts_by_owner.
Common Mistakes
-
transaction_details: Some(TransactionDetails::Full)is not the default — By default,get_transactions_for_addressreturns signatures only. SetTransactionDetails::Fullto get full transaction data. -
Do not add ComputeBudget instructions with
send_smart_transaction— The SDK adds them automatically. Adding your own causes aHeliusError::InvalidInputerror. -
Priority fees are in microlamports per compute unit — Not lamports. Values from
get_priority_fee_estimateare already in the correct unit. -
DAS pagination is 1-indexed —
page: 1is the first page, notpage: 0. -
async_connection()requiresnew_asyncorHeliusBuilder— Callinghelius.async_connection()on a client created withHelius::new()returnsErr(HeliusError::ClientNotInitialized). -
get_assetreturnsOption<Asset>— A successful response may still beNoneif the asset doesn’t exist. Handle theOptionexplicitly. -
Sender tips are mandatory —
send_smart_transaction_with_senderautomatically determines and appends tips. Minimum 0.0002 SOL (Dual mode) or 0.000005 SOL (SWQOS-only). -
TLS feature flags — The crate defaults to
native-tls. Usefeatures = ["rustls"](anddefault-features = false) for pure-Rust TLS when OpenSSL is unavailable.
Error Handling and Retries
The SDK provides typed error variants via theHeliusError enum, so you can match on them directly:
Retry strategy
Retry onRateLimitExceeded and InternalError with exponential backoff:
| Error Variant | HTTP Status | Action |
|---|---|---|
Unauthorized | 401 | Check API key |
RateLimitExceeded | 429 | Back off and retry |
InternalError | 5xx | Retry with exponential backoff |
BadRequest | 400 | Fix request parameters |
NotFound | 404 | Check resource exists |
Timeout | — | Increase timeout or retry |