Skip to content

Commit

Permalink
fix: do not enter long block auction if market is terminated
Browse files Browse the repository at this point in the history
  • Loading branch information
wwestgarth committed Jul 3, 2024
1 parent f4e364e commit 5aecb04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/execution/future/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,10 @@ func (m *Market) uncrossOrderAtAuctionEnd(ctx context.Context) {
}

func (m *Market) EnterLongBlockAuction(ctx context.Context, duration int64) {
if !m.canTrade() {
return
}

m.mkt.State = types.MarketStateSuspended
m.mkt.TradingMode = types.MarketTradingModelLongBlockAuction
if m.as.InAuction() {
Expand Down
4 changes: 4 additions & 0 deletions core/execution/spot/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,10 @@ func (m *Market) uncrossOrderAtAuctionEnd(ctx context.Context) {
}

func (m *Market) EnterLongBlockAuction(ctx context.Context, duration int64) {
if !m.canTrade() {
return
}

m.mkt.State = types.MarketStateSuspended
m.mkt.TradingMode = types.MarketTradingModelLongBlockAuction
if m.as.InAuction() {
Expand Down

0 comments on commit 5aecb04

Please sign in to comment.