solana_central/pumpfun/derive_bonding_curve.rs
1use crate::constants::PUMP_CONSTANTS;
2use solana_sdk::pubkey::Pubkey;
3
4/// Derive the Pumpfun bonding curve PDA for a given token address
5///
6/// Uses the seeds `["bonding-curve", token_address]` to derive the program-derived address.
7pub fn derive_bonding_curve(token_address: &Pubkey) -> Pubkey {
8 let (pda, _) = Pubkey::find_program_address(
9 &[b"bonding-curve", token_address.as_ref()],
10 &PUMP_CONSTANTS.bonding_curve_program,
11 );
12 pda
13}