|
|
@@ -12,7 +12,7 @@ use tokio::spawn;
|
|
|
use tokio::time::Instant;
|
|
|
use tracing::{error, info, trace, warn};
|
|
|
use exchanges::coinex_swap_rest::CoinexSwapRest;
|
|
|
-use crate::{Platform, ExchangeEnum, Account, Position, Ticker, Market, Order, OrderCommand, PositionModeEnum};
|
|
|
+use crate::{Platform, ExchangeEnum, Account, Position, Ticker, Market, Order, OrderCommand, PositionModeEnum, utils};
|
|
|
use global::trace_stack::TraceStack;
|
|
|
use crate::utils::get_tick_size;
|
|
|
|
|
|
@@ -412,7 +412,7 @@ impl Platform for CoinexSwap {
|
|
|
let ct_val = self.market.ct_val;
|
|
|
let order_side;
|
|
|
let position_side;
|
|
|
- let size = amount.round_dp(self.market.amount_precision.to_u32().unwrap());
|
|
|
+ let size = utils::truncate_decimal(amount, self.market.amount_precision.to_u32().unwrap());
|
|
|
if size <= Decimal::ZERO {
|
|
|
error!("下单数量异常 amount {} amount_precision {} size {}", amount, self.market.amount_precision.to_u32().unwrap(), size);
|
|
|
return Err(Error::new(ErrorKind::Other, format!("下单数量错误 amount:{}", amount)));
|