code.vegaprotocol.io/vega@v0.79.0/core/integration/features/orders/0037-OPEG-020.feature (about) 1 Feature: 0037-OPEG-020, 0037-OPEG-021 2 3 Background: 4 Given the following network parameters are set: 5 | name | value | 6 | market.liquidity.bondPenaltyParameter | 1 | 7 | network.markPriceUpdateMaximumFrequency | 0s | 8 | limits.markets.maxPeggedOrders | 6 | 9 | validators.epoch.length | 5s | 10 | market.liquidity.earlyExitPenalty | 0.25 | 11 | market.liquidity.stakeToCcyVolume | 1.0 | 12 | market.liquidity.sla.nonPerformanceBondPenaltySlope | 0.19 | 13 | market.liquidity.sla.nonPerformanceBondPenaltyMax | 1 | 14 15 And the liquidity monitoring parameters: 16 | name | triggering ratio | time window | scaling factor | 17 | lqm-params | 0.1 | 24h | 1 | 18 19 And the following assets are registered: 20 | id | decimal places | 21 | ETH | 0 | 22 23 And the average block duration is "1" 24 And the simple risk model named "simple-risk-model-1": 25 | long | short | max move up | min move down | probability of trading | 26 | 0.1 | 0.1 | 60 | 50 | 0.2 | 27 And the fees configuration named "fees-config-1": 28 | maker fee | infrastructure fee | 29 | 0.004 | 0.001 | 30 And the price monitoring named "price-monitoring-1": 31 | horizon | probability | auction extension | 32 | 1 | 0.99 | 5 | 33 And the liquidity sla params named "SLA": 34 | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor | 35 | 0.01 | 0.5 | 1 | 1.0 | 36 37 Scenario: Given a mid-price which is not an integer multiple of the market tick size, a buy order pegged to the mid price should have it's price rounded up to the nearest market tick size 38 #while a sell order pegged to the mid price should have it's price rounded down to the nearest market tick size 39 And the markets: 40 | id | quote name | asset | liquidity monitoring | risk model | margin calculator | auction duration | fees | price monitoring | data source config | linear slippage factor | quadratic slippage factor | sla params | decimal places | tick size | 41 | ETH/DEC21 | ETH | ETH | lqm-params | simple-risk-model-1 | default-margin-calculator | 1 | fees-config-1 | price-monitoring-1 | default-eth-for-future | 0.5 | 0 | SLA | 0 | 10 | 42 And the parties deposit on asset's general account the following amount: 43 | party | asset | amount | 44 | party1 | ETH | 100000000 | 45 | party3 | ETH | 100000000 | 46 | party4 | ETH | 100000000 | 47 And the average block duration is "1" 48 And the parties submit the following liquidity provision: 49 | id | party | market id | commitment amount | fee | lp type | 50 | lp1 | party1 | ETH/DEC21 | 10000 | 0.001 | submission | 51 And the parties place the following orders: 52 | party | market id | side | volume | price | resulting trades | type | tif | reference | 53 | party3 | ETH/DEC21 | buy | 100 | 100 | 0 | TYPE_LIMIT | TIF_GTC | p3b1 | 54 | party3 | ETH/DEC21 | buy | 10 | 110 | 0 | TYPE_LIMIT | TIF_GTC | p3b2 | 55 | party4 | ETH/DEC21 | sell | 10 | 110 | 0 | TYPE_LIMIT | TIF_GTC | p4s2 | 56 | party4 | ETH/DEC21 | sell | 1000 | 190 | 0 | TYPE_LIMIT | TIF_GTC | p4s1 | 57 58 Then the network moves ahead "2" blocks 59 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC21" 60 61 Then the following trades should be executed: 62 | buyer | price | size | seller | 63 | party3 | 110 | 10 | party4 | 64 65 # Place PEGGED orders to cover our commitment 66 And the parties place the following orders: 67 | party | market id | side | volume | price | resulting trades | type | tif | reference | pegged reference | pegged offset | 68 | party1 | ETH/DEC21 | buy | 10 | 0 | 0 | TYPE_LIMIT | TIF_GTC | party1-order1 | MID | 10 | 69 | party1 | ETH/DEC21 | sell | 10 | 0 | 0 | TYPE_LIMIT | TIF_GTC | party1-order2 | MID | 10 | 70 71 Then the order book should have the following volumes for market "ETH/DEC21": 72 | side | price | volume | 73 | buy | 140 | 10 | 74 | sell | 150 | 10 | 75 76 77 78