solana_central/protocol_idls/
pumpfun.rs

1use borsh::BorshDeserialize;
2use solana_sdk::pubkey::Pubkey;
3
4#[derive(BorshDeserialize)]
5pub struct PfBondingCurveIdl {
6  pub discriminator: [u8; 8],
7  pub virtual_token_reserves: u64,
8  pub virtual_sol_reserves: u64,
9  pub real_token_reserves: u64,
10  pub real_sol_reserves: u64,
11  pub token_total_supply: u64,
12  pub complete: bool,
13  pub creator: Pubkey,
14  // 150 account size total, 81 bytes used up
15  padding: [u8; 69],
16}
17
18/**
19Current event IDL used in pumpfun bonding curve event, will always be 266 bytes, example tx:
20Post creator fee addition event: 35Vbdm6aMboKYBJcrqKVLoaxnJgRJGe9iJ4nNovWacMeVxDRqeSkSfFDjVy16ywT6jX6CiGRQawKFKE3q8UFzAdo
21Post length: 266
22*/
23#[derive(BorshDeserialize)]
24pub struct PfTradeEventIdlCurrent {
25  // 16 byte discriminator
26  pub padding: [u8; 16],
27  pub mint: Pubkey,
28  /*
29  Sol amount is how much SOL was actually sent to the protocol/bonding curve and this quantity
30  EXCLUDES fees which the user additionally sends. So this is NOT the total amount of sol involved in the swap
31  */
32  pub sol_amount: u64,
33  pub token_amount: u64,
34  pub is_buy: bool,
35  pub user: Pubkey,
36  pub timestamp: i64,
37  // These values are all after the swap takes place
38  pub virtual_sol_reserves: u64,
39  pub virtual_token_reserves: u64,
40  pub real_sol_reserves: u64,
41  pub real_token_reserves: u64,
42  pub fee_recipient: Pubkey,
43  pub fee_basis_points: u64,
44  pub fee: u64,
45  pub creator: Pubkey,
46  pub creator_fee_basis_points: u64,
47  pub creator_fee: u64,
48  pub track_volume: bool,
49  pub track_unclaimed_tokens: u64,
50  pub total_claimed_tokens: u64,
51  pub current_sol_volume: u64,
52  pub last_update_timestamp: u64,
53}
54
55/**
56Old event
57Pre creator fee addition event: 4szssqMqm7tSkdQnBRDt8MijHu32GbLDnJxYijfinoo3sJnFAFya8oSE3sihmU3NA5U7DToDU5uE9jjmQCVn1yGs
58Pre length: 137
59*/
60#[derive(BorshDeserialize)]
61pub struct PfTradeEventIdlOld {
62  pub discriminator: [u8; 16],
63  pub mint: Pubkey,
64  pub sol_amount: u64,
65  pub token_amount: u64,
66  pub is_buy: bool,
67  pub user: Pubkey,
68  pub timestamp: i64,
69  pub virtual_sol_reserves: u64,
70  pub virtual_token_reserves: u64,
71}
72