code.vegaprotocol.io/vega@v0.79.0/core/integration/features/orders/cancel_all_orders.feature (about) 1 Feature: Cancelling all orders emits a single event per party. 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 And the average block duration is "1" 15 16 And the liquidity monitoring parameters: 17 | name | triggering ratio | time window | scaling factor | 18 | lqm-params | 0.1 | 24h | 1 | 19 20 And the following assets are registered: 21 | id | decimal places | 22 | ETH | 0 | 23 24 And the average block duration is "1" 25 And the simple risk model named "simple-risk-model-1": 26 | long | short | max move up | min move down | probability of trading | 27 | 0.1 | 0.1 | 60 | 50 | 0.2 | 28 And the fees configuration named "fees-config-1": 29 | maker fee | infrastructure fee | 30 | 0.004 | 0.001 | 31 And the price monitoring named "price-monitoring-1": 32 | horizon | probability | auction extension | 33 | 1 | 0.99 | 5 | 34 And the liquidity sla params named "SLA": 35 | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor | 36 | 0.01 | 0.5 | 1 | 1.0 | 37 And the markets: 38 | 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 | 39 | 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 | 40 And the parties deposit on asset's general account the following amount: 41 | party | asset | amount | 42 | party1 | ETH | 100000000 | 43 | party2 | ETH | 100000000 | 44 | party3 | ETH | 100000000 | 45 | party4 | ETH | 100000000 | 46 And the parties submit the following liquidity provision: 47 | id | party | market id | commitment amount | fee | lp type | 48 | lp1 | party1 | ETH/DEC21 | 10000 | 0.001 | submission | 49 50 Scenario: Parties cancel all their orders. 51 Given the parties place the following orders: 52 | party | market id | side | volume | price | resulting trades | type | tif | reference | 53 | party2 | ETH/DEC21 | buy | 100 | 90 | 0 | TYPE_LIMIT | TIF_GTC | p2b1 | 54 | party3 | ETH/DEC21 | buy | 100 | 100 | 0 | TYPE_LIMIT | TIF_GTC | p3b1 | 55 | party3 | ETH/DEC21 | buy | 10 | 110 | 0 | TYPE_LIMIT | TIF_GTC | p3b2 | 56 | party4 | ETH/DEC21 | sell | 10 | 110 | 0 | TYPE_LIMIT | TIF_GTC | p4s2 | 57 | party4 | ETH/DEC21 | sell | 1000 | 190 | 0 | TYPE_LIMIT | TIF_GTC | p4s1 | 58 | party2 | ETH/DEC21 | sell | 1000 | 200 | 0 | TYPE_LIMIT | TIF_GTC | p2s1 | 59 60 When the network moves ahead "2" blocks 61 Then the following trades should be executed: 62 | buyer | price | size | seller | 63 | party3 | 110 | 10 | party4 | 64 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC21" 65 Then the orders should have the following states: 66 | party | market id | side | volume | remaining | price | status | 67 | party2 | ETH/DEC21 | buy | 100 | 100 | 90 | STATUS_ACTIVE | 68 | party3 | ETH/DEC21 | buy | 100 | 100 | 100 | STATUS_ACTIVE | 69 | party4 | ETH/DEC21 | sell | 1000 | 1000 | 190 | STATUS_ACTIVE | 70 | party2 | ETH/DEC21 | sell | 1000 | 1000 | 200 | STATUS_ACTIVE | 71 72 When the parties cancel all their orders for the markets: 73 | party | market id | 74 | party2 | ETH/DEC21 | 75 Then the following orders are cancelled on market "ETH/DEC21": 76 | reference | party | 77 | p2b1 | party2 | 78 | p2s1 | party2 | 79 And the orders should have the following states: 80 | party | market id | side | volume | remaining | price | status | 81 | party2 | ETH/DEC21 | buy | 100 | 100 | 90 | STATUS_CANCELLED | 82 | party3 | ETH/DEC21 | buy | 100 | 100 | 100 | STATUS_ACTIVE | 83 | party4 | ETH/DEC21 | sell | 1000 | 1000 | 190 | STATUS_ACTIVE | 84 | party2 | ETH/DEC21 | sell | 1000 | 1000 | 200 | STATUS_CANCELLED |