---
id: SI0035
title: "Rug-risk token scorer"
url: https://carbium.sh/library/si/rug-risk-token-scorer
collection: AI and blockchain
category: ML classification
revision: 1
updated: 2026-11-22
author: Carbium
code: MIT (LICENSE in the zip); text: all rights reserved, Carbium Corporation
---

# Rug-risk token scorer

A ruggability check for any mint. It reads the mint account for live mint and freeze authority and for Token-2022 powers, adds how new the token is, and prints a score from 0 to 100 with one line per reason.

## What a rug needs

A rug pull is a creator taking value from holders after they buy; some of the ways to do it are switches kept on the mint account, which anyone can read.

- Mint authority: whoever holds it can create more supply at any time, which dilutes every holder.
- Freeze authority: whoever holds it can freeze a holder's token account so the tokens cannot move.
- Permanent delegate (Token-2022): the delegate can transfer or burn tokens out of any holder's account.
- Transfer fee (Token-2022): every transfer withholds a share, and a high rate makes selling expensive.
- Transfer hook (Token-2022): a program the creator chose runs on every transfer and can refuse it.
- Default account state frozen (Token-2022): new token accounts start frozen until the authority thaws them.

Revoking an authority sets its field to null for good, so a null settles the question. A live authority is a power someone holds, whether or not they ever use it. The scorer adds points for each power it finds and prints the list, so you see why a number came out as it did. [Token mint supply and authorities](https://carbium.sh/library/howsolana/token-mint-supply-and-authorities) reads supply and authorities on their own, and [Token authority screening](https://carbium.sh/library/usecase/token-authority-screening) covers authority screening as a standing check.

## The signals and their weights

| Signal | Where it lives | Points |
|---|---|---|
| Mint authority is live | `mintAuthority` on the mint | 35 |
| Freeze authority is live | `freezeAuthority` on the mint | 25 |
| Permanent delegate set | `permanentDelegate` extension | 30 |
| Transfer fee above zero | `transferFeeConfig` extension | 10 |
| Transfer hook program set | `transferHook` extension | 15 |
| New accounts start frozen | `defaultAccountState` extension | 20 |
| Oldest indexed signature under 24 hours old | oldest signature that mentions the mint | 10 |

The weights are a judgment call. They are set so that a live mint authority plus a live freeze authority lands exactly on 60, the line for high. Change the numbers in `score` to fit what you screen. The total is capped at 100.

The age signal is the weakest one. A new mint has had no time to build a record, and plenty of honest tokens are new.

## The scorer

One file, with `@solana/kit` and Node's own modules. Set `CARBIUM_KEY` first; the file exits with a message when it is unset.

`main.ts` (run: `node main.ts`)

```ts
// SI0035 · Rug-risk token scorer
// https://carbium.sh/library/si/rug-risk-token-scorer
// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.
// SPDX-License-Identifier: MIT

// Rug-risk score for SPL mints from their live authorities and Token-2022 extensions.
// Run: CARBIUM_KEY=... node main.ts [mint ...]
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 rpc = createSolanaRpcFromTransport(
  createDefaultRpcTransport({
    url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh",
    headers: { "x-api-key": key },
  }),
);

const DEFAULT_MINTS = [
  "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
];
type Finding = [points: number, why: string];

async function score(mint: string) {
  const [account, sigs] = await Promise.allSettled([
    rpc.getAccountInfo(address(mint), { encoding: "jsonParsed" }).send(),
    rpc.getSignaturesForAddress(address(mint), { limit: 1000 }).send(),
  ]);
  if (account.status === "rejected") throw account.reason;
  const parsed: any = (account.value.value?.data as any)?.parsed;
  if (parsed?.type !== "mint") throw new Error("not an SPL mint");
  const info = parsed.info;
  const ext: Record<string, any> = Object.fromEntries(
    (info.extensions ?? []).map((e: any) => [e.extension, e.state]),
  );

  const found: Finding[] = [];
  if (info.mintAuthority) found.push([35, "mint authority is live, supply can grow"]);
  if (info.freezeAuthority) found.push([25, "freeze authority is live, accounts can be frozen"]);
  if (ext.permanentDelegate?.delegate) found.push([30, "permanent delegate can move or burn any balance"]);
  if (Number(ext.transferFeeConfig?.newerTransferFee?.transferFeeBasisPoints) > 0) {
    found.push([10, "transfer fee above zero"]);
  }
  if (ext.transferHook?.programId) found.push([15, "transfer hook program runs on every transfer"]);
  if (ext.defaultAccountState?.accountState === "frozen") found.push([20, "new token accounts start frozen"]);

  if (sigs.status === "rejected") {
    found.push([0, "age unknown, signature read failed"]);
  } else if (sigs.value.length === 1000) {
    found.push([0, "age unknown, 1,000 signatures fill the page"]);
  } else {
    const oldest = sigs.value.at(-1);
    const ageHours = oldest?.blockTime ? (Date.now() / 1000 - Number(oldest.blockTime)) / 3600 : Infinity;
    if (ageHours < 24) {
      found.push([10, "oldest signature in the 30-day index is under 24 hours old"]);
    }
  }

  const total = Math.min(100, found.reduce((sum, [points]) => sum + points, 0));
  return {
    mint,
    score: total,
    band: total >= 60 ? "high" : total >= 25 ? "medium" : "low",
    reasons: found.map(([points, why]) => `+${points} ${why}`),
  };
}

for (const mint of process.argv.length > 2 ? process.argv.slice(2) : DEFAULT_MINTS) {
  try {
    console.log(JSON.stringify(await score(mint)));
  } catch (e) {
    console.log(JSON.stringify({ mint, error: (e as Error).message }));
  }
}
```

Pass any number of mint addresses as arguments. With none, it scores two well-known mints. Each mint prints one line of JSON with `mint`, `score`, `band` and `reasons`, where every reason carries its points. A mint that fails prints `mint` and `error` instead, and the loop moves on to the next one.

The account read asks for `jsonParsed`, so the node decodes the mint and the extension list for you. A token account or a program account comes back with another parsed type and a plain wallet with none, and the file refuses them either way with `not an SPL mint`. The signature read is allowed to fail without sinking the score: the reasons then say the age is unknown. A full page of 1,000 signatures says the same, because the oldest signature on it is not the first one the mint ever had.

## Reading a score

- 0 to 24, low: no mint authority, no freeze authority and no permanent delegate. A transfer hook or a fee alone still lands here.
- 25 to 59, medium: a live mint authority, freeze authority or permanent delegate on its own, or smaller extensions and a new mint that add up to 25.
- 60 and over, high: several powers reach the line, such as a live mint authority together with a live freeze authority.

High is a count of powers, and it says nothing about intent. The USDC mint keeps both a live mint authority and a live freeze authority, because its issuer needs them, and it scores 60. What the number tells you is who can act on your balance and how many ways they have. Whether you accept that holder is your call, and the reasons list names exactly what you are accepting.

Low carries a smaller claim. It says the mint has no mint or freeze authority and no permanent delegate. Anyone can still build a rug around a clean mint, through its pool or its holders.

## What a run costs

Per mint the scorer makes one account read and one signature read. An account read costs 10 cells and `getSignaturesForAddress` costs 50, so one mint is 60 cells and a list of 100 mints is 6,000. The signature read is the slower of the two on Free and Dev, where the [limits](https://carbium.sh/docs#limits) are 0.24 and 1.2 req/s against 0.5 and 15 req/s for the account read. The loop runs one mint at a time with no pause, so on those two plans a long list needs a delay between mints.

Both reads leave commitment out, and `@solana/kit` fills in `confirmed` when a call does that. Every score here is a reading at confirmed.

## Where it ends

- Liquidity is outside the mint. Whether a pool's liquidity tokens are burned or locked, and who can pull the pool, lives in other accounts that this file never reads. A clean mint can still be drained through its pool.
- Holder concentration is missing. `getTokenLargestAccounts` is not served and answers -32601, so the biggest holders are not read here. A token where ten wallets hold nearly everything scores the same as one with a wide spread.
- The age check reaches back only as far as the address index, which keeps up to 30 days. An old mint with little traffic, whose only signatures in that window are from today, scores as new. A mint with 1,000 signatures or more in the window gets no age points and its reasons say the age is unknown, and an empty page past 30 days marks the index limit and leaves the address's older history unread.
- A live authority is reported without its holder. It may be a single wallet, a multisig or a program, and the file does not tell them apart. A transfer hook is flagged for existing, and what its program does is yours to read.
- Extensions outside the table are ignored. A scorer for Token-2022 needs a line for each extension you care about.

## When it goes wrong

| What goes wrong | What to do |
|---|---|
| The run prints `not an SPL mint` for an address that is a token. | The address is a token account, a wallet or another program's account. Pass the mint. A token account's parsed data carries its mint address. |
| A mint launched today prints `age unknown, 1,000 signatures fill the page` and gets no age points. | A busy new token fills the 1,000-signature page, which hides its oldest signature, so the scorer cannot read its age. Treat that age as unknown, and do not read the missing points as a sign the mint is old. The reverse also happens: an old mint with few signatures in the window can read as new. |
| A well-run token scores high and someone reads that as a scam warning. | Show the `reasons` next to the number. The band counts powers held, and a regulated stablecoin holds several by design. |
| A Token-2022 mint with an extension scores zero for it. | The scorer reads only the extensions in its table. Add the extension's name from the parsed list and a weight to `score`. |
| The run answers 401 on every call. | An unknown key gets 401 at the door. Attach the whole key in `CARBIUM_KEY`, with no prefix cut off. |

## Questions

### Can this tell me a token is safe?

No. A low score says the mint has no mint or freeze authority and no permanent delegate. Pool liquidity, holder spread and the creator's other wallets sit outside the mint and outside this file.

### Why does the scorer skip holder concentration?

The usual call for it, `getTokenLargestAccounts`, is not served and answers -32601, which you should not retry. Holder data needs another route, and this file stays on the mint.

### Can I score many mints in one call?

`getMultipleAccounts` reads up to 100 mints a call below Pro, and 300 on Pro, at 10 cells per pubkey. Swap it in for the account read and keep one signature read per mint.

### Is a revoked authority final?

Yes. Setting an authority to none cannot be undone, so a null field stays null. A live authority can be revoked at any time, which makes a score a reading of today.

## Related

- [Token mint supply and authorities](https://carbium.sh/library/howsolana/token-mint-supply-and-authorities) (How to use Solana, HS0005)
- [Token authority screening](https://carbium.sh/library/usecase/token-authority-screening) (Use cases, UC0009)
- [carbium.sh/docs#rpc](https://carbium.sh/docs#rpc)
- [carbium.sh/docs#errors](https://carbium.sh/docs#errors)
- [carbium.sh/docs#limits](https://carbium.sh/docs#limits)
- [carbium.sh/docs#auth](https://carbium.sh/docs#auth)
