From 8cf18ae12760a5d492d8dcf9053baca08cd73d3b Mon Sep 17 00:00:00 2001 From: ze97286 Date: Wed, 27 Sep 2023 21:52:38 +0100 Subject: [PATCH] chore: do not restore 0 positions --- core/execution/future/market.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/execution/future/market.go b/core/execution/future/market.go index 993ed51ca6d..ca72fc79076 100644 --- a/core/execution/future/market.go +++ b/core/execution/future/market.go @@ -837,7 +837,9 @@ func (m *Market) PostRestore(ctx context.Context) error { // if loading from an old snapshot we're restoring positions using the position engine if m.marketActivityTracker.NeedsInitialisation(m.settlementAsset, m.mkt.ID) { for _, mp := range m.position.Positions() { - m.marketActivityTracker.RestorePosition(m.settlementAsset, mp.Party(), m.mkt.ID, mp.Size(), mp.Price(), m.positionFactor) + if mp.Size() != 0 { + m.marketActivityTracker.RestorePosition(m.settlementAsset, mp.Party(), m.mkt.ID, mp.Size(), mp.Price(), m.positionFactor) + } } }