services
Get a key

library / Use cases / UC0039

Multi-dapp usage dashboard

Follow many Solana dapps from one account: which calls give per-program volume and failure share, the request rate each plan carries for polling a long watch list, when to switch to a stream, and a Node collector that stores the counts in SQLite.

By Carbium · Analytics and research · UC0039 · updated 2026-11-22

01

Per-dapp counts from one index

A dashboard over several dapps starts with two questions per dapp. How many transactions touched its program in a window, and how many of them failed. Each dapp is an address, its program id. getSignaturesForAddress lists the newest signatures that mention an address, and every row carries the slot, the block time and an err field that is null on success. Counting rows and non-null errors gives volume and failure share without fetching a single transaction body.

That is the economical path for a firm with a long watch list. A signature page and a transaction read both cost 50 cells, but one page of up to 100 signatures covers 100 transactions, so the page is the unit to poll. Fetch a transaction body only for the signature an analyst clicks on.

The same shape works for any address you want to compare: a program, a vault, a market account. Keep the list in a file or table, one row per dapp with a label, and let the collector take the addresses as arguments.

02

What polling a watch list costs

The budget belongs to the account. Keys on an account share one budget, so a desk with ten analysts and ten keys still draws on a single pool, and a new key adds no capacity.

CallCellsFree req/sDev req/sBusiness req/sPro req/s
getSignaturesForAddress500.241.2100500
getTransaction500.241.2525
getSlot and other cached reads1530100500

The sum for a watch list is the number of programs divided by the poll interval in seconds, read against the signature row of your plan. Forty programs every 10 seconds is 4 pages a second: Dev's 1.2 cannot carry it, Business's 100 can. The same forty every 60 seconds is about 0.67 a second and fits Dev. A drill-down that reads transactions is a separate line: at 5 req/s on Business it is the first thing to run short, so cache each body by signature.

A rate class absorbs bursts up to 1,024 cells or one second of its rate, whichever is larger. One second of Business's 100 req/s is 5,000 cells and Pro's is 25,000, so the 40-page sweep above (2,000 cells) fits inside the burst on those plans. On Free and Dev the 1,024-cell floor binds: a sweep of 20 pages is 1,000 cells and fits, while a sweep of 40 is 2,000 cells and the tail of it can come back as 429 with a retry-after hint. Space the calls across the interval instead of firing the whole list at once.

Credits are the monthly meter beside the rates. Plans per month are Free at $0 with 500K credits once at sign-up, Dev at $20 with 10M, Business at $250 with 50M and Pro at $500 with 200M. Each paid month adds credits and unspent credits stay.

03

A collector in one file

The script reads CARBIUM_KEY, takes program ids as arguments and falls back to three busy programs when you give none. It sends the key in the x-api-key header to the RPC endpoint https://services.carbium.sh, asks for the newest 100 signatures of each program one after another, and writes them to a SQLite file with (program, signature) as the primary key. A signature seen in an earlier run is ignored on insert, so overlapping polls never count twice.

main.ts
// UC0039 · Multi-dapp usage dashboard// https://carbium.sh/library/usecase/multi-dapp-usage-dashboard// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.// SPDX-License-Identifier: MIT// Read-only usage collector: newest signatures per program id into SQLite, then a per-dapp summary.import { DatabaseSync } from "node:sqlite";import { address, createDefaultRpcTransport, createSolanaRpcFromTransport } 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 DEFAULTS = [  "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",  "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",  "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc",];const programs = process.argv.length > 2 ? process.argv.slice(2) : DEFAULTS;const PAGE = 100;const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));const db = new DatabaseSync("usage.db");db.exec("create table if not exists sigs (program text, signature text, slot integer, ts integer, failed integer, primary key (program, signature))");const insert = db.prepare("insert or ignore into sigs values (?, ?, ?, ?, ?)");// One retry after a pause: a Free key allows 0.24 getSignaturesForAddress calls a second.async function newest(program: string) {  for (let attempt = 0; ; attempt++) {    try { return await rpc.getSignaturesForAddress(address(program), { limit: PAGE }).send(); }    catch (e) { if (attempt === 1) throw e; await sleep(4000); }  }}const full = new Map<string, boolean>();const errors = new Map<string, string>();for (const [i, p] of programs.entries()) {  // After its burst a Free key refills about 12 cells a second, so each page waits about 4 s.  if (i > 0) await sleep(4000);  try {    const page = await newest(p);    db.exec("begin");    for (const s of page) insert.run(p, s.signature, Number(s.slot), Number(s.blockTime ?? 0), s.err ? 1 : 0);    db.exec("commit");    full.set(p, page.length === PAGE);  } catch (e) {    errors.set(p, e instanceof Error ? e.message : String(e));  }}const since = Math.floor(Date.now() / 1000) - 3600;const summary = db.prepare("select count(*) n, coalesce(sum(failed), 0) f, min(ts) a, max(ts) b from sigs where program = ? and ts > ?");const rows = programs.map((p) => {  const program = p.slice(0, 8);  const error = errors.get(p);  if (error !== undefined) return { program, txs: 0, failedPct: 0, spanSec: 0, perMinute: 0, pageFull: false, error: error.slice(0, 60) };  const r = summary.get(p, since) as unknown as { n: number; f: number; a: number; b: number };  const span = Math.max(1, r.b - r.a);  return {    program,    txs: r.n,    failedPct: r.n ? Number(((100 * r.f) / r.n).toFixed(1)) : 0,    spanSec: r.n ? r.b - r.a : 0,    perMinute: Number(((60 * r.n) / span).toFixed(1)),    pageFull: full.get(p) ?? false,    error: "",  };});console.table(rows);if (errors.size === programs.length) { console.error("No program answered."); process.exit(1); }

run: CARBIUM_KEY=$CARBIUM_KEY node main.ts <program-id-1> <program-id-2>

After the writes it prints one row per program for the last hour of stored data: transactions counted, failed share, the time span the rows cover, transactions per minute over that span, a flag when the page came back full, and an error column that stays empty unless the program failed. It signs and sends nothing.

The collector waits 4 seconds between programs. Three pages are 150 cells and fit a Free key's burst, but after the burst Free refills about 12 cells a second, so each further page waits about 4 seconds. Each call gets one retry after a short wait, and a program that still fails is printed as a row with its error while the others carry on.

04

Reading the numbers

The call leaves commitment out, and @solana/kit 8.6.0 fills in confirmed when a call does that, so each page lists transactions at confirmed commitment. Block times have a resolution of one second, which is why the span is floored at one second before a rate is computed.

A full page means the window is truncated. If a program shows 100 rows and a span of 12 seconds, it did at least 100 transactions in 12 seconds and the older ones are simply not on this page. Shorten the interval for that program or move it to a stream. The per-minute figure is only a lower bound while the flag is set.

The failed share counts transactions whose err is set. It tells you a dapp is failing more than usual, and a spike is the cue to look at one transaction. For the drill-down, getTransaction and getBlock take maxSupportedTransactionVersion: 1 with an encoding. Left absent or at 0, they answer -32015 for a v1 transaction. A signature the page lists can still return null from getTransaction when it is older than the validator's ledger, so handle null.

Compare dapps by shape and trend. A lending program and a swap router differ in how many instructions a transaction carries, so a raw count between them says little. Plot each against its own last week.

05

Streaming for the busiest programs

Polling is the right tool for a long list of quiet programs. For the few programs that fill a page between polls, a subscription delivers every event. logsSubscribe on the WebSocket streams transaction logs by mention of an address, and a mention filter opens at 25 credits, then costs 20 credits per MiB sent. An all-logs or program-wide subscription opens at the top weight of 200 credits. A refused subscription costs nothing.

Plans cap sockets and subscriptions per account, and Free carries 5 sockets. One socket can hold several subscriptions, so a firm following a dozen programs opens one connection with a subscription for each program.

The gRPC stream on port 9443 is the heavier option, with server-side filters, and it opens on Dev, Business and Pro. A common split is a poller for the long tail and a stream for the top five programs, with both writing into the same table. The collector above already dedupes on signature, so the two sources can overlap without double counting. For per-wallet views of the same idea see Wallet watch list at scale, and for a treasury-style view see DAO treasury dashboard.

06

Where it ends

  • Page size: the collector reads the newest 100 signatures per program per run. A program with more than 100 transactions between runs loses the ones in between, and the full-page flag is the only sign.
  • History: getSignaturesForAddress pages come from an address index that keeps up to 30 days. An empty page past that is the index's age limit, and the address may have older transactions. A dashboard that needs a year starts with your own stored rows.
  • Mentions count: a transaction is listed whenever the program id appears in its account keys, so one that only reads a program account counts alongside one that invokes it, and so does one that reaches the program through a CPI from a router.
  • Failures count whole transactions. A transaction that fails in one instruction of several is one failure, and the script cannot say which instruction.
  • getProgramAccountsV2 and getTokenLargestAccounts are not served and answer -32601. Holder lists and total value locked come from your own index.
  • The script counts usage. Prices, liquidity and wallet value are other reads, and the SQLite file lives on one machine.
07

When it goes wrong

what goes wrongwhat to do
Counts double after each poll because the same signatures come back.Keep (program, signature) as the primary key and insert with ignore, as the collector does.
A busy program shows exactly 100 rows on every run and its rate looks flat.The page is full and the window is truncated. Shorten the interval for that program or follow it with a logsSubscribe mention filter.
A sweep over the whole list draws 429 on its last programs.Space the calls across the interval, honor the retry-after hint, and compare programs divided by interval against your plan's signature row.
The drill-down returns -32015 for some transactions.Pass maxSupportedTransactionVersion: 1 with an encoding on getTransaction and getBlock.
getTransaction returns null for a signature the page listed.Pages come from the address index and reach below the validator's ledger. Treat null as no body available and prove the drill-down on the newest signatures.
The dashboard reads empty for a program past 30 days.The index keeps 30 days at most. Store the counts you collect and read older periods from your own table.
08

Questions

Do I need one key per dapp or per analyst?

No. Limits are per account and every key on it shares one budget, so extra keys add no capacity. Use keys to separate services and revoke them one at a time.

How do I choose a plan for a watch list?

Divide the number of programs by the poll interval in seconds and compare the result with the getSignaturesForAddress row for each plan. Add the transaction lookups your analysts run, which have a lower rate.

Can I get every event for a program instead of polling?

Yes. A logsSubscribe mention filter on the WebSocket streams its transactions, and the gRPC stream on port 9443 opens on Dev, Business and Pro. Both cost 20 credits per MiB sent.

How do I choose a poll interval per program?

Start from the full-page flag. A program that returns 100 rows within a few seconds needs a shorter interval or a stream, and a quiet one can wait minutes. The interval you pick also sets the req/s your plan must carry.