2025-01-23 17:48:10 +08:00
|
|
|
|
[package]
|
2025-06-16 10:20:30 +08:00
|
|
|
|
name = "sol-trade-sdk"
|
2026-07-17 02:15:20 +08:00
|
|
|
|
version = "5.0.0"
|
2025-01-23 17:48:10 +08:00
|
|
|
|
edition = "2021"
|
2025-08-23 20:37:03 +08:00
|
|
|
|
authors = [
|
|
|
|
|
|
"William <byteblock6@gmail.com>",
|
|
|
|
|
|
"sgxiang <sgxiang@gmail.com>",
|
|
|
|
|
|
"wei <1415121722@qq.com>",
|
|
|
|
|
|
]
|
2025-06-16 10:20:30 +08:00
|
|
|
|
repository = "https://github.com/0xfnzero/sol-trade-sdk"
|
2026-05-14 00:25:44 +08:00
|
|
|
|
description = "A high-performance Rust SDK for Solana DEX trading."
|
2025-01-23 17:48:10 +08:00
|
|
|
|
license = "MIT"
|
2025-07-10 18:31:01 +08:00
|
|
|
|
keywords = ["solana", "memecoins", "pumpfun", "pumpswap", "raydium"]
|
2025-01-23 17:48:10 +08:00
|
|
|
|
readme = "README.md"
|
|
|
|
|
|
|
2025-08-25 00:21:15 +08:00
|
|
|
|
|
|
|
|
|
|
[workspace]
|
|
|
|
|
|
members = [
|
|
|
|
|
|
"examples/trading_client",
|
2026-01-05 21:26:21 +00:00
|
|
|
|
"examples/shared_infrastructure",
|
2025-08-25 00:21:15 +08:00
|
|
|
|
"examples/middleware_system",
|
|
|
|
|
|
"examples/pumpswap_trading",
|
2026-02-27 13:42:15 +08:00
|
|
|
|
"examples/pumpfun_copy_trading",
|
|
|
|
|
|
"examples/pumpfun_sniper_trading",
|
2025-08-25 00:21:15 +08:00
|
|
|
|
"examples/bonk_sniper_trading",
|
|
|
|
|
|
"examples/bonk_copy_trading",
|
|
|
|
|
|
"examples/raydium_cpmm_trading",
|
|
|
|
|
|
"examples/raydium_amm_v4_trading",
|
2025-09-04 16:32:34 +08:00
|
|
|
|
"examples/address_lookup",
|
|
|
|
|
|
"examples/nonce_cache",
|
2025-09-08 00:24:29 +08:00
|
|
|
|
"examples/pumpswap_direct_trading",
|
2025-09-09 17:02:24 +08:00
|
|
|
|
"examples/wsol_wrapper",
|
2025-09-10 00:05:13 +08:00
|
|
|
|
"examples/seed_trading",
|
2025-09-15 21:12:42 +08:00
|
|
|
|
"examples/cli_trading",
|
2025-09-19 15:46:51 +08:00
|
|
|
|
"examples/gas_fee_strategy",
|
2025-10-05 22:27:04 +08:00
|
|
|
|
"examples/meteora_damm_v2_direct_trading",
|
2026-06-07 22:22:26 +08:00
|
|
|
|
"examples/simple_trading",
|
2025-08-25 00:21:15 +08:00
|
|
|
|
]
|
|
|
|
|
|
|
2025-01-23 17:48:10 +08:00
|
|
|
|
[lib]
|
2026-05-04 13:46:11 +08:00
|
|
|
|
crate-type = ["rlib"]
|
2025-01-23 17:48:10 +08:00
|
|
|
|
|
2025-12-08 01:35:40 +08:00
|
|
|
|
[features]
|
|
|
|
|
|
default = []
|
|
|
|
|
|
perf-trace = [] # 性能追踪特性,生产环境应禁用以获得最佳性能
|
|
|
|
|
|
|
2025-01-23 17:48:10 +08:00
|
|
|
|
[dependencies]
|
2025-09-27 14:24:41 +08:00
|
|
|
|
solana-sdk = "3.0.0"
|
2026-04-11 18:43:18 +08:00
|
|
|
|
solana-client = "3.1.12"
|
2025-10-25 22:46:36 +08:00
|
|
|
|
solana-program = "3.0.0"
|
2026-04-11 18:43:18 +08:00
|
|
|
|
solana-rpc-client = "3.1.12"
|
|
|
|
|
|
solana-rpc-client-api = "3.1.12"
|
|
|
|
|
|
solana-transaction-status = "3.1.12"
|
|
|
|
|
|
solana-account-decoder = "3.1.12"
|
2025-09-27 14:24:41 +08:00
|
|
|
|
solana-hash = "3.0.0"
|
2026-04-11 18:43:18 +08:00
|
|
|
|
solana-entry = "3.0.0"
|
|
|
|
|
|
solana-rpc-client-nonce-utils = "3.1.12"
|
|
|
|
|
|
solana-perf = "3.1.12"
|
|
|
|
|
|
solana-metrics = "3.1.12"
|
|
|
|
|
|
solana-tls-utils = "3.1.12"
|
|
|
|
|
|
solana-nonce = "3.2.0"
|
|
|
|
|
|
|
|
|
|
|
|
solana-address-lookup-table-interface = "3.0.0"
|
|
|
|
|
|
solana-message = "3.1.0"
|
2025-09-27 14:24:41 +08:00
|
|
|
|
solana-compute-budget-interface = "3.0.0"
|
2026-02-27 13:42:15 +08:00
|
|
|
|
solana-commitment-config = { version = "3.1.1", features = ["serde"] }
|
2026-04-11 18:43:18 +08:00
|
|
|
|
solana-transaction-status-client-types = "3.1.12"
|
|
|
|
|
|
solana-system-interface = { version = "3.0.0", features = ["bincode"] }
|
2025-09-27 14:24:41 +08:00
|
|
|
|
|
2025-01-23 17:48:10 +08:00
|
|
|
|
borsh = { version = "1.5.3", features = ["derive"] }
|
|
|
|
|
|
isahc = "1.7.2"
|
|
|
|
|
|
serde = { version = "1.0.215", features = ["derive"] }
|
|
|
|
|
|
serde_json = "1.0.134"
|
|
|
|
|
|
futures = "0.3.31"
|
|
|
|
|
|
futures-util = "0.3.31"
|
|
|
|
|
|
base64 = "0.22.1"
|
|
|
|
|
|
bs58 = "0.5.1"
|
2026-07-17 03:22:52 +08:00
|
|
|
|
# `five8` 1.0 permits five8_core 0.1.x, whose DecodeError implements
|
|
|
|
|
|
# std::error::Error only with this feature. Solana keypair decoding requires it.
|
|
|
|
|
|
five8_core = { version = "0.1.2", features = ["std"] }
|
2025-02-12 20:12:14 +08:00
|
|
|
|
rand = "0.9.0"
|
2025-01-23 17:48:10 +08:00
|
|
|
|
bincode = "1.3.3"
|
|
|
|
|
|
anyhow = "1.0.90"
|
2025-02-21 20:47:28 +08:00
|
|
|
|
reqwest = { version = "0.12.12", features = ["json", "multipart"] }
|
2025-01-23 17:48:10 +08:00
|
|
|
|
tokio = { version = "1.42.0" , features = ["full", "rt-multi-thread"]}
|
2026-04-11 18:43:18 +08:00
|
|
|
|
tonic = { version = "0.12", features = ["transport"] }
|
2025-04-02 13:39:59 +08:00
|
|
|
|
rustls = { version = "0.23.23", features = ["ring"] }
|
|
|
|
|
|
rustls-native-certs = "0.8.1"
|
|
|
|
|
|
tokio-rustls = "0.26.1"
|
2025-05-29 18:53:58 +08:00
|
|
|
|
core_affinity = "0.8"
|
2025-01-23 17:48:10 +08:00
|
|
|
|
chrono = "0.4.39"
|
|
|
|
|
|
regex = "1"
|
2025-02-12 20:12:14 +08:00
|
|
|
|
tracing = "0.1.41"
|
2025-02-13 20:44:20 +08:00
|
|
|
|
thiserror = "2.0.11"
|
|
|
|
|
|
async-trait = "0.1.86"
|
2025-02-15 18:53:17 +08:00
|
|
|
|
once_cell = "1.20.3"
|
2026-04-11 18:43:18 +08:00
|
|
|
|
prost = "0.13"
|
|
|
|
|
|
prost-types = "0.13"
|
2025-04-02 13:39:59 +08:00
|
|
|
|
num_enum = "0.7.3"
|
|
|
|
|
|
num-derive = "0.4.2"
|
|
|
|
|
|
num-traits = "0.2.19"
|
|
|
|
|
|
hex = "0.4.3"
|
|
|
|
|
|
bytemuck = { version = "1.4.0" }
|
|
|
|
|
|
arrayref = "0.3.6"
|
|
|
|
|
|
borsh-derive = "1.5.5"
|
2025-08-05 18:28:13 +08:00
|
|
|
|
indicatif = "0.18.0"
|
2026-04-11 18:43:18 +08:00
|
|
|
|
|
2025-09-04 16:32:34 +08:00
|
|
|
|
fnv = "1.0.7"
|
|
|
|
|
|
dashmap = "6.1.0"
|
2025-09-08 17:12:29 +08:00
|
|
|
|
clru = "0.6"
|
|
|
|
|
|
smallvec = "1.15.1"
|
2025-09-19 00:49:45 +08:00
|
|
|
|
parking_lot = "0.12"
|
2025-09-21 20:47:36 +08:00
|
|
|
|
arc-swap = "1.7"
|
2025-09-27 14:24:41 +08:00
|
|
|
|
sha2 = "0.10"
|
|
|
|
|
|
tonic-prost = "0.14.2"
|
2026-04-16 20:11:41 +08:00
|
|
|
|
# 须含 runtime-tokio,否则 quinn::Endpoint::client 报 no async runtime found,QUIC(Speedlanding/Soyas)无法初始化
|
|
|
|
|
|
quinn = { version = "0.11", default-features = false, features = ["rustls", "runtime-tokio"] }
|
2026-07-12 18:03:08 +08:00
|
|
|
|
lunar-lander-quic-client = "0.4"
|
2026-03-07 10:47:31 +08:00
|
|
|
|
rcgen = "0.13"
|
2026-03-12 15:40:56 +08:00
|
|
|
|
uuid = "1.11"
|
2025-10-06 23:40:27 +08:00
|
|
|
|
|
|
|
|
|
|
# Performance optimization dependencies
|
|
|
|
|
|
crossbeam-queue = "0.3"
|
|
|
|
|
|
crossbeam-utils = "0.8"
|
|
|
|
|
|
memmap2 = "0.9"
|
|
|
|
|
|
num_cpus = "1.16"
|
|
|
|
|
|
libc = "0.2"
|
|
|
|
|
|
|
2025-12-08 01:35:40 +08:00
|
|
|
|
# 🚀 编译器优化配置 - 平衡性能与编译速度
|
2025-10-06 23:40:27 +08:00
|
|
|
|
[profile.release]
|
2025-12-08 01:35:40 +08:00
|
|
|
|
opt-level = 3 # 最高优化级别(不影响编译速度)
|
|
|
|
|
|
lto = "thin" # 瘦LTO - 平衡性能与编译速度(比fat快5-10倍)
|
|
|
|
|
|
codegen-units = 16 # 16个代码生成单元 - 并行编译(比1快10倍)
|
2025-10-06 23:40:27 +08:00
|
|
|
|
panic = "abort" # 恐慌即中止
|
|
|
|
|
|
overflow-checks = false # 禁用溢出检查
|
|
|
|
|
|
debug = false # 禁用调试信息
|
|
|
|
|
|
debug-assertions = false # 禁用调试断言
|
|
|
|
|
|
rpath = false
|
|
|
|
|
|
strip = true # 去除符号表
|
2025-12-08 01:35:40 +08:00
|
|
|
|
incremental = true # 增量编译 - 大幅加速重新编译
|
2025-10-06 23:40:27 +08:00
|
|
|
|
|
|
|
|
|
|
[profile.dev]
|
|
|
|
|
|
opt-level = 1 # 开发时适度优化
|
|
|
|
|
|
overflow-checks = true # 开发时启用溢出检查
|
|
|
|
|
|
|
2026-03-18 21:32:23 +08:00
|
|
|
|
# 🚀 构建依赖
|
|
|
|
|
|
# 注意:proto 代码已预生成在 src/swqos/pb/serverpb.rs
|
|
|
|
|
|
# 开发者如需重新生成代码,请运行 gen_proto 目录下的工具
|
|
|
|
|
|
|
2025-10-06 23:40:27 +08:00
|
|
|
|
# 🚀 性能关键依赖的特殊优化
|
|
|
|
|
|
[profile.release.package.solana-sdk]
|
|
|
|
|
|
opt-level = 3
|
|
|
|
|
|
|
|
|
|
|
|
[profile.release.package.bincode]
|
|
|
|
|
|
opt-level = 3
|