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

     1  Feature: Test market depth events for pegged orders (with BID and ASK price)
     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 expect order events for pegged orders are produced for all references
    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        | pegged4          | BTC   | 5000000   |
    24        | aux              | BTC   | 100000000 |
    25        | aux2             | BTC   | 100000000 |
    26      # setup pegged orders
    27      Then the parties place the following pegged orders:
    28        | party   | market id | side | volume | pegged reference | offset |
    29        | pegged1 | ETH/DEC19 | sell | 5      | ASK              | 10     |
    30        | pegged2 | ETH/DEC19 | sell | 5      | MID              | 15     |
    31        | pegged3 | ETH/DEC19 | buy  | 5      | BID              | 10     |
    32        | pegged4 | ETH/DEC19 | buy  | 5      | 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 | 5      | ASK       | 10     | 0     | STATUS_PARKED |
    36        | pegged2 | ETH/DEC19 | sell | 5      | MID       | 15     | 0     | STATUS_PARKED |
    37        | pegged3 | ETH/DEC19 | buy  | 5      | BID       | 10     | 0     | STATUS_PARKED |
    38        | pegged4 | ETH/DEC19 | buy  | 5      | MID       | 10     | 0     | STATUS_PARKED |
    39      When the parties place the following orders:
    40        | party            | market id | side | volume | price | resulting trades | type       | tif     | reference       |
    41        | sellSideProvider | ETH/DEC19 | sell | 1000   | 120   | 0                | TYPE_LIMIT | TIF_GTC | sell-provider-1 |
    42        | buySideProvider  | ETH/DEC19 | buy  | 1000   | 80    | 0                | TYPE_LIMIT | TIF_GTC | buy-provider-1  |
    43        | aux              | ETH/DEC19 | sell | 1      | 100   | 0                | TYPE_LIMIT | TIF_GTC | aux-s-1         |
    44        | aux2             | ETH/DEC19 | buy  | 1      | 100   | 0                | TYPE_LIMIT | TIF_GTC | aux-b-1         |
    45      Then the orders should have the following states:
    46        | party            | market id | side | volume | remaining | price | status        |
    47        | sellSideProvider | ETH/DEC19 | sell | 1000   | 1000      | 120   | STATUS_ACTIVE |
    48        | buySideProvider  | ETH/DEC19 | buy  | 1000   | 1000      | 80    | STATUS_ACTIVE |
    49      Then the opening auction period ends for market "ETH/DEC19"
    50      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/DEC19"
    51      # Now check what happened to our pegged orders
    52      Then the pegged orders should have the following states:
    53        | party   | market id | side | volume | reference | offset | price | status        |
    54        | pegged1 | ETH/DEC19 | sell | 5      | ASK       | 10     | 130   | STATUS_ACTIVE |
    55        | pegged1 | ETH/DEC19 | sell | 5      | ASK       | 10     | 130   | STATUS_ACTIVE |
    56        | pegged1 | ETH/DEC19 | sell | 5      | ASK       | 10     | 130   | STATUS_ACTIVE |
    57        | pegged2 | ETH/DEC19 | sell | 5      | MID       | 15     | 115   | STATUS_ACTIVE |
    58        | pegged3 | ETH/DEC19 | buy  | 5      | BID       | 10     | 70    | STATUS_ACTIVE |
    59        | pegged4 | ETH/DEC19 | buy  | 5      | MID       | 10     | 90    | STATUS_ACTIVE |