Skip to content

Add Pumpfun mayhem mode detection#92

Open
TornGuard wants to merge 2 commits intocxcx-ai:mainfrom
TornGuard:add-pumpfun-mayhem-mode
Open

Add Pumpfun mayhem mode detection#92
TornGuard wants to merge 2 commits intocxcx-ai:mainfrom
TornGuard:add-pumpfun-mayhem-mode

Conversation

@TornGuard
Copy link
Copy Markdown

Summary

Implements detection for Pumpfun's new mayhem mode feature as requested in #90.

What is Mayhem Mode?

Mayhem mode is an optional feature for Pumpfun tokens created with the create_v2 instruction. Coins with mayhem mode enabled use a different fee recipient account (GesfTA3X2arioaHp8bbKdjG9vJtskViWACZoYvxp4twS).

Changes

Type Definitions

  • Added isMayhemMode?: boolean field to TradeInfo interface (src/types/trade.ts)
  • Added isMayhemMode?: boolean field to MemeEvent interface (src/types/meme.ts)
  • Added isMayhemMode: boolean field to PumpswapBuyEvent and PumpswapSellEvent interfaces (src/types/pumpswap.ts)

Constants

  • Added mayhem fee recipient to FEE_ACCOUNTS array (src/constants/programId.ts)

Detection Logic

  • Pumpfun parser (src/parsers/pumpfun/parser-pumpfun-event.ts): Checks if mayhem fee recipient exists in transaction account keys
  • Pumpswap parser (src/parsers/pumpfun/parser-pumpswap-event.ts): Checks if protocol fee recipient matches mayhem fee recipient

Technical Details

  • Mayhem Fee Recipient: GesfTA3X2arioaHp8bbKdjG9vJtskViWACZoYvxp4twS
  • Detection Method:
    • For Pumpfun bonding curve trades: Check if mayhem fee recipient is in transaction accounts
    • For Pumpswap trades: Check if protocolFeeRecipient field equals mayhem fee recipient
  • Result: isMayhemMode is set to true when detected, making it easy for users to identify mayhem mode trades

Testing

  • ✅ Project builds successfully with TypeScript
  • ✅ All type definitions properly updated
  • ✅ Detection logic integrated into existing parsers

Example Usage

const parser = new DexParser();
const result = await parser.parseAll(transaction);

if (result.trades && result.trades.length > 0) {
  const trade = result.trades[0];
  if (trade.isMayhemMode) {
    console.log('This is a mayhem mode trade!');
  }
}

Closes #90

toadevm added 2 commits November 14, 2025 16:42
- Added Axiom (BLUR9cL8HqZzu5bSaC7VRX25RCG93Hv3T6NPyKxQhWUT) to DEX_PROGRAMS
- Added Padre (9Fox6i7oT8p4qHn76Qj3dks8RRMGsXQyfMSBScA5yVyX) to DEX_PROGRAMS
- Updated README.md Trading Bots section
- Both tested with live mainnet transactions
Implements detection for Pumpfun's new mayhem mode feature.

Changes:
- Added isMayhemMode field to TradeInfo, MemeEvent, and Pumpswap event types
- Added mayhem fee recipient to FEE_ACCOUNTS constant
- Implemented detection logic in Pumpfun and Pumpswap event parsers
- Mayhem mode is detected by checking for the mayhem fee recipient account

Technical details:
- Mayhem fee recipient: GesfTA3X2arioaHp8bbKdjG9vJtskViWACZoYvxp4twS
- Detection works for both bonding curve and Pumpswap trades
- isMayhemMode flag is set to true when mayhem fee recipient is present

Closes cxcx-ai#90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mayhem mode?

1 participant