code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spots/opening-auction-expires.feature (about) 1 Feature: Set up a spot market, with an opening auction, then uncross the book. Make sure opening auction can end. 2 Background: 3 4 Given the fees configuration named "fees-config-1": 5 | maker fee | infrastructure fee | 6 | 0.005 | 0.002 | 7 And the simple risk model named "my-simple-risk-model": 8 | long | short | max move up | min move down | probability of trading | 9 | 0.08628781058136630000 | 0.09370922348428490000 | -1 | -1 | 0.2 | 10 And the fees configuration named "my-fees-config": 11 | maker fee | infrastructure fee | 12 | 0.004 | 0.001 | 13 And the following network parameters are set: 14 | name | value | 15 | market.auction.minimumDuration | 5 | 16 | market.auction.maximumDuration | 10s | 17 And the spot markets: 18 | id | name | base asset | quote asset | risk model | auction duration | fees | price monitoring | sla params | 19 | BTC/ETH | BTC/ETH | BTC | ETH | my-simple-risk-model | 5 | fees-config-1 | default-none | default-basic | 20 21 Scenario: 0043-MKTL-013 Ensure spot markets get cancelled if they fail to leave opening auction 22 # setup accounts 23 Given the parties deposit on asset's general account the following amount: 24 | party | asset | amount | 25 | party1 | ETH | 100000 | 26 | party2 | ETH | 100000 | 27 | party3 | ETH | 100000 | 28 | party2 | BTC | 5 | 29 30 Then the parties submit the following liquidity provision: 31 | id | party | market id | commitment amount | fee | lp type | 32 | lp1 | party3 | BTC/ETH | 3000 | 0.1 | submission | 33 # place orders and generate trades 34 When the parties place the following orders: 35 | party | market id | side | volume | price | resulting trades | type | tif | reference | 36 | party2 | BTC/ETH | buy | 1 | 95 | 0 | TYPE_LIMIT | TIF_GTC | t2-b-1 | 37 | party1 | BTC/ETH | buy | 1 | 100 | 0 | TYPE_LIMIT | TIF_GFA | t1-b-1 | 38 | party3 | BTC/ETH | buy | 1 | 110 | 0 | TYPE_LIMIT | TIF_GFA | t3-b-1 | 39 40 Then "party1" should have holding account balance of "100" for asset "ETH" 41 Then "party2" should have holding account balance of "95" for asset "ETH" 42 Then "party3" should have holding account balance of "110" for asset "ETH" 43 44 When the network moves ahead "1" blocks 45 Then the market data for the market "BTC/ETH" should be: 46 | trading mode | 47 | TRADING_MODE_OPENING_AUCTION | 48 49 When the network moves ahead "9" blocks 50 Then the last market state should be "STATE_PENDING" for the market "BTC/ETH" 51 52 When the network moves ahead "1" blocks 53 Then the last market state should be "STATE_CANCELLED" for the market "BTC/ETH" 54 55 #orders are cancelled 56 And the orders should have the following status: 57 | party | reference | status | 58 | party2 | t2-b-1 | STATUS_CANCELLED | 59 | party1 | t1-b-1 | STATUS_CANCELLED | 60 | party3 | t3-b-1 | STATUS_CANCELLED | 61 62 #asset is released for party with orders and LP commitment 63 Then "party1" should have general account balance of "100000" for asset "ETH" 64 Then "party2" should have general account balance of "100000" for asset "ETH" 65 Then "party3" should have general account balance of "100000" for asset "ETH" 66 67 # check transfers for asset releasing 68 Then the following transfers should happen: 69 | from | to | from account | to account | market id | amount | asset | 70 | party3 | party3 | ACCOUNT_TYPE_HOLDING | ACCOUNT_TYPE_GENERAL | | 110 | ETH | 71 | party2 | party2 | ACCOUNT_TYPE_HOLDING | ACCOUNT_TYPE_GENERAL | | 95 | ETH | 72 | party1 | party1 | ACCOUNT_TYPE_HOLDING | ACCOUNT_TYPE_GENERAL | | 100 | ETH | 73 | party3 | party3 | ACCOUNT_TYPE_BOND | ACCOUNT_TYPE_GENERAL | BTC/ETH | 3000 | ETH | 74