diff --git a/CHANGELOG.md b/CHANGELOG.md index de60d4a97b..b534745461 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,7 @@ - [11665](https://github.com/vegaprotocol/vega/issues/11665) - Delay the final termination of a transfer to the following epoch. - [11679](https://github.com/vegaprotocol/vega/issues/11679) - Fix calculation of fees in party `stats`. - [11665](https://github.com/vegaprotocol/vega/issues/11665) - Delay the final termination of a transfer to the following epoch. - +- [11687](https://github.com/vegaprotocol/vega/issues/11687) - Fix potential division by zero in notional reward metric evaluation. ## 0.78.1 ### 🐛 Fixes diff --git a/core/execution/common/market_activity_tracker.go b/core/execution/common/market_activity_tracker.go index 144f40bd6f..0e9d1ea879 100644 --- a/core/execution/common/market_activity_tracker.go +++ b/core/execution/common/market_activity_tracker.go @@ -1393,7 +1393,7 @@ func calcNotionalAt(n *twNotional, t, tn int64, markPrice *num.Uint) *num.Uint { } p1 := num.UintZero().Mul(n.currentEpochTWNotional, tnOverTComp) var notional *num.Uint - if markPrice != nil && !markPrice.IsZero() { + if markPrice != nil && !markPrice.IsZero() && !(n.price.IsZero() || n.notional.IsZero()) { notional, _ = num.UintFromDecimal(n.notional.ToDecimal().Div(n.price.ToDecimal()).Mul(markPrice.ToDecimal())) } else { notional = n.notional