code.vegaprotocol.io/vega@v0.79.0/core/integration/features/orders/market-depth-4.feature (about)

     1  Feature: Test market depth events for pegged orders (cancelling 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 @OrdCan
    14    Scenario: Check order events with larger pegged orders, and lower balance; check cancelling all orders for a party per market 0033-OCAN-010
    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   | 50000     |
    21        | pegged2          | BTC   | 50000     |
    22        | pegged3          | BTC   | 50000     |
    23        | pegged4          | BTC   | 50000     |
    24        | aux              | BTC   | 100000000 |
    25        | aux2             | BTC   | 100000000 |
    26      # setup pegged orders
    27      When the parties place the following pegged orders:
    28        | party   | market id | side | volume | pegged reference | offset |
    29        | pegged1 | ETH/DEC19 | sell | 500    | ASK              | 10     |
    30        | pegged2 | ETH/DEC19 | sell | 500    | MID              | 15     |
    31        | pegged3 | ETH/DEC19 | buy  | 500    | BID              | 10     |
    32        | pegged4 | ETH/DEC19 | buy  | 500    | MID              | 10     |
    33      Then the pegged orders should have the following states:
    34        | party   | market id | side | volume | reference | offset | price | status        |
    35        | pegged1 | ETH/DEC19 | sell | 500    | ASK       | 10     | 0     | STATUS_PARKED |
    36        | pegged2 | ETH/DEC19 | sell | 500    | MID       | 15     | 0     | STATUS_PARKED |
    37        | pegged3 | ETH/DEC19 | buy  | 500    | BID       | 10     | 0     | STATUS_PARKED |
    38        | pegged4 | ETH/DEC19 | buy  | 500    | MID       | 10     | 0     | STATUS_PARKED |
    39      # setup orderbook
    40      When the parties place the following orders:
    41        | party            | market id | side | volume | price | resulting trades | type       | tif     | reference       |
    42        | sellSideProvider | ETH/DEC19 | sell | 1000   | 120   | 0                | TYPE_LIMIT | TIF_GTC | sell-provider-1 |
    43        | buySideProvider  | ETH/DEC19 | buy  | 1000   | 80    | 0                | TYPE_LIMIT | TIF_GTC | buy-provider-1  |
    44        | aux              | ETH/DEC19 | sell | 1      | 100   | 0                | TYPE_LIMIT | TIF_GTC | aux-s-1         |
    45        | aux2             | ETH/DEC19 | buy  | 1      | 100   | 0                | TYPE_LIMIT | TIF_GTC | aux-b-1         |
    46      Then the orders should have the following states:
    47        | party            | market id | side | volume | remaining | price | status        |
    48        | sellSideProvider | ETH/DEC19 | sell | 1000   | 1000      | 120   | STATUS_ACTIVE |
    49        | buySideProvider  | ETH/DEC19 | buy  | 1000   | 1000      | 80    | STATUS_ACTIVE |
    50      Then the opening auction period ends for market "ETH/DEC19"
    51      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19"
    52      # Now check what happened to our pegged orders
    53      Then the pegged orders should have the following states:
    54        | party   | market id | side | volume | reference | offset | price | status        |
    55        | pegged1 | ETH/DEC19 | sell | 500    | ASK       | 10     | 130   | STATUS_ACTIVE |
    56        | pegged2 | ETH/DEC19 | sell | 500    | MID       | 15     | 115   | STATUS_ACTIVE |
    57        | pegged3 | ETH/DEC19 | buy  | 500    | BID       | 10     | 70    | STATUS_ACTIVE |
    58        | pegged4 | ETH/DEC19 | buy  | 500    | MID       | 10     | 90    | STATUS_ACTIVE |
    59      ##  Cancel some pegged events, and clear order event buffer so we can ignore the events we checked above
    60      When the parties cancel all their orders for the markets:
    61        | party   | market id |
    62        | pegged1 | ETH/DEC19 |
    63        | pegged3 | ETH/DEC19 |
    64        | pegged2 | ETH/DEC19 |
    65      # Cancelling all orders on a market for a party by the "cancel all party orders per market message" leaves orders on other markets unaffected, 0033-OCAN-010
    66  
    67      Then the pegged orders should have the following states:
    68        | party   | market id | side | volume | reference | offset | price | status           |
    69        | pegged3 | ETH/DEC19 | buy  | 500    | BID       | 10     | 70    | STATUS_CANCELLED |
    70        | pegged1 | ETH/DEC19 | sell | 500    | ASK       | 10     | 130   | STATUS_CANCELLED |
    71        | pegged2 | ETH/DEC19 | sell | 500    | MID       | 15     | 115   | STATUS_CANCELLED |
    72  
    73      Then the order book should have the following volumes for market "ETH/DEC19":
    74        | side | price | volume |
    75        | buy  | 80    | 1000   |
    76        | sell | 120   | 1000   |