Commit Graph

46 Commits

Author SHA1 Message Date
ysq c5ff7c1cbb refactor: Refactor SDK core architecture and trading parameter system
- Refactor SolanaTrade main class structure with improved modular design
- Refactor trading parameter system: BuyParams/SellParams -> InternalBuyParams/InternalSellParams
- Remove deprecated PriorityFee and related utility functions
- Add SwqosSettings to replace legacy SwqosConfig
- Add comprehensive technical documentation:
  • Address Lookup Table usage guide (EN/CN)
  • Nonce Cache mechanism documentation (EN/CN)
  • Trading Parameters documentation (EN/CN)
- Refactor all example code to adapt to new API interfaces
- Optimize public API design and code comments
- Clean up redundant utility functions and type definitions

Impact: 43 files changed, 2013 insertions(+), 1735 deletions(-)
2025-09-17 00:10:33 +08:00
ysq 48a6c6283a refactor: optimize trading execution architecture and add wSOL management
- Simplify TradeExecutor interface by integrating middleware and swqos clients into params
- Refactor parallel execution module with dedicated buy/sell execute functions
- Add SOL wrapping/unwrapping functionality for wSOL management
- Remove redundant parameter passing in sell operations
- Delete example main.rs file
- Optimize transaction building with integrated parameter structures

BREAKING CHANGE: TradeExecutor interface simplified, middleware and swqos_clients now passed through params
2025-09-09 17:02:24 +08:00
ysq b9fa2f2f0f refactor: optimize instruction builders structure and improve code documentation
- Add structured comment sections with clear code organization
- Improve variable naming and account address calculation logic
- Update comments for better readability across all trading protocols
- Enhance code structure for PumpFun, PumpSwap, and Raydium protocols
2025-09-09 00:50:24 +08:00
ysq c8241d12d2 feat: optimize PumpSwap instruction builder performance and caching
- Add PumpSwapUserVolume PDA cache key support
- Refactor PumpSwap instruction builder to simplify code logic
- Optimize memory allocation with pre-allocated Vec capacity
- Integrate fast_fn caching mechanism to replace redundant PDA calculations
- Standardize account metadata construction and data serialization
- Simplify wSOL handling logic by reusing common functions
- Optimize import statements and remove unused dependencies
- Add pool token account parameters to PumpSwapParams structure
2025-09-08 21:54:05 +08:00
ysq ea6c3e9989 feat: optimize Bonk protocol with caching and wSOL management
- Add instruction/PDA caching for Bonk operations
- Implement reusable wSOL management module
- Support pre-computed pool addresses in BonkParams
- Optimize memory allocation with SmallVec and fixed arrays
- Reduce code duplication across protocols
2025-09-08 18:29:05 +08:00
ysq 47bc81f025 refactor: enhance associated token account handling with custom token program support
- Rename create_associated_token_account_fast to create_associated_token_account_idempotent_fast
- Upgrade get_associated_token_address_fast to support custom token_program_id parameter
- Update ATA cache mechanism to include token_program_id
- Adopt new ATA functions in Bonk and PumpFun instruction builders
- Improve token program compatibility and cache efficiency
2025-09-08 17:33:53 +08:00
ysq 93c133a9ea feat: Add caching system and performance optimizations
- Add fast_fn module with global caches for PDA, ATA, and instruction operations
- Implement memory-efficient caches using CLRU and parking_lot for thread-safe access
- Optimize compute budget instruction generation with caching
- Replace std::sync::Mutex with parking_lot::Mutex for better performance
- Add dedicated caching for PumpFun PDAs and associated token addresses
- Improve transaction building with batch signature optimization
- Add new dependencies: clru, smallvec, parking_lot for cache infrastructure
- Remove unused utility functions in pumpfun module
- Enhance error messages for tip fee configuration validation
2025-09-08 17:12:29 +08:00
ysq 31b5e2855b perf: optimize constants and memory allocation for trading instruction performance 2025-09-08 10:58:43 +08:00
ysq 21d6714c25 refactor: reorganize code structure and optimize modular design
- Remove src/common/address_lookup.rs and tip_cache.rs to simplify common modules
- Move protocol-specific utility functions from trading/ to instruction/utils/
- Refactor utility functions for PumpFun, PumpSwap, Raydium AMM V4, and Raydium CPMM
- Consolidate constant definitions by inlining seeds and accounts modules into respective utility files
- Update all import paths to ensure code consistency
- Optimize trading parameter construction and executor logic
- Improve address lookup cache and nonce management mechanisms
2025-09-07 19:00:08 +08:00
ysq eddac7a679 perf: optimize trade executor performance and reduce memory usage
- Implement singleton pattern for TradeFactory
- Replace TradeTimer with direct Instant measurements
- Optimize PumpFun instruction building and parallel execution
- Reduce unnecessary clones and improve memory allocation
- Simplify address lookup table management
2025-09-07 18:07:45 +08:00
ysq 90fcd5ca01 refactor: unify transaction building and execution architecture
- Remove redundant transaction builder functions and merge into single build_transaction()
- Simplify compute budget manager with unified add_compute_budget_instructions()
- Consolidate trade executor interface by removing separate buy/sell methods
- Unify BuyParams/SellParams usage, remove *WithTipParams structs
- Streamline parallel execution logic and remove TradeType parameter
- Delete obsolete files: address_lookup.rs, tip_cache.rs
- Clean up nonce manager by removing unused is_using_nonce() function

This refactoring reduces code duplication and provides a cleaner, more maintainable API
for transaction building and execution across all trading protocols.
2025-09-07 17:22:58 +08:00
ysq 597982653d feat: optimize cache systems and add examples 2025-09-04 16:32:34 +08:00
wei 3f9b3cec8c remove invalid fields 2025-09-02 00:43:05 +08:00
ysq 90ea46ea3f feat: This update includes the following changes:
1. Upgrade version from 0.4.7 to 0.5.0
2. Rename compute unit parameters from unit_limit/unit_price to tip_unit_limit/tip_unit_price
3. Remove creator parameter from API to simplify trading interface
4. Optimize PumpFun and PumpSwap protocol parameter structures with creator_vault support
5. Remove unnecessary constants and functions like TOTAL_SUPPLY and BONDING_CURVE_SUPPLY
6. Improve code formatting and documentation
2025-08-23 20:37:03 +08:00
ysq c9b5c98a36 feat: v0.4.5 - add immediate sell functionality and default implementations
- Bump version to 0.4.5
- Add Default traits for BondingCurveAccount and BonkParams
- Add immediate_sell methods for PumpFun and Bonk params
- Update README version references
2025-08-21 23:54:26 +08:00
ysq c98d022ae8 refactor: migrate streaming functionality to separate SDK, bump to v0.2.2 2025-07-20 00:56:11 +08:00
wood c66a89cad2 update example 2025-07-10 23:54:49 +08:00
wood 36b25c1fbe update readme 2025-07-10 23:27:40 +08:00
ysq b891b2bc27 refactor: Major SDK architecture refactoring and API consolidation
- Consolidate separate buy/sell modules into unified trading interface
- Remove protocol-specific buy/sell files (bonk, pumpfun, pumpswap)
- Add new trading constants and utility functions
- Simplify API with unified buy/sell methods supporting multiple protocols
- Enhance documentation with comprehensive examples and usage guides
- Add balance checking and token account management utilities
- Improve code organization and maintainability
2025-07-10 18:14:21 +08:00
wood 516b682519 rename grpc to streaming 2025-07-10 03:24:13 +08:00
wood f1649ac933 update dir 2025-07-10 02:53:01 +08:00
ysq e0a47a271f feat: add SubscriptionHandle for managing subscription lifecycle
- Add SubscriptionHandle struct to manage async subscription tasks
- Implement graceful shutdown mechanism with unsub_fn callback
- Export new module in common/mod.rs
- Support for proper resource cleanup in subscription management
2025-07-09 22:54:25 +08:00
ysq 44ae51747b feat: refactor event parsing architecture and add Raydium Launchpad support
Major changes:
- Refactor event parsing system: migrate scattered logs_* modules to unified event_parser architecture
- Add unified UnifiedEvent trait and EventParser trait for standardized event parsing interface
- Introduce GenericEventParser and EventParserFactory for plugin-style protocol extension
- Add match_event! macro to simplify event type matching and handling
- Add Raydium Launchpad (Bonk.fun) protocol support:
  - Complete buy/sell trading functionality
  - Pool state management and querying
  - Event parsing and subscription
- Update trading system to support new protocol architecture
- Refactor constants organization, rename raydium to raydium_launchpad
- Update documentation and example code

Technical improvements:
- Unified event interface design for better code maintainability
- Factory pattern implementation for dynamic protocol loading
- Generic event parser to reduce code duplication
- Improved error handling and type safety

Breaking Changes:
- Remove old logs_* modules, use new event_parser system
- Protocol constants path change: raydium -> raydium_launchpad
- Event subscription API updated to unified interface
2025-07-09 22:29:29 +08:00
wood 0da3a3b918 remove use_rpc 2025-07-06 23:38:09 +08:00
wood d13c382a46 update trade config and swqos 2025-07-06 23:36:18 +08:00
wood 3ac39508d9 rebuild code 2025-07-06 22:06:44 +08:00
wood 148cce8253 . 2025-06-20 00:55:40 +08:00
ysq 29ce9d787f [Feature] Add smart tip fee functionality
1. Add smart_buy_tip_fee field to PriorityFee struct
2. Extend copy_buy_with_tip method with custom_buy_tip_fee parameter
3. Implement dynamic tip fee adjustment logic
2025-06-19 22:30:04 +08:00
sgxiang 768dc92156 Merge commit '602b310cf841be6e695fd01744bc4a510b59f962' 2025-06-16 21:11:35 +08:00
sgxiang 602b310cf8 feat: Add Raydium DEX integration support
Add Raydium logs processing, event parsing and GRPC stream handling functionality,
remove redundant PumpSwap subscription module, optimize project structure.
2025-06-16 18:30:54 +08:00
wei af2afcbb60 fix 2025-06-14 18:52:46 +08:00
sgxiang 165335af11 feat(pumpswap): enhance PumpSwap trading functionality and logs parsing system
- Expand buy/sell trading logic with optimized execution flow
- Improve logs data structures and parser performance
- Enhance common utilities and pool management features
- Refactor main program architecture for better maintainability
- Update library export interfaces with improved API design
2025-06-12 00:00:30 +08:00
wei a3859edf86 add signature 2025-06-10 16:13:26 +08:00
sgxiang 651789b553 refactor(pumpswap): refactor account handling logic in logs_parser and optimize account data extraction 2025-06-10 00:54:42 +08:00
sgxiang 94c2a22ab7 feat: Add PumpSwap trading functionality module 2025-06-06 22:29:30 +08:00
sgxiang 63109713f4 refactor: organize code into multi-protocol architecture with PumpFun submodules 2025-06-06 22:13:19 +08:00
sgxiang bfe76fcddc 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
2025-05-29 18:53:58 +08:00
Burton Qin 43c877cbb3 perf: move regex compilation out of loop in RaydiumEvent::parse_logs 2025-05-19 00:47:35 +08:00
William 8050d7ea8f rename jito mod 2025-04-10 12:29:42 +08:00
William 7c755058cc fix create token, add param with creator pubkey 2025-04-10 11:04:55 +08:00
William ec03ed8edc add nextblock, 0slot support 2025-04-02 13:39:59 +08:00
William 858c0e5700 fix jito buy 2025-01-25 16:01:16 +08:00
William 3d3adec767 update client error 2025-01-25 12:41:21 +08:00
William 87810d47bb add close account 2025-01-25 01:04:45 +08:00
William 14b77dbdf4 update events 2025-01-24 14:01:56 +08:00
William a01275367e add callback to subscribe 2025-01-23 21:15:55 +08:00