Skip to content

Commit

Permalink
Merge pull request #11416 from vegaprotocol/fix_lb
Browse files Browse the repository at this point in the history
fix: leave long block auction when auction duration expires
  • Loading branch information
ze97286 authored Jun 27, 2024
2 parents 1d5ba45 + 8d7bab6 commit 898fb04
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
- [11380](https://github.com/vegaprotocol/vega/issues/11380) - Handle broken stop orders in prepare proposal.
- [11136](https://github.com/vegaprotocol/vega/issues/11136) - Fix premature invocation of post commit hooks in case of fee stats event.
- [11409](https://github.com/vegaprotocol/vega/issues/11409) - When updating a capped market - copy the cap from the existing market definition.
- [11415](https://github.com/vegaprotocol/vega/issues/11415) - End long block auction when expired.

## 0.76.1

Expand Down
7 changes: 7 additions & 0 deletions core/execution/future/auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ func (m *Market) checkAuction(ctx context.Context, now time.Time, idgen common.I
if m.as.Trigger() == types.AuctionTriggerLiquidityTargetNotMet || m.as.Trigger() == types.AuctionTriggerUnableToDeployLPOrders {
m.as.SetReadyToLeave()
}

if m.as.Trigger() == types.AuctionTriggerLongBlock || m.as.ExtensionTrigger() == types.AuctionTriggerLongBlock {
if endTS := m.as.ExpiresAt(); endTS != nil && endTS.Before(now) {
m.as.SetReadyToLeave()
}
}

// price and liquidity auctions
isPrice := m.as.IsPriceAuction() || m.as.IsPriceExtension()
if !isPrice {
Expand Down
6 changes: 6 additions & 0 deletions core/execution/spot/auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ func (m *Market) checkAuction(ctx context.Context, now time.Time, idgen common.I
return
}

if m.as.Trigger() == types.AuctionTriggerLongBlock || m.as.ExtensionTrigger() == types.AuctionTriggerLongBlock {
if endTS := m.as.ExpiresAt(); endTS != nil && endTS.Before(now) {
m.as.SetReadyToLeave()
}
}

isPrice := m.as.IsPriceAuction() || m.as.IsPriceExtension()
if isPrice || m.as.CanLeave() {
m.pMonitor.CheckPrice(ctx, m.as, indicativeUncrossingPrice, true, true)
Expand Down

0 comments on commit 898fb04

Please sign in to comment.