code.vegaprotocol.io/vega@v0.79.0/core/integration/features/pap/0097-PAPU-021.feature (about)

     1  Feature: Given the program currently has no funds earmarked for an auction, if a program's expiry timestamp is reached, the program will be cancelled and no further auctions will take place. (0097-PAPU-021).
     2  
     3      Background:
     4          Given time is updated to "2024-09-24T00:00:00Z"
     5          And the average block duration is "1"
     6          Given the log normal risk model named "log-normal-risk-model":
     7              | risk aversion | tau | mu | r | sigma |
     8              | 0.000001      | 0.1 | 0  | 0 | 1.0   |
     9          And the following network parameters are set:
    10              | name                                    | value |
    11              | market.value.windowLength               | 60s   |
    12              | network.markPriceUpdateMaximumFrequency | 0s    |
    13              | limits.markets.maxPeggedOrders          | 6     |
    14              | market.auction.minimumDuration          | 1     |
    15              | market.fee.factors.infrastructureFee    | 0.001 |
    16              | market.fee.factors.makerFee             | 0.004 |
    17              | spam.protection.max.stopOrdersPerMarket | 5     |
    18              | validators.epoch.length                 | 60m   |
    19          And the liquidity monitoring parameters:
    20              | name       | triggering ratio | time window | scaling factor |
    21              | lqm-params | 1.0              | 20s         | 1              |
    22          And the fees configuration named "fees-config-1":
    23              | maker fee | infrastructure fee |
    24              | 0.0004    | 0.001              |
    25          And the price monitoring named "price-monitoring":
    26              | horizon | probability | auction extension |
    27              | 3600    | 0.99        | 30                |
    28          And the liquidity sla params named "SLA-22":
    29              | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor |
    30              | 0.5         | 0.6                          | 1                             | 1.0                    |
    31          And the following network parameters are set:
    32              | name                           | value |
    33              | limits.markets.maxPeggedOrders | 2     |
    34          And the following assets are registered:
    35              | id  | decimal places |
    36              | ETH | 0              |
    37  
    38          And the spot markets:
    39              | id      | name    | base asset | quote asset | liquidity monitoring | risk model            | auction duration | fees          | price monitoring | sla params |
    40              | BTC/ETH | BTC/ETH | BTC        | ETH         | lqm-params           | log-normal-risk-model | 2                | fees-config-1 | price-monitoring | SLA-22     |
    41  
    42          Given the parties deposit on asset's general account the following amount:
    43              | party  | asset | amount     |
    44              | party1 | ETH   | 1000000000 |
    45              | party2 | ETH   | 1000000000 |
    46              | party3 | ETH   | 1000000000 |
    47              | party1 | BTC   | 1000000000 |
    48              | party3 | BTC   | 1000000000 |
    49              | lpprov | ETH   | 1000000000 |
    50              | lpprov | BTC   | 1000000000 |
    51  
    52          When the parties submit the following liquidity provision:
    53              | id  | party  | market id | commitment amount | fee | lp type    |
    54              | lp1 | lpprov | BTC/ETH   | 937000            | 0.1 | submission |
    55              | lp1 | lpprov | BTC/ETH   | 937000            | 0.1 | submission |
    56          And the parties place the following pegged iceberg orders:
    57              | party  | market id | peak size | minimum visible size | side | pegged reference | volume | offset |
    58              | lpprov | BTC/ETH   | 2         | 1                    | buy  | MID              | 50     | 100    |
    59              | lpprov | BTC/ETH   | 2         | 1                    | sell | MID              | 50     | 100    |
    60  
    61          # place orders and generate trades - slippage 100
    62          And the parties place the following orders:
    63              | party  | market id | side | volume | price   | resulting trades | type       | tif     | reference |
    64              | party2 | BTC/ETH   | buy  | 1      | 950000  | 0                | TYPE_LIMIT | TIF_GTC | t2-b-1    |
    65              | party1 | BTC/ETH   | buy  | 1      | 1000000 | 0                | TYPE_LIMIT | TIF_GFA | t1-b-1    |
    66              | party3 | BTC/ETH   | sell | 1      | 1000000 | 0                | TYPE_LIMIT | TIF_GTC | t2-s-1    |
    67  
    68          When the opening auction period ends for market "BTC/ETH"
    69  
    70          And the following trades should be executed:
    71              | buyer  | price   | size | seller |
    72              | party1 | 1000000 | 1    | party3 |
    73          And the mark price should be "1000000" for the market "BTC/ETH"
    74  
    75          And the composite price oracles from "0xCAFECAFE2":
    76              | name         | price property   | price type   | price decimals |
    77              | price_oracle | prices.ETH.value | TYPE_INTEGER | 0              |
    78  
    79          And the time triggers oracle spec is:
    80              | name                      | initial   | every |
    81              | auction_schedule          | 172713601 | 30    |
    82              | auction_vol_snap_schedule | 172713600 | 30    |
    83  
    84          And the parties deposit on asset's general account the following amount:
    85              | party                                                            | asset | amount |
    86              | f0b40ebdc5b92cf2cf82ff5d0c3f94085d23d5ec2d37d0b929e177c6d4d37e4c | BTC   | 50000  |
    87         
    88  
    89      Scenario: pap is not funded and expires nothing gets earmarked (0097-PAPU-021)
    90          When the protocol automated purchase is defined as:
    91              | id    | from | from account type          | to account type               | market id | price oracle | price oracle staleness tolerance | oracle offset factor | auction schedule oracle | auction volume snapshot schedule oracle | auction duration | minimum auction size | maximum auction size | expiry timestamp |
    92              | 12345 | BTC  | ACCOUNT_TYPE_BUY_BACK_FEES | ACCOUNT_TYPE_NETWORK_TREASURY | BTC/ETH   | price_oracle | 10s                              | 1.01                 | auction_schedule        | auction_vol_snap_schedule               | 60s              | 100                  | 200                  | 1727136030       |
    93  
    94          And the active pap id should be "12345" for the market "BTC/ETH"
    95  
    96          Then the oracles broadcast data with block time signed with "0xCAFECAFE2":
    97              | name             | value   | time offset |
    98              | prices.ETH.value | 1000000 | -1s         |
    99  
   100          And the network moves ahead "120" blocks
   101          And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "BTC/ETH"
   102          And the active pap id should be "none" for the market "BTC/ETH"
   103          And the active pap order id should be "none" for the market "BTC/ETH"
   104  
   105  
   106