liquiditymaker: skip dust quantity

This commit is contained in:
c9s 2024-05-14 17:34:26 +08:00
parent e6ce215979
commit 34200efd54
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -81,12 +81,17 @@ func (g *LiquidityOrderGenerator) Generate(
price := layerPrices[i] price := layerPrices[i]
s := layerScales[i] s := layerScales[i]
quantity := factor * s quantity := g.Market.TruncateQuantity(fixedpoint.NewFromFloat(factor * s))
if g.Market.IsDustQuantity(quantity, price) {
continue
}
orders = append(orders, types.SubmitOrder{ orders = append(orders, types.SubmitOrder{
Symbol: g.Symbol, Symbol: g.Symbol,
Price: price, Price: price,
Type: types.OrderTypeLimitMaker, Type: types.OrderTypeLimitMaker,
Quantity: g.Market.TruncateQuantity(fixedpoint.NewFromFloat(quantity)), Quantity: quantity,
Side: side, Side: side,
Market: g.Market, Market: g.Market,
}) })