---
id: BI0147
title: "Season pass progress tracker"
url: https://carbium.sh/library/blockchainideas/season-pass-progress-tracker
collection: Blockchain ideas
category: Games
revision: 1
updated: 2026-11-23
author: Carbium
code: MIT (LICENSE in the zip); text: all rights reserved, Carbium Corporation
---

# Season pass progress tracker

A season pass issued as an SPL token mint can be watched from one read-only script: its supply, the day count into the season, and the mint's activity since the season began. Each run saves a snapshot, so the next run shows the change.

## Who uses it

Two groups look at the same numbers. The first is a game studio's live-ops team. Before a season closes they want to know how many passes exist, how many days are left, and whether the mint still sees traffic or has gone quiet. A daily run answers all three without anyone opening an explorer.

The second is a community manager answering the question every season brings: how many passes are out. The board prints the supply read from the chain with its decimals, so the answer is the chain's own answer, and anyone who runs the same script gets the same figure.

A hackathon team can point the same script at any SPL mint. The default is USDC, a mint with steady traffic, so the first run prints numbers that move. Put in your season's mint before you show the board to anyone.

## What it reads

The board makes two reads per run and works out the day count from the clock. Each figure has one source.

| Figure | Source | What it tells you |
|---|---|---|
| Supply | getTokenSupply on the mint | passes issued, as the raw amount and the decimal string, plus the change since the last snapshot |
| Days into the season | the start date argument and the machine clock | whole days since midnight UTC on the start date, zero until then |
| Activity since the start | getSignaturesForAddress on the mint, newest 1,000 | transactions that touched the mint on or after the start date, and how many of them succeeded |
| Sample window | blockTime of the oldest signature in the page | how far back the activity count reaches |

Supply counts tokens that exist. Activity counts transactions, and one transfer, one mint or one failed attempt each adds a signature. Read activity as a sign of movement and supply as the count of passes, and do not add the two together.

## The build

The script is one file. It needs `@solana/kit` and Node 24, and it writes one JSON file, `season-progress.json`, in the folder it runs from. It never signs and never sends a transaction.

1. Read the mint and the season start date from the arguments. The start is midnight UTC on the date given.
2. Load the snapshot file if it exists, so the last recorded supply is known before the new read.
3. Call getTokenSupply and getSignaturesForAddress together, each at confirmed commitment. They settle separately, so a failed call prints its message and the other figure still prints.
4. Count the signatures that fell on or after the start date and succeeded, and note when the page is full.
5. Print the day count, the supply with its change, and the activity figures with the window they cover.
6. Append the new supply to the snapshot file, and only after the supply read succeeded.

`main.ts` (run: `CARBIUM_KEY=<YOUR_KEY> node main.ts EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v 2026-11-01`)

```ts
// BI0147 · Season pass progress tracker
// https://carbium.sh/library/blockchainideas/season-pass-progress-tracker
// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.
// SPDX-License-Identifier: MIT

import { address, createDefaultRpcTransport, createSolanaRpcFromTransport } from "@solana/kit";
import { readFile, writeFile } from "node:fs/promises";

const key = process.env.CARBIUM_KEY;
if (!key) {
  console.error("Set CARBIUM_KEY to your Carbium API key.");
  process.exit(1);
}

// USDC by default: a mint with steady traffic, so the first run prints numbers that move. Pass your season's mint.
const [mintArg = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", startArg = "2026-11-01"] = process.argv.slice(2);
const seasonStart = Date.parse(`${startArg}T00:00:00Z`);
if (Number.isNaN(seasonStart)) {
  console.error("Season start must be a date such as 2026-11-01.");
  process.exit(1);
}

const rpc = createSolanaRpcFromTransport(
  createDefaultRpcTransport({
    url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh",
    headers: { "x-api-key": key },
  }),
);
const SNAPSHOTS = "season-progress.json"; // written in the folder the command runs from
type Snapshot = { at: number; amount: string };
const reason = (e: unknown): string => (e instanceof Error ? e.message : String(e));

async function main(): Promise<void> {
  const mint = address(mintArg);
  const history: Snapshot[] = await readFile(SNAPSHOTS, "utf8")
    .then((text) => JSON.parse(text) as Snapshot[])
    .catch(() => []);

  const [supplyRes, sigsRes] = await Promise.allSettled([
    rpc.getTokenSupply(mint).send(),
    rpc.getSignaturesForAddress(mint, { limit: 1000, commitment: "confirmed" }).send(),
  ]);

  const days = Math.floor((Date.now() - seasonStart) / 86_400_000);
  console.log(`mint ${mint}, season day ${Math.max(0, days)} from ${startArg}`);

  if (supplyRes.status === "fulfilled") {
    const { amount, uiAmountString } = supplyRes.value.value;
    const last = history[history.length - 1];
    const change = last
      ? `${BigInt(amount) - BigInt(last.amount)} raw units since ${new Date(last.at).toISOString()}`
      : "no earlier snapshot";
    console.log(`supply ${uiAmountString}, change ${change}`);
    history.push({ at: Date.now(), amount });
    await writeFile(SNAPSHOTS, JSON.stringify(history, null, 1));
  } else {
    console.error("getTokenSupply failed:", reason(supplyRes.reason));
  }

  if (sigsRes.status === "rejected") {
    console.error("getSignaturesForAddress failed:", reason(sigsRes.reason));
    return;
  }
  const sigs = sigsRes.value;
  const inSeason = sigs.filter((s) => s.blockTime !== null && Number(s.blockTime) * 1000 >= seasonStart);
  const succeeded = inSeason.filter((s) => s.err === null).length;
  const oldest = sigs[sigs.length - 1];
  const windowStart = oldest?.blockTime ? new Date(Number(oldest.blockTime) * 1000).toISOString() : "unknown";
  console.log(`activity: ${inSeason.length} signatures since the season start, ${succeeded} succeeded`);
  console.log(`sample: ${sigs.length} newest signatures, back to ${windowStart}${sigs.length === 1000 ? " (page cap, a floor)" : ""}`);
}

main().catch((e) => {
  console.error(reason(e));
  process.exit(1);
});
```

The JSON-RPC server defaults to finalized, while @solana/kit 8.6.0 sends confirmed when a call leaves the commitment out. The script names confirmed on both calls, so the level it reads at is written in the code and does not depend on the library. The snapshot file goes in the folder the command runs from. Keep that folder between runs, or the change line starts over.

## What it costs

A run makes two calls. The signature call is the one that counts against the plan, at 50 cells. Credits meter RPC work, and the plan sets how many calls a second a key may make.

| Plan | Credits | getSignaturesForAddress rate |
|---|---|---|
| Free ($0) | 500K once, at sign-up | 0.24 req/s |
| Dev ($20) | 10M per month | 1.2 req/s |
| Business ($250) | 50M per month | 100 req/s |
| Pro ($500) | 200M per month | 500 req/s |

A daily run sends one signature call, far below the 0.24 req/s that Free allows. Running the board every few minutes is the case where the Free rate starts to matter, so pick a cadence that matches who reads the output. An account's keys share one budget, so a second tool on the same key draws from the same rate and credits. The [plan limits](https://carbium.sh/docs/limits) list the full terms.

## What to add next

- A daily cron job that runs the board at a fixed hour and keeps the snapshot file as the season's record.
- A holder count: getTokenAccountsByOwner for each wallet on a list you already hold, summed by mint, to show how many wallets own a pass.
- A chart: serve the snapshot file from a small HTTP page so the supply curve is visible to the whole team.
- A second season: run the board on last season's mint with the same start day, to set the two curves side by side.

## Where it ends

- The script reads the pass as an SPL token mint. A pass kept as data in a game's program account has no supply field, so the board cannot count it.
- The signature index reaches back 30 days at most. A season that began longer ago shows activity for the last 30 days only, and an empty page past that marks the index's age limit, not the mint's first transaction.
- The sample is the newest 1,000 signatures. On a busy mint that covers minutes, so the activity count is a floor, and the window line shows how far back the sample reaches.
- Activity counts transactions that touched the mint. It includes failed attempts and transfers between two other wallets, so it does not count passes bought.
- Supply is the total issued. A pass minted to a studio treasury counts as issued before any player holds it, and a burned pass drops out of the count.
- Days come from the clock of the machine running the script. A wrong clock gives a wrong day count, and the board has no way to notice.

## When it goes wrong

| What goes wrong | What to do |
|---|---|
| One of the two calls prints an error and the other figure is missing. | Both calls settle on their own, so the run keeps going. A 401 means the key was not sent whole, so attach the whole key. A 429 means the call went past its rate; run again later. |
| The activity count is 1,000 and the season started weeks ago. | That is the page cap, so the count is a floor. Read the window line. Set the start date to a day the window reaches, or read the count as recent activity only. |
| The change line says no earlier snapshot on every run. | The snapshot file is not kept between runs. Run from the same folder each time, and check that the file was written after the supply read succeeded. |
| The day count shows 0. | The start date is later than the machine clock, or the clock is wrong. Check the date on the machine and the start argument. |
| The script exits with a message about the key. | CARBIUM_KEY is not set in this shell. Set it for the run. The script reads it from the environment and never prints it. |
| The script exits with an invalid address error. | The mint argument is not a valid address, or it is a token account, which is not a mint. Copy the mint address itself from an explorer. |

## Questions

### Can the board count how many players hold a season pass?

Not from supply alone. Supply counts passes issued, including any the studio holds. A holder count takes a list of wallets and a token-account read for each one, which is the first item in what to add next.

### Does this work for a pass kept inside the game's own account?

No. The board reads the supply field of an SPL mint, so a pass stored as program account data has nothing to count here. The game has to expose its own count through an account for that.

### Why does the activity number stop at 1,000?

The script asks for one page of 1,000 signatures in a single call, which is the page size the code sets. A busy mint can fill that page in a short time, so read the figure as a floor.

### Can I run this on the Free plan?

Yes. A daily run is one signature call, far below the 0.24 req/s that Free allows. The Free credits are granted once, at sign-up, so a daily schedule is the one to plan for.

## Related

- [Live chain-state game](https://carbium.sh/library/blockchainideas/live-chain-state-game) (Blockchain ideas, BI0009)
- [Game state and player items](https://carbium.sh/library/usecase/game-state-and-player-items) (Use cases, UC0010)
- [carbium.sh/docs/rpc](https://carbium.sh/docs/rpc)
- [carbium.sh/docs/limits](https://carbium.sh/docs/limits)
- [carbium.sh/docs/auth](https://carbium.sh/docs/auth)
- [carbium.sh/docs/endpoints](https://carbium.sh/docs/endpoints)
