code.vegaprotocol.io/vega@v0.79.0/core/integration/features/auctions/5468-opening-auction-uncross-with-wash-trades.feature (about) 1 Feature: Set up a market, with an opening auction, then uncross the book in presence of wash trades 2 3 Background: 4 5 And the markets: 6 | id | quote name | asset | risk model | margin calculator | auction duration | fees | price monitoring | data source config | linear slippage factor | quadratic slippage factor | sla params | 7 | ETH/DEC19 | BTC | BTC | default-simple-risk-model-4 | default-margin-calculator | 1 | default-none | default-none | default-eth-for-future | 0.25 | 0 | default-futures | 8 9 Scenario: Set up opening auction with wash trades and uncross 10 # setup accounts 11 Given the parties deposit on asset's general account the following amount: 12 | party | asset | amount | 13 | party1 | BTC | 100000000 | 14 | party2 | BTC | 100000000 | 15 | party3 | BTC | 100000000 | 16 | party4 | BTC | 100000000 | 17 | lpprov | BTC | 100000000 | 18 And the following network parameters are set: 19 | name | value | 20 | limits.markets.maxPeggedOrders | 2 | 21 22 When the parties submit the following liquidity provision: 23 | id | party | market id | commitment amount | fee | lp type | 24 | lp1 | lpprov | ETH/DEC19 | 50000 | 0.1 | submission | 25 | lp1 | lpprov | ETH/DEC19 | 50000 | 0.1 | submission | 26 And the parties place the following pegged iceberg orders: 27 | party | market id | peak size | minimum visible size | side | pegged reference | volume | offset | 28 | lpprov | ETH/DEC19 | 2 | 1 | buy | MID | 50 | 100 | 29 | lpprov | ETH/DEC19 | 2 | 1 | sell | MID | 50 | 100 | 30 31 # place orders and generate trades 32 When the parties place the following orders: 33 | party | market id | side | volume | price | resulting trades | type | tif | reference | 34 | party3 | ETH/DEC19 | buy | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | t3-b-1 | 35 | party4 | ETH/DEC19 | sell | 1 | 11000 | 0 | TYPE_LIMIT | TIF_GTC | t4-s-1 | 36 | party1 | ETH/DEC19 | buy | 5 | 10000 | 0 | TYPE_LIMIT | TIF_GFA | t1-b-1 | 37 | party1 | ETH/DEC19 | sell | 5 | 10000 | 0 | TYPE_LIMIT | TIF_GFA | t1-s-1 | 38 | party1 | ETH/DEC19 | buy | 5 | 10000 | 0 | TYPE_LIMIT | TIF_GFA | t1-b-2 | 39 | party2 | ETH/DEC19 | sell | 5 | 10000 | 0 | TYPE_LIMIT | TIF_GFA | t2-s-2 | 40 | party2 | ETH/DEC19 | sell | 3 | 12000 | 0 | TYPE_LIMIT | TIF_GFA | t2-s-3 | 41 Then the opening auction period ends for market "ETH/DEC19" 42 43 And the market data for the market "ETH/DEC19" should be: 44 | mark price | trading mode | target stake | supplied stake | open interest | 45 | 10000 | TRADING_MODE_CONTINUOUS | 50000 | 50000 | 5 | 46 47 And the following trades should be executed: 48 | buyer | price | size | seller | 49 | party1 | 10000 | 5 | party1 | 50 | party1 | 10000 | 5 | party2 | 51 52 Then the orders should have the following status: 53 | party | reference | status | 54 | party3 | t3-b-1 | STATUS_ACTIVE | 55 | party4 | t4-s-1 | STATUS_ACTIVE | 56 | party1 | t1-b-1 | STATUS_FILLED | 57 | party1 | t1-s-1 | STATUS_FILLED | 58 | party1 | t1-b-2 | STATUS_FILLED | 59 | party2 | t2-s-2 | STATUS_FILLED | 60 | party2 | t2-s-3 | STATUS_CANCELLED | 61 62 Then the parties should have the following profit and loss: 63 | party | volume | unrealised pnl | realised pnl | 64 | party1 | 5 | 0 | 0 | 65 | party2 | -5 | 0 | 0 |