소스 검색

市价下单1000币名称问题解决,订单格式化均价取值修改

JiahengHe 1 년 전
부모
커밋
c1001660bf
2개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 0
      standard/src/phemex_swap.rs
  2. 1 1
      standard/src/phemex_swap_handle.rs

+ 2 - 0
standard/src/phemex_swap.rs

@@ -311,6 +311,8 @@ impl Platform for PhemexSwap {
 
         if symbol.starts_with("1000") {
             symbol_format = utils::format_symbol(symbol.clone(), "").replace("1000", "u1000");
+        } else if symbol.starts_with("u1000") { // 已经格式化 不需要做其他处理
+            symbol_format = symbol;
         } else {
             symbol_format = utils::format_symbol(symbol.clone(), "");
         }

+ 1 - 1
standard/src/phemex_swap_handle.rs

@@ -93,7 +93,7 @@ pub fn format_order_item(order: &Value, ct_val: Decimal) -> Order {
     let price = Decimal::from_str(order["priceRp"].as_str().unwrap()).unwrap();
     let amount = Decimal::from_str(order["orderQty"].as_str().unwrap()).unwrap() * ct_val;
     let deal_amount = Decimal::from_str(order["cumQty"].as_str().unwrap()).unwrap() * ct_val;
-    let avg_price = Decimal::from_str(order["cumValueRv"].as_str().unwrap()).unwrap();
+    let avg_price = Decimal::from_str(order["execPriceRp"].as_str().unwrap()).unwrap();
 
     let status = order["ordStatus"].as_str().unwrap();
     let custom_status;