Skip to content

Commit

Permalink
Merge pull request #11539 from vegaprotocol/fix_spot_spam_bug
Browse files Browse the repository at this point in the history
fix: order spam check for spot fixed
  • Loading branch information
jeremyletang authored Aug 8, 2024
2 parents c4d95f6 + fddb134 commit 4205bf7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
- [11528](https://github.com/vegaprotocol/vega/issues/11528) - Added support for eligible entities reward.
- [11372](https://github.com/vegaprotocol/vega/issues/11372) - Support combined filters for the `AMM` API.
- [11535](https://github.com/vegaprotocol/vega/issues/11535) - Added support for lottery rank distribution strategy.
### 🐛 Fixes

### 🐛 Fixes
- [11521](https://github.com/vegaprotocol/vega/issues/11521) - Restore `AMM` position factor when loading from a snapshot.
- [11526](https://github.com/vegaprotocol/vega/issues/11526) - `EstimateAMMBounds` now respects the market's decimal places.

- [11540](https://github.com/vegaprotocol/vega/issues/11540) - Fix spam check for spots to use not double count quantum.

## 0.77.5

Expand Down
3 changes: 1 addition & 2 deletions core/execution/spot/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -3349,10 +3349,9 @@ func (m *Market) checkOrderForSpam(side types.Side, orderPrice *num.Uint, orderS
price, _ = num.UintFromDecimal(orderPrice.ToDecimal().Mul(m.priceFactor))
}

minQuantum := assetQuantum.Mul(quantumMultiplier)
value := num.UintZero().Mul(num.NewUint(orderSize), price).ToDecimal()
value = value.Div(m.positionFactor)
required := minQuantum.Mul(assetQuantum)
required := assetQuantum.Mul(quantumMultiplier)
if value.LessThan(required) {
return fmt.Errorf(fmt.Sprintf("order value (%s) is less than minimum holding requirement for spam (%s)", value.String(), required.String()))
}
Expand Down

0 comments on commit 4205bf7

Please sign in to comment.