code.vegaprotocol.io/vega@v0.79.0/core/integration/features/orders/market-depth-2.feature (about) 1 Feature: Test market depth events for pegged orders 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 | BTC | BTC | default-simple-risk-model-2 | default-margin-calculator | 1 | default-none | default-none | default-eth-for-future | 0.25 | 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 13 @Depth 14 Scenario: Check order events with larger pegged orders, and lower balance 15 # setup accounts 16 Given the parties deposit on asset's general account the following amount: 17 | party | asset | amount | 18 | sellSideProvider | BTC | 100000000 | 19 | buySideProvider | BTC | 100000000 | 20 | pegged1 | BTC | 5000 | 21 | pegged2 | BTC | 50000 | 22 | pegged3 | BTC | 50000 | 23 | aux | BTC | 100000000 | 24 | aux2 | BTC | 100000000 | 25 # setup pegged orders 26 Then the parties place the following pegged orders: 27 | party | market id | side | volume | pegged reference | offset | 28 | pegged1 | ETH/DEC19 | sell | 1000 | MID | 10 | 29 | pegged2 | ETH/DEC19 | buy | 500 | MID | 15 | 30 | pegged3 | ETH/DEC19 | buy | 500 | MID | 10 | 31 Then the pegged orders should have the following states: 32 | party | market id | side | volume | reference | offset | price | status | 33 | pegged1 | ETH/DEC19 | sell | 1000 | MID | 10 | 0 | STATUS_PARKED | 34 | pegged2 | ETH/DEC19 | buy | 500 | MID | 15 | 0 | STATUS_PARKED | 35 | pegged3 | ETH/DEC19 | buy | 500 | MID | 10 | 0 | STATUS_PARKED | 36 # setup orderbook 37 When the parties place the following orders: 38 | party | market id | side | volume | price | resulting trades | type | tif | reference | 39 | sellSideProvider | ETH/DEC19 | sell | 1000 | 120 | 0 | TYPE_LIMIT | TIF_GTC | sell-provider-1 | 40 | buySideProvider | ETH/DEC19 | buy | 1000 | 80 | 0 | TYPE_LIMIT | TIF_GTC | buy-provider-1 | 41 | aux | ETH/DEC19 | sell | 1 | 100 | 0 | TYPE_LIMIT | TIF_GTC | aux-s-1 | 42 | aux2 | ETH/DEC19 | buy | 1 | 100 | 0 | TYPE_LIMIT | TIF_GTC | aux-b-1 | 43 Then the orders should have the following states: 44 | party | market id | side | volume | remaining | price | status | 45 | sellSideProvider | ETH/DEC19 | sell | 1000 | 1000 | 120 | STATUS_ACTIVE | 46 | buySideProvider | ETH/DEC19 | buy | 1000 | 1000 | 80 | STATUS_ACTIVE | 47 # Checked out, remove the order events we've checked, now let's have a look at the pegged order events 48 Then the opening auction period ends for market "ETH/DEC19" 49 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19" 50 # Now check what happened to our pegged orders 51 Then the pegged orders should have the following states: 52 | party | market id | side | volume | reference | offset | price | status | 53 | pegged1 | ETH/DEC19 | sell | 1000 | MID | 10 | 110 | STATUS_ACTIVE | 54 | pegged2 | ETH/DEC19 | buy | 500 | MID | 15 | 85 | STATUS_ACTIVE | 55 | pegged3 | ETH/DEC19 | buy | 500 | MID | 10 | 90 | STATUS_ACTIVE |