소스 검색

htx查询全部仓位接口 仓位数量不做ct_val计算

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

+ 1 - 3
standard/src/htx_swap.rs

@@ -160,7 +160,6 @@ impl Platform for HtxSwap {
     }
 
     async fn get_positions(&mut self) -> Result<Vec<Position>, Error> {
-        let ct_val = self.market.ct_val;
         let params = json!({
             "contract_type": "swap"
         });
@@ -172,7 +171,7 @@ impl Platform for HtxSwap {
 
         let res_data_json = response.data;
         let positions_info = res_data_json.as_array().unwrap();
-        let result = positions_info.iter().map(|item| { format_position_item(item, &ct_val) }).collect();
+        let result = positions_info.iter().map(|item| { format_position_item(item, &Decimal::ONE) }).collect();
         Ok(result)
     }
 
@@ -297,7 +296,6 @@ impl Platform for HtxSwap {
         });
         if price.eq(&Decimal::ZERO) {
             params["order_price_type"] = json!("market");
-            params["volume"] = json!(amount.to_string());
         } else {
             params["price"] = json!(price.to_string());
             params["order_price_type"] = json!("limit");