Ver código fonte

警告解决

JiahengHe 1 ano atrás
pai
commit
84cf412f2c
3 arquivos alterados com 5 adições e 9 exclusões
  1. 2 3
      exchanges/src/bybit_swap_ws.rs
  2. 0 3
      strategy/src/lib.rs
  3. 3 3
      strategy/src/quant.rs

+ 2 - 3
exchanges/src/bybit_swap_ws.rs

@@ -9,7 +9,6 @@ use tokio_tungstenite::tungstenite::{Error, Message};
 use tracing::{info, trace};
 
 use ring::hmac;
-use tracing_subscriber::fmt::format;
 
 use crate::response_base::ResponseData;
 use crate::socket_tool::{AbstractWsMode, HeartbeatType};
@@ -200,7 +199,7 @@ impl BybitSwapWs {
         let label = self.label.clone();
         let timestamp = Utc::now().timestamp_millis();
         let login_param = self.login_param.clone();
-        let (api_key, secret_key) = match self.login_param.clone() {
+        let (api_key, secret_key) = match login_param {
             None => { ("".to_string(), "".to_string()) }
             Some(p) => {
                 (p.api_key.clone().to_string(), p.secret_key.clone().to_string())
@@ -279,7 +278,7 @@ impl BybitSwapWs {
         if json_value.get("success").is_some() {
             //订阅内容
             let success = json_value["success"].as_bool().unwrap();
-            let ret_msg = json_value["ret_msg"].as_str().unwrap();
+            // let ret_msg = json_value["ret_msg"].as_str().unwrap();
             let op = json_value["op"].as_str().unwrap();
             let success_error = if success {
                 "成功"

+ 0 - 3
strategy/src/lib.rs

@@ -11,8 +11,5 @@ mod gate_swap;
 mod kucoin_swap;
 mod kucoin_spot;
 mod bitget_spot;
-mod predictor_new;
-mod instant_volatility_indicator;
-mod ring_buffer;
 mod okx_usdt_swap;
 mod bybit_usdt_swap;

+ 3 - 3
strategy/src/quant.rs

@@ -747,9 +747,9 @@ impl Quant {
                 volume: Default::default(),
             });
         }
-        let bp = self.trade_msg.market[BID_PRICE_INDEX];
-        let ap = self.trade_msg.market[ASK_PRICE_INDEX];
-        let mp = (bp + ap) * dec!(0.5);
+        // let bp = self.trade_msg.market[BID_PRICE_INDEX];
+        // let ap = self.trade_msg.market[ASK_PRICE_INDEX];
+        // let mp = (bp + ap) * dec!(0.5);
         // 更新持仓价值
         // self.predictor.balance_value = self.trade_msg.cash * mp;
         let ref_price: Vec<Vec<Decimal>> = self.predictor.get_ref_price(&ref_tickers);