code.vegaprotocol.io/vega@v0.79.0/core/integration/features/auctions/0043-MKTL-010.feature (about)

     1  Feature: Ensure the markets expire if they cannot leave opening auction within the configured period
     2  
     3  
     4    Background:
     5  
     6      Given the following assets are registered:
     7        | id  | decimal places |
     8        | ETH | 5              |
     9      And the simple risk model named "my-simple-risk-model":
    10        | long                   | short                  | max move up | min move down | probability of trading |
    11        | 0.08628781058136630000 | 0.09370922348428490000 | -1          | -1            | 0.2                    |
    12      And the fees configuration named "my-fees-config":
    13        | maker fee | infrastructure fee |
    14        | 0.004     | 0.001              |
    15      And the following network parameters are set:
    16        | name                                         | value |
    17        | limits.markets.maxPeggedOrders               | 2     |
    18        | market.auction.minimumDuration               | 5     |
    19        | market.auction.maximumDuration               | 100s  |
    20      And the markets:
    21        | id        | quote name | asset | risk model           | margin calculator         | auction duration | fees           | price monitoring | data source config     | decimal places | linear slippage factor | quadratic slippage factor | sla params      | is passed |
    22        | ETH/DEC20 | ETH        | ETH   | my-simple-risk-model | default-margin-calculator | 5                | my-fees-config | default-none     | default-eth-for-future | 2              | 0.25                   | 0                         | default-futures | true      |
    23  
    24    @Expires
    25    Scenario: Covers 0043-MKTL-010
    26      # setup accounts
    27      Given the parties deposit on asset's general account the following amount:
    28        | party  | asset | amount        |
    29        | party1 | ETH   | 1000000000000 |
    30        | party2 | ETH   | 1000000000000 |
    31        | party3 | ETH   | 1000000000000 |
    32        | lpprov | ETH   | 1000000000000 |
    33      And the initial insurance pool balance is "10000" for all the markets
    34  
    35      # place only buy orders, we will never leave opening auction
    36      When the parties submit the following liquidity provision:
    37        | id  | party  | market id | commitment amount | fee | lp type    |
    38        | lp1 | lpprov | ETH/DEC20 | 937000000         | 0.1 | submission |
    39        | lp1 | lpprov | ETH/DEC20 | 937000000         | 0.1 | submission |
    40      And the parties place the following pegged iceberg orders:
    41        | party  | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
    42        | lpprov | ETH/DEC20 | 2         | 1                    | buy  | MID              | 50     | 100    |
    43      And the parties place the following orders:
    44        | party  | market id | side | volume | price   | resulting trades | type       | tif     | reference |
    45        | party2 | ETH/DEC20 | buy  | 1      | 950000  | 0                | TYPE_LIMIT | TIF_GTC | t2-b-1    |
    46        | party1 | ETH/DEC20 | buy  | 1      | 1000000 | 0                | TYPE_LIMIT | TIF_GFA | t1-b-1    |
    47        | party3 | ETH/DEC20 | buy  | 1      | 1000000 | 0                | TYPE_LIMIT | TIF_GFA | t3-b-1    |
    48      Then the market data for the market "ETH/DEC20" should be:
    49        | trading mode                 | supplied stake |
    50        | TRADING_MODE_OPENING_AUCTION | 937000000      |
    51      And the insurance pool balance should be "10000" for the market "ETH/DEC20"
    52      And the parties should have the following account balances:
    53        | party  | asset | market id | margin    | general      | bond      |
    54        | party1 | ETH   | ETH/DEC20 | 103545373 | 999896454627 |           |
    55        | party2 | ETH   | ETH/DEC20 | 98368105  | 999901631895 |           |
    56        | party3 | ETH   | ETH/DEC20 | 103545373 | 999896454627 |           |
    57        | lpprov | ETH   | ETH/DEC20 | 0         | 999063000000 | 937000000 |
    58  
    59      # And then some more time, way past the min auction duration, but before the max duration
    60      When the network moves ahead "50" blocks
    61      # Ensure we're still in opening auction
    62      Then the trading mode should be "TRADING_MODE_OPENING_AUCTION" for the market "ETH/DEC20"
    63      And the insurance pool balance should be "10000" for the market "ETH/DEC20"
    64      And the market state should be "STATE_PENDING" for the market "ETH/DEC20"
    65  
    66      # Now move ahead past to when the market is expected to expire
    67      When the network moves ahead "51" blocks
    68      # The market should be cancelled
    69      Then the last market state should be "STATE_CANCELLED" for the market "ETH/DEC20"
    70      # The market was cancelled, the insurance pool is released instantly
    71      And the insurance pool balance should be "0" for the market "ETH/DEC20"
    72      # The insurance pool balance is accounted for, though
    73      And the global insurance pool balance should be "10000" for the asset "ETH"
    74      # Account balances have been resotred, though
    75      And the parties should have the following account balances:
    76        | party  | asset | market id | margin | general       | bond |
    77        | party1 | ETH   | ETH/DEC20 | 0      | 1000000000000 |      |
    78        | party2 | ETH   | ETH/DEC20 | 0      | 1000000000000 |      |
    79        | party3 | ETH   | ETH/DEC20 | 0      | 1000000000000 |      |
    80        | lpprov | ETH   | ETH/DEC20 | 0      | 1000000000000 | 0    |