types: do not truncate quantity before adjustment

This commit is contained in:
c9s 2023-06-16 15:35:07 +08:00
parent dc3901cc7f
commit 46fecbbdeb
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -158,7 +158,6 @@ func (m Market) CanonicalizeVolume(val fixedpoint.Value) float64 {
// AdjustQuantityByMinNotional adjusts the quantity to make the amount greater than the given minAmount
func (m Market) AdjustQuantityByMinNotional(quantity, currentPrice fixedpoint.Value) fixedpoint.Value {
// modify quantity for the min amount
quantity = m.TruncateQuantity(quantity)
amount := currentPrice.Mul(quantity)
if amount.Compare(m.MinNotional) < 0 {
ratio := m.MinNotional.Div(amount)