#让SDK中打印 submit_timing 的数据( SwqosType和 提交耗时)返回给buy 和 sell 方法。

主要解决问题:
当 wait_tx_confirmed 参数为 false 时,SUBMIT_TIMEOUT_SECS 等待改为2秒,要么全部提交完成返回,要么不等待提交未返回的交易,方便快速创建交易订单。

#Let the SDK print submit_timing data (SwqosType and submission time) and return it to the buy and sell methods.

Main problems solved:

When the wait_tx_confirmed parameter is false, the SUBMIT_TIMEOUT_SECS wait is changed to 2 seconds. Either all submissions are completed and returned, or the unreturned transactions are not waited for submission, which facilitates the rapid creation of transaction orders.
This commit is contained in:
Admin
2026-04-01 15:46:01 +08:00
parent ae890ad976
commit eaa3214e4d
4 changed files with 23 additions and 19 deletions
+1 -1
View File
@@ -562,7 +562,7 @@ pub async fn execute_parallel(
// All jobs enqueued (no spawn on hot path)
if !wait_transaction_confirmed {
const SUBMIT_TIMEOUT_SECS: u64 = 30;
const SUBMIT_TIMEOUT_SECS: u64 = 2;//无需确认的交易,一般2秒合适了 一般2秒内发送全都返回 没返回的也不等了,没返回的就是太慢的swqos
let ret = collector.wait_for_all_submitted(SUBMIT_TIMEOUT_SECS).await.unwrap_or((
false,
vec![],