Commit Graph

62 Commits

Author SHA1 Message Date
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 76a47e87b1 feat(raydium-cpmm): optimize instruction builder performance and add vault address caching
- Replace dynamic PDA calculations with cached vault addresses for better performance
- Add support for pre-calculated pool state and observation state addresses
- Optimize instruction data creation using fixed-size arrays instead of Vec
- Refactor vault account resolution with fallback to PDA calculation
- Use fast ATA address calculation to reduce computation overhead
- Extract common wSOL handling logic to reduce code duplication
- Add RaydiumCpmmParams::from_trade() constructor for event-driven trading
- Improve memory allocation efficiency with Vec::with_capacity()
2025-09-08 22:33:05 +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 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 1252446c90 fixed 2025-09-07 23:54:37 +08:00
ysq 544e65318d 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
2025-09-07 21:36:57 +08:00
ysq 51253c7aaf refactor: simplify instruction builders and optimize transaction construction
- Remove redundant helper methods in instruction builders (bonk, pumpfun, pumpswap, raydium)
- Inline buy/sell instruction construction for better performance
- Remove unnecessary Buy/Sell structs and helper functions in pumpfun
- Consolidate instruction building logic to reduce code duplication
- Fix pointer dereference issue in parallel execution
- Improve code maintainability and reduce complexity
2025-09-07 19:50:27 +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
ysq 02af3e98e2 feat(pumpswap): Add fee configuration support v0.5.6 2025-09-03 21:06:14 +08:00
ysq f29b38c8bc Merge commit '818f1abd9d2e4c35656f8b3a006811bbd80928e1' 2025-08-31 22:54:36 +08:00
ysq 865ad8148e feat: upgrade to v0.5.3 2025-08-31 22:54:08 +08:00
wei 818f1abd9d fix: BonkParams platform_onfig changed to platform_comfig 2025-08-30 23:51:20 +08:00
ysq 9438172029 feat: upgrade to v0.5.2 2025-08-27 14:27:26 +08:00
ysq c10406915c feat: add examples and enhance MEV protection services
This commit adds comprehensive examples for various trading operations including:
- PumpFun copy and sniper trading
- Bonk copy and sniper trading
- PumpSwap trading
- Raydium CPMM and AMM V4 trading
- Middleware system demonstration
- Event subscription

Enhanced MEV protection services with FlashBlock and Node1 integration.
Updated instruction modules for bonk, pumpswap, and raydium_cpmm.
Improved SWQOS modules for better transaction handling.
2025-08-25 00:21:15 +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 20767ae597 feat(core): Upgrade SDK version to 0.4.7 and enhance parameter constructors
- Upgrade SDK version from 0.4.6 to 0.4.7
- Enhance PumpFunParams.immediate_sell function with creator parameter support
- Extend BonkParams.immediate_sell function with necessary platform parameters
2025-08-22 22:28:54 +08:00
ysq 8d17530843 feat(bonk): Update BONK protocol support and fee handling
- Add system program and associated account support
- Update instruction builder with platform/creator accounts
- Implement associated account helper functions
- Upgrade SDK to 0.4.6 and dependencies
- Repla
2025-08-22 21:49:14 +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 5a9238a741 feat: add transaction confirmation wait option and parallel execution optimization
- Add wait_transaction_confirmed parameter to all trading methods
- Support async transaction sending without waiting for confirmation for better performance
- Optimize parallel execution logic to return on first successful transaction
- Fix direct priority_fee modification issue
- Improve error handling and resource management
- Update all example code to support new parameter
2025-08-21 21:32:53 +08:00
ysq d27a44735a feat: Add Raydium AMM V4 support and middleware system
- Add Raydium AMM V4 trading protocol support
- Implement instruction middleware system for dynamic processing
- Refactor trade executors to support middleware parameters
- Add fee calculation and slippage protection mechanisms
- Maintain backward compatibility with optional middleware
2025-08-19 18:07:21 +08:00
ysq 57474bfa6e feat: major refactor with calculation utilities and instruction optimization
- Add comprehensive calculation utilities for all protocols (bonk, pumpfun, pumpswap, raydium)
- Refactor instruction modules to reduce code complexity and improve maintainability
- Optimize trading parameters structure and enhance common utilities
- Separate calculation logic from trading modules for better code organization
- Update dependencies and module exports
2025-08-18 18:00:14 +08:00
ysq 63244f4073 refactor: restructure trading modules and add price calculation utilities
- Remove redundant pool.rs files from trading protocols
- Consolidate protocol logic into common.rs files
- Add comprehensive price calculation utilities for all protocols
- Add decimals constants module
- Restructure utils module for better organization
- Update documentation with price utilities information

Breaking changes:
- Removed bonding_curve.rs from pumpfun module
- Consolidated trading logic across protocols
- Refactored utils module structure
2025-08-14 22:45:33 +08:00
ysq 069c5e3d21 feat: upgrade to v0.3.3 2025-08-12 11:39:37 +08:00
ysq 3006bd0ced feat: upgrade dependencies and bump to v0.2.15 2025-08-05 18:30:26 +08:00
wei 04bfd9fdfe change sol_str_to_lamports to sol_to_lamports 2025-08-05 15:48:11 +08:00
ysq e976af6935 feat: upgrade to v0.2.12 and refactor system instructions 2025-08-03 22:51:11 +08:00
ysq 45140ae789 feat(pumpswap): enhance flexible mint support and optimize performance
- Add base_mint/quote_mint parameters to PumpSwapParams for flexible trading pairs
- Implement pool reserves caching to reduce RPC calls and improve speed
- Refactor unified buy/sell instruction logic for different mint types
- Add volume accumulator PDA support and proper fee calculations
- Update pool discovery for both base and quote mint searches
- Bump version to 0.2.11

Breaking: PumpSwapParams now requires mint and reserves parameters
2025-08-02 23:51:04 +08:00
ysq 07a42641de feat: v0.2.10 - add PumpFun volume accumulator support
- Bump version to 0.2.10
- Upgrade solana-streamer-sdk to 0.1.8
- Add volume accumulator PDAs and functions
2025-08-01 22:59:39 +08:00
ysq c98d022ae8 refactor: migrate streaming functionality to separate SDK, bump to v0.2.2 2025-07-20 00:56:11 +08:00
ysq 7942bea571 feat: add Raydium CLMM protocol support, bump version to 0.2.1 2025-07-19 21:28:01 +08:00
ysq c133287f70 feat: Add Token 2022 support for Raydium CPMM, update constants to use spl_token::ID 2025-07-17 13:56:09 +08:00
ysq 75a29cd7ee feat: integrate Raydium CPMM trading protocol support
- Add Raydium CPMM constants, instruction builder and pool implementation
- Implement unified buy/sell trading interface and event parsing system
- Update documentation and examples to support new protocol
2025-07-16 22:54:23 +08:00
ysq aef9fe6b14 feat: add Bonk trading examples and fix function naming
- Add comprehensive Bonk trading examples in README
- Fix function naming consistency (width -> with)
- Enhance BonkParams with from_trade and from_dev_trade methods
- Add amount calculation utilities and tests
2025-07-14 22:26:03 +08:00
ysq c4bf62be7d feat: optimize Bonk trading instructions and add price calculation
- Optimize sell instruction building, remove redundant code and add account closing
- Add token price calculation function supporting different decimal places
- Clean up debug logs and refactor code structure
2025-07-12 01:14:05 +08:00
ysq 9946637c62 refactor: rename 2025-07-11 16:38:30 +08:00
ysq 2b970698c2 fixed: fix timer 2025-07-11 10:40:04 +08:00
wood 947652db30 update dex_type 2025-07-11 00:02:51 +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
wood 42952dfc8b rename protocol to dex_type 2025-07-10 22:15:53 +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
wood 794207b6c2 update dir 2025-07-10 02:47:52 +08:00
wood 8f79c3bfd9 rebuild sdk dir 2025-07-10 02:38:06 +08:00
ysq 756ec6e263 refactor: rename protocol from RaydiumLaunchpad to Bonk
Comprehensive renaming of RaydiumLaunchpad-related modules, structs, event types and constants to Bonk while maintaining functional logic
2025-07-10 00:23:29 +08:00