code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spot/orders/0074-BTCH-015.feature (about) 1 Feature: If an instruction causes the market to enter a Price Monitoring Auction the market should enter the auction immediately 2 before continuing with later instructions. (0074-BTCH-015) 3 4 Background: 5 Given time is updated to "2024-01-01T00:00:00Z" 6 7 Given the following network parameters are set: 8 | name | value | 9 | network.markPriceUpdateMaximumFrequency | 0s | 10 | market.value.windowLength | 1h | 11 12 Given the following assets are registered: 13 | id | decimal places | 14 | ETH | 2 | 15 | BTC | 2 | 16 17 Given the fees configuration named "fees-config-1": 18 | maker fee | infrastructure fee | 19 | 0.01 | 0.03 | 20 Given the log normal risk model named "lognormal-risk-model-1": 21 | risk aversion | tau | mu | r | sigma | 22 | 0.001 | 0.01 | 0 | 0.0 | 1.2 | 23 And the price monitoring named "price-monitoring-1": 24 | horizon | probability | auction extension | 25 | 3600 | 0.999 | 10 | 26 27 And the spot markets: 28 | id | name | base asset | quote asset | risk model | auction duration | fees | price monitoring | decimal places | position decimal places | sla params | 29 | BTC/ETH | BTC/ETH | BTC | ETH | lognormal-risk-model-1 | 1 | fees-config-1 | price-monitoring-1 | 2 | 2 | default-basic | 30 31 # setup accounts 32 Given the parties deposit on asset's general account the following amount: 33 | party | asset | amount | 34 | party1 | ETH | 10000 | 35 | party2 | ETH | 10000 | 36 | party4 | BTC | 100 | 37 | party5 | BTC | 100 | 38 And the average block duration is "1" 39 40 # Place some orders to get out of auction 41 And the parties place the following orders: 42 | party | market id | side | volume | price | resulting trades | type | tif | 43 | party1 | BTC/ETH | buy | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 44 | party5 | BTC/ETH | sell | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 45 | party5 | BTC/ETH | sell | 2 | 1050 | 0 | TYPE_LIMIT | TIF_GTC | 46 47 And the opening auction period ends for market "BTC/ETH" 48 When the network moves ahead "1" blocks 49 Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH" 50 And the mark price should be "1000" for the market "BTC/ETH" 51 52 And the market data for the market "BTC/ETH" should be: 53 | mark price | trading mode | horizon | min bound | max bound | target stake | supplied stake | open interest | 54 | 1000 | TRADING_MODE_CONTINUOUS | 3600 | 959 | 1042 | 0 | 0 | 0 | 55 56 Scenario: Placing an order outside of price bands will force the market to go into auction before the order is traded. 57 All other orders after the out of bounds order will be placed in the auction. 58 59 Then the party "party1" starts a batch instruction 60 Then the party "party1" adds the following orders to a batch: 61 | market id | side | volume | price | type | tif | reference | 62 | BTC/ETH | buy | 1 | 1050 | TYPE_LIMIT | TIF_GTC | p1-buy1 | 63 | BTC/ETH | buy | 1 | 1060 | TYPE_LIMIT | TIF_GTC | p1-buy2 | 64 Then the party "party1" submits their batch instruction 65 When the network moves ahead "1" blocks 66 67 # `p1-buy1` forced us into an auction 68 Then the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "BTC/ETH" 69 70 # Both orders rest on the book in the auction instead of crossing 71 Then the orders should have the following states: 72 | party | market id | side | price | remaining | volume | reference | status | 73 | party1 | BTC/ETH | buy | 1050 | 1 | 1 | p1-buy1 | STATUS_ACTIVE | 74 | party1 | BTC/ETH | buy | 1060 | 1 | 1 | p1-buy2 | STATUS_ACTIVE | 75 76 77 78