|
|
@@ -2,7 +2,7 @@ use std::ops::{Div, Mul};
|
|
|
use chrono::Utc;
|
|
|
use rand::Rng;
|
|
|
use rust_decimal::Decimal;
|
|
|
-use tracing::error;
|
|
|
+use tracing::{error};
|
|
|
use global::public_params;
|
|
|
|
|
|
// 生成订单的id,可以根据交易所名字来
|
|
|
@@ -48,7 +48,7 @@ pub fn get_amount_by_min_amount_value(min_amount_value: Decimal,
|
|
|
order_price: Decimal,
|
|
|
step_size: Decimal) -> Decimal {
|
|
|
// ceil可以向上取整
|
|
|
- let amount_unit = (min_amount_value / order_price).ceil();
|
|
|
+ let amount_unit = ((min_amount_value / order_price) / step_size).ceil();
|
|
|
|
|
|
amount_unit * step_size
|
|
|
}
|