refactor: optimize AccountMeta creation with lazy static constants

- Consolidate protocol constants to unified module
- Pre-build AccountMeta objects using once_cell::Lazy
- Reduce instruction building overhead across all DEX protocols
- Improve code maintainability and performance
This commit is contained in:
ysq
2025-09-07 21:36:57 +08:00
parent 51253c7aaf
commit 544e65318d
17 changed files with 323 additions and 185 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ use solana_streamer_sdk::streaming::event_parser::protocols::bonk::types::PoolSt
use crate::{
constants::decimals::{DEFAULT_TOKEN_DECIMALS, SOL_DECIMALS},
instruction::utils::bonk::accounts::WSOL_TOKEN_ACCOUNT,
constants::WSOL_TOKEN_ACCOUNT,
};
/// Calculate the token price in WSOL based on pool state