DEV Community

TateLyman
TateLyman

Posted on

How to Detect Solana Rug Pulls Programmatically — 5 On-Chain Red Flags

Rug pulls are the #1 risk for Solana traders. Here's how to detect them programmatically using the Solana RPC API.

1. Mint Authority Active

If the mint authority hasn't been revoked, the token creator can inflate supply infinitely.

const mintInfo = await connection.getParsedAccountInfo(mintPubkey);
const mintAuth = mintInfo.value?.data?.parsed?.info?.mintAuthority;
if (mintAuth) console.log('RED FLAG: Mint authority active');
Enter fullscreen mode Exit fullscreen mode

2. Freeze Authority Active

Freeze authority lets the creator lock any wallet's tokens, preventing sales.

const freezeAuth = mintInfo.value?.data?.parsed?.info?.freezeAuthority;
if (freezeAuth) console.log('RED FLAG: Freeze authority active');
Enter fullscreen mode Exit fullscreen mode

3. Top Holder Concentration

If one wallet holds >30% of supply (excluding liquidity pools), it's a dump risk.

Use getTokenLargestAccounts RPC method to check.

4. Low Liquidity

Check the token's liquidity pool size relative to market cap. If LP is <10% of market cap, exit liquidity is limited.

5. Mutable Metadata

If token metadata can be changed, the name and symbol can be swapped to impersonate legitimate tokens.

Automate It

Top comments (0)