Parcourir la source

订单ws状态适配

JiahengHe il y a 1 an
Parent
commit
e6f267a647
2 fichiers modifiés avec 3 ajouts et 1 suppressions
  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);