Skip to content

Commit 4205bf7

Browse files
authored
Merge pull request #11539 from vegaprotocol/fix_spot_spam_bug
fix: order spam check for spot fixed
2 parents c4d95f6 + fddb134 commit 4205bf7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
- [11528](https://github.com/vegaprotocol/vega/issues/11528) - Added support for eligible entities reward.
2121
- [11372](https://github.com/vegaprotocol/vega/issues/11372) - Support combined filters for the `AMM` API.
2222
- [11535](https://github.com/vegaprotocol/vega/issues/11535) - Added support for lottery rank distribution strategy.
23-
### 🐛 Fixes
2423

24+
### 🐛 Fixes
2525
- [11521](https://github.com/vegaprotocol/vega/issues/11521) - Restore `AMM` position factor when loading from a snapshot.
2626
- [11526](https://github.com/vegaprotocol/vega/issues/11526) - `EstimateAMMBounds` now respects the market's decimal places.
27-
27+
- [11540](https://github.com/vegaprotocol/vega/issues/11540) - Fix spam check for spots to use not double count quantum.
2828

2929
## 0.77.5
3030

core/execution/spot/market.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3349,10 +3349,9 @@ func (m *Market) checkOrderForSpam(side types.Side, orderPrice *num.Uint, orderS
33493349
price, _ = num.UintFromDecimal(orderPrice.ToDecimal().Mul(m.priceFactor))
33503350
}
33513351

3352-
minQuantum := assetQuantum.Mul(quantumMultiplier)
33533352
value := num.UintZero().Mul(num.NewUint(orderSize), price).ToDecimal()
33543353
value = value.Div(m.positionFactor)
3355-
required := minQuantum.Mul(assetQuantum)
3354+
required := assetQuantum.Mul(quantumMultiplier)
33563355
if value.LessThan(required) {
33573356
return fmt.Errorf(fmt.Sprintf("order value (%s) is less than minimum holding requirement for spam (%s)", value.String(), required.String()))
33583357
}

0 commit comments

Comments
 (0)