Mayhem mode is an alternate operating mode that routes token vaults and fees through the Mayhem program instead of the standard Pump program. It's set per-token at creation time and cannot be changed afterward.
When a token is created with mayhemMode: true, the on-chain program derives a separate set of PDAs, fee recipients, and token vaults from the Mayhem program ID. The bonding curve math and trading mechanics remain identical — only the account routing changes.
- Separate fee accounting — mayhem tokens use
reservedFeeRecipient/reservedFeeRecipientsfrom the global state, keeping fee collection separate from standard tokens - Alternate vault routing — tokens are held in vaults derived from the Mayhem program ID, providing isolation from standard Pump vaults
- Token-2022 support — mayhem mode uses
TOKEN_2022_PROGRAM_IDfor token vaults instead of the standard SPL Token program
- If you don't need separate fee routing, use
mayhemMode: false(the default) - Mayhem mode cannot be toggled after token creation — choose carefully
- Most standard PumpFun use cases don't require mayhem mode
Set mayhemMode: true when creating a token:
import { PUMP_SDK } from "@nirholas/pump-sdk";
const instruction = await PUMP_SDK.createV2Instruction({
mint: mint.publicKey,
name: "My Token",
symbol: "MTK",
uri: "https://example.com/metadata.json",
creator: wallet.publicKey,
user: wallet.publicKey,
mayhemMode: true, // ← enables mayhem mode
});Note: Mayhem mode must be set at creation time. You cannot switch a token between normal and mayhem mode after it's created.
In normal mode, fee recipients are drawn from:
global.feeRecipientglobal.feeRecipients(array)
In mayhem mode, fee recipients are drawn from:
global.reservedFeeRecipientglobal.reservedFeeRecipients(array)
import { getFeeRecipient } from "@nirholas/pump-sdk";
// Normal mode — picks from standard fee recipients
const recipient = getFeeRecipient(global, false);
// Mayhem mode — picks from reserved fee recipients
const mayhemRecipient = getFeeRecipient(global, true);The getFeeRecipient function is called internally by the SDK when building buy/sell instructions. You only need to call it directly if you're building custom transaction logic.
Mayhem mode tokens use vaults derived from the Mayhem program instead of the standard Pump program:
| Aspect | Normal Mode | Mayhem Mode |
|---|---|---|
| Token vault | Standard bonding curve ATA | getTokenVaultPda(mint) — Mayhem program |
| SOL vault | Standard Pump SOL vault | getSolVaultPda() — Mayhem program |
| Token program | TOKEN_PROGRAM_ID |
TOKEN_2022_PROGRAM_ID |
| Mayhem state | Not used | getMayhemStatePda(mint) — per-token |
| Global params | Not used | getGlobalParamsPda() — shared |
Mayhem mode introduces four additional PDAs, all derived from the Mayhem program ID (MYH2mwFDd7oGCfBFCGMhrNzNBhrDMPRi4iJsGf6G96y):
import {
getGlobalParamsPda,
getMayhemStatePda,
getSolVaultPda,
getTokenVaultPda,
MAYHEM_PROGRAM_ID,
} from "@nirholas/pump-sdk";
// Mayhem global configuration (shared across all mayhem tokens)
const globalParams = getGlobalParamsPda();
// Seeds: ["global-params"] → MAYHEM_PROGRAM_ID
// Per-token mayhem state (unique per mint)
const mayhemState = getMayhemStatePda(mint);
// Seeds: ["mayhem-state", mint.toBuffer()] → MAYHEM_PROGRAM_ID
// Shared SOL vault (holds SOL reserves for all mayhem tokens)
const solVault = getSolVaultPda();
// Seeds: ["sol-vault"] → MAYHEM_PROGRAM_ID
// Per-token vault (Token-2022 ATA of the SOL vault for this mint)
const tokenVault = getTokenVaultPda(mint);When you call createV2Instruction or buyInstructions/sellInstructions, the SDK automatically:
- Reads the
mayhemModeparameter (from your input or from the bonding curve state) - Includes the Mayhem program ID and PDAs in the instruction accounts
- Selects the correct fee recipient (
reservedvsstandard) - Uses the appropriate token program for vault operations
You don't need to manually construct mayhem-specific accounts — the SDK does it for you.
You can check if a bonding curve was created in mayhem mode by reading the isMayhemMode field:
const bondingCurve = await sdk.fetchBondingCurve(mint);
if (bondingCurve.isMayhemMode) {
console.log("This token uses mayhem mode");
// The SDK handles this automatically for buy/sell instructions
}You can also check the global state to see if mayhem mode is enabled at the protocol level:
const global = await sdk.fetchGlobal();
if (global.mayhemModeEnabled) {
console.log("Mayhem mode is enabled globally");
}When buying or selling mayhem mode tokens, pass the bonding curve state (which carries isMayhemMode) — the SDK routes accounts correctly:
// This works identically for both normal and mayhem tokens
const buyIxs = await PUMP_SDK.buyInstructions({
global,
bondingCurveAccountInfo,
bondingCurve, // Contains isMayhemMode — SDK reads it internally
associatedUserAccountInfo,
mint,
user,
amount: tokenAmount,
solAmount,
slippage: 1,
tokenProgram,
});Fee sharing (shareholders, distributions) works the same way for mayhem tokens. The fee collection routing is different but the distribution mechanism is identical.
When a mayhem token graduates and migrates to PumpAMM, the migration instruction handles the transition from mayhem vaults to the AMM pool. No special handling is required.
- Fee Sharing Guide — creator fee distribution
- Architecture — SDK module layout
- API Reference — full PDA function signatures
The isMayhemMode flag is set at creation time based on global.mayhemModeEnabled and stored permanently in the bonding curve account.
Mayhem mode slightly alters how mintSupply is passed to fee calculations. In normal mode, ONE_BILLION_SUPPLY (1,000,000,000,000,000) is used as the mint supply for fee tier computation. In mayhem mode, the actual mintSupply from the bonding curve is used instead:
// Internal to fees.ts — you don't call this directly
const { protocolFeeBps, creatorFeeBps } = computeFeesBps({
global,
feeConfig,
mintSupply: isMayhemMode ? mintSupply : ONE_BILLION_SUPPLY,
virtualSolReserves,
virtualTokenReserves,
});This means mayhem mode tokens may fall into different fee tiers than normal mode tokens at the same reserve levels.
| Constant | Address |
|---|---|
MAYHEM_PROGRAM_ID |
MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e |
import { MAYHEM_PROGRAM_ID } from "@nirholas/pump-sdk";- Architecture — SDK design and program overview
- Bonding Curve Math — Price calculation formulas
- Fee Tiers — Market-cap-based fee rates
- API Reference — Full function signatures