Skip to main content
Best practices and recommended patterns for agents using the Helius Rust SDK. For installation and getting started, see the overview.

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), use send_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 poll get_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:

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

  1. transaction_details: Some(TransactionDetails::Full) is not the default — By default, get_transactions_for_address returns signatures only. Set TransactionDetails::Full to get full transaction data.
  2. Do not add ComputeBudget instructions with send_smart_transaction — The SDK adds them automatically. Adding your own causes a HeliusError::InvalidInput error.
  3. Priority fees are in microlamports per compute unit — Not lamports. Values from get_priority_fee_estimate are already in the correct unit.
  4. DAS pagination is 1-indexedpage: 1 is the first page, not page: 0.
  5. async_connection() requires new_async or HeliusBuilder — Calling helius.async_connection() on a client created with Helius::new() returns Err(HeliusError::ClientNotInitialized).
  6. get_asset returns Option<Asset> — A successful response may still be None if the asset doesn’t exist. Handle the Option explicitly.
  7. Sender tips are mandatorysend_smart_transaction_with_sender automatically determines and appends tips. Minimum 0.0002 SOL (Dual mode) or 0.000005 SOL (SWQOS-only).
  8. TLS feature flags — The crate defaults to native-tls. Use features = ["rustls"] (and default-features = false) for pure-Rust TLS when OpenSSL is unavailable.

Error Handling and Retries

The SDK provides typed error variants via the HeliusError enum, so you can match on them directly:

Retry strategy

Retry on RateLimitExceeded and InternalError with exponential backoff: