get Program Accounts V2
Page through a program's accounts in fixed-size chunks using a cursor, instead of one unbounded response.
getProgramAccountsV2 takes the same filters as getProgramAccounts and adds limit, paginationKey and changedSinceSlot, paging through the account set instead of returning it all at once. Pages hold up to 10,000 accounts, 1,000 by default.
This constant-k method is modeled on Helius' getProgramAccountsV2 and is available on Blade Runner and Nexus. The first call omits paginationKey; each subsequent call passes back the previous page's paginationKey, until the response returns null.
Parameters
params is a JSON array, with values in this order: programId, config.
Base58-encoded public key of the program whose accounts to list.
Filtering, encoding, and pagination settings.
Show propertiesProperties
Format for each account's data. jsonParsed falls back to base64 when no program-specific parser is available.
base58base64base64+zstdjsonParsedHow settled the account/transaction state must be before the node acts on it. processed is fastest and can roll back; finalized is slowest and never rolls back.
processedconfirmedfinalizedMinimum slot the node must have reached before evaluating the request.
0Wrap the result as {context: {slot, apiVersion}, value: {accounts, paginationKey}} instead of returning {accounts, paginationKey} directly.
Return only a byte range of each account's data instead of the whole thing. Not compatible with jsonParsed.
Show propertiesProperties
Byte offset.
0Number of bytes.
0Server-side filters; an account must match all of them to be included. Same shape as getProgramAccounts.
Show one ofOne of
Show propertiesProperties
Required exact size of the account's data, in bytes.
0Show propertiesProperties
Compare bytes at a fixed offset within the account's data.
Show propertiesProperties
Byte offset.
0Encoded bytes to compare against.
Encoding used for bytes (base58 by default).
base58base64Maximum accounts to return in this page, from 1 to 10,000. Optional: leave it out and the page holds up to 1,000 accounts.
1Maximum: 10000Cursor for the next page: the base58 account public key returned as paginationKey by the previous call. Omit it on the first call; stop paginating once the response's paginationKey is null.
Return only accounts modified at or after this slot. Use it to poll for changes instead of re-reading the whole account set.
0Result
A page of matching accounts plus the cursor for the next page (or null on the last page).
Show one ofOne of
Default shape, used when withContext is false or omitted.
Show propertiesProperties
The page of matching accounts.
Show each itemEach item
Base58 public key of the account.
The account's on-chain state.
Show propertiesProperties
Account balance, in lamports.
Base58 address of the program (or, for a token account, the wallet) that owns this account.
Account data.
Whether this account is a program.
Legacy rent-exemption epoch; not meaningful for accounts created after rent-exempt minimums became mandatory.
Size of the account's data, in bytes.
Base58 public key of the last account in this page. Passing it back as paginationKey fetches the next page; it is null on the last page, the only end-of-results signal.
Shape used when withContext is true.
Show propertiesProperties
Response context, including the slot the data was read at.
Show propertiesProperties
Slot number this applies to.
RPC node software version that produced this response.
The requested data; see the fields below.
Show propertiesProperties
The page of matching accounts.
Cursor for the next page; null once there are no more pages.
Notes
- Available on Blade Runner at 25 requests per second and on Nexus at 75 per second. Free and Operator keys get HTTP
403withgetProgramAccountsV2 requires higher tier. - A page can come back with fewer accounts than
limit, or zero, without that meaning the end; only anullpaginationKeysignals the end, which the last page always carries. - Program scans follow
getProgramAccountsrules: at least one selective filter (memcmpordataSize), token-program scans owner-scoped viadataSize: 165plus amemcmpof the 32-byte owner at offset 32. - Twelve hot programs are answered from a purpose-built in-memory index rather than an account scan: a fraction of a second, no scan-results cap, and no filter required. Every other program is scanned on disk, where the filter requirement and scan limits above apply.
| Program | Program ID |
|---|---|
| Address Lookup Table | AddressLookupTab1e1111111111111111111111111 |
| Raydium AMM V4 | 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 |
| Raydium CPMM | CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C |
| Raydium CLMM | CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK |
| Orca Whirlpool | whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc |
| Meteora DLMM | LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo |
| Meteora DAMM V2 | cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG |
| Meteora DBC | dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN |
| Pump.fun | 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P |
| PumpSwap | pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA |
| Serum V3 | 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin |
| Drift V2 | dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH |