feat: add support for pump mayhem mode

This commit is contained in:
ysq
2025-11-10 15:30:24 +08:00
parent 4f315187f3
commit 4cee5e6a06
15 changed files with 180 additions and 68 deletions
+11 -7
View File
@@ -1,8 +1,7 @@
use crate::common::{bonding_curve::BondingCurveAccount, global::GlobalAccount, SolanaRpcClient};
use crate::common::{bonding_curve::BondingCurveAccount, SolanaRpcClient};
use anyhow::anyhow;
use solana_sdk::pubkey::Pubkey;
use std::{collections::HashMap, sync::Arc};
use tokio::sync::RwLock;
use std::sync::Arc;
/// Constants used as seeds for deriving PDAs (Program Derived Addresses)
pub mod seeds {
@@ -58,6 +57,15 @@ pub mod global_constants {
is_writable: true,
};
pub const MAYHEM_FEE_RECIPIENT: Pubkey =
pubkey!("GesfTA3X2arioaHp8bbKdjG9vJtskViWACZoYvxp4twS");
pub const MAYHEM_FEE_RECIPIENT_META: solana_sdk::instruction::AccountMeta =
solana_sdk::instruction::AccountMeta {
pubkey: FEE_RECIPIENT,
is_signer: false,
is_writable: true,
};
/// Public key for the global PDA
pub const GLOBAL_ACCOUNT: Pubkey = pubkey!("4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf");
pub const GLOBAL_ACCOUNT_META: solana_sdk::instruction::AccountMeta =
@@ -152,10 +160,6 @@ impl Symbol {
pub const SOLANA: &'static str = "solana";
}
lazy_static::lazy_static! {
static ref ACCOUNT_CACHE: RwLock<HashMap<Pubkey, Arc<GlobalAccount>>> = RwLock::new(HashMap::new());
}
#[inline]
pub fn get_bonding_curve_pda(mint: &Pubkey) -> Option<Pubkey> {
crate::common::fast_fn::get_cached_pda(