OpenInfra.sh is now live - Solana infrastructure, included with every server. LEARN MORE HERE >

OpenInfra.shopeninfra.sh

Account updates

Receive a push notification every time a subscribed account is modified — no polling required.

Subscribing to accounts

import Client, { CommitmentLevel } from "@triton-one/yellowstone-grpc"; const client = new Client("grpc.openinfra.sh:10000", undefined, {  "x-token": process.env.OPENINFRA_API_KEY!,}); const stream = await client.subscribe(); // Subscribe to a single accountawait new Promise<void>((resolve, reject) =>  stream.write(    {      accounts: {        marginfi_group: {          account: ["MFv2hWf31Z9kbCa1snEPdcgp7krqKMpCwv4CZKE1FaW"],          owner:   [],          filters: [],        },      },      slots: {},      transactions: {},      blocks: {},      blocksMeta: {},      accountsDataSlice: [],      commitment: CommitmentLevel.CONFIRMED,    },    (err) => (err ? reject(err) : resolve())  )); stream.on("data", (data) => {  if (!data.account) return;  const { account, slot } = data.account;  console.log(`slot ${slot} — lamports: ${account.lamports}`);  // account.data is a Uint8Array of the raw account bytes});

Data slices

If you only need part of the account (e.g. a discriminator, a price field at a known offset), use accountsDataSlice to limit the bytes transferred:

// Request only bytes 0–7 (Anchor discriminator)stream.write({  accounts: {    discriminator_only: {      account: ["YourAccountAddress"],      owner: [],      filters: [],    },  },  accountsDataSlice: [{ offset: 0, length: 8 }],  // ...}, callback);

Slices apply globally to all account subscriptions in the request. Multiple slices are concatenated in the response.

What triggers an update?

An update is pushed when the account's lamports, data, owner, or executable flag changes within a confirmed slot. Accounts that receive SOL through vote rewards or inflation also trigger updates.