code.vegaprotocol.io/vega@v0.79.0/core/integration/features/auctions/0094-PRAC-003.feature (about) 1 Feature: Long block auction is triggered after a block that took 90 seconds (0094-PRAC-003) 2 3 4 5 Background: 6 Given the following assets are registered: 7 | id | decimal places | 8 | ETH | 5 | 9 And the long block duration table is: 10 | threshold | duration | 11 | 3s | 1m | 12 | 40s | 10m | 13 | 2m | 1h | 14 And the simple risk model named "my-simple-risk-model": 15 | long | short | max move up | min move down | probability of trading | 16 | 0.08628781058136630000 | 0.09370922348428490000 | -1 | -1 | 0.2 | 17 And the fees configuration named "my-fees-config": 18 | maker fee | infrastructure fee | 19 | 0.004 | 0.001 | 20 # create 2 markets 21 And the markets: 22 | id | quote name | asset | risk model | margin calculator | auction duration | fees | price monitoring | data source config | decimal places | linear slippage factor | quadratic slippage factor | sla params | 23 | ETH/DEC19 | ETH | ETH | my-simple-risk-model | default-margin-calculator | 1 | my-fees-config | default-none | default-eth-for-future | 2 | 0.25 | 0 | default-futures | 24 | ETH/DEC20 | ETH | ETH | my-simple-risk-model | default-margin-calculator | 1 | my-fees-config | default-none | default-eth-for-future | 2 | 0.25 | 0 | default-futures | 25 And the following network parameters are set: 26 | name | value | 27 | limits.markets.maxPeggedOrders | 2 | 28 And the average block duration is "1" 29 And the parties deposit on asset's general account the following amount: 30 | party | asset | amount | 31 | party1 | ETH | 1000000000000 | 32 | party2 | ETH | 1000000000000 | 33 | party3 | ETH | 1000000000000 | 34 | party4 | ETH | 1000000000000 | 35 | lpprov1 | ETH | 1000000000000 | 36 | lpprov2 | ETH | 1000000000000 | 37 And the parties submit the following liquidity provision: 38 | id | party | market id | commitment amount | fee | lp type | 39 | lp1 | lpprov1 | ETH/DEC20 | 937000000 | 0.1 | submission | 40 | lp2 | lpprov2 | ETH/DEC19 | 937000000 | 0.1 | submission | 41 And the parties place the following pegged iceberg orders: 42 | party | market id | peak size | minimum visible size | side | pegged reference | volume | offset | 43 | lpprov1 | ETH/DEC20 | 2 | 1 | buy | BID | 50 | 100 | 44 | lpprov1 | ETH/DEC20 | 2 | 1 | sell | ASK | 50 | 100 | 45 | lpprov2 | ETH/DEC19 | 2 | 1 | buy | MID | 50 | 100 | 46 | lpprov2 | ETH/DEC19 | 2 | 1 | sell | MID | 50 | 100 | 47 48 @LBA 49 Scenario: 0094-PRAC-003: long/slow block triggers auction on all markets. 50 # place orders and generate trades - slippage 100 51 When the parties place the following orders: 52 | party | market id | side | volume | price | resulting trades | type | tif | reference | 53 | party1 | ETH/DEC20 | buy | 1 | 999500 | 0 | TYPE_LIMIT | TIF_GTC | t1-b-1 | 54 | party1 | ETH/DEC20 | buy | 1 | 1000000 | 0 | TYPE_LIMIT | TIF_GFA | t1-b-2 | 55 | party2 | ETH/DEC20 | sell | 2 | 1000000 | 0 | TYPE_LIMIT | TIF_GTC | t2-s-1 | 56 | party3 | ETH/DEC19 | buy | 1 | 999500 | 0 | TYPE_LIMIT | TIF_GTC | t3-b-1 | 57 | party3 | ETH/DEC19 | buy | 1 | 1000000 | 0 | TYPE_LIMIT | TIF_GTC | t3-b-2 | 58 | party4 | ETH/DEC19 | sell | 2 | 1000000 | 0 | TYPE_LIMIT | TIF_GTC | t4-s-1 | 59 Then the market data for the market "ETH/DEC20" should be: 60 | trading mode | supplied stake | target stake | 61 | TRADING_MODE_OPENING_AUCTION | 937000000 | 937000000 | 62 And the market data for the market "ETH/DEC19" should be: 63 | trading mode | supplied stake | target stake | 64 | TRADING_MODE_OPENING_AUCTION | 937000000 | 937000000 | 65 66 When the network moves ahead "2" blocks 67 Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC20" 68 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19" 69 #And debug detailed orderbook volumes for market "ETH/DEC20" 70 And the order book should have the following volumes for market "ETH/DEC20": 71 | volume | price | side | 72 | 2 | 999400 | buy | 73 | 1 | 999500 | buy | 74 | 1 | 1000000 | sell | 75 | 2 | 1000100 | sell | 76 #And debug detailed orderbook volumes for market "ETH/DEC19" 77 And the order book should have the following volumes for market "ETH/DEC19": 78 | volume | price | side | 79 | 1 | 999500 | buy | 80 | 2 | 999650 | buy | 81 | 2 | 999850 | sell | 82 | 1 | 1000000 | sell | 83 84 And the following trades should be executed: 85 | buyer | price | size | seller | 86 | party1 | 1000000 | 1 | party2 | 87 | party3 | 1000000 | 1 | party4 | 88 And the mark price should be "1000000" for the market "ETH/DEC20" 89 And the mark price should be "1000000" for the market "ETH/DEC19" 90 91 When the previous block duration was "90s" 92 Then the trading mode should be "TRADING_MODE_LONG_BLOCK_AUCTION" for the market "ETH/DEC20" 93 And the trading mode should be "TRADING_MODE_LONG_BLOCK_AUCTION" for the market "ETH/DEC19" 94 95 # We know what the volume on the books look like, but let's submit some orders that will trade regardless 96 # And we'll see no trades happen 97 When the parties place the following orders: 98 | party | market id | side | volume | price | resulting trades | type | tif | reference | 99 | party1 | ETH/DEC20 | buy | 1 | 999999 | 0 | TYPE_LIMIT | TIF_GTC | t1-b-3 | 100 | party2 | ETH/DEC20 | sell | 1 | 999999 | 0 | TYPE_LIMIT | TIF_GTC | t2-s-2 | 101 | party3 | ETH/DEC19 | buy | 1 | 999999 | 0 | TYPE_LIMIT | TIF_GTC | t3-b-3 | 102 | party4 | ETH/DEC19 | sell | 1 | 999999 | 0 | TYPE_LIMIT | TIF_GTC | t4-s-2 | 103 Then the trading mode should be "TRADING_MODE_LONG_BLOCK_AUCTION" for the market "ETH/DEC20" 104 And the trading mode should be "TRADING_MODE_LONG_BLOCK_AUCTION" for the market "ETH/DEC19" 105 106 When the network moves ahead "9m50s" with block duration of "2s" 107 Then the trading mode should be "TRADING_MODE_LONG_BLOCK_AUCTION" for the market "ETH/DEC20" 108 And the trading mode should be "TRADING_MODE_LONG_BLOCK_AUCTION" for the market "ETH/DEC19" 109 110 # still in auction, 10 seconds later, though: 111 When the network moves ahead "11" blocks 112 Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC20" 113 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19" 114 And the following trades should be executed: 115 | buyer | price | size | seller | 116 | party1 | 999999 | 1 | party2 | 117 | party3 | 999999 | 1 | party4 | 118