code.vegaprotocol.io/vega@v0.79.0/core/integration/features/verified/0070-MKTD-market-decimal-places.feature (about)

     1  Feature: Allow markets to be specified with a smaller number of decimal places than the underlying settlement asset
     2  
     3      Background:
     4          Given the following network parameters are set:
     5              | name                                          | value |
     6              | market.liquidity.bondPenaltyParameter       | 0.2   |
     7              | limits.markets.maxPeggedOrders                | 1500  |
     8              | network.markPriceUpdateMaximumFrequency       | 0s    |
     9              | limits.markets.maxPeggedOrders                | 12    |
    10          Given the liquidity monitoring parameters:
    11              | name               | triggering ratio | time window | scaling factor |
    12              | lqm-params         | 0.1              | 24h         | 1.0            |
    13  
    14          And the following assets are registered:
    15              | id  | decimal places |
    16              | ETH | 5              |
    17              | USD | 2              |
    18          And the average block duration is "1"
    19          And the log normal risk model named "log-normal-risk-model-1":
    20              | risk aversion | tau | mu | r | sigma |
    21              | 0.000001      | 0.1 | 0  | 0 | 1.0   |
    22          And the fees configuration named "fees-config-1":
    23              | maker fee | infrastructure fee |
    24              | 0.004     | 0.001              |
    25          And the price monitoring named "price-monitoring-1":
    26              | horizon | probability | auction extension |
    27              | 1       | 0.99        | 300               |
    28          And the markets:
    29              | 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      |
    30              | ETH/MAR22 | ETH        | USD   | lqm-params           | log-normal-risk-model-1 | default-margin-calculator | 1                | fees-config-1 | price-monitoring-1 | default-eth-for-future | 0              | 0                       | 1                      | 0                         | default-futures |
    31              | USD/DEC19 | USD        | ETH   | lqm-params           | log-normal-risk-model-1 | default-margin-calculator | 1                | default-none  | price-monitoring-1 | default-usd-for-future | 3              | 3                       | 1                      | 0                         | default-futures |
    32              | USD/DEC20 | USD        | ETH   | lqm-params           | log-normal-risk-model-1 | default-margin-calculator | 1                | default-none  | price-monitoring-1 | default-usd-for-future | 5              | 5                       | 1                      | 0                         | default-futures |
    33              | USD/DEC21 | USD        | ETH   | lqm-params           | log-normal-risk-model-1 | default-margin-calculator | 1                | default-none  | price-monitoring-1 | default-usd-for-future | 5              | 3                       | 1                      | 0                         | default-futures |
    34          And the parties deposit on asset's general account the following amount:
    35              | party  | asset | amount    |
    36              | party0 | USD   | 5000000   |
    37              | party0 | ETH   | 5000000   |
    38              | party1 | USD   | 100000000 |
    39              | party1 | ETH   | 100000000 |
    40              | party2 | USD   | 100000000 |
    41              | party2 | ETH   | 100000000 |
    42              | party3 | USD   | 100000000 |
    43              | lpprov | ETH   | 100000000 |
    44              | lpprov | USD   | 100000000 |
    45  
    46      @SLABug
    47      Scenario: 001: Markets with different precisions trade at the same price
    48  
    49          Given  the parties submit the following liquidity provision:
    50              | id  | party  | market id | commitment amount | fee   | lp type    |
    51              | lp0 | party0 | USD/DEC20 | 1000              | 0.001 | submission |
    52              | lp0 | party0 | USD/DEC20 | 1000              | 0.001 | submission |
    53              | lp1 | party0 | USD/DEC21 | 1000              | 0.001 | submission |
    54              | lp1 | party0 | USD/DEC21 | 1000              | 0.001 | submission |
    55              | lp2 | party0 | USD/DEC19 | 1000              | 0.001 | submission |
    56              | lp2 | party0 | USD/DEC19 | 1000              | 0.001 | submission |
    57              | lp3 | lpprov | USD/DEC20 | 4000              | 0.001 | submission |
    58              | lp3 | lpprov | USD/DEC20 | 4000              | 0.001 | submission |
    59              | lp4 | lpprov | USD/DEC21 | 4000              | 0.001 | submission |
    60              | lp4 | lpprov | USD/DEC21 | 4000              | 0.001 | submission |
    61              | lp5 | lpprov | USD/DEC19 | 4000              | 0.001 | submission |
    62              | lp5 | lpprov | USD/DEC19 | 4000              | 0.001 | submission |
    63          And the parties place the following pegged iceberg orders:
    64              | party  | market id | peak size | minimum visible size | side | pegged reference | volume     | offset |
    65              | party0 | USD/DEC20 | 20 | 1 | sell | ASK | 100 | 20 |
    66              | party0 | USD/DEC20 | 20 | 1 | buy  | BID | 100 | 20 |
    67              | party0 | USD/DEC21 | 20 | 1 | sell | ASK | 100 | 20 |
    68              | party0 | USD/DEC21 | 20 | 1 | buy  | BID | 100 | 20 |
    69              | party0 | USD/DEC19 | 20 | 1 | sell | ASK | 100 | 20 |
    70              | party0 | USD/DEC19 | 20 | 1 | buy  | BID | 100 | 20 |
    71              | lpprov | USD/DEC20 | 20 | 1 | sell | ASK | 100 | 20 |
    72              | lpprov | USD/DEC20 | 20 | 1 | buy  | BID | 100 | 20 |
    73              | lpprov | USD/DEC21 | 20 | 1 | sell | ASK | 100 | 20 |
    74              | lpprov | USD/DEC21 | 20 | 1 | buy  | BID | 100 | 20 |
    75              | lpprov | USD/DEC19 | 20 | 1 | sell | ASK | 100 | 20 |
    76              | lpprov | USD/DEC19 | 20 | 1 | buy  | BID | 100 | 20 |
    77  
    78          And the parties place the following orders:
    79              | party  | market id | side | volume | price  | resulting trades | type       | tif     | reference   |
    80              | party1 | USD/DEC21 | buy  | 10     | 100000 | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2   |
    81              | party2 | USD/DEC21 | sell | 10     | 100000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3  |
    82              | party1 | USD/DEC20 | buy  | 1000   | 100000 | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2   |
    83              | party2 | USD/DEC20 | sell | 1000   | 100000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3  |
    84              | party1 | USD/DEC19 | buy  | 10     | 1000   | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2a  |
    85              | party2 | USD/DEC19 | sell | 10     | 1000   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3a |
    86              | party0 | USD/DEC21 | buy  | 1      | 90000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1   |
    87              | party0 | USD/DEC21 | sell | 1      | 110000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2  |
    88              | party0 | USD/DEC20 | buy  | 1      | 90000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1   |
    89              | party0 | USD/DEC20 | sell | 1      | 110000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2  |
    90              | party0 | USD/DEC19 | buy  | 1      | 900    | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1a  |
    91              | party0 | USD/DEC19 | sell | 1      | 1100   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2a |
    92  
    93          Then the market data for the market "USD/DEC19" should be:
    94              | target stake | supplied stake |
    95              | 3556         | 5000           |
    96          Then the market data for the market "USD/DEC20" should be:
    97              | target stake | supplied stake |
    98              | 3556         | 5000           |
    99          Then the market data for the market "USD/DEC21" should be:
   100              | target stake | supplied stake |
   101              | 3556         | 5000           |
   102  
   103          When the network moves ahead "2" blocks
   104          Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "USD/DEC21"
   105          And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "USD/DEC20"
   106          And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "USD/DEC19"
   107  
   108      @Liquidation
   109      Scenario: 002: Users engage in a USD market auction, (0070-MKTD-003, 0070-MKTD-008)
   110          Given the parties submit the following liquidity provision:
   111              | id  | party  | market id | commitment amount | fee   | lp type    |
   112              | lp1 | party0 | ETH/MAR22 | 35569             | 0.001 | submission |
   113              | lp1 | party0 | ETH/MAR22 | 35569             | 0.001 | amendment  |
   114          And the parties place the following pegged iceberg orders:
   115              | party  | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
   116              | party0 | ETH/MAR22 | 2         | 1                    | sell | ASK              | 500    | 20     |
   117              | party0 | ETH/MAR22 | 2         | 1                    | buy  | BID              | 500    | 20     |
   118          And the parties place the following orders:
   119              | party  | market id | side | volume | price | resulting trades | type       | tif     | reference  |
   120              | party1 | ETH/MAR22 | buy  | 1      | 9     | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1  |
   121              | party1 | ETH/MAR22 | buy  | 1      | 9     | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1  |
   122              | party1 | ETH/MAR22 | buy  | 10     | 10    | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2  |
   123              | party2 | ETH/MAR22 | sell | 10     | 10    | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3 |
   124              | party2 | ETH/MAR22 | sell | 1      | 10    | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-1 |
   125              | party2 | ETH/MAR22 | sell | 1      | 11    | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2 |
   126  
   127          And the markets are updated:
   128              | id          | linear slippage factor | quadratic slippage factor |
   129              | ETH/MAR22   | 1                      | 1e3                       |
   130  
   131          When the opening auction period ends for market "ETH/MAR22"
   132          Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/MAR22"
   133  
   134          And the parties should have the following account balances:
   135              | party  | asset | market id | margin  | general  | bond  |
   136              | party0 | USD   | ETH/MAR22 | 0       | 4964431  | 35569 |
   137              | party1 | USD   | ETH/MAR22 | 0       | 0        |       |
   138              | party2 | USD   | ETH/MAR22 | 0       | 0        |       |
   139          # party1 is closed out
   140          And the following trades should be executed:
   141              | buyer   | price | size | seller |
   142              | party1  | 10    | 10   | party2 |
   143              | network | 10    | 10   | party1 |
   144  
   145      Scenario: 003: Users engage in an ETH market auction, (0070-MKTD-003, 0070-MKTD-008)
   146          Given the parties submit the following liquidity provision:
   147              | id  | party  | market id | commitment amount | fee   | lp type    |
   148              | lp1 | party0 | USD/DEC19 | 50000             | 0.001 | submission |
   149              | lp1 | party0 | USD/DEC19 | 50000             | 0.001 | amendment  |
   150          And the parties place the following pegged iceberg orders:
   151              | party  | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
   152              | party0 | USD/DEC19 | 2         | 1                    | sell | ASK              | 500    | 20     |
   153              | party0 | USD/DEC19 | 2         | 1                    | buy  | BID              | 500    | 20     |
   154          And the parties place the following orders:
   155              | party  | market id | side | volume | price | resulting trades | type       | tif     | reference  |
   156              | party1 | USD/DEC19 | buy  | 1      | 900   | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1  |
   157              | party1 | USD/DEC19 | buy  | 1      | 900   | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1  |
   158              | party1 | USD/DEC19 | buy  | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2  |
   159              | party2 | USD/DEC19 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3 |
   160              | party2 | USD/DEC19 | sell | 1      | 1010  | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-1 |
   161              | party2 | USD/DEC19 | sell | 1      | 1100  | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2 |
   162  
   163          When the opening auction period ends for market "USD/DEC19"
   164          Then the auction ends with a traded volume of "10" at a price of "1000"
   165          And the parties should have the following account balances:
   166              | party  | asset | market id | margin | general  | bond  |
   167              | party0 | ETH   | USD/DEC19 | 213415 | 4736585  | 50000 |
   168              | party1 | ETH   | USD/DEC19 | 2353   | 99997647 |       |
   169              | party2 | ETH   | USD/DEC19 | 6322   | 99993678 |       |
   170          And the following trades should be executed:
   171              | buyer  | price | size | seller |
   172              | party1 | 1000  | 10   | party2 |
   173  
   174      Scenario: 004: Users engage in an ETH market auction with full decimal places, (0070-MKTD-003, 0070-MKTD-008)
   175  
   176          Given  the parties submit the following liquidity provision:
   177              | id  | party  | market id | commitment amount | fee   | lp type    |
   178              | lp1 | party0 | USD/DEC20 | 500               | 0.001 | submission |
   179              | lp1 | party0 | USD/DEC20 | 500               | 0.001 | amendment  |
   180          And the parties place the following pegged iceberg orders:
   181              | party  | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
   182              | party0 | USD/DEC20 | 2         | 1                    | sell | ASK              | 500    | 20     |
   183              | party0 | USD/DEC20 | 2         | 1                    | buy  | BID              | 500    | 20     |
   184          And the parties place the following orders:
   185              | party  | market id | side | volume | price  | resulting trades | type       | tif     | reference  |
   186              | party1 | USD/DEC20 | buy  | 1      | 90000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1  |
   187              | party1 | USD/DEC20 | buy  | 1      | 90000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1  |
   188              | party1 | USD/DEC20 | buy  | 10     | 100000 | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2  |
   189              | party2 | USD/DEC20 | sell | 10     | 100000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3 |
   190              | party2 | USD/DEC20 | sell | 1      | 101000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-1 |
   191              | party2 | USD/DEC20 | sell | 1      | 110000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2 |
   192  
   193          When the opening auction period ends for market "USD/DEC20"
   194          Then the auction ends with a traded volume of "10" at a price of "100000"
   195          And the parties should have the following account balances:
   196              | party  | asset | market id | margin | general  | bond |
   197              | party0 | ETH | USD/DEC20 | 2134 | 4997366  | 500 |
   198              | party1 | ETH | USD/DEC20 | 24   | 99999976 |     |
   199              | party2 | ETH | USD/DEC20 | 63   | 99999937 |     |
   200          And the following trades should be executed:
   201              | buyer  | price  | size | seller |
   202              | party1 | 100000 | 10   | party2 |
   203  
   204      @SLABug
   205      Scenario: 005: User tops up markets with differing precisions with the same asset + amount, should result in identical margin changes, (0070-MKTD-004)
   206  
   207          Given  the parties submit the following liquidity provision:
   208              | id  | party  | market id | commitment amount | fee   | lp type    |
   209              | lp1 | party0 | USD/DEC20 | 100000            | 0.001 | submission |
   210              | lp1 | party0 | USD/DEC20 | 100000            | 0.001 | amendment  |
   211              | lp2 | party0 | USD/DEC19 | 5000              | 0.001 | submission |
   212              | lp2 | party0 | USD/DEC19 | 5000              | 0.001 | amendment  |
   213          And the parties place the following pegged iceberg orders:
   214              | party  | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
   215              | party0 | USD/DEC20 | 2         | 1                    | sell | ASK              | 100    | 20     |
   216              | party0 | USD/DEC20 | 2         | 1                    | buy  | BID              | 100    | 20     |
   217              | party0 | USD/DEC19 | 2         | 1                    | sell | ASK              | 100    | 20     |
   218              | party0 | USD/DEC19 | 2         | 1                    | buy  | BID              | 100    | 20     |
   219  
   220          And the parties place the following orders:
   221              | party  | market id | side | volume | price  | resulting trades | type       | tif     | reference   |
   222              | party1 | USD/DEC20 | buy  | 1      | 90000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1   |
   223              | party1 | USD/DEC20 | buy  | 1      | 90000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1   |
   224              | party1 | USD/DEC20 | buy  | 10     | 100000 | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2   |
   225              | party2 | USD/DEC20 | sell | 10     | 100000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3  |
   226              | party2 | USD/DEC20 | sell | 1      | 101000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-1  |
   227              | party2 | USD/DEC20 | sell | 1      | 110000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2  |
   228              | party1 | USD/DEC19 | buy  | 1      | 900    | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1a  |
   229              | party1 | USD/DEC19 | buy  | 1      | 900    | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1a  |
   230              | party1 | USD/DEC19 | buy  | 10     | 1000   | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2a  |
   231              | party2 | USD/DEC19 | sell | 10     | 1000   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3a |
   232              | party2 | USD/DEC19 | sell | 1      | 1010   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-1a |
   233              | party2 | USD/DEC19 | sell | 1      | 1100   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2a |
   234  
   235          Then the market data for the market "USD/DEC19" should be:
   236              | target stake | supplied stake |
   237              | 3556         | 5000           |
   238  
   239          When the network moves ahead "2" blocks
   240  
   241  # party1 has position +10 and mark price 100000
   242  
   243          Then the parties should have the following account balances:
   244              | party  | asset | market id | margin | general  | bond   |
   245              | party0 | ETH   | USD/DEC20 | 427    | 4851889  | 100000 |
   246              | party1 | ETH   | USD/DEC20 | 24     | 99997623 |        |
   247              | party2 | ETH   | USD/DEC20 | 63     | 99993615 |        |
   248              | party0 | ETH   | USD/DEC19 | 42684  | 4851889  | 5000   |
   249              | party1 | ETH   | USD/DEC19 | 2353   | 99997623 |        |
   250              | party2 | ETH   | USD/DEC19 | 6322   | 99993615 |        |
   251  
   252          When the parties deposit on asset's general account the following amount:
   253              | party  | asset | amount |
   254              | party0 | ETH   | 1000   |
   255              | party1 | ETH   | 1000   |
   256              | party2 | ETH   | 1000   |
   257          Then the parties should have the following account balances:
   258              | party  | asset | market id | margin | general  | bond   |
   259              | party0 | ETH   | USD/DEC20 | 427    | 4852889  | 100000 |
   260              | party1 | ETH   | USD/DEC20 | 24     | 99998623 |        |
   261              | party2 | ETH   | USD/DEC20 | 63     | 99994615 |        |
   262              | party0 | ETH   | USD/DEC19 | 42684  | 4852889  | 5000   |
   263              | party1 | ETH   | USD/DEC19 | 2353   | 99998623 |        |
   264              | party2 | ETH   | USD/DEC19 | 6322   | 99994615 |        |
   265  
   266      @SLABug
   267      Scenario: 006: User checks prices after opening auction, (0070-MKTD-005)
   268  
   269          Given  the parties submit the following liquidity provision:
   270              | id  | party  | market id | commitment amount | fee   | lp type    |
   271              | lp1 | party0 | USD/DEC20 | 100000            | 0.001 | submission |
   272              | lp1 | party0 | USD/DEC20 | 100000            | 0.001 | amendment  |
   273              | lp2 | party0 | USD/DEC19 | 5000              | 0.001 | submission |
   274              | lp2 | party0 | USD/DEC19 | 5000              | 0.001 | amendment  |
   275          And the parties place the following pegged iceberg orders:
   276              | party  | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
   277              | party0 | USD/DEC20 | 2         | 1                    | sell | ASK              | 100    | 20     |
   278              | party0 | USD/DEC20 | 2         | 1                    | buy  | BID              | 100    | 20     |
   279              | party0 | USD/DEC19 | 2         | 1                    | sell | ASK              | 100    | 20     |
   280              | party0 | USD/DEC19 | 2         | 1                    | buy  | BID              | 100    | 20     |
   281   
   282          And the parties place the following orders:
   283              | party  | market id | side | volume | price  | resulting trades | type       | tif     | reference   |
   284              | party1 | USD/DEC20 | buy  | 1      | 90000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1   |
   285              | party1 | USD/DEC20 | buy  | 1      | 90000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1   |
   286              | party1 | USD/DEC20 | buy  | 10     | 100000 | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2   |
   287              | party2 | USD/DEC20 | sell | 10     | 100000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3  |
   288              | party2 | USD/DEC20 | sell | 1      | 101000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-1  |
   289              | party2 | USD/DEC20 | sell | 1      | 110000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2  |
   290              | party1 | USD/DEC19 | buy  | 1      | 900    | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1a  |
   291              | party1 | USD/DEC19 | buy  | 1      | 900    | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1a  |
   292              | party1 | USD/DEC19 | buy  | 10     | 1000   | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2a  |
   293              | party2 | USD/DEC19 | sell | 10     | 1000   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3a |
   294              | party2 | USD/DEC19 | sell | 1      | 1010   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-1a |
   295              | party2 | USD/DEC19 | sell | 1      | 1100   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2a |
   296  
   297          When the network moves ahead "2" blocks
   298          Then the mark price should be "100000" for the market "USD/DEC20"
   299          And the mark price should be "1000" for the market "USD/DEC19"
   300  
   301      @SLABug
   302      Scenario: 007: Offsets are calculated in market units, (0070-MKTD-007)
   303  
   304          Given  the parties submit the following liquidity provision:
   305              | id  | party  | market id | commitment amount | fee   | lp type    |
   306              | lp1 | party0 | USD/DEC20 | 5000              | 0.001 | submission |
   307              | lp1 | party0 | USD/DEC20 | 5000              | 0.001 | amendment  |
   308              | lp2 | party0 | USD/DEC19 | 5000              | 0.001 | submission |
   309              | lp2 | party0 | USD/DEC19 | 5000              | 0.001 | amendment  |
   310          And the parties place the following pegged iceberg orders:
   311              | party  | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
   312              | party0 | USD/DEC20 | 2         | 1                    | sell | MID              | 100    | 20     |
   313              | party0 | USD/DEC20 | 2         | 1                    | buy  | MID              | 100    | 20     |
   314              | party0 | USD/DEC19 | 2         | 1                    | sell | MID              | 100    | 20     |
   315              | party0 | USD/DEC19 | 2         | 1                    | buy  | MID              | 100    | 20     |
   316  
   317          And the parties place the following orders:
   318              | party  | market id | side | volume | price  | resulting trades | type       | tif     | reference   |
   319              | party1 | USD/DEC20 | buy  | 1      | 90000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1   |
   320              | party1 | USD/DEC20 | buy  | 1      | 90000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1   |
   321              | party1 | USD/DEC20 | buy  | 10     | 100000 | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2   |
   322              | party2 | USD/DEC20 | sell | 10     | 100000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3  |
   323              | party2 | USD/DEC20 | sell | 1      | 101000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-1  |
   324              | party2 | USD/DEC20 | sell | 1      | 110000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2  |
   325              | party1 | USD/DEC19 | buy  | 1      | 900    | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1a  |
   326              | party1 | USD/DEC19 | buy  | 1      | 900    | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1a  |
   327              | party1 | USD/DEC19 | buy  | 10     | 1000   | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2a  |
   328              | party2 | USD/DEC19 | sell | 10     | 1000   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3a |
   329              | party2 | USD/DEC19 | sell | 1      | 1010   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-1a |
   330              | party2 | USD/DEC19 | sell | 1      | 1100   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2a |
   331  
   332          When the network moves ahead "2" blocks
   333          Then the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "USD/DEC19"
   334          When the parties place the following pegged orders:
   335              | party  | market id | side | volume | pegged reference | offset |
   336              | party1 | USD/DEC19 | sell | 5      | ASK              | 5      |
   337              | party1 | USD/DEC20 | sell | 5      | ASK              | 5      |
   338          Then the pegged orders should have the following states:
   339              | party  | market id | side | volume | reference | offset | price  | status        |
   340              | party1 | USD/DEC20 | sell | 5      | ASK       | 5      | 101005 | STATUS_ACTIVE |
   341              | party1 | USD/DEC19 | sell | 5      | ASK       | 5      | 1015   | STATUS_ACTIVE |
   342  
   343      Scenario: 008: Price monitoring bounds are calculated at asset precision but displayed rounded, (0070-MKTD-006)
   344  
   345          Given  the parties submit the following liquidity provision:
   346              | id  | party  | market id | commitment amount | fee   | lp type    |
   347              | lp1 | party0 | USD/DEC20 | 1000              | 0.001 | submission |
   348              | lp1 | party0 | USD/DEC20 | 1000              | 0.001 | amendment  |
   349              | lp1 | party0 | USD/DEC21 | 1000              | 0.001 | submission |
   350              | lp1 | party0 | USD/DEC21 | 1000              | 0.001 | amendment  |
   351              | lp2 | party0 | USD/DEC19 | 1000              | 0.001 | submission |
   352              | lp2 | party0 | USD/DEC19 | 1000              | 0.001 | amendment  |
   353          And the parties place the following pegged iceberg orders:
   354              | party  | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
   355              | party0 | USD/DEC20 | 2         | 1                    | sell | ASK              | 100    | 20     |
   356              | party0 | USD/DEC20 | 2         | 1                    | buy  | BID              | 100    | 20     |
   357              | party0 | USD/DEC21 | 2         | 1                    | sell | ASK              | 100    | 20     |
   358              | party0 | USD/DEC21 | 2         | 1                    | buy  | BID              | 100    | 20     |
   359              | party0 | USD/DEC19 | 2         | 1                    | sell | ASK              | 100    | 20     |
   360              | party0 | USD/DEC19 | 2         | 1                    | buy  | BID              | 100    | 20     |
   361   
   362          And the parties place the following orders:
   363              | party  | market id | side | volume | price  | resulting trades | type       | tif     | reference   |
   364              | party1 | USD/DEC21 | buy  | 10     | 100000 | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2   |
   365              | party2 | USD/DEC21 | sell | 10     | 100000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3  |
   366              | party1 | USD/DEC20 | buy  | 1000   | 100000 | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2   |
   367              | party2 | USD/DEC20 | sell | 1000   | 100000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3  |
   368              | party1 | USD/DEC19 | buy  | 10     | 1000   | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-2a  |
   369              | party2 | USD/DEC19 | sell | 10     | 1000   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-3a |
   370              | party0 | USD/DEC21 | buy  | 1      | 90000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1   |
   371              | party0 | USD/DEC21 | sell | 1      | 110000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2  |
   372              | party0 | USD/DEC20 | buy  | 1      | 90000  | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1   |
   373              | party0 | USD/DEC20 | sell | 1      | 110000 | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2  |
   374              | party0 | USD/DEC19 | buy  | 1      | 900    | 0                | TYPE_LIMIT | TIF_GTC | buy-ref-1a  |
   375              | party0 | USD/DEC19 | sell | 1      | 1100   | 0                | TYPE_LIMIT | TIF_GTC | sell-ref-2a |
   376  
   377          When the opening auction period ends for market "USD/DEC20"
   378  
   379          Then the price monitoring bounds for the market "USD/DEC19" should be:
   380              | min bound | max bound |
   381              | 1000      | 1000      |
   382          And the price monitoring bounds for the market "USD/DEC20" should be:
   383              | min bound | max bound |
   384              | 99955     | 100045    |
   385          And the price monitoring bounds for the market "USD/DEC21" should be:
   386              | min bound | max bound |
   387              | 99955     | 100045    |