Documentation Index
Fetch the complete documentation index at: https://docs.orbitflare.com/llms.txt
Use this file to discover all available pages before exploring further.
Parameters
Configuration object containing the following optional fields:
The level of commitment to use:
processed: Latest block (unconfirmed)
confirmed: Confirmed by supermajority
finalized: Finalized by supermajority
Filter results by account type:
circulating: Filter to circulating accounts
nonCirculating: Filter to non-circulating accounts
Response
The slot the request was processed at
Array of objects containing account information:Address of the account (base-58 encoded)
Number of lamports in the account
Code Examples
Basic Request
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getLargestAccounts"
}'
Request with Filter
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getLargestAccounts",
"params": [
{
"filter": "circulating"
}
]
}'
Using web3.js
import { Connection } from '@solana/web3.js';
const connection = new Connection('https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY');
// Get all largest accounts
const largestAccounts = await connection.getLargestAccounts();
console.log('Largest accounts:', largestAccounts);
// Get circulating accounts only
const circulatingAccounts = await connection.getLargestAccounts({
filter: 'circulating'
});
console.log('Largest circulating accounts:', circulatingAccounts);
Notes
- Returns the top 20 accounts by lamport balance
- Results are sorted in descending order by balance
- Circulating accounts are those not owned by the system program
- Non-circulating accounts are typically owned by the system program
- The response is immediate as it reads from the current state
Best Practices
- Use appropriate commitment level based on your needs:
processed for UI updates
confirmed for most operations
finalized for critical operations
- Use the
filter parameter to focus on relevant accounts
- Convert lamports to SOL by dividing by 1e9 when displaying to users
- Consider caching results for UI updates to reduce RPC load
Common Errors
| Code | Message | Solution |
|---|
| -32602 | Invalid param: Invalid filter | Use either ‘circulating’ or ‘nonCirculating’ |
| -32601 | Method not found | Verify you’re connected to a Solana RPC node |
| -32007 | Account information unavailable | Node may be bootstrapping or syncing |
Use Cases
-
Network Analysis
async function analyzeNetworkDistribution() {
const accounts = await connection.getLargestAccounts();
const total = accounts.reduce((sum, acc) => sum + acc.lamports, 0);
const top20Percentage = accounts.reduce((sum, acc) => sum + acc.lamports, 0) / total;
console.log(`Top 20 accounts hold ${top20Percentage * 100}% of total SOL`);
}
-
Token Distribution Monitoring
async function monitorTokenDistribution() {
const circulating = await connection.getLargestAccounts({ filter: 'circulating' });
const nonCirculating = await connection.getLargestAccounts({ filter: 'nonCirculating' });
const circulatingTotal = circulating.reduce((sum, acc) => sum + acc.lamports, 0);
const nonCirculatingTotal = nonCirculating.reduce((sum, acc) => sum + acc.lamports, 0);
console.log('Circulating supply:', circulatingTotal / 1e9, 'SOL');
console.log('Non-circulating supply:', nonCirculatingTotal / 1e9, 'SOL');
}
-
Whale Watching
interface WhaleAlert {
address: string;
balance: number;
change: number;
}
async function trackWhaleMovements(previousAccounts: any[]) {
const currentAccounts = await connection.getLargestAccounts();
const alerts: WhaleAlert[] = [];
for (const current of currentAccounts) {
const previous = previousAccounts.find(p => p.address === current.address);
if (previous) {
const change = current.lamports - previous.lamports;
if (Math.abs(change) > 1e9) { // Alert on changes > 1 SOL
alerts.push({
address: current.address,
balance: current.lamports / 1e9,
change: change / 1e9
});
}
}
}
return alerts;
}