code.vegaprotocol.io/vega@v0.79.0/core/integration/features/auctions/cancel-gfn-auction.feature (about)

     1  Feature: When moving into auction, all GFN orders are cancelled
     2  
     3    Background:
     4      Given the price monitoring named "my-price-monitoring":
     5        | horizon | probability | auction extension |
     6        | 60      | 0.95        | 240               |
     7        | 600     | 0.99        | 360               |
     8      And the price monitoring named "my-price-monitoring-2":
     9        | horizon | probability | auction extension |
    10        | 60      | 0.95        | 240               |
    11        | 120     | 0.99        | 360               |
    12      And the log normal risk model named "my-log-normal-risk-model":
    13        | risk aversion | tau                    | mu | r     | sigma |
    14        | 0.000001      | 0.00011407711613050422 | 0  | 0.016 | 2.0   |
    15      And the markets:
    16        | id        | quote name | asset | risk model                    | margin calculator         | auction duration | fees         | price monitoring      | data source config     | linear slippage factor | quadratic slippage factor | sla params      |
    17        | ETH/DEC20 | ETH        | ETH   | default-log-normal-risk-model | default-margin-calculator | 60               | default-none | my-price-monitoring   | default-eth-for-future | 0.01                   | 0                         | default-futures |
    18      And the following network parameters are set:
    19        | name                           | value |
    20        | market.auction.minimumDuration | 60    |
    21        | limits.markets.maxPeggedOrders | 2     |
    22  
    23  
    24    @GFNCancel
    25    Scenario: replicates test_GFN_OrdersCancelledIntoAuction ST - covers 0068-MATC-027 and 0026-AUCT-015
    26      Given the parties deposit on asset's general account the following amount:
    27        | party  | asset | amount       |
    28        | party1 | ETH   | 100000000000 |
    29        | party2 | ETH   | 100000000000 |
    30        | party3 | ETH   | 100000000000 |
    31        | party4 | ETH   | 100000000000 |
    32        | aux    | ETH   | 100000000000 |
    33        | aux2   | ETH   | 100000000000 |
    34        | lpprov | ETH   | 100000000000 |
    35  
    36      When the parties submit the following liquidity provision:
    37        | id  | party  | market id | commitment amount | fee | lp type    |
    38        | lp1 | lpprov | ETH/DEC20 | 90000000          | 0.1 | submission |
    39        | lp1 | lpprov | ETH/DEC20 | 90000000          | 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  | BID              | 50         | 100    |
    43        | lpprov | ETH/DEC20 | 2         | 1                    | sell | ASK              | 50         | 100    |
    44  
    45      When the parties place the following orders:
    46        | party | market id | side | volume | price   | resulting trades | type       | tif     |
    47        | aux   | ETH/DEC20 | buy  | 1      | 1       | 0                | TYPE_LIMIT | TIF_GTC |
    48        | aux   | ETH/DEC20 | sell | 1      | 200000  | 0                | TYPE_LIMIT | TIF_GTC |
    49        | aux2  | ETH/DEC20 | buy  | 1      | 1000000 | 0                | TYPE_LIMIT | TIF_GTC |
    50        | aux   | ETH/DEC20 | sell | 1      | 1000000 | 0                | TYPE_LIMIT | TIF_GTC |
    51  
    52      Then the network moves ahead "59" blocks
    53      And the trading mode should be "TRADING_MODE_OPENING_AUCTION" for the market "ETH/DEC20"
    54  
    55      When the parties place the following orders:
    56        | party | market id | side | volume | price | resulting trades | type       | tif     |
    57        | aux2  | ETH/DEC20 | buy  | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    58        | aux   | ETH/DEC20 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    59  
    60      Then the opening auction period ends for market "ETH/DEC20"
    61  
    62      And the market data for the market "ETH/DEC20" should be:
    63        | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    64        | 1000       | TRADING_MODE_CONTINUOUS | 60      | 995       | 1005      | 7434         | 90000000       | 10            |
    65        | 1000       | TRADING_MODE_CONTINUOUS | 600     | 978       | 1022      | 7434         | 90000000       | 10            |
    66  
    67      # place GFN orders outside of bounds so we can trigger auction without those order uncrossing
    68      When the parties place the following orders:
    69        | party  | market id | side | volume | price | resulting trades | type       | tif     | reference  |
    70        | party1 | ETH/DEC20 | buy  | 1      | 990   | 0                | TYPE_LIMIT | TIF_GFN | gfn-buy-1  |
    71        | party2 | ETH/DEC20 | sell | 1      | 1010  | 0                | TYPE_LIMIT | TIF_GFN | gfn-sell-1 |
    72        | party4 | ETH/DEC20 | sell | 1      | 1010  | 0                | TYPE_LIMIT | TIF_GTC | gtc-sell-1 |
    73      Then the order book should have the following volumes for market "ETH/DEC20":
    74        | side | volume | price   |
    75        | buy  | 1      | 1       |
    76        | buy  | 2      | 900     |
    77        | buy  | 1      | 990     |
    78        | buy  | 1      | 1000    |
    79        | sell | 2      | 1010    |
    80        | sell | 2      | 1110    |
    81        | sell | 1      | 200000  |
    82        | sell | 1      | 1000000 |
    83      And the market data for the market "ETH/DEC20" should be:
    84        | mark price | trading mode            | horizon | min bound | max bound | target stake | supplied stake | open interest |
    85        | 1000       | TRADING_MODE_CONTINUOUS | 60      | 995       | 1005      | 7434         | 90000000       | 10            |
    86        | 1000       | TRADING_MODE_CONTINUOUS | 600     | 978       | 1022      | 7434         | 90000000       | 10            |
    87  
    88      When the parties place the following orders:
    89        | party  | market id | side | volume | price | resulting trades | type       | tif     |
    90        | party3 | ETH/DEC20 | buy  | 1      | 1010  | 0                | TYPE_LIMIT | TIF_GTC |
    91      Then the trading mode should be "TRADING_MODE_MONITORING_AUCTION" for the market "ETH/DEC20"
    92      ## The GFN orders will should be removed from the book (buy at 990, sell at 1010)
    93      ## the 2 GTC orders that triggered the price auction, however, remain
    94      And the order book should have the following volumes for market "ETH/DEC20":
    95        | side | volume | price   |
    96        | buy  | 1      | 1       |
    97        | buy  | 0      | 900     |
    98        | buy  | 0      | 990     |
    99        | buy  | 1      | 1000    |
   100        | buy  | 1      | 1010    |
   101        | sell | 1      | 1010    |
   102        | sell | 0      | 1110    |
   103        | sell | 1      | 200000  |
   104        | sell | 1      | 1000000 |
   105      And the orders should have the following status:
   106        | party  | reference  | status           |
   107        | party1 | gfn-buy-1  | STATUS_CANCELLED |
   108        | party2 | gfn-sell-1 | STATUS_CANCELLED |
   109        | party4 | gtc-sell-1 | STATUS_ACTIVE    |