debpf
pump.fun / instructions

Instruction

init_user_volume_accumulator

Decompiled

Creates the per-user "volume accumulator" PDA (seeds "user_volume_accumulator" + user) that pump.fun uses to track a wallet's trading volume for rewards. Anyone can call it and pay for any user's account. The user does not need to sign. The payer covers rent for the 137-byte account (about 0.0018444 SOL), and there is no protocol fee. It is init_if_needed, so if the account already exists the call just rewrites the same user field and emits the event again. The only things that can fail it are wrong seeds, the wrong event authority or program account, or the payer not having enough SOL for rent.

Discriminator
0x5e06ca73ff60e8b7
Calls in the sample
3
Reproduced, seen by the agent
—
Reproduced, never shown to the agent
—
Bytecodefn_25274
25274mov64 r8, r4
25275mov64 r9, r3
25276mov64 r7, r2
25277stxdw [r10-624], r1
25278lddw r1, 0x1ae600 ; "Instruction: InitUserVolumeAccumulator"
2527amov64 r2, 0x26
2527bcall sol_log_
2527csth [r10-562], 0xffff
2527dstxdw [r10-552], r8
2527estxdw [r10-560], r9
2527fmov64 r1, r10
25280add64 r1, -0x232
25281stxdw [r10-4088], r1
25282mov64 r1, r10
25283add64 r1, -0x110
25284mov64 r3, r10
25285add64 r3, -0x230
25286mov64 r5, r10
25287mov64 r2, r7
25288call fn_1ec5c
25289ldxdw r9, [r10-264]
2528aldxdw r8, [r10-272]
2528bldxb r6, [r10-6]
2528cjeq r6, 0x2, +148 ; -> 25321
2528dmov64 r1, r10
2528eadd64 r1, -0x210
2528fmov64 r2, r10
25290add64 r2, -0x100
25291stxdw [r10-632], r1
25292mov64 r3, 0xfa
25293call fn_35367
25294ldxw r1, [r10-5]
25295stxw [r10-277], r1
25296ldxb r1, [r10-1]
25297stxb [r10-273], r1
25298stxb [r10-278], r6
25299stxdw [r10-536], r9
2529astxdw [r10-544], r8
2529bldxb r1, [r10-561]
2529cstxb [r10-239], r1
2529dldxb r1, [r10-562]
2529estxb [r10-240], r1
2529fldxdw r1, [r10-552]
252a0stxdw [r10-248], r1
252a1ldxdw r1, [r10-560]
252a2stxdw [r10-256], r1
252a3mov64 r1, r10
252a4add64 r1, -0x220
252a5stxdw [r10-264], r1
252a6stxdw [r10-272], r7
252a7mov64 r1, r10
252a8add64 r1, -0x248
252a9mov64 r2, r10
252aaadd64 r2, -0x110
252abcall fn_0ed78
252acldxdw r8, [r10-584]
252adjeq r8, 0x2, +1 ; -> 252af
252aeja +65 ; -> 252f0
252afmov64 r1, r10
252b0add64 r1, -0x258
252b1ldxdw r2, [r10-632]
252b2lddw r3, 0x1adff9
252b4mov64 r4, r7
252b5call fn_00cae
252b6mov64 r8, 0x2
252b7ldxdw r2, [r10-600]
252b8jeq r2, 0x2, +9 ; -> 252c2
252b9ldxdw r3, [r10-592]
252bamov64 r1, r10
252bbadd64 r1, -0x268
252bclddw r4, 0x1ad5b3 ; "user_volume_accumulator"
252bemov64 r5, 0x17
252bfcall fn_005a9
252c0ldxdw r9, [r10-608]
252c1ldxdw r8, [r10-616]
252c2ldxdw r1, [r10-400]
252c3ldxdw r2, [r10-408]
252c4ldxdw r3, [r2+0]
252c5add64 r3, -0x1
252c6stxdw [r2+0], r3
252c7jne r3, 0x0, +3 ; -> 252cb
252c8ldxdw r3, [r2+8]
252c9add64 r3, -0x1
252castxdw [r2+8], r3
252cbldxdw r2, [r1+0]
252ccadd64 r2, -0x1
252cdstxdw [r1+0], r2
252cejne r2, 0x0, +3 ; -> 252d2
252cfldxdw r2, [r1+8]
252d0add64 r2, -0x1
252d1stxdw [r1+8], r2
252d2ldxdw r1, [r10-352]
252d3ldxdw r2, [r10-360]
252d4ldxdw r3, [r2+0]
252d5add64 r3, -0x1
252d6stxdw [r2+0], r3
252d7jne r3, 0x0, +3 ; -> 252db
252d8ldxdw r3, [r2+8]
252d9add64 r3, -0x1
252dastxdw [r2+8], r3
252dbldxdw r2, [r1+0]
252dcadd64 r2, -0x1
252ddstxdw [r1+0], r2
252dejne r2, 0x0, +3 ; -> 252e2
252dfldxdw r2, [r1+8]
252e0add64 r2, -0x1
252e1stxdw [r1+8], r2
252e2ldxdw r1, [r10-304]
252e3ldxdw r2, [r10-312]
252e4ldxdw r3, [r2+0]
252e5add64 r3, -0x1
252e6stxdw [r2+0], r3
252e7jne r3, 0x0, +3 ; -> 252eb
252e8ldxdw r3, [r2+8]
252e9add64 r3, -0x1
252eastxdw [r2+8], r3
252ebldxdw r2, [r1+0]
252ecadd64 r2, -0x1
252edstxdw [r1+0], r2
252eejne r2, 0x0, +50 ; -> 25321
252efja +46 ; -> 2531e
252f0ldxdw r9, [r10-576]
252f1ldxdw r1, [r10-400]
252f2ldxdw r2, [r10-408]
252f3ldxdw r3, [r2+0]
252f4add64 r3, -0x1
252f5stxdw [r2+0], r3
252f6jne r3, 0x0, +3 ; -> 252fa
252f7ldxdw r3, [r2+8]
252f8add64 r3, -0x1
252f9stxdw [r2+8], r3
252faldxdw r2, [r1+0]
252fbadd64 r2, -0x1
252fcstxdw [r1+0], r2
252fdjne r2, 0x0, +3 ; -> 25301
252feldxdw r2, [r1+8]
252ffadd64 r2, -0x1
25300stxdw [r1+8], r2
25301ldxdw r1, [r10-352]
25302ldxdw r2, [r10-360]
25303ldxdw r3, [r2+0]
25304add64 r3, -0x1
25305stxdw [r2+0], r3
25306jne r3, 0x0, +3 ; -> 2530a
25307ldxdw r3, [r2+8]
25308add64 r3, -0x1
25309stxdw [r2+8], r3
2530aldxdw r2, [r1+0]
2530badd64 r2, -0x1
2530cstxdw [r1+0], r2
2530djne r2, 0x0, +3 ; -> 25311
2530eldxdw r2, [r1+8]
2530fadd64 r2, -0x1
25310stxdw [r1+8], r2
25311ldxdw r1, [r10-304]
25312ldxdw r2, [r10-312]
25313ldxdw r3, [r2+0]
25314add64 r3, -0x1
25315stxdw [r2+0], r3
25316jne r3, 0x0, +3 ; -> 2531a
25317ldxdw r3, [r2+8]
25318add64 r3, -0x1
25319stxdw [r2+8], r3
2531aldxdw r2, [r1+0]
2531badd64 r2, -0x1
2531cstxdw [r1+0], r2
2531djne r2, 0x0, +3 ; -> 25321
2531eldxdw r2, [r1+8]
2531fadd64 r2, -0x1
25320stxdw [r1+8], r2
25321ldxdw r1, [r10-624]
25322stxdw [r1+8], r9
25323stxdw [r1+0], r8
25324exit
Reconstructedinit_user_volume_accumulator
// discriminator 5e06ca73ff60e8b7, no args
#[derive(Accounts)]
pub struct InitUserVolumeAccumulator<'info> {
#[account(mut)] // ConstraintMut (2000) on "payer"
pub payer: Signer<'info>,
/// CHECK: any pubkey; does not need to sign
pub user: UncheckedAccount<'info>,
#[account(
init_if_needed, // pc 1ef64: owner == SystemProgram ? create : deserialize existing
payer = payer,
space = 137, // pc 1efa5: mov r2, 0x89
seeds = [b"user_volume_accumulator", user.key().as_ref()],
bump, // pc 1eda2: ConstraintSeeds (2006)
)] // existing acct: ConstraintMut (2000) / RentExempt (2005) checks
pub user_volume_accumulator: Account<'info, UserVolumeAccumulator>,
pub system_program: Program<'info, System>,
/// CHECK: PDA ["__event_authority"] (ConstraintSeeds 2006 on mismatch)
pub event_authority: UncheckedAccount<'info>,
pub program: Program<'info, Pump>, // must equal this program id
}
pub fn init_user_volume_accumulator(ctx: Context<InitUserVolumeAccumulator>) -> Result<()> {
msg!("Instruction: InitUserVolumeAccumulator");
// Creation (inside try_accounts, fn_1ef5b) when the PDA is still system-owned:
// lamports == 0 : system_program::create_account(payer -> pda, rent.minimum_balance(137), 137, program_id)
// lamports > 0 : transfer(payer -> pda, max(rent_min,1) - lamports) if short; allocate(137); assign(program_id)
// rent_min(137) = (137 + 128) * 3480 * 2 = 1_844_400 lamports (at current rent params)
let clock = Clock::get()?; // fn_32dcc
let acc = &mut ctx.accounts.user_volume_accumulator;
acc.user = ctx.accounts.user.key(); // pc 0eda9: only field written, rest stays zero
// (if account already existed, other fields are untouched)
emit_cpi!(InitUserVolumeAccumulatorEvent { // event disc 0xd88265e8480d2486 (LE), 80 bytes
payer: ctx.accounts.payer.key(),
user: ctx.accounts.user.key(),
timestamp: clock.unix_timestamp,
}); // self-CPI tagged 0x1d9acb512ea545e4, signed by __event_authority
Ok(()) // fn_00cae: serialize account (AccountDidNotSerialize on failure)
}

Replay model

The executable model the agent wrote. Every tally above comes from running it against mainnet.

// no model entered yet

Accounts

  1. 0payersigns, written
  2. 1user
  3. 2user_volume_accumulatorwritten
  4. 3system_program
  5. 4event_authority
  6. 5program

program 6EF8rr…BEwF6P