code.vegaprotocol.io/vega@v0.79.0/core/integration/features/position_tracking/wrong-position-tracking.feature (about) 1 Feature: Test position tracking with auctions 2 3 Background: 4 Given the markets: 5 | id | quote name | asset | risk model | margin calculator | auction duration | fees | price monitoring | data source config | linear slippage factor | quadratic slippage factor | sla params | 6 | ETH/DEC19 | ETH | ETH | default-simple-risk-model-3 | default-margin-calculator | 1 | default-none | default-basic | default-eth-for-future | 0.01 | 0 | default-futures | 7 And the following network parameters are set: 8 | name | value | 9 | market.auction.minimumDuration | 1 | 10 | limits.markets.maxPeggedOrders | 1500 | 11 | network.markPriceUpdateMaximumFrequency | 0s | 12 | limits.markets.maxPeggedOrders | 2 | 13 14 Scenario: 15 Given the parties deposit on asset's general account the following amount: 16 | party | asset | amount | 17 | party0 | ETH | 1000000000 | 18 | party1 | ETH | 1000000000 | 19 | party2 | ETH | 1000000000 | 20 | party3 | ETH | 1000000000 | 21 | partylp | ETH | 1000000000 | 22 | ruser | ETH | 75000 | 23 24 # submit our LP 25 Then the parties submit the following liquidity provision: 26 | id | party | market id | commitment amount | fee | lp type | 27 | lp1 | partylp | ETH/DEC19 | 16000000 | 0.3 | submission | 28 | lp1 | partylp | ETH/DEC19 | 16000000 | 0.3 | amendment | 29 And the parties place the following pegged iceberg orders: 30 | party | market id | peak size | minimum visible size | side | pegged reference | volume | offset | 31 | partylp | ETH/DEC19 | 2 | 1 | buy | BID | 2 | 10 | 32 | partylp | ETH/DEC19 | 2 | 1 | sell | ASK | 13 | 10 | 33 34 # get out of auction 35 When the parties place the following orders: 36 | party | market id | side | volume | price | resulting trades | type | tif | reference | 37 | party0 | ETH/DEC19 | buy | 1 | 100000 | 0 | TYPE_LIMIT | TIF_GTC | t0-b-1 | 38 | party1 | ETH/DEC19 | sell | 1 | 100000 | 0 | TYPE_LIMIT | TIF_GTC | t1-s-1 | 39 | party0 | ETH/DEC19 | buy | 5 | 95000 | 0 | TYPE_LIMIT | TIF_GTC | t0-b-2 | 40 | party1 | ETH/DEC19 | sell | 5 | 107000 | 0 | TYPE_LIMIT | TIF_GTC | t1-s-2 | 41 42 Then the opening auction period ends for market "ETH/DEC19" 43 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19" 44 45 When the parties place the following orders with ticks: 46 | party | market id | side | volume | price | resulting trades | type | tif | reference | 47 | party1 | ETH/DEC19 | sell | 15 | 107500 | 0 | TYPE_LIMIT | TIF_GTC | t1-s-3 | 48 | party0 | ETH/DEC19 | buy | 10 | 107100 | 0 | TYPE_LIMIT | TIF_GTC | t1-b-3 | 49 50 And the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "ETH/DEC19" 51 52 When the parties place the following orders with ticks: 53 | party | market id | side | volume | price | resulting trades | type | tif | reference | error | 54 | party3 | ETH/DEC19 | buy | 10 | 107300 | 0 | TYPE_LIMIT | TIF_GTC | t3-b-1 | | 55 | party1 | ETH/DEC19 | sell | 10 | 107100 | 0 | TYPE_LIMIT | TIF_GTC | t1-s-4 | | 56 | ruser | ETH/DEC19 | buy | 50 | 107500 | 0 | TYPE_LIMIT | TIF_GTC | lp-b-1 | margin check failed | 57 | party3 | ETH/DEC19 | buy | 70 | 106000 | 0 | TYPE_LIMIT | TIF_GFA | lp-b-2 | | 58 59 Then the parties place the following pegged orders: 60 | party | market id | side | volume | pegged reference | offset | 61 | ruser | ETH/DEC19 | buy | 35 | BID | 1000 | 62 | ruser | ETH/DEC19 | sell | 35 | ASK | 3000 | 63 64 When the parties place the following orders with ticks: 65 | party | market id | side | volume | price | resulting trades | type | tif | reference | 66 | party1 | ETH/DEC19 | sell | 80 | 105000 | 0 | TYPE_LIMIT | TIF_GTC | t1-s-5 | 67 | party3 | ETH/DEC19 | buy | 81 | 106000 | 0 | TYPE_LIMIT | TIF_GFA | t3-b-2 | 68 | party3 | ETH/DEC19 | buy | 86 | 107000 | 0 | TYPE_LIMIT | TIF_GTC | t3-b-3 | 69 70 Then the parties place the following pegged orders: 71 | party | market id | side | volume | pegged reference | offset | 72 | party0 | ETH/DEC19 | buy | 100 | BID | 5000 | 73 | party1 | ETH/DEC19 | sell | 95 | ASK | 1000 | 74 75 When the network moves ahead "15" blocks 76 Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19"