Commit Graph

92 Commits

Author SHA1 Message Date
ysq 5225cff73c feat: add seed optimization and refactor wSOL account control
- Add `open_seed_optimize` parameter for enhanced performance
- Move wSOL account flags from protocol params to buy/sell params
- Add seed_trading example demonstrating optimization features
- Update all examples and upgrade dependencies
- Improve wSOL account management flexibility

BREAKING CHANGE: Modified buy/sell method signatures and protocol param structs
2025-09-10 00:05:13 +08:00
ysq 1c5cfd4511 Merge commit 'cab5ee8ed4a80adbfd51e5c02411ef93ac9f37b4' into feat/seed 2025-09-09 17:09:35 +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
liam 5092561091 feat: 为 buy 和 sell 方法添加 Signature 返回值 2025-09-09 12:03:42 +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 8d77f6e5ca feat: Add PumpSwap direct trading example and RPC client optimization 2025-09-08 00:24:29 +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 db3b50fc28 feat: v0.5.5 - enhanced priority fee system and dependency updates
- Update solana-streamer-sdk to 0.4.1
- Refactor priority fee API (custom_buy_tip_fee → custom_priority_fee)
- Simplify documentation and clean up examples

BREAKING CHANGE: priority fee parameter type changed
2025-09-03 17:47:10 +08:00
wei 6f953ffa0d The buy and sell methods have added the priority_fee parameter, which can control the priority fee for each transaction 2025-09-02 09:43:53 +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 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
wei 22c1d4ea85 The buy and sell methods support passing lookup_table_pubkey 2025-08-14 22:29:21 +08:00
ysq 5cd6c6197d feat: Upgrade to SDK version 0.2.6
- Upgrade solana-streamer-sdk dependency from 0.1.4 to 0.1.5
- Enhance sell function with with_tip parameter to control tip feature
- Improve event subscription using subscribe_events_v2 API with account filtering
- Update documentation and example code for new API
2025-07-26 17:54:59 +08:00
ysq 7a05ec216c feat: Upgrade SDK version to 0.2.4 and optimize tip fee setting logic
- Upgrade SDK version from 0.2.3 to 0.2.4
- Update solana-streamer-sdk dependency to version 0.1.3
- Optimize buy_tip_fees setting logic using map function instead of hardcoded array
- Update version numbers in README documentation
2025-07-24 21:38:22 +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 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 461538ad90 refactor: simplify trading API and improve configuration management
- Remove `with_tip` parameter from buy/sell methods, always use tip-enabled transactions
- Fix variable naming inconsistencies (token_amount -> amount_token)
- Add automatic padding logic for buy_tip_fees array to match swqos_configs length
- Update README examples with corrected variable references and API usage
- Fix bug in test_pumpswap() using wrong DexType (PumpFun -> PumpSwap)
- Improve API documentation with clearer parameter descriptions
- Clean up code formatting and remove unnecessary blank lines

Breaking Changes:
- buy() and sell() method signatures changed (removed with_tip parameter)
- Variable naming standardized across codebase
2025-07-12 20:50:13 +08:00
wood c66a89cad2 update example 2025-07-10 23:54:49 +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 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
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 def16e6b92 update swqos config 2025-07-07 03:28:02 +08:00
wood 38a8e2dae4 update jito and nextblock 2025-07-07 01:01:38 +08:00
wood d13c382a46 update trade config and swqos 2025-07-06 23:36:18 +08:00
wood ecbdbc5890 rebuild code 2025-07-06 22:08:14 +08:00
wood 3ac39508d9 rebuild code 2025-07-06 22:06:44 +08:00
ysq 0e57a7f55c docs: remove token creation sections 2025-07-05 20:48:22 +08:00
wei 77e1f9a480 dynamic tip optimization 2025-06-24 23:45:51 +08:00
ysq bfd6809855 refactor: rename PumpFun to SolanaTrade and improve API consistency
- Rename PumpFun class to SolanaTrade to better reflect its expanded functionality
- Rename copy_buy methods to buy for better API clarity
- Update ShredStream and Yellowstone gRPC subscription examples
- Add bonding_curve parameter to trading methods
- Improve documentation with updated code examples
- Update README files with new features and API changes
2025-06-24 20:56:15 +08:00
ysq a0579a338b feat(pumpswap): Auto-wrap SOL and enrich gRPC events
This commit introduces two main enhancements:

    1.  Adds an `auto_handle_wsol` parameter to `PumpSwap` buy/sell functions. When enabled, the SDK automatically manages the wrapping of SOL to WSOL and unwrapping back to SOL, simplifying client-side logic.
    2.  Enriches `PumpSwap` gRPC buy/sell events by parsing transaction instructions to include token mints and account addresses, providing more context for event consumers.
2025-06-23 00:50:51 +08:00
ysq 9396871b01 Merge commit 'd8643c8421026f41266e41ac6dde676306a1cb93' into dev 2025-06-22 23:06:57 +08:00
ysq 926201b4c7 refactor(trading): Adapt buy/sell functions to use parameter objects
This commit refactors the `copy_buy_with_tip`, `sell_by_percent`, `sell_by_amount`, and their `with_tip` variants within the `PumpFun` struct.

    The functions now accept parameter objects (`BuyWithTipParams`, `SellParams`, `SellWithTipParams`) instead of a list of individual arguments. This change improves code modularity, readability, and allows for dynamic dispatch to the correct protocol implementation (PumpFun or PumpSwap) based on the provided protocol parameters.
2025-06-22 23:05:54 +08:00
wei d8643c8421 sniper_buy_with_tip add bonding_curve 2025-06-22 22:50:05 +08:00
ysq 7024e100b9 feat: Refactor pump.fun buy transaction creation
Removes the `dev_buy_token` and `dev_sol_cost` parameters from the buy process to simplify the interface and reduce redundancy.
2025-06-20 18:14:26 +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
wei 02ab5f5314 fixd 2025-06-18 18:17:28 +08:00
wei 2303a4c1e6 feat: bonding_curve is transmitted from the outside 2025-06-18 17:39:20 +08:00
sgxiang 428ece5d6a feat: refactor trading architecture with unified framework
- Add unified TradeExecutor interface and protocol abstraction
- Refactor PumpFun/PumpSwap into adapter pattern
- Introduce TradeFactory for multi-protocol support
- Add parallel execution and unified parameter system
- Include Raydium protocol support and log parsing
- Simplify codebase structure and improve maintainability
2025-06-17 23:32:20 +08:00
sgxiang f20dbbd793 feat(pumpswap): improve nonce handling logic and transaction building flow 2025-06-16 21:08:46 +08:00
wei f38fb91076 Add a method to obtain pumpswap token balance 2025-06-15 20:50:51 +08:00
wei af2afcbb60 fix 2025-06-14 18:52:46 +08:00
wei 1ac52b03a9 Add the current price for obtaining pumpswap tokens 2025-06-12 20:45:22 +08:00
sgxiang 1db60c2d65 Merge commit '1743fecf1abc184d3e346b7c5126eb06869a447c' into feat/pumpswap 2025-06-12 00:00:55 +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