浏览代码

添加打印信息

JiahengHe 1 年之前
父节点
当前提交
612dc6f2c8
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      strategy/src/coinex_usdt_swap.rs

+ 5 - 1
strategy/src/coinex_usdt_swap.rs

@@ -1,7 +1,8 @@
-use tracing::{error};
+use tracing::{error, info};
 use std::collections::BTreeMap;
 use std::sync::Arc;
 use std::sync::atomic::AtomicBool;
+use futures_util::future::err;
 use rust_decimal::Decimal;
 use tokio::spawn;
 use tokio::sync::Mutex;
@@ -98,6 +99,7 @@ async fn on_data(core_arc_clone: Arc<Mutex<Core>>,
         }
         "order.update" => {
             trace_stack.set_source("coinex_swap.orders".to_string());
+            info!("订单推送: {}", response.data);
             let orders = standard::handle_info::HandleSwapInfo::handle_order(CoinexSwap, response.clone(), multiplier.clone());
             let mut order_infos:Vec<OrderInfo> = Vec::new();
             for mut order in orders.order {
@@ -132,6 +134,8 @@ async fn on_data(core_arc_clone: Arc<Mutex<Core>>,
             if new_order.status != "REMOVE" || new_order.filled == Decimal::ZERO {
                 core.update_order(order_infos, trace_stack).await;
                 return
+            } else {
+                error!("不做操作的订单: {:?}", new_order);
             }
 
             // 单向持仓的处理