code.vegaprotocol.io/vega@v0.79.0/core/integration/features/auctions/opening-auction-expiry.feature (about) 1 Feature: Set up a market, create indiciative price different to actual opening auction uncross price 2 3 Background: 4 Given the simple risk model named "my-simple-risk-model": 5 | long | short | max move up | min move down | probability of trading | 6 | 0.1 | 0.1 | 2 | -3 | 0.2 | 7 Given the markets: 8 | id | quote name | asset | risk model | margin calculator | auction duration | fees | price monitoring | data source config | linear slippage factor | quadratic slippage factor | sla params | 9 | ETH/DEC19 | BTC | ETH | my-simple-risk-model | default-margin-calculator | 5 | default-none | default-basic | default-eth-for-future | 0.25 | 0 | default-futures | 10 And the following network parameters are set: 11 | name | value | 12 | market.auction.minimumDuration | 5 | 13 | market.auction.maximumDuration | 10s | 14 | network.floatingPointUpdates.delay | 10s | 15 | network.markPriceUpdateMaximumFrequency | 0s | 16 | limits.markets.maxPeggedOrders | 2 | 17 18 @DebugAuctionMax @Expires 19 Scenario: 0043-MKTL-012 Simple test verifying the market is cancelled if it failes to leave opening auction 20 # setup accounts 21 Given the parties deposit on asset's general account the following amount: 22 | party | asset | amount | 23 | party1 | ETH | 100000 | 24 | party5 | ETH | 10000 | 25 | party6 | ETH | 10000 | 26 | lpprov | ETH | 10000 | 27 28 # Start market with some dead time 29 And the network moves ahead "5" blocks 30 Then the parties submit the following liquidity provision: 31 | id | party | market id | commitment amount | fee | lp type | 32 | party1 | party1 | ETH/DEC19 | 30000 | 0.1 | submission | 33 34 Then the market data for the market "ETH/DEC19" should be: 35 | trading mode | 36 | TRADING_MODE_OPENING_AUCTION | 37 # Ensure an indicative price/volume of 10, although we will not uncross at this price point 38 And the parties place the following orders: 39 | party | market id | side | volume | price | resulting trades | type | tif | reference | 40 | party6 | ETH/DEC19 | buy | 1 | 20 | 0 | TYPE_LIMIT | TIF_GFA | t6-b-1 | 41 When the network moves ahead "1" blocks 42 Then the market data for the market "ETH/DEC19" should be: 43 | trading mode | 44 | TRADING_MODE_OPENING_AUCTION | 45 And the parties place the following orders: 46 | party | market id | side | volume | price | resulting trades | type | tif | reference | 47 | party5 | ETH/DEC19 | sell | 1 | 21 | 0 | TYPE_LIMIT | TIF_GFA | t5-s-1 | 48 # place orders to set the actual price point at which we'll uncross to be 10000 49 When the network moves ahead "1" blocks 50 Then the market data for the market "ETH/DEC19" should be: 51 | trading mode | 52 | TRADING_MODE_OPENING_AUCTION | 53 54 Then the parties should have the following account balances: 55 | party | asset | market id | margin | general | bond | 56 | party1 | ETH | ETH/DEC19 | 0 | 70000 | 30000 | 57 | party5 | ETH | ETH/DEC19 | 3 | 9997 | | 58 | party6 | ETH | ETH/DEC19 | 2 | 9998 | | 59 When the network moves ahead "10" blocks 60 61 # Now the market should be cancelled 62 Then the last market state should be "STATE_CANCELLED" for the market "ETH/DEC19" 63 64 #orders are cancelled 65 And the orders should have the following status: 66 | party | reference | status | 67 | party5 | t5-s-1 | STATUS_CANCELLED | 68 | party6 | t6-b-1 | STATUS_CANCELLED | 69 70 #asset is released for party with orders and LP commitment 71 Then "party1" should have general account balance of "100000" for asset "ETH" 72 Then "party5" should have general account balance of "10000" for asset "ETH" 73 Then "party6" should have general account balance of "10000" for asset "ETH" 74 75 # Then debug transfers 76 # check transfers for asset releasing 77 Then the following transfers should happen: 78 | from | to | from account | to account | market id | amount | asset | 79 | party1 | party1 | ACCOUNT_TYPE_BOND | ACCOUNT_TYPE_GENERAL | ETH/DEC19 | 30000 | ETH | 80 81 Then the parties should have the following account balances: 82 | party | asset | market id | margin | general | bond | 83 | party1 | ETH | ETH/DEC19 | 0 | 100000 | 0 | 84 | party5 | ETH | ETH/DEC19 | 0 | 10000 | | 85 | party6 | ETH | ETH/DEC19 | 0 | 10000 | | 86 87