Browse Source

bybit的Buy和binance的Buy不是一个意思,哈哈哈……

skyffire 9 months ago
parent
commit
781a45e18c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      standard/src/bybit_swap_handle.rs

+ 1 - 1
standard/src/bybit_swap_handle.rs

@@ -111,7 +111,7 @@ pub fn handle_force_order(res_data: &ResponseData) -> ForceOrder {
     let side = json_value["side"].as_str().unwrap().to_string();
     let price = Decimal::from_str(json_value["price"].as_str().unwrap()).unwrap();
     let mut amount = Decimal::from_str(json_value["size"].as_str().unwrap()).unwrap();
-    if side == "Sell" {
+    if side == "Buy" {
         amount = -amount
     }
     let mut value = price * amount;