services
Get a key

library / AI and blockchain / SI0041

Fake-pool route check

Give it the token mints on a swap route and it prints PASS, REVIEW or STOP for each: a known mint, a look-alike of one, or an unknown mint with its authorities and extensions listed. One account read covers the whole route.

By Carbium · Swap assistants · SI0041 · updated 2026-11-22

01

What a fake pool is on chain

Pool creation on Solana is permissionless. Anyone can mint a token, give it the name and symbol of a popular one, open a pool against SOL or USDC and seed it with a little liquidity. A router that finds the pool will quote it, because a quote only reports what the pool's curve returns for your input. Nothing in that step asks whether the token on the other side is the one you meant.

Token names and symbols are not unique, and a metadata account can say anything. The mint address is the only identity a token has. So the useful check compares mint addresses against ones you already trust, then looks at what an unknown mint's authorities and extensions allow.

The swap method builds an unsigned transaction that you sign and send through any RPC, so a gap exists between the route and your signature. A route can come from the quote method or from any other router. This file sits in that gap: pass it each mint the route touches. LP token classifier scores a mint's authorities for pool-shaped control; the check here asks whether each token on the route is the one you meant.

02

What one mint read shows

CheckWhere it comes fromWhat it tells you
Address is in your known lista local comparethe token is the one you meant
Address shares its first or last 4 characters with a known minta local comparea look-alike made to pass a glance at a shortened address
The account parses as a mintthe type field of the jsonParsed account dataa wallet, token account or program is not a token
Mint authority is livemintAuthoritythe supply can still grow
Freeze authority is livefreezeAuthorityan authority can freeze holders' token accounts
Extensions are presentthe Token-2022 extensions listtransfer fees, hooks or a permanent delegate can change what a transfer does

The real USDC mint has a live mint authority and a freeze authority, so authority flags alone would fail the token everyone means. Identity comes first: only a match in the known list produces PASS. For every other mint the authorities become evidence for a person to read.

A mint with both authorities revoked has a fixed supply. A copy of a popular token can revoke them too, so that state rules out some abuses and proves nothing about who issued the token.

03

The route check file

One file on @solana/kit 8.6.0 and Node 24, which runs the TypeScript directly. Set CARBIUM_KEY first; the file exits with a message when it is missing. CARBIUM_RPC_URL overrides the endpoint, which defaults to https://services.carbium.sh. The key goes out in the x-api-key header.

main.ts
// SI0041 · Fake-pool route check// https://carbium.sh/library/si/fake-pool-route-check// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.// SPDX-License-Identifier: MIT// Fake-pool route check: judge the token mints on a swap route before you sign.// 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 url = process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh";const rpc = createSolanaRpcFromTransport(createDefaultRpcTransport({ url, headers: { "x-api-key": key } }));// Mints you trust, copied from the issuers' own pages. Extend it for your own routes.const KNOWN: Record<string, string> = {  EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v: "USDC",  Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB: "USDT",  So11111111111111111111111111111111111111112: "wSOL",};const TOKEN_PROGRAM = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";type Info = {  mintAuthority: string | null;  freezeAuthority: string | null;  supply: string;  decimals: number;  extensions?: { extension: string }[];};type Acct = { owner: string; data: { parsed?: { type: string; info: Info } } | string[] };const mints = process.argv.length > 2 ? process.argv.slice(2) : [...Object.keys(KNOWN), TOKEN_PROGRAM];if (mints.length > 100) {  console.error("At most 100 mints a call; split the list.");  process.exit(1);}function judge(mint: string, acct: Acct | null): [string, string] {  const parsed = acct && !Array.isArray(acct.data) ? acct.data.parsed : undefined;  if (!parsed || parsed.type !== "mint") {    return ["STOP", acct ? "account exists but is not a mint" : "no account at this address"];  }  const i = parsed.info;  const facts = [    i.mintAuthority ? "mint authority live" : "mint authority revoked",    i.freezeAuthority ? "freeze authority live" : "no freeze authority",    `supply ${i.supply} at ${i.decimals} decimals`,  ];  if (i.extensions?.length) facts.push(`extensions ${i.extensions.map((e) => e.extension).join(",")}`);  const detail = facts.join(", ");  if (KNOWN[mint]) return ["PASS", `${KNOWN[mint]} canonical | ${detail}`];  const twin = Object.keys(KNOWN).find((k) => k.slice(0, 4) === mint.slice(0, 4) || k.slice(-4) === mint.slice(-4));  if (twin) return ["STOP", `looks like ${KNOWN[twin]} but is a different mint | ${detail}`];  return ["REVIEW", `unknown mint | ${detail}`];}try {  const addrs = mints.map((m) => address(m));  const { value } = await rpc.getMultipleAccounts(addrs, { commitment: "finalized", encoding: "jsonParsed" }).send();  let flagged = 0;  mints.forEach((m, i) => {    const [verdict, why] = judge(m, value[i] as unknown as Acct | null);    if (verdict !== "PASS") flagged++;    console.log(`${verdict.padEnd(7)} ${m} | ${why}`);  });  console.log(`${mints.length} mints, ${flagged} need a look`);} catch (e) {  console.log(`no verdict | ${(e as Error).message}`);  process.exitCode = 1;}

run: node main.ts

Pass the mint addresses from your route as arguments. With none, it checks four built-in addresses: the USDC, USDT and wSOL mints, which print PASS, and the token program's own address, which prints STOP because it is a program and no mint. One line comes out per address, with the verdict, the address and what the read showed.

Edit the KNOWN table to hold the mints your application deals in. Copy each address once from the issuer's own site and keep the table in version control, so a change to it shows up in review.

04

Reading the three verdicts

  • PASS: the address equals a mint in your table. The authority and supply facts are printed for the record and do not change the verdict.
  • REVIEW: a valid mint you have not vouched for. It may be genuine, a new launch, or a copy. Find where the address came from, compare it with the issuer's published one, and add it to the table if it checks out.
  • STOP: no account, an account that is no mint, or a mint that looks like a known one without matching it. Do not sign a route through it.

If any mint on the route prints REVIEW or STOP, hold the signature until a person has looked.

!A failed read carries no verdict. The file prints no verdict and exits with status 1. Rerun the same list, and treat the route as unchecked in the meantime.
05

Reads, cost and commitment

The file reads every mint with one getMultipleAccounts call. It charges 10 cells per pubkey, so a route of 4 mints costs 40 cells, and 100 pubkeys cost 1,000 cells (1,001 over a 4 KiB body). The call takes up to 300 pubkeys, but the 1,024-cell burst caps a call at 100 below Pro, so 300 is a Pro number. The file stops at 100 before it sends anything. Account reads run at 0.5, 15, 50 and 400 req/s on Free, Dev, Business and Pro. Limits are per account, and an account's keys share one budget.

The call sets finalized itself, so the authorities and extensions it judges come from a state no fork can drop. Finalized sits 0 to 1 slots behind processed, so a mint created in the last slot or so reads as no account and prints STOP until it is finalized.

06

Where it ends

  • The known list is yours. An unknown mint can be genuine, and the file only says nobody has vouched for it yet.
  • Pool depth is not read. A pool's reserves live in its vault token accounts, found through the pool program's layout. With a vault address in hand, getTokenAccountBalance reads the amount as an account read at 10 cells.
  • Holder concentration is not available. getTokenLargestAccounts is not served and answers -32601, which means do not retry.
  • Liquidity locks and who owns the pool's share tokens are not read. A pool whose creator can withdraw everything looks the same here as one whose creator cannot.
  • Extensions are listed by name and not decoded. A transfer hook runs another program on every transfer, and its logic needs reading by hand.
  • An unknown mint never gets PASS, but the file cannot tell whether a mint's freeze authority, transfer hook or the pool program itself would block a later sale. Only reading the code or simulating the sell shows that, and this file signs, sends and simulates nothing.
  • The read is a snapshot. An authority can change after it, so run the check close to the moment you sign.
  • Metadata names and symbols are not read. The check works from addresses alone.
07

When it goes wrong

what goes wrongwhat to do
Every address prints STOP with an account that is not a mint.You passed pool, vault or wallet addresses. Pass the token mints the route moves through.
The run prints no verdict with an invalid address message and no line per mint.kit checks each string for 32-byte base58 locally before any request is sent. Remove or correct the bad entry and run the list again.
The run prints no verdict after a 429.The whole list goes out as one getMultipleAccounts call at 10 cells per pubkey, so a long list draws more cells than a short one. Rerun the same list once the retry-after has passed.
A genuine mint you use prints STOP as a look-alike.It shares its first or last 4 characters with a mint in the table. Compare the whole address with the issuer's page and add it to KNOWN, which turns it into PASS.
More than 100 addresses are refused before any request.Split the route list into chunks of at most 100. Only a Pro key sends 300 in one call; raise the check in the file for that.
A holder-concentration check built on getTokenLargestAccounts answers -32601.Do not retry. The method is not served. Drop that input, or take holders from a source you control.
08

Questions

Does a revoked mint authority make a token safe?

It fixes the supply, which rules out new tokens appearing. A copy of a popular token can revoke its authorities as well, so the address still has to match the one you trust.

Why compare the first and last 4 characters?

Wallet screens often shorten an address to its two ends, and an attacker can grind an address to match them. The file compares the whole string for PASS and uses the ends only to spot a look-alike.

Can it check the pool itself?

Not from the mint. The pool's reserves sit in vault token accounts that the pool program's layout points to. Read a vault with getTokenAccountBalance, an account read at 10 cells, once you know its address.

Where does the known list come from?

From you. Copy each address once from the issuer's own site, review the table like any other code, and extend it as your routes grow. The file ships three.