Skip to content

Commit

Permalink
chore: do not restore 0 positions
Browse files Browse the repository at this point in the history
  • Loading branch information
ze97286 committed Sep 27, 2023
1 parent 890736b commit 8cf18ae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/execution/future/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit 8cf18ae

Please sign in to comment.