Read Solana account balances and owners in one RPC request
A balance monitor also needs to know which program owns each account. One getMultipleAccounts call returns both fields for up to 100 addresses, with a shared context slot.
Request only the fields you consume
Send this JSON by HTTP POST. The System Program and Vote Program make a reproducible pair of addresses. A zero-length dataSlice keeps account metadata while omitting the contents of each account’s data buffer.
{"jsonrpc":"2.0","id":1,"method":"getMultipleAccounts","params":[["11111111111111111111111111111111","Vote111111111111111111111111111111111111111"],{"commitment":"finalized","encoding":"base64","dataSlice":{"offset":0,"length":0}}]}
Pair the first address with result.value[0], the second with result.value[1]. For each populated element, save lamports, owner and result.context.slot. owner is the program responsible for the account’s data. For token accounts, finding the wallet authority requires decoding the token account data separately.
Keep missing accounts aligned
If you request A, B and C and the result has the form [object, null, object], B was absent in this context. Removing nulls before matching addresses would assign C’s balance to B. Preserve the distinction between an absent account and a numeric zero in your storage schema.
Compare batches across slots
A watchlist of 135 addresses takes at least two requests. Store each batch’s actual context slot. On the second request, minContextSlot can enforce a floor equal to the first response’s slot. The node may still answer from a later slot, so an aggregate across both batches can span different states.