---
id: HS0101
title: "Post-confirmation account read"
url: https://carbium.sh/library/howsolana/post-confirmation-account-read
collection: How to use Solana
category: Confirmation and retries
revision: 1
updated: 2026-11-23
author: Carbium
code: MIT (LICENSE in the zip); text: all rights reserved, Carbium Corporation
---

# Post-confirmation account read

One TypeScript file waits for a signature to reach confirmed, takes the slot the status reports, and reads the account with minContextSlot set to that slot, so a lagging node answers with an error you can retry and never with a false null.

## Why the account reads as missing

A confirmation and an account read are two separate requests. The first asks whether a signature reached a commitment level. The second asks what an address holds. Nothing in the second request says which slot it must reflect, so a node that has not yet processed the slot holding your `createAccount` answers `getAccountInfo` with `null`. That null looks like proof that the account was never created.

Four causes produce it, and they stack.

- The status and the read use different commitment levels. A confirmation at `finalized` followed by a read at `processed` is safe, but the reverse order is not.
- The read lands on a node that is a slot or two behind the one that reported the status.
- The transaction landed and failed. The signature reports a status with `err` set, the account was never created, and a client that only checks for a status treats it as success.
- The address is wrong, for example the funding wallet instead of the new account.

The first two share one cure: take the slot from the status and refuse any read that is older than it. The third needs a look at `err` in the status, which the file prints on its first line. The fourth needs a second look at the address you pass, since the file reads exactly that one.

## The code

Install `@solana/kit` at 8.6.0, export `CARBIUM_KEY` and run the file with Node 24. With no arguments it finds a recent signature that mentions the USDC mint and reads the mint account. With two arguments it takes your own signature and the account that transaction created.

`main.ts` (run: `node main.ts [signature account]`)

```ts
// HS0101 · Post-confirmation account read
// https://carbium.sh/library/howsolana/post-confirmation-account-read
// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.
// SPDX-License-Identifier: MIT

import { setTimeout as sleep } from "node:timers/promises";
import {
  address,
  createDefaultRpcTransport,
  createSolanaRpcFromTransport,
  isSolanaError,
  signature,
  SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED,
} from "@solana/kit";

const key = process.env.CARBIUM_KEY;
if (!key) {
  console.error("Set CARBIUM_KEY to your Carbium API key.");
  process.exit(1);
}
const url = process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh";
const rpc = createSolanaRpcFromTransport(
  createDefaultRpcTransport({ url, headers: { "x-api-key": key } }),
);

const USDC = address("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
const [sigArg, accountArg] = process.argv.slice(2);
if (sigArg && !accountArg) {
  console.error("Usage: node main.ts [signature account]");
  process.exit(1);
}
const account = accountArg ? address(accountArg) : USDC;
let sig = sigArg ? signature(sigArg) : undefined;
if (!sig) {
  const recent = await rpc.getSignaturesForAddress(USDC, { limit: 10 }).send();
  sig = recent.find((r) => r.err === null)?.signature;
}
if (!sig) {
  console.error("No recent successful signature found.");
  process.exit(1);
}

// Step 1: wait for the signature to reach confirmed, and keep its slot.
let slot: bigint | undefined;
for (let i = 0; i < 20 && slot === undefined; i++) {
  const { value } = await rpc
    .getSignatureStatuses([sig], { searchTransactionHistory: true })
    .send();
  const s = value[0];
  if (s && (s.confirmationStatus === "confirmed" || s.confirmationStatus === "finalized")) {
    console.log(`status slot ${s.slot} ${s.confirmationStatus} err=${JSON.stringify(s.err)}`);
    slot = s.slot;
  } else {
    await sleep(300);
  }
}
if (slot === undefined) {
  console.error("Signature never reached confirmed: it may have expired.");
  process.exit(1);
}

const show = (label: string, r: Awaited<ReturnType<typeof bare>>) =>
  console.log(
    `${label}: context slot ${r.context.slot}, ` +
      (r.value ? `${r.value.lamports} lamports, owner ${r.value.owner}` : "null"),
  );
const bare = () => rpc.getAccountInfo(account, { commitment: "confirmed", encoding: "base64" }).send();
show("bare read", await bare());

// Step 2: the same read with a floor, retried while the node is behind it.
for (let i = 0; i < 20; i++) {
  try {
    const r = await rpc
      .getAccountInfo(account, { commitment: "confirmed", encoding: "base64", minContextSlot: slot })
      .send();
    show("guarded read", r);
    break;
  } catch (e) {
    if (!isSolanaError(e, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED)) throw e;
    if (i === 19) throw new Error(`node still behind slot ${slot} after 20 tries`);
    console.log(`node behind slot ${slot}, waiting`);
    await sleep(300);
  }
}
```

The file polls `getSignatureStatuses` every 300 ms until the status is `confirmed` or `finalized`, up to 20 tries. It then reads the account twice. The first read leaves out `minContextSlot` and shows what a bare call gets. The second sets `minContextSlot` to the slot of the status. A node still behind that slot refuses with a minimum-context-slot error and the loop waits 300 ms and asks again. Twenty refusals, or any other error, end the run.

## What the run prints

| Line | Meaning |
|---|---|
| status slot | The slot in which the transaction was processed, taken from the status. This is the floor for the guarded read. |
| bare read | The answer of a call with no floor, with the slot it was served at. Its context slot can sit below the status slot. |
| guarded read | The answer of a call with `minContextSlot` set. Its context slot is never below the status slot. |
| err | Printed on the status line as `err=`: the transaction's own error, or null. A non-null value means the transaction created nothing, whatever the reads say. |

In the default run both reads find the mint, because it existed long before the signature. The guard matters for an account the transaction itself created: pass that signature and address, and while the bare read can answer null from a lagging node, the guarded read waits for it to catch up.

> Print `err` from the status before any account read. A confirmed status with an error means the transaction paid its fee and changed nothing else.

## Which commitment to read at

The JSON-RPC server answers at `finalized` when a call names no commitment. `@solana/kit` 8.6.0 fills in `confirmed` for a call that leaves it out, so a kit call without a commitment is a confirmed read. The file names `confirmed` on both reads so the level is visible in the code.

Since the Alpenglow switch a slot lasts about 200 ms and finalized sits 0 to 1 slots behind processed. Waiting for `finalized` before a read therefore costs about one slot, and for a deposit credit or an account you will build on it is the safer pick. One read of the three levels can still show two of them equal or briefly out of order, so compare slots, never levels.

A `confirmed` status can be followed by a `finalized` read of the same account that answers null. The finalized view is a hair behind, and the floor from `minContextSlot` is what makes the retry loop correct at any level: set the commitment you need on the read and keep the floor from the status.

## On Carbium

`getAccountInfo` is an [account read](https://carbium.sh/docs/rpc) and costs 10 cells, so a retry loop spends 10 cells per attempt. At 300 ms spacing a loop makes about three calls a second. That fits a Dev key at 15 req/s and is six times a Free key's 0.5 req/s, so on Free space the retries two seconds apart.

A call over its rate waits once and is served if its cells refill within 1 s. Past that the call gets 429 with a retry-after hint. The file treats a 429 like any other error and stops, so a loop in your own code should wait out the hint and go on.

To skip polling, open a `signatureSubscribe` on the [WebSocket](https://carbium.sh/docs/websocket). It sends one confirmation and the subscription ends, and the slot in that notification is the floor for the read. [Consistent reads with minContextSlot](https://carbium.sh/library/howsolana/consistent-reads-with-mincontextslot) covers the same floor on reads that have no signature behind them.

## Where it ends

The floor proves the node has reached a slot. It proves nothing about the account. If the transaction failed, or its fork was dropped after a processed status, the read answers null at any context slot. Check `err`, and read at `confirmed` or above when the account must stay.

A status of `null` after 20 tries means the cluster has not seen the signature. The transaction may have expired with its blockhash. The file stops and prints that, and it does not resend: resending an expired transaction needs a fresh blockhash and a duplicate check, which is a different job.

The file reads one account. A transaction that creates several, such as a mint and its token account, needs a read per address. `getMultipleAccounts` returns all of them at one context slot, at 10 cells per pubkey, and takes the same `minContextSlot`.

## When it goes wrong

| What goes wrong | What to do |
|---|---|
| getAccountInfo answers null right after confirmTransaction returned. | Read the slot from `getSignatureStatuses` and pass it as `minContextSlot` on the read. Retry the minimum-context-slot error after a short wait, and check the status `err` before blaming the node. |
| Error -32016 minimum context slot not reached on every attempt. | The node answering is behind the slot you asked for. Wait between tries and give the loop a cap. If it never clears, the node is not advancing: stop the loop, report the error and try the read again later. |
| The status is confirmed but the account never appears. | The transaction failed. Read `err` in the status, then `getTransaction` for its logs, and fix the instruction. The fee was paid and the account was not created. |
| HTTP 429 with a retry-after hint during the retry loop. | Wait for the seconds in the header, then continue. Space the retries wider on a plan with a low account-read rate. |
| getSignatureStatuses returns null for a signature you just sent. | The cluster has not seen it yet, or it expired. Keep polling until the blockhash lifetime ends, then rebuild with a fresh blockhash and send again. |

## Questions

### Does a confirmed status guarantee the account is readable?

It says the transaction was processed at that level on the node that answered, and it created the account only if `err` is null. Another node can be behind it, so pin the read to the status slot with `minContextSlot`.

### Should I use a higher commitment instead of minContextSlot?

They cure different things. A higher commitment on the status wait gives you a slot that is final. The floor on the read keeps a lagging node from answering below that slot.

### Why does the file read the account twice?

The bare read shows what an unguarded call returns, with the slot it was served at. The guarded read is the one to keep in your code.

### Can I get the slot without polling?

Yes. `signatureSubscribe` sends one notification when the signature reaches the level you set, and its context slot works as the floor.

## Related

- [Consistent reads with minContextSlot](https://carbium.sh/library/howsolana/consistent-reads-with-mincontextslot) (How to use Solana, HS0029)
- [React post-confirm balance refresh](https://carbium.sh/library/integrate/react-post-confirm-balance-refresh) (Integrations, I0036)
- [carbium.sh/docs/rpc](https://carbium.sh/docs/rpc)
- [carbium.sh/docs/websocket](https://carbium.sh/docs/websocket)
- [carbium.sh/docs/limits](https://carbium.sh/docs/limits)
- [carbium.sh/docs/errors](https://carbium.sh/docs/errors)
