Skip to content

Commit

Permalink
xmaker: fix price initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Sep 15, 2024
1 parent 80430fe commit 26b1fd2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/strategy/xmaker/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,13 @@ func (s *Strategy) getLayerPrice(
}
}

sideBook := sourceBook.SideBook(side)
if pv, ok := sideBook.First(); ok {
price = pv.Price
}

if requiredDepth.Sign() > 0 {
price = aggregatePrice(sourceBook.SideBook(side), requiredDepth)
price = aggregatePrice(sideBook, requiredDepth)
price = price.Mul(fixedpoint.One.Add(delta))
if i > 0 {
price = price.Add(pips.Mul(s.makerMarket.TickSize))
Expand Down

0 comments on commit 26b1fd2

Please sign in to comment.