Преглед изворни кода

处理订阅数据前的前置处理。

skyffire пре 1 година
родитељ
комит
bf4f6e64e2
4 измењених фајлова са 6 додато и 6 уклоњено
  1. 2 2
      strategy/src/core.rs
  2. 1 1
      strategy/src/exchange_disguise.rs
  3. 2 2
      strategy/src/gate_usdt_swap.rs
  4. 1 1
      strategy/src/lib.rs

+ 2 - 2
strategy/src/core.rs

@@ -1707,12 +1707,12 @@ impl Core {
 
         loop {
             let is_clear = self.check_position(target_hold_coin, clear_count <= 1).await;
-            // 如果5次中间有一次没清理干净,则重新清理
+            // 如果N次中间有一次没清理干净,则重新清理
             if !is_clear {
                 clear_count = 1
             }
 
-            // 如果连续5次都检查到清理干净,则表明大概率是清理干净了的
+            // 如果连续N次都检查到清理干净,则表明大概率是清理干净了的
             if clear_count >= 1 {
                 info!("连续{}次清理完成。", clear_count);
                 info!("");

+ 1 - 1
strategy/src/exchange_disguise.rs

@@ -9,7 +9,7 @@ use standard::SpecialDepth;
 
 use crate::binance_usdt_swap::reference_binance_swap_run;
 use crate::bitget_usdt_swap::bitget_usdt_swap_run;
-use crate::gate_swap::gate_swap_run;
+use crate::gate_usdt_swap::gate_swap_run;
 // use crate::binance_spot::reference_binance_spot_run;
 // use crate::bitget_spot::bitget_spot_run;
 use crate::bybit_usdt_swap::bybit_swap_run;

+ 2 - 2
strategy/src/gate_swap.rs → strategy/src/gate_usdt_swap.rs

@@ -49,7 +49,7 @@ pub async fn gate_swap_run(is_shutdown_arc: Arc<AtomicBool>,
                                        GateSwapWsType::PublicAndPrivate("usdt".to_string()));
             ws.set_subscribe(vec![
                 // GateSwapSubscribeType::PuFuturesTrades,
-                GateSwapSubscribeType::PuFuturesBookTicker,
+                // GateSwapSubscribeType::PuFuturesBookTicker,
 
                 GateSwapSubscribeType::PrFuturesOrders(user_id.clone()),
                 GateSwapSubscribeType::PrFuturesPositions(user_id.clone()),
@@ -60,7 +60,7 @@ pub async fn gate_swap_run(is_shutdown_arc: Arc<AtomicBool>,
                                        GateSwapWsType::PublicAndPrivate("usdt".to_string()));
             ws.set_subscribe(vec![
                 GateSwapSubscribeType::PuFuturesTrades,
-                GateSwapSubscribeType::PuFuturesBookTicker
+                GateSwapSubscribeType::PuFuturesOrderBook
             ]);
         }
 

+ 1 - 1
strategy/src/lib.rs

@@ -6,7 +6,7 @@ mod utils;
 pub mod exchange_disguise;
 mod binance_usdt_swap;
 mod binance_spot;
-mod gate_swap;
+mod gate_usdt_swap;
 mod kucoin_swap;
 mod kucoin_spot;
 mod bitget_spot;