Skip to content

Commit

Permalink
liquiditymaker: skip dust quantity
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed May 14, 2024
1 parent e6ce215 commit 34200ef
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/strategy/liquiditymaker/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,17 @@ func (g *LiquidityOrderGenerator) Generate(
price := layerPrices[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{
Symbol: g.Symbol,
Price: price,
Type: types.OrderTypeLimitMaker,
Quantity: g.Market.TruncateQuantity(fixedpoint.NewFromFloat(quantity)),
Quantity: quantity,
Side: side,
Market: g.Market,
})
Expand Down

0 comments on commit 34200ef

Please sign in to comment.