feat: major gas fee strategy and documentation overhaul

- feat(gas): add comprehensive gas fee strategy management system
  * Implement GasFeeStrategyType with Default/LowTipHighCuPrice/HighTipLowCuPrice strategies
  * Add dynamic gas fee configuration per SWQOS service and trade type
  * Integrate arc-swap for thread-safe strategy updates

- docs: restructure documentation with dedicated guides
  * Add ADDRESS_LOOKUP_TABLE.md/CN.md for lookup table configuration
  * Add NONCE_CACHE.md/CN.md for nonce management documentation
  * Add TRADING_PARAMETERS.md/CN.md for comprehensive parameter guides
  * Simplify main README.md with focused overview

- refactor: update all examples with new gas fee strategy integration
  * Modernize 14 trading examples with consistent parameter handling
  * Improve error handling and configuration management
  * Enhance parallel trading implementation
This commit is contained in:
ysq
2025-09-19 00:49:45 +08:00
parent fad343ffbf
commit 006686e8a3
45 changed files with 2133 additions and 1681 deletions
+4 -5
View File
@@ -147,7 +147,6 @@ impl TemporalClient {
pub async fn send_transaction(&self, trade_type: TradeType, transaction: &VersionedTransaction) -> Result<()> {
let start_time = Instant::now();
let (content, signature) = serialize_transaction_and_encode(transaction, UiTransactionEncoding::Base64).await?;
println!(" Transaction encoded to base64: {:?}", start_time.elapsed());
// Build request body according to Nozomi documentation requirements
let request_body = serde_json::to_string(&json!({
@@ -175,12 +174,12 @@ impl TemporalClient {
if let Ok(response_json) = serde_json::from_str::<serde_json::Value>(&response_text) {
if response_json.get("result").is_some() {
println!(" nozomi {} submitted: {:?}", trade_type, start_time.elapsed());
println!(" [nozomi] {} submitted: {:?}", trade_type, start_time.elapsed());
} else if let Some(_error) = response_json.get("error") {
// eprintln!("nozomi transaction submission failed: {:?}", _error);
}
} else {
eprintln!(" nozomi {} submission failed: {:?}", trade_type, response_text);
eprintln!(" [nozomi] {} submission failed: {:?}", trade_type, response_text);
}
let start_time: Instant = Instant::now();
@@ -188,12 +187,12 @@ impl TemporalClient {
Ok(_) => (),
Err(e) => {
println!(" signature: {:?}", signature);
println!(" nozomi {} confirmation failed: {:?}", trade_type, start_time.elapsed());
println!(" [nozomi] {} confirmation failed: {:?}", trade_type, start_time.elapsed());
return Err(e);
},
}
println!(" signature: {:?}", signature);
println!(" nozomi {} confirmed: {:?}", trade_type, start_time.elapsed());
println!(" [nozomi] {} confirmed: {:?}", trade_type, start_time.elapsed());
Ok(())
}