grid2: update metrics before we re-play orders

This commit is contained in:
c9s 2023-03-07 20:01:27 +08:00
parent f26568e213
commit db119a2218
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -1413,9 +1413,10 @@ func (s *Strategy) recoverGridWithOpenOrders(ctx context.Context, historyService
// before we re-play the orders,
// we need to add these open orders to the active order book
s.addOrdersToActiveOrderBook(gridOrders)
s.setGrid(grid)
s.EmitGridReady()
s.updateGridNumOfOrdersMetrics()
s.updateOpenOrderPricesMetrics(s.orderExecutor.ActiveMakerOrders().Orders())
for i := range filledOrders {
// avoid using the iterator