code.vegaprotocol.io/vega@v0.79.0/core/integration/features/auctions/5460-market-order-cannot-trade-due-to-auction.feature (about)

     1  Feature: Test for issue 5460
     2  
     3    Background:
     4      Given the following network parameters are set:
     5        | name                               | value |
     6        | network.floatingPointUpdates.delay | 10s   |
     7        | market.auction.minimumDuration     | 1     |
     8        | limits.markets.maxPeggedOrders     | 2     |
     9      And the liquidity monitoring parameters:
    10        | name       | triggering ratio | time window | scaling factor |
    11        | lqm-params | 1.00             | 24h         | 1              |
    12  
    13      And the following assets are registered:
    14        | id  | decimal places |
    15        | ETH | 5              |
    16      And the average block duration is "1"
    17      And the log normal risk model named "log-normal-risk-model-1":
    18        | risk aversion | tau                    | mu | r | sigma |
    19        | 0.000001      | 0.00011407711613050422 | 0  | 0 | 1.0   |
    20      And the fees configuration named "fees-config-1":
    21        | maker fee | infrastructure fee |
    22        | 0.001     | 0.001              |
    23      And the price monitoring named "price-monitoring-1":
    24        | horizon | probability | auction extension |
    25        | 43200   | 0.9999999   | 60                |
    26      And the markets:
    27        | id        | quote name | asset | liquidity monitoring | risk model              | margin calculator         | auction duration | fees          | price monitoring   | data source config     | decimal places | position decimal places | linear slippage factor | quadratic slippage factor | sla params      |
    28        | ETH/DEC21 | ETH        | ETH   | lqm-params           | log-normal-risk-model-1 | default-margin-calculator | 10               | fees-config-1 | price-monitoring-1 | default-eth-for-future | 5              | 5                       | 0.25                   | 0                         | default-futures |
    29      And the parties deposit on asset's general account the following amount:
    30        | party    | asset | amount            |
    31        | party0   | ETH   | 100000000000000   |
    32        | party1   | ETH   | 10000000000000    |
    33        | party2   | ETH   | 10000000000000    |
    34        | party3   | ETH   | 10000000000000    |
    35        | party_a1 | ETH   | 10000000000000    |
    36        | party_a2 | ETH   | 10000000000000    |
    37        | party_r  | ETH   | 10000000000000000 |
    38        | party_r1 | ETH   | 10000000000000000 |
    39  
    40    @SLABug
    41    Scenario: 002 replicate bug
    42  
    43      When the parties submit the following liquidity provision:
    44        | id  | party  | market id | commitment amount | fee   | lp type    |
    45        | lp1 | party0 | ETH/DEC21 | 200000000         | 0.001 | submission |
    46        | lp1 | party0 | ETH/DEC21 | 200000000         | 0.001 | submission |
    47      And the parties place the following pegged iceberg orders:
    48        | party  | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
    49        | party0 | ETH/DEC21 | 1000      | 1                    | buy  | MID              | 200000 | 205    |
    50        | party0 | ETH/DEC21 | 1000      | 1                    | sell | MID              | 300000 | 205    |
    51      And the parties place the following orders:
    52        | party    | market id | side | volume | price | resulting trades | type       | tif     |
    53        | party_a1 | ETH/DEC21 | buy  | 100000 | 30000 | 0                | TYPE_LIMIT | TIF_GTC |
    54        | party_a2 | ETH/DEC21 | sell | 100000 | 30000 | 0                | TYPE_LIMIT | TIF_GTC |
    55        | party_r  | ETH/DEC21 | buy  | 100000 | 29998 | 0                | TYPE_LIMIT | TIF_GTC |
    56        | party_r  | ETH/DEC21 | sell | 100000 | 30002 | 0                | TYPE_LIMIT | TIF_GTC |
    57  
    58      Then the opening auction period ends for market "ETH/DEC21"
    59      And the auction ends with a traded volume of "100000" at a price of "30000"
    60  
    61      And the market data for the market "ETH/DEC21" should be:
    62        | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    63        | 30000      | TRADING_MODE_CONTINUOUS | 43200   | 24617     | 36510     | 1626         | 200000000      | 100000        |
    64  
    65      When the parties place the following orders:
    66        | party   | market id | side | volume | price | resulting trades | type       | tif     |
    67        | party_r | ETH/DEC21 | buy  | 100000 | 29987 | 0                | TYPE_LIMIT | TIF_GTC |
    68        | party_r | ETH/DEC21 | buy  | 100000 | 29977 | 0                | TYPE_LIMIT | TIF_GTC |
    69        | party_r | ETH/DEC21 | buy  | 100000 | 29967 | 0                | TYPE_LIMIT | TIF_GTC |
    70        | party_r | ETH/DEC21 | buy  | 100000 | 29957 | 0                | TYPE_LIMIT | TIF_GTC |
    71  
    72      Then the market state should be "STATE_ACTIVE" for the market "ETH/DEC21"
    73  
    74      And the market data for the market "ETH/DEC21" should be:
    75        | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest | static mid price |
    76        | 30000      | TRADING_MODE_CONTINUOUS | 43200   | 24617     | 36510     | 1626         | 200000000      | 100000        | 30000            |
    77  
    78      And the order book should have the following volumes for market "ETH/DEC21":
    79        | side | price | volume |
    80        | buy  | 29998 | 100000 |
    81        | buy  | 29987 | 100000 |
    82        | buy  | 29977 | 100000 |
    83        | buy  | 29967 | 100000 |
    84        | buy  | 29957 | 100000 |
    85        | buy  | 29795 | 1000   |
    86        | sell | 30002 | 100000 |
    87        | sell | 30205 | 1000   |
    88  
    89      And the parties place the following orders:
    90        | party    | market id | side | volume | price  | resulting trades | type        | tif     |
    91        | party_r1 | ETH/DEC21 | buy  | 300000 | 400000 | 2                | TYPE_MARKET | TIF_IOC |
    92  
    93      And the order book should have the following volumes for market "ETH/DEC21":
    94        | side | price | volume |
    95        | buy  | 29998 | 100000 |
    96        | buy  | 29987 | 100000 |
    97        | buy  | 29977 | 100000 |
    98        | buy  | 29967 | 100000 |
    99        | buy  | 29957 | 100000 |
   100        | sell | 30002 | 0      |
   101        | sell | 30204 | 0      |
   102      When the network moves ahead "1" blocks
   103  
   104      Then the market state should be "STATE_ACTIVE" for the market "ETH/DEC21"
   105  
   106      And the parties place the following orders:
   107        | party   | market id | side | volume | price | resulting trades | type       | tif     |
   108        | party_r | ETH/DEC21 | sell | 100000 | 30002 | 0                | TYPE_LIMIT | TIF_GTC |
   109  
   110      Then the network moves ahead "10" blocks
   111  
   112      Then the market state should be "STATE_ACTIVE" for the market "ETH/DEC21"
   113  
   114      And the order book should have the following volumes for market "ETH/DEC21":
   115        | side | price | volume |
   116        | buy  | 29998 | 100000 |
   117        | buy  | 29987 | 100000 |
   118        | buy  | 29977 | 100000 |
   119        | buy  | 29967 | 100000 |
   120        | buy  | 29957 | 100000 |
   121        | buy  | 29795 | 1000   |
   122        | sell | 30002 | 100000 |
   123        | sell | 30205 | 1000   |
   124  
   125      And the parties place the following orders:
   126        | party   | market id | side | volume | price | resulting trades | type       | tif     |
   127        | party_r | ETH/DEC21 | buy  | 100000 | 29700 | 0                | TYPE_LIMIT | TIF_GTC |
   128  
   129      And the order book should have the following volumes for market "ETH/DEC21":
   130        | side | price  | volume |
   131        | buy  | 29998  | 100000 |
   132        | buy  | 29987  | 100000 |
   133        | buy  | 29977  | 100000 |
   134        | buy  | 29967  | 100000 |
   135        | buy  | 29957  | 100000 |
   136        | buy  | 29795  | 1000   |
   137        | buy  | 400000 | 0      |
   138        | buy  | 29700  | 100000 |
   139        | sell | 30002  | 100000 |
   140        | sell | 30205  | 1000   |
   141  
   142      And the market data for the market "ETH/DEC21" should be:
   143        | trading mode            | auction trigger             | target stake | supplied stake | open interest |
   144        | TRADING_MODE_CONTINUOUS | AUCTION_TRIGGER_UNSPECIFIED | 6549         | 200000000      | 400000        |
   145  
   146      And the parties place the following orders:
   147        | party    | market id | side | volume | price | resulting trades | type        | tif     |
   148        | party_r1 | ETH/DEC21 | sell | 600000 | 29000 | 6                | TYPE_MARKET | TIF_IOC |
   149  
   150      And the market data for the market "ETH/DEC21" should be:
   151        | trading mode            | auction trigger             | target stake | supplied stake | open interest |
   152        | TRADING_MODE_CONTINUOUS | AUCTION_TRIGGER_UNSPECIFIED | 8187         | 200000000      | 500000        |