pump.fun / instructions
Instruction
close_user_volume_accumulator
Decompiled
Lets a user close their own UserVolumeAccumulator PDA (seeds ["user_volume_accumulator", user]) and get its rent-exempt lamports back. Only the wallet the PDA is derived from can do it, because it has to sign and the seeds are checked. There are no fees and no admin involvement. The program never checks that unclaimed rewards are zero: whatever is recorded (total unclaimed tokens, current SOL volume) is lost when the account closes. Those values only show up in the emitted event.
- Discriminator
- 0xf945a4da9667548a
- Calls in the sample
- 5
- Reproduced, seen by the agent
- —
- Reproduced, never shown to the agent
- —
Bytecodefn_25325
25325mov64 r8, r425326mov64 r9, r325327mov64 r7, r225328stxdw [r10-496], r125329lddw r1, 0x1ae626 ; "Instruction: CloseUserVolumeAccumulator"2532bmov64 r2, 0x272532ccall sol_log_2532dsth [r10-450], 0xffff2532estxdw [r10-440], r82532fstxdw [r10-448], r925330mov64 r1, r1025331add64 r1, -0x1c225332stxdw [r10-4088], r125333mov64 r1, r1025334add64 r1, -0xd825335mov64 r3, r1025336add64 r3, -0x1c025337mov64 r5, r1025338mov64 r2, r725339call fn_1ea082533aldxdw r9, [r10-208]2533bldxdw r8, [r10-216]2533cldxb r6, [r10-6]2533djeq r6, 0x2, +103 ; -> 253a52533emov64 r1, r102533fadd64 r1, -0x1a025340mov64 r2, r1025341add64 r2, -0xc825342mov64 r3, 0xc225343call fn_3536725344ldxw r1, [r10-5]25345stxw [r10-221], r125346ldxb r1, [r10-1]25347stxb [r10-217], r125348stxb [r10-222], r625349stxdw [r10-424], r92534astxdw [r10-432], r82534bldxb r1, [r10-449]2534cstxb [r10-183], r12534dldxb r1, [r10-450]2534estxb [r10-184], r12534fldxdw r1, [r10-440]25350stxdw [r10-192], r125351ldxdw r1, [r10-448]25352stxdw [r10-200], r125353mov64 r1, r1025354add64 r1, -0x1b025355stxdw [r10-208], r125356stxdw [r10-216], r725357mov64 r1, r1025358add64 r1, -0x1d825359mov64 r2, r102535aadd64 r2, -0xd82535bcall fn_0ec182535cldxdw r8, [r10-472]2535djeq r8, 0x2, +1 ; -> 2535f2535eja +37 ; -> 253842535fmov64 r1, r1025360add64 r1, -0x1e825361mov64 r2, r1025362add64 r2, -0x1b025363call fn_1ec0325364ldxdw r1, [r10-296]25365ldxdw r2, [r10-304]25366ldxdw r3, [r2+0]25367add64 r3, -0x125368ldxdw r9, [r10-480]25369ldxdw r8, [r10-488]2536astxdw [r2+0], r32536bjne r3, 0x0, +3 ; -> 2536f2536cldxdw r3, [r2+8]2536dadd64 r3, -0x12536estxdw [r2+8], r32536fldxdw r2, [r1+0]25370add64 r2, -0x125371stxdw [r1+0], r225372jne r2, 0x0, +3 ; -> 2537625373ldxdw r2, [r1+8]25374add64 r2, -0x125375stxdw [r1+8], r225376ldxdw r1, [r10-248]25377ldxdw r2, [r10-256]25378ldxdw r3, [r2+0]25379add64 r3, -0x12537astxdw [r2+0], r32537bjne r3, 0x0, +3 ; -> 2537f2537cldxdw r3, [r2+8]2537dadd64 r3, -0x12537estxdw [r2+8], r32537fldxdw r2, [r1+0]25380add64 r2, -0x125381stxdw [r1+0], r225382jne r2, 0x0, +34 ; -> 253a525383ja +30 ; -> 253a225384ldxdw r9, [r10-464]25385ldxdw r1, [r10-296]25386ldxdw r2, [r10-304]25387ldxdw r3, [r2+0]25388add64 r3, -0x125389stxdw [r2+0], r32538ajne r3, 0x0, +3 ; -> 2538e2538bldxdw r3, [r2+8]2538cadd64 r3, -0x12538dstxdw [r2+8], r32538eldxdw r2, [r1+0]2538fadd64 r2, -0x125390stxdw [r1+0], r225391jne r2, 0x0, +3 ; -> 2539525392ldxdw r2, [r1+8]25393add64 r2, -0x125394stxdw [r1+8], r225395ldxdw r1, [r10-248]25396ldxdw r2, [r10-256]25397ldxdw r3, [r2+0]25398add64 r3, -0x125399stxdw [r2+0], r32539ajne r3, 0x0, +3 ; -> 2539e2539bldxdw r3, [r2+8]2539cadd64 r3, -0x12539dstxdw [r2+8], r32539eldxdw r2, [r1+0]2539fadd64 r2, -0x1253a0stxdw [r1+0], r2253a1jne r2, 0x0, +3 ; -> 253a5253a2ldxdw r2, [r1+8]253a3add64 r2, -0x1253a4stxdw [r1+8], r2253a5ldxdw r1, [r10-496]253a6stxdw [r1+8], r9253a7stxdw [r1+0], r8253a8exit
Reconstructedclose_user_volume_accumulator
// discriminator f945a4da9667548a#[derive(Accounts)]#[event_cpi] // adds event_authority + programpub struct CloseUserVolumeAccumulator<'info> {#[account(mut)] // 2000 ConstraintMut "user" (pc 1eb17)pub user: Signer<'info>, // signer check in fn_02590#[account(mut, // 2000 ConstraintMut (pc 1ebb5)seeds = [b"user_volume_accumulator", user.key().as_ref()],bump, // find_program_address, 2006 ConstraintSeeds (pc 1eac9)close = user // 2011 ConstraintClose if accumulator == user (pc 1ebc4))]pub user_volume_accumulator: Account<'info, UserVolumeAccumulator>, // owner==program (3007), initialized (3012), discriminator// event_authority: PDA ["__event_authority"] -> 2006 ConstraintSeeds (pc 1eb8e)// program: must be this program id}pub fn close_user_volume_accumulator(ctx: Context<CloseUserVolumeAccumulator>) -> Result<()> {msg!("Instruction: CloseUserVolumeAccumulator");let acc = &ctx.accounts.user_volume_accumulator;let clock = Clock::get()?; // fn_32dcc// emit_cpi!: self-CPI signed by __event_authority, data = EVENT_IX_TAG(e4 45 a5 2e 51 cb 9a 1d) ++ eventemit_cpi!(CloseUserVolumeAccumulatorEvent { // event disc 929fbdac925838f4user: ctx.accounts.user.key(),timestamp: clock.unix_timestamp,// the accumulator's four u64/i64 fields, copied as stored// (struct offsets +48,+56,+64,+72; per the IDL these are total_unclaimed_tokens,// total_claimed_tokens, current_sol_volume, last_update_timestamp)total_unclaimed_tokens: acc.total_unclaimed_tokens,total_claimed_tokens: acc.total_claimed_tokens,current_sol_volume: acc.current_sol_volume,last_update_timestamp: acc.last_update_timestamp,});Ok(())// exit (fn_1ec03 -> fn_32372), Anchor `close = user`:// user.lamports += accumulator.lamports; accumulator.lamports = 0;// accumulator.assign(system_program); accumulator.realloc(0)// NOTE: no check that total_unclaimed_tokens == 0. Unclaimed rewards are lost.}
Replay model
The executable model the agent wrote. Every tally above comes from running it against mainnet.
// no model entered yet
Accounts
- 0usersigns, written
- 1user_volume_accumulatorwritten
- 2event_authority
- 3program
program 6EF8rr…BEwF6P