|
|
@@ -274,7 +274,7 @@ impl Platform for PhemexSwap {
|
|
|
let order_info = res_data_json.iter().find(|item| item["orderId"].as_str().unwrap() == order_id || item["clOrdId"] == custom_id);
|
|
|
match order_info {
|
|
|
None => {
|
|
|
- error!("phemex_swap:获取order信息错误!\nget_order_detail:res_data={:?},order_id={},custom_id:{}", response, order_id, custom_id);
|
|
|
+ // error!("phemex_swap:获取order信息错误!\nget_order_detail:res_data={:?},order_id={},custom_id:{}", response, order_id, custom_id);
|
|
|
Err(Error::new(ErrorKind::Other, response.to_string()))
|
|
|
}
|
|
|
Some(order) => {
|
|
|
@@ -609,7 +609,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["orderQtyRq"].as_str().unwrap()).unwrap() * ct_val;
|
|
|
let deal_amount = Decimal::from_str(order["cumQtyRq"].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["cumValueRv"].as_str().unwrap()).unwrap()/deal_amount;
|
|
|
|
|
|
let status = order["ordStatus"].as_str().unwrap();
|
|
|
let custom_status;
|