浏览代码

订单ws状态适配

JiahengHe 1 年之前
父节点
当前提交
e6f267a647
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 2 0
      standard/src/phemex_swap_handle.rs
  2. 1 1
      strategy/src/phemex_usdt_swap.rs

+ 2 - 0
standard/src/phemex_swap_handle.rs

@@ -101,6 +101,8 @@ pub fn format_order_item(order: &Value, ct_val: Decimal) -> Order {
         custom_status = "REMOVE".to_string()
     } else if vec!["New", "Init", "Created", "PartiallyFilled"].contains(&status) {
         custom_status = "NEW".to_string()
+    } else if vec!["Rejected"].contains(&status) {
+        custom_status = "NULL".to_string()
     } else {
         error!("gate_swap:格式化订单状态错误!\nformat_order_item:order={:?}", order);
         panic!("gate_swap:格式化订单状态错误!\nformat_order_item:order={:?}", order)

+ 1 - 1
strategy/src/phemex_usdt_swap.rs

@@ -122,7 +122,7 @@ async fn on_private_data(core_arc_clone: Arc<Mutex<Core>>,
             let mut order_infos:Vec<OrderInfo> = Vec::new();
             for mut order in orders.order {
                 if order.status == "NULL" {
-                    error!("phemex_usdt_swap 未识别的订单状态:{:?}", response);
+                    // error!("phemex_usdt_swap 未识别的订单状态:{:?}", response);
                     continue;
                 }
                 let mut order_info = OrderInfo::parse_order_to_order_info(&mut order);