---
id: HS0104
title: "Lookup table capacity check"
url: https://carbium.sh/library/howsolana/lookup-table-capacity-check
collection: How to use Solana
category: Versioned transactions and lookup tables
revision: 1
updated: 2026-11-23
author: Carbium
code: MIT (LICENSE in the zip); text: all rights reserved, Carbium Corporation
---

# Lookup table capacity check

A lookup table holds at most 256 addresses. One TypeScript file reads a table, prints how many entries it holds, how many are free and whether it is extendable, frozen, deactivating or full. With no argument it checks the tables a recent swap used.

## The limit is 256

An address lookup table (a LUT, also called an ALT) holds 256 addresses at most. The ceiling comes from how a transaction points into a table: each index is a single byte, so it can name entries 0 through 255 and nothing past that. The table program refuses to extend a table beyond 256 entries, and no setting raises the ceiling.

The limit applies to one table. A v0 transaction may name several tables, so a program that needs more than 256 extra addresses spreads them over more than one. No field in the table stores a count. The size of the account tells you: a fixed 56-byte front section, then 32 bytes for each address stored after it.

| Entries held | Total account size | What it means |
|---|---|---|
| 0 | 56 bytes | Freshly created, empty. |
| 1 | 88 bytes | One address stored. |
| 100 | 3256 bytes | 156 slots still open. |
| 256 | 8248 bytes | Full, so every later extend is refused. |

Reverse that sizing and you have the check. Take the account size, drop the first 56 bytes, divide what is left by 32, and you get the entries in use. Free slots are 256 minus that number. The file below does exactly this on every table you give it.

## The code

Install `@solana/kit` at 8.6.0, export `CARBIUM_KEY` and run the file with Node 24. Pass one or more table addresses to check them. With no argument it lists the eight newest signatures of the Jupiter v6 program, fetches them one at a time until one carries `addressTableLookups`, and checks every table that transaction names.

`main.ts` (run: `node main.ts [lookup-table-address ...]`)

```ts
// HS0104 · Lookup table capacity check
// https://carbium.sh/library/howsolana/lookup-table-capacity-check
// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.
// SPDX-License-Identifier: MIT

import { address, createDefaultRpcTransport, createSolanaRpcFromTransport, isAddress } 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 rpc = createSolanaRpcFromTransport(
  createDefaultRpcTransport({
    url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh",
    headers: { "x-api-key": key },
  }),
);

const LUT_PROGRAM = "AddressLookupTab1e1111111111111111111111111";
const JUPITER = address("JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4");
const HEADER = 56;
const CAPACITY = 256;
const ACTIVE = 0xffffffffffffffffn;

type Message = { addressTableLookups?: { accountKey: string }[] };

async function tablesInRecentSwap(): Promise<string[]> {
  const recent = await rpc.getSignaturesForAddress(JUPITER, { limit: 8 }).send();
  for (const { signature } of recent) {
    try {
      const tx = await rpc
        .getTransaction(signature, { encoding: "json", maxSupportedTransactionVersion: 1 })
        .send();
      const message = tx?.transaction.message as unknown as Message | undefined;
      const keys = (message?.addressTableLookups ?? []).map((l) => l.accountKey);
      if (keys.length > 0) return keys;
    } catch (e) {
      console.error(`skipped ${signature}: ${(e as Error).message}`);
    }
  }
  return [];
}

async function check(table: string): Promise<string> {
  const { value } = await rpc.getAccountInfo(address(table), { encoding: "base64" }).send();
  if (!value || value.owner !== LUT_PROGRAM) throw new Error("not an address lookup table account");
  const raw = Buffer.from(value.data[0], "base64");
  const used = (raw.length - HEADER) / 32;
  if (!Number.isInteger(used) || used < 0 || raw.readUInt32LE(0) !== 1) {
    throw new Error("unexpected account layout");
  }
  const free = CAPACITY - used;
  const frozen = raw[21] === 0;
  const deactivating = raw.readBigUInt64LE(4) !== ACTIVE;
  const state = frozen ? "frozen" : deactivating ? "deactivating" : free <= 0 ? "full" : "extendable";
  return `${table}: ${used} of ${CAPACITY} used, ${free} free, ${raw.length} bytes, ${state}`;
}

const given = process.argv.slice(2);
const bad = given.find((a) => !isAddress(a));
if (bad) {
  console.error(`${bad} is not an address.`);
  process.exit(1);
}
const tables = given.length > 0 ? given : await tablesInRecentSwap();
if (tables.length === 0) {
  console.error("No lookup table in the newest signatures; run again or pass a table address.");
  process.exit(1);
}
const results = await Promise.allSettled(tables.map((t) => check(t)));
results.forEach((r, i) => {
  console.log(r.status === "fulfilled" ? r.value : `${tables[i]}: ${r.reason instanceof Error ? r.reason.message : String(r.reason)}`);
});
```

Every call runs at `confirmed`, which @solana/kit 8.6.0 fills in when commitment is left out. The transaction fetch sends `maxSupportedTransactionVersion: 1`, so v0 and v1 transactions both decode. The table reads run side by side with `Promise.allSettled`, so a table that has been closed prints its own error line and the others still print.

A line looks like `<address>: 214 of 256 used, 42 free, 6904 bytes, extendable`. The label at the end comes from two header fields. A frozen table has no authority, so nobody can add to it whatever its count. A deactivating table carries a deactivation slot below the largest u64, and the program refuses to extend it. A table with zero free slots is labelled full. Any other table is extendable.

## Filling a table

Getting to 256 takes more than one transaction. Each extend instruction carries the new addresses as raw 32-byte values inside a transaction capped at 1232 bytes, so one extend adds around 30 addresses. A table built up from empty therefore needs about nine extend transactions.

- Only the authority can extend, and only while the table is active.
- Extending is append-only: new entries land after the last one, so earlier indexes never move.
- The program does not check for duplicates. Adding an address that is already present spends a slot on a second copy.
- A new entry cannot be used by a transaction in the slot that added it.

Because duplicates cost slots, check the free count before an extend run, and filter your list against the entries already in the table. To list those entries, see [Lookup table contents reader](https://carbium.sh/library/howsolana/lookup-table-contents-reader).

## What a transaction can pull in

The table's 256 slots and a transaction's reach are separate limits. A v0 transaction addresses its accounts with one-byte indexes as well, so the static keys plus every address loaded from tables add up to at most 256 accounts, and the runtime's cap on the accounts one transaction may lock sits well below that. Room in the 1232-byte message is the other limit: each table a message names costs its 32-byte address, two length bytes and one byte for every index used, so many small lookups take more room than one well-filled table.

That favours packing the addresses a program touches together into a few full tables. Before you build one, run the size arithmetic from [Transaction size checker](https://carbium.sh/library/howsolana/transaction-size-checker), and decode what a swap actually loads with [Swap transaction decoder](https://carbium.sh/library/si/swap-transaction-decoder).

## On Carbium

A `getAccountInfo` read costs 10 [cells](https://carbium.sh/docs/rpc) and runs at 0.5 req/s on Free, 15 on Dev, 50 on Business and 400 on Pro. A table check is one such read, and a table is a single account, so even a full table's 8248 bytes arrive in one call.

The discovery path costs more. One `getSignaturesForAddress` is 50 cells and each `getTransaction` is 50 more. The file stops at the first transaction that names a table and tries eight at most, so discovery costs at most 450 cells, plus 10 for each table it then reads. A [rate class](https://carbium.sh/docs/limits) absorbs a burst of at least 1,024 cells, so the listing, the eight fetches and the table reads fit together even on Free. Pass addresses and the discovery calls never happen.

## Where it ends

The count is a snapshot at `confirmed`. A table being extended right now can hold more by the time you read the line, and the file does not hold a lock on anything.

Free slots say how many addresses fit. They do not say whether your next extend will land: you still need the authority's signature, a fee payer and a transaction small enough to send. This file signs nothing and holds no keypair.

Discovery reads only the eight newest signatures of one busy program, and the address index behind `getSignaturesForAddress` reaches back 30 days at most. A signature it lists can return null from `getTransaction`, and the file skips those. If none of the eight carries a lookup, it says so and exits.

No RPC call lists the tables that contain a given address, so the file cannot tell you which table already holds an address you want to add. Pass the table addresses you know.

## When it goes wrong

| What goes wrong | What to do |
|---|---|
| A line says the address is not an address lookup table account. | The account is missing, closed, or owned by another program. Pass a table address, the `accountKey` a transaction lists inside `addressTableLookups`. |
| A line says the account has an unexpected layout. | The account belongs to the lookup table program, but its type field is not 1 or its length is not 56 plus a multiple of 32, so the bytes do not parse as a table. Fetch the account at base64 and check its first four bytes and its length. |
| getTransaction answers -32015 for a signature. | The call must send `maxSupportedTransactionVersion: 1`, as the file does. With the value absent or 0, a v1 transaction or a block holding one fails. |
| Discovery prints that no tables were found. | None of the eight newest transactions used a table, or each came back null or failed. Run it again for newer signatures, or pass an address. |
| A table reads as extendable but the extend instruction fails. | Check that the signer is the table's authority and that the batch fits in the free slots. An extend that would pass 256 entries is refused as a whole, so send fewer addresses. |
| HTTP 429 with a retry-after hint. | Repeated discovery runs on a low plan can push the calls over their rate. Pass table addresses to skip them, or wait for the hint. |

## Questions

### What is the maximum number of addresses in a lookup table?

256. Transactions refer to entries by a one-byte index, so a table cannot grow past that, and an extend that would cross it is refused.

### Can I raise the limit or chain tables together?

No. The limit is fixed in the table program. To use more addresses, create another table and name both in the transaction's lookups.

### Does a transaction get to use all 256 entries?

No. The fee payer and any other static keys count toward the same 256-account cap, and the runtime's limit on accounts one transaction may lock sits well below 256. Each looked-up entry also costs one index byte of the 1232-byte message.

### Do removed or duplicate entries free up slots?

No. Entries cannot be removed from a table. To reclaim space, deactivate and close the table, then build a new one.

## Related

- [Lookup table contents reader](https://carbium.sh/library/howsolana/lookup-table-contents-reader) (How to use Solana, HS0032)
- [Swap transaction decoder](https://carbium.sh/library/si/swap-transaction-decoder) (AI and blockchain, SI0012)
- [carbium.sh/docs/rpc](https://carbium.sh/docs/rpc)
- [carbium.sh/docs/limits](https://carbium.sh/docs/limits)
- [carbium.sh/docs/endpoints](https://carbium.sh/docs/endpoints)
- [carbium.sh/docs/auth](https://carbium.sh/docs/auth)
