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

# Rug-pull label dataset

A table of mint inputs read from Carbium RPC, with authorities, extensions and activity per token, stored in SQLite with a weak label and an empty outcome column, plus how to fill the outcome later without leaking the answer into the inputs.

## What the label has to say

A rug-pull dataset is a table with one row per token and one column that says whether the token was rugged. The chain hands you the inputs for that row in two calls. It does not hand you the label. Whether a token was a rug pull is a judgment about what happened to it afterwards: the creator pulled the pool's liquidity, minted new supply and sold it, or kept a power over holders' balances and used it. Each of those is an event, and an event is found by watching later transactions, not by reading a mint account today.

So the dataset has two parts that arrive at different times. The inputs are read when you first see the token. The outcome is filled in after a window you choose has passed. The script below writes the first part and leaves a null `outcome` column for the second, so the table is the same shape before and after labelling.

> Keep that order. Inputs read after a token has died describe the aftermath. A creator can revoke an authority after selling, and a model trained on rows read at that point learns that a revoked authority means a rug.

## The columns one mint gives you

| Column | Where it comes from | What it tells a classifier |
|---|---|---|
| `mint` | the address you pass | the key of the row |
| `program` | owner of the mint account | the Token program or Token-2022, which adds extensions |
| `slot` | context of the account read | the moment of the reading, for comparing against later reads |
| `decimals`, `supply` | parsed mint | scale and size, with supply kept as a string |
| `mint_authority`, `freeze_authority` | parsed mint | null once revoked; a value means someone can still mint or freeze |
| `extensions` | Token-2022 extension list | a permanent delegate can move or burn any holder's tokens; a transfer hook runs the creator's program on every transfer and can block it |
| `page_count`, `page_oldest` | newest 100 signatures of the mint | how busy the mint is, and the block time of the oldest signature in that page |

Supply goes in as text. A mint's raw supply is an unsigned 64-bit integer, and a JavaScript number loses digits above 2^53, so a high-decimal token would get a wrong last few digits.

The column people ask for next is holder concentration. `getTokenLargestAccounts` is not served and answers -32601, so concentration comes from token accounts you already know, read by address, or from your own indexer. The script leaves it out.

## The script that writes the rows

One file on `@solana/kit` 8.6.0 and `node:sqlite`. It exits with a message when `CARBIUM_KEY` is unset. Pass mint addresses as arguments, or pass none to read three well-known public mints: USDC, wrapped SOL and BONK. It writes `rugs.db` in the current folder.

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

```ts
// SI0105 · Rug-pull label dataset
// https://carbium.sh/library/si/rug-pull-label-dataset
// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.
// SPDX-License-Identifier: MIT

// Rug-pull dataset rows from mint accounts. Run: CARBIUM_KEY=... node main.ts [mint ...]
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 = [
  "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "So11111111111111111111111111111111111111112",
  "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
];
const mints = process.argv.length > 2 ? process.argv.slice(2) : DEFAULTS;
const RISKY_EXTENSIONS = ["permanentDelegate", "transferHook"];

const db = new DatabaseSync("rugs.db");
db.exec(`CREATE TABLE IF NOT EXISTS labels (
  mint TEXT PRIMARY KEY, program TEXT, slot INTEGER, decimals INTEGER, supply TEXT,
  mint_authority TEXT, freeze_authority TEXT, extensions TEXT,
  page_count INTEGER, page_oldest INTEGER, powers TEXT, outcome TEXT)`);
const seen = db.prepare("SELECT 1 FROM labels WHERE mint = ?");
const insert = db.prepare("INSERT INTO labels VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL)");

async function read(mint: string): Promise<void> {
  const [info, page] = await Promise.all([
    rpc.getAccountInfo(address(mint), { encoding: "jsonParsed" }).send(),
    rpc.getSignaturesForAddress(address(mint), { limit: 100 }).send(),
  ]);
  const parsed = (info.value?.data as any)?.parsed;
  if (parsed?.type !== "mint") throw new Error("not a mint account");
  const i = parsed.info;
  const extensions: string[] = (i.extensions ?? []).map((e: { extension: string }) => e.extension);
  const times = page.flatMap((s) => (s.blockTime === null ? [] : [Number(s.blockTime)]));
  const powers = [
    i.mintAuthority && "mintAuthority",
    i.freezeAuthority && "freezeAuthority",
    ...extensions.filter((e) => RISKY_EXTENSIONS.includes(e)),
  ].filter(Boolean).join(",");
  insert.run(
    mint, String(info.value?.owner), Number(info.context.slot), i.decimals, i.supply,
    i.mintAuthority ?? null, i.freezeAuthority ?? null, extensions.join(","),
    page.length, times.length ? Math.min(...times) : null, powers,
  );
}

for (const mint of mints) {
  try {
    if (seen.get(mint)) console.log(mint, "already stored");
    else await read(mint);
  } catch (e) {
    console.error(mint, "failed:", (e as Error).message);
  }
}
for (const row of db.prepare("SELECT mint, decimals, powers, page_count, outcome FROM labels").all()) {
  console.log(JSON.stringify(row));
}
db.close();
```

Each mint takes two calls: `getAccountInfo` with `jsonParsed` encoding, and `getSignaturesForAddress` with a limit of 100. Neither names a commitment, so kit fills in confirmed. The `slot` column holds the slot of the account read. A mint already in the table is skipped, and a mint that fails prints its error while the loop moves on to the next one. The run ends by printing the table, one JSON object per row, with `outcome` null on each.

The insert has no replace clause, so the table keeps the first reading of each mint. That is deliberate: the row holds what was visible at first sight, and a later run cannot overwrite it with the aftermath.

## A weak label to start with

The `powers` column lists which of four things a mint still allows: minting, freezing, a permanent delegate and a transfer hook. An empty string means none of them. It is a weak label, a cheap rule that sorts rows into two piles before anyone has looked at them.

Its precision is poor. A stablecoin issuer keeps its mint and freeze authority by design, so `powers` is set on a token nobody calls a rug. Its recall is weak too, since a pulled pool needs no authority at all. Use the column to order the work: it picks the rows a person or a later job labels first, and it is a feature column for a model, never the answer.

The outcome comes from following the mint after the reading. Walk its newer signatures, read the transactions, and record what you decided to call a rug: supply minted after the reading, or a pool drained. When that job reads transactions it passes `maxSupportedTransactionVersion: 1` with an encoding, because with the value absent or 0 a v1 transaction answers -32015. It also treats a null from `getTransaction` as a skip: the signature pages reach below the validator's ledger floor, so an older listed signature can come back null.

Write the outcome at the end of a fixed window for every row, the same length for all of them. A model that sees rows with a one-day window next to rows with a thirty-day window learns the window. Run the follow-up before 30 days have passed since the reading: the address index keeps 30 days, so the first signatures after the reading drop out of it if you wait longer. For the same reason, split train and test by the reading's `slot`, so the test rows are newer than every training row. [30-day training dataset](https://carbium.sh/library/si/30-day-training-dataset) covers the 30-day window as training data.

## Calls and cost

A mint costs one account read at 10 cells and one signature page at 50 cells, 60 cells in all. A list of 1,000 mints is 60,000 cells of admission. The signature page is the narrower door, so it sets the pace on a small plan.

| Method | Cells | Free | Dev | Business | Pro |
|---|---|---|---|---|---|
| `getAccountInfo` | 10 | 0.5 req/s | 15 req/s | 50 req/s | 400 req/s |
| `getSignaturesForAddress` | 50 | 0.24 req/s | 1.2 req/s | 100 req/s | 500 req/s |

The loop runs one mint at a time. On a 429 the mint fails, the script prints it, and a rerun picks up the mints that are missing, because stored mints are skipped. See the [rate limits](https://carbium.sh/docs/limits) for how a call over its rate is handled.

A long list of mints belongs on a plan where `getSignaturesForAddress` runs at a higher rate. If you only need authorities and extensions, drop the signature call and the cost per mint falls to 10 cells.

## Where it ends

- The table has no outcome. Someone has to define a rug pull, run the follow-up job and check a sample by hand. Lists of flagged tokens that others publish can seed the column, and each needs the same check that its inputs were read before the event.
- `getSignaturesForAddress` reaches back 30 days at most, from its own address index, and an empty page past that marks the index's age limit. The launch time and the creator of an older mint are not in this table.
- There is no liquidity or pool state. Reading a pool needs that exchange's account layout, and a liquidity pull is the commonest rug of all, so `powers` misses it.
- Rugs are rare next to the tokens that never do it. A classifier on this table needs class weights or resampling, and accuracy alone will look good for a model that says clean every time.
- The script refuses an account that is not a mint. A token account address fails with a message, and the loop goes on.

## When it goes wrong

| What goes wrong | What to do |
|---|---|
| A row has an empty `powers` column and the token still rugged. | Authority-free rugs pull liquidity instead of minting. Add pool-state columns from that exchange's account layout, or label from the follow-up events and keep `powers` as one column among several. |
| `page_oldest` looks recent on every busy mint. | The page holds the newest 100 signatures, so on a busy mint it can cover only seconds or minutes. Use `page_count` with the span as an activity rate and take age from somewhere else. |
| A 429 stops a long list partway through. | The failed mint prints its error and the loop continues. Rerun the same command: stored mints are skipped and the missing ones are read. |
| A method copied from another recipe, such as `getTokenLargestAccounts`, answers -32601. | Do not retry it. Read the token accounts you know with a served method, or build concentration in your own indexer. |
| The last digits of `supply` are wrong in a spreadsheet or a notebook. | Keep supply as text in SQLite and convert with a big-integer type in the notebook, never a float. |
| `getTransaction` answers null for a signature the page listed. | Skip it. Signature pages reach below the ledger floor, so an older listed signature can be missing. Build the follow-up on the newest signatures. |

## Questions

### Does Carbium serve a labelled rug-pull dataset?

No. Carbium serves the chain reads that build one. The labels come from your own definition of a rug and from lists you trust, checked against what the chain shows.

### Why read the mint with jsonParsed encoding?

The parsed form returns the authorities, the decimals and the extension names as fields. The script reads them directly and does not decode the 82-byte mint layout by hand.

### Can I build the labels from a single account read?

No. One read shows what a mint allows at one moment. A rug is something that happens later, so the label needs a second look after your window has passed.

### Which plan fits a long list of mints?

One where `getSignaturesForAddress` runs at a higher rate. Free allows 0.24 req/s for it and Dev 1.2 req/s. Leaving the signature call out lets the account read set the pace alone.

### Where do holders come in?

Concentration is the next column to add. It needs the mint's token accounts with their balances, so read the ones you already know by address or keep holders in your own indexer. `getTokenLargestAccounts` is not served, so it cannot fill the column.

## Related

- [Token authority screening](https://carbium.sh/library/usecase/token-authority-screening) (Use cases, UC0009)
- [30-day training dataset](https://carbium.sh/library/si/30-day-training-dataset) (AI and blockchain, SI0014)
- [carbium.sh/docs/rpc](https://carbium.sh/docs/rpc)
- [carbium.sh/docs/limits](https://carbium.sh/docs/limits)
- [carbium.sh/docs/migrate](https://carbium.sh/docs/migrate)
- [carbium.sh/docs/errors](https://carbium.sh/docs/errors)
