Skip to content

Commit

Permalink
fix: spot calculate fee on amend, use order price if no amended price…
Browse files Browse the repository at this point in the history
… is provided

Signed-off-by: Jeremy Letang <[email protected]>
  • Loading branch information
jeremyletang committed Aug 14, 2024
1 parent 4815e13 commit 7191637
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
- [11535](https://github.com/vegaprotocol/vega/issues/11535) - Added support for lottery rank distribution strategy.
- [11536](https://github.com/vegaprotocol/vega/issues/11536) - Make the batch market instructions errors programmatically usable.
- [11546](https://github.com/vegaprotocol/vega/issues/11546) - Add validation to market proposals metadata.
- [11562](https://github.com/vegaprotocol/vega/issues/11562) - Update average notional metric with mark price at the end of the epoch and when calculating live score.
- [11562](https://github.com/vegaprotocol/vega/issues/11562) - Update average notional metric with mark price at the end of the epoch and when calculating live score.
- [11570](https://github.com/vegaprotocol/vega/issues/11570) - Include the required set of parties for evaluation for eligible entities reward.

### 🐛 Fixes

- [11521](https://github.com/vegaprotocol/vega/issues/11521) - Restore `AMM` position factor when loading from a snapshot.
Expand All @@ -35,6 +35,7 @@
- [11540](https://github.com/vegaprotocol/vega/issues/11540) - Fix spam check for spots to use not double count quantum.
- [11542](https://github.com/vegaprotocol/vega/issues/11542) - Fix non determinism in lottery ranking.
- [11544](https://github.com/vegaprotocol/vega/issues/11544) - Fix empty candles stream.
- [11579](https://github.com/vegaprotocol/vega/issues/11579) - Spot calculate fee on amend, use order price if no amended price is provided.


## 0.77.5
Expand Down
6 changes: 3 additions & 3 deletions core/execution/spot/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -2380,13 +2380,13 @@ func (m *Market) validateOrderAmendment(order *types.Order, amendment *types.Ord
existingHoldingQty, existingHoldingFee := m.orderHoldingTracker.GetCurrentHolding(order.ID)
oldHoldingRequirement := num.Sum(existingHoldingQty, existingHoldingFee)
newFeesRequirement := num.UintZero()
if m.as.InAuction() {
newFeesRequirement, _ = m.calculateFees(order.Party, remaining, amendment.Price, order.Side)
}
price := order.Price
if amendment.Price != nil {
price, _ = num.UintFromDecimal(amendment.Price.ToDecimal().Mul(m.priceFactor))
}
if m.as.InAuction() {
newFeesRequirement, _ = m.calculateFees(order.Party, remaining, price, order.Side)
}
if order.PeggedOrder != nil {
p, err := m.getNewPeggedPrice(order)
if err != nil {
Expand Down

0 comments on commit 7191637

Please sign in to comment.