feat: Add address lookup, caching system and Jito GRPC integration

- Implement address lookup tables and multi-level caching

- Add GRPC stream processing and YellowStone connections

- Extend PumpFun functionality including token creation

- Integrate Jito GRPC services (auth, block engine, relayer)

- Optimize log processing and event system
This commit is contained in:
sgxiang
2025-05-29 18:53:58 +08:00
parent f261b8a66d
commit bfe76fcddc
37 changed files with 4168 additions and 694 deletions
+25 -5
View File
@@ -1,7 +1,7 @@
use std::sync::Arc;
use solana_client::rpc_client::RpcClient;
use solana_sdk::{commitment_config::CommitmentConfig, signature::Keypair};
use solana_sdk::{commitment_config::CommitmentConfig, pubkey::Pubkey, signature::Keypair};
use serde::Deserialize;
use crate::{constants::trade::{DEFAULT_BUY_TIP_FEE, DEFAULT_COMPUTE_UNIT_LIMIT, DEFAULT_COMPUTE_UNIT_PRICE, DEFAULT_SELL_TIP_FEE}, swqos::FeeClient};
@@ -19,11 +19,16 @@ pub struct Cluster {
pub nextblock_auth_token: String,
pub zeroslot_url: String,
pub zeroslot_auth_token: String,
pub nozomi_url: String,
pub nozomi_auth_token: String,
pub use_jito: bool,
pub use_nextblock: bool,
pub use_zeroslot: bool,
pub use_nozomi: bool,
pub priority_fee: PriorityFee,
pub commitment: CommitmentConfig,
pub lookup_table_key: Option<Pubkey>,
pub use_rpc: bool,
}
impl Cluster {
@@ -34,11 +39,16 @@ impl Cluster {
String, nextblock_auth_token:
String, zeroslot_url: String,
zeroslot_auth_token: String,
nozomi_url: String,
nozomi_auth_token: String,
priority_fee: PriorityFee,
commitment: CommitmentConfig,
use_jito: bool,
use_nextblock: bool,
use_zeroslot: bool
use_zeroslot: bool,
use_nozomi: bool,
lookup_table_key: Option<Pubkey>,
use_rpc: bool,
) -> Self {
Self {
rpc_url,
@@ -47,21 +57,28 @@ impl Cluster {
nextblock_auth_token,
zeroslot_url,
zeroslot_auth_token,
nozomi_url,
nozomi_auth_token,
priority_fee,
commitment,
use_jito,
use_nextblock,
use_zeroslot
use_zeroslot,
use_nozomi,
lookup_table_key,
use_rpc,
}
}
}
#[derive(Debug, Deserialize, Clone, Copy, PartialEq)]
#[derive(Debug, Deserialize, Clone, PartialEq)]
pub struct PriorityFee {
pub unit_limit: u32,
pub unit_price: u64,
pub rpc_unit_limit: u32,
pub rpc_unit_price: u64,
pub buy_tip_fee: f64,
pub buy_tip_fees: Vec<f64>,
pub sell_tip_fee: f64,
}
@@ -70,7 +87,10 @@ impl Default for PriorityFee {
Self {
unit_limit: DEFAULT_COMPUTE_UNIT_LIMIT,
unit_price: DEFAULT_COMPUTE_UNIT_PRICE,
rpc_unit_limit: 0,
rpc_unit_price: 0,
buy_tip_fee: DEFAULT_BUY_TIP_FEE,
buy_tip_fees: vec![],
sell_tip_fee: DEFAULT_SELL_TIP_FEE
}
}