Order: Fix AmountStepIncrementSize conforms check (#1286)

Was using max instead of min, and using either should be redundant
anyway
This commit is contained in:
Gareth Kirwan
2023-07-31 09:29:17 +01:00
committed by GitHub
parent a0bc2c0cf3
commit a207d6ecf3

View File

@@ -242,9 +242,8 @@ func (m *MinMaxLevel) Conforms(price, amount float64, orderType Type) error {
}
if m.AmountStepIncrementSize != 0 {
dAmount := decimal.NewFromFloat(amount)
dMinAmount := decimal.NewFromFloat(m.MaximumBaseAmount)
dStep := decimal.NewFromFloat(m.AmountStepIncrementSize)
if !dAmount.Sub(dMinAmount).Mod(dStep).IsZero() {
if !dAmount.Mod(dStep).IsZero() {
return fmt.Errorf("%w stepSize: %.8f supplied %.8f",
ErrAmountExceedsStep,
m.AmountStepIncrementSize,