diff --git a/pkg/strategy/grid2/strategy.go b/pkg/strategy/grid2/strategy.go index 3d454e784..67c755585 100644 --- a/pkg/strategy/grid2/strategy.go +++ b/pkg/strategy/grid2/strategy.go @@ -152,7 +152,7 @@ func (s *Strategy) handleOrderFilled(o types.Order) { } // use the profit to buy more inventory in the grid - if s.Compound { + if s.Compound || s.EarnBase { quoteQuantity := o.Quantity.Mul(o.Price) newQuantity = quoteQuantity.Div(newPrice) } @@ -162,6 +162,11 @@ func (s *Strategy) handleOrderFilled(o types.Order) { if pin, ok := s.grid.NextHigherPin(newPrice); ok { newPrice = fixedpoint.Value(pin) } + + if s.EarnBase { + quoteQuantity := o.Quantity.Mul(o.Price) + newQuantity = quoteQuantity.Div(newPrice) + } } orderForm := types.SubmitOrder{