Skip to content

Commit f6ee8fd

Browse files
committed
Merge pull request #11688 from vegaprotocol/11687
fix: potential division by zero in notional reward metric evaluation …
1 parent ca6b5ea commit f6ee8fd

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
- [11665](https://github.com/vegaprotocol/vega/issues/11665) - Delay the final termination of a transfer to the following epoch.
6363
- [11679](https://github.com/vegaprotocol/vega/issues/11679) - Fix calculation of fees in party `stats`.
6464
- [11665](https://github.com/vegaprotocol/vega/issues/11665) - Delay the final termination of a transfer to the following epoch.
65-
65+
- [11687](https://github.com/vegaprotocol/vega/issues/11687) - Fix potential division by zero in notional reward metric evaluation.
6666
## 0.78.1
6767

6868
### 🐛 Fixes

core/execution/common/market_activity_tracker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ func calcNotionalAt(n *twNotional, t, tn int64, markPrice *num.Uint) *num.Uint {
13291329
}
13301330
p1 := num.UintZero().Mul(n.currentEpochTWNotional, tnOverTComp)
13311331
var notional *num.Uint
1332-
if markPrice != nil && !markPrice.IsZero() {
1332+
if markPrice != nil && !markPrice.IsZero() && !(n.price.IsZero() || n.notional.IsZero()) {
13331333
notional, _ = num.UintFromDecimal(n.notional.ToDecimal().Div(n.price.ToDecimal()).Mul(markPrice.ToDecimal()))
13341334
} else {
13351335
notional = n.notional

0 commit comments

Comments
 (0)