Merge pull request #1066 from c9s/fix/grid2/fee-reduction

This commit is contained in:
gx578007 2023-02-24 12:56:09 +08:00 committed by GitHub
commit 3acb0a0a64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -373,9 +373,11 @@ func (s *Strategy) processFilledOrder(o types.Order) {
// if we don't reduce the sell quantity, than we might fail to place the sell order // if we don't reduce the sell quantity, than we might fail to place the sell order
if o.Side == types.SideTypeBuy { if o.Side == types.SideTypeBuy {
baseSellQuantityReduction = s.aggregateOrderBaseFee(o) baseSellQuantityReduction = s.aggregateOrderBaseFee(o)
s.logger.Infof("GRID BUY ORDER BASE FEE: %s %s", baseSellQuantityReduction.String(), s.Market.BaseCurrency) s.logger.Infof("GRID BUY ORDER BASE FEE: %s %s", baseSellQuantityReduction.String(), s.Market.BaseCurrency)
baseSellQuantityReduction = baseSellQuantityReduction.Round(s.Market.VolumePrecision, fixedpoint.Up)
s.logger.Infof("GRID BUY ORDER BASE FEE (Rounding): %s %s", baseSellQuantityReduction.String(), s.Market.BaseCurrency)
newQuantity = newQuantity.Sub(baseSellQuantityReduction) newQuantity = newQuantity.Sub(baseSellQuantityReduction)
} }