code.vegaprotocol.io/vega@v0.79.0/core/integration/features/orders/market-depth-1.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: Ensure the expected order events for pegged orders are produced when mid price changes
    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   | 5000000   |
    21        | pegged2          | BTC   | 5000000   |
    22        | pegged3          | BTC   | 5000000   |
    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 | 10     | MID              | 10     |
    29        | pegged2 | ETH/DEC19 | buy  | 5      | MID              | 15     |
    30        | pegged3 | ETH/DEC19 | buy  | 5      | 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 | 10     | MID       | 10     | 0     | STATUS_PARKED |
    34        | pegged2 | ETH/DEC19 | buy  | 5      | MID       | 15     | 0     | STATUS_PARKED |
    35        | pegged3 | ETH/DEC19 | buy  | 5      | MID       | 10     | 0     | STATUS_PARKED |
    36      When the parties place the following orders:
    37        | party            | market id | side | volume | price | resulting trades | type       | tif     | reference       |
    38        | sellSideProvider | ETH/DEC19 | sell | 1000   | 120   | 0                | TYPE_LIMIT | TIF_GTC | sell-provider-1 |
    39        | buySideProvider  | ETH/DEC19 | buy  | 1000   | 80    | 0                | TYPE_LIMIT | TIF_GTC | buy-provider-1  |
    40        | aux              | ETH/DEC19 | sell | 1      | 100   | 0                | TYPE_LIMIT | TIF_GTC | aux-s-1         |
    41        | aux2             | ETH/DEC19 | buy  | 1      | 100   | 0                | TYPE_LIMIT | TIF_GTC | aux-b-1         |
    42      Then the orders should have the following states:
    43        | party            | market id | side | volume | remaining | price | status        |
    44        | sellSideProvider | ETH/DEC19 | sell | 1000   | 1000      | 120   | STATUS_ACTIVE |
    45        | buySideProvider  | ETH/DEC19 | buy  | 1000   | 1000      | 80    | STATUS_ACTIVE |
    46      # Checked out, remove the order events we've checked, now let's have a look at the pegged order events
    47      Then the opening auction period ends for market "ETH/DEC19"
    48      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19"
    49      # Now check what happened to our pegged orders
    50      Then the pegged orders should have the following states:
    51        | party   | market id | side | volume | reference | offset | price | status        |
    52        | pegged1 | ETH/DEC19 | sell | 10     | MID       | 10     | 110   | STATUS_ACTIVE |
    53        | pegged2 | ETH/DEC19 | buy  | 5      | MID       | 15     | 85    | STATUS_ACTIVE |
    54        | pegged3 | ETH/DEC19 | buy  | 5      | MID       | 10     | 90    | STATUS_ACTIVE |