Quick Start
Transaction Optimization
Optimize compute units, priority fees, and transaction sending
Data Retrieval
Efficient patterns for fetching account and program data
Real-time Monitoring
WebSocket subscriptions and streaming data optimization
Best Practices
Performance guidelines and resource management
Transaction Optimization
Compute Unit Management
1. Simulate to determine actual usage:Priority Fee Optimization
1. Get dynamic fee estimates:Transaction Sending Best Practices
- Standard Approach
- With Confirmation
Data Retrieval Optimization
Enhanced Pagination Methods (V2)
For large-scale data queries, use the new V2 methods with cursor-based pagination:⚡ Performance Boost
getProgramAccountsV2 and getTokenAccountsByOwnerV2 provide significant performance improvements for applications dealing with large datasets:- Configurable limits: 1-10,000 accounts per request
- Cursor-based pagination: Prevents timeouts on large queries
- Incremental updates: Use
changedSinceSlotfor real-time synchronization - Better memory usage: Stream data instead of loading everything at once
Data Retrieval Optimization
Efficient Account Queries
- Single Account
- Multiple Accounts
- Program Accounts
Token Balance Lookups
Transaction History
Real-time Monitoring
Account Subscriptions
Program Account Monitoring
Transaction Monitoring
Advanced Patterns
Smart Retry Logic
Memory-Efficient Processing
Connection Pooling
Performance Monitoring
Track RPC Usage
Best Practices
Commitment Levels
- processed
- confirmed
- finalized
- Use for: WebSocket subscriptions, real-time updates
- Latency: ~400ms
- Reliability: Good for most applications
Resource Management
Error Handling
Common Pitfalls to Avoid
Related Methods
The optimization techniques in this guide reference the following WebSocket and RPC methods:getSignaturesForAddress
Get transaction signatures for an address
getTransaction
Retrieve full transaction details by signature
getProgramAccounts
Fetch all accounts owned by a program
getTokenAccountsByOwner
Get token accounts for a wallet
getMultipleAccountsInfo
Batch fetch multiple account details
getAccountInfo
Get information about a single account
accountSubscribe
Subscribe to account changes via WebSocket
programSubscribe
Subscribe to program account changes via WebSocket
logsSubscribe
Subscribe to transaction logs via WebSocket
Summary
By implementing these optimization techniques, you can achieve:- 60-90% reduction in API call volume
- Significantly lower latency for real-time operations
- Reduced bandwidth usage through targeted queries
- Better error resilience with smart retry logic
- Lower operational costs through efficient resource usage
Next Steps
Ready to implement these optimizations? Check out our Transaction Optimization Guide for transaction-specific best practices.