Skip to content

Commit

Permalink
xmaker: count spread maker only when placing new order
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jan 28, 2025
1 parent 9d29612 commit 48fe6e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/strategy/xmaker/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,6 @@ func (s *Strategy) Hedge(ctx context.Context, pos fixedpoint.Value) {
if s.SpreadMaker != nil && s.SpreadMaker.Enabled && s.makerBook != nil {
if makerBid, makerAsk, hasMakerPrice := s.makerBook.BestBidAndAsk(); hasMakerPrice {
if makerOrderForm, ok := s.SpreadMaker.canSpreadMaking(signal, s.Position, s.makerMarket, makerBid.Price, makerAsk.Price); ok {
spreadMakerCounterMetrics.With(s.metricsLabels).Inc()

s.logger.Infof("position: %f@%f, maker book bid: %f/%f, spread maker order form: %+v",
s.Position.GetBase().Float64(),
Expand All @@ -1547,6 +1546,7 @@ func (s *Strategy) Hedge(ctx context.Context, pos fixedpoint.Value) {
}

if !hasOrder || !keptOrder {
spreadMakerCounterMetrics.With(s.metricsLabels).Inc()
s.logger.Infof("placing new spread maker order: %+v...", makerOrderForm)

retOrder, err := s.SpreadMaker.placeOrder(ctx, makerOrderForm)
Expand Down

0 comments on commit 48fe6e5

Please sign in to comment.