|
|
@@ -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");
|