Parcourir la source

htx 订单格式化均价修复

JiahengHe il y a 1 an
Parent
commit
52c16f4a58
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 1 1
      standard/src/htx_swap.rs
  2. 1 1
      standard/src/htx_swap_handle.rs

+ 1 - 1
standard/src/htx_swap.rs

@@ -572,7 +572,7 @@ pub fn format_order_item(order: serde_json::Value, ct_val: Decimal) -> Order {
     let price = Decimal::from_f64(order["price"].as_f64().unwrap()).unwrap();
     let amount = Decimal::from_f64(order["volume"].as_f64().unwrap()).unwrap() * ct_val;
     let deal_amount = Decimal::from_f64(order["trade_volume"].as_f64().unwrap()).unwrap() * ct_val;
-    let avg_price = Decimal::from_f64(order["trade_avg_price"].as_f64().unwrap_or(0.0)).unwrap() * ct_val;
+    let avg_price = Decimal::from_f64(order["trade_avg_price"].as_f64().unwrap_or(0.0)).unwrap();
 
     let status = order["status"].to_string();
 

+ 1 - 1
standard/src/htx_swap_handle.rs

@@ -48,7 +48,7 @@ pub fn format_order_item(order: serde_json::Value, ct_val: Decimal) -> Order {
     let price = Decimal::from_f64(order["price"].as_f64().unwrap()).unwrap();
     let amount = Decimal::from_f64(order["volume"].as_f64().unwrap()).unwrap() * ct_val;
     let deal_amount = Decimal::from_f64(order["trade_volume"].as_f64().unwrap()).unwrap() * ct_val;
-    let avg_price = Decimal::from_f64(order["trade_avg_price"].as_f64().unwrap_or(0.0)).unwrap() * ct_val;
+    let avg_price = Decimal::from_f64(order["trade_avg_price"].as_f64().unwrap_or(0.0)).unwrap();
 
     let status = order["status"].to_string();