Skip to content

Commit

Permalink
scmaker: fix negative op
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jun 14, 2023
1 parent ce40151 commit 6270eef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/strategy/scmaker/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (s *Strategy) placeAdjustmentOrders(ctx context.Context) {
tickSize := s.Market.TickSize

if s.Position.IsShort() {
price := profitProtectedPrice(types.SideTypeBuy, s.Position.AverageCost, ticker.Sell.Add(-tickSize), s.session.MakerFeeRate, s.MinProfit)
price := profitProtectedPrice(types.SideTypeBuy, s.Position.AverageCost, ticker.Sell.Add(tickSize.Neg()), s.session.MakerFeeRate, s.MinProfit)
quoteQuantity := fixedpoint.Min(price.Mul(posSize), quoteBal.Available)
bidQuantity := quoteQuantity.Div(price)

Expand Down Expand Up @@ -286,7 +286,7 @@ func (s *Strategy) placeLiquidityOrders(ctx context.Context) {

if i == s.NumOfLiquidityLayers {
bwf := fixedpoint.NewFromFloat(bandWidth)
bidPrice = midPrice.Add(-bwf)
bidPrice = midPrice.Add(bwf.Neg())
askPrice = midPrice.Add(bwf)
} else if i > 0 {
bidPrice = midPrice.Sub(tickSize.Mul(fi))
Expand Down

0 comments on commit 6270eef

Please sign in to comment.