code.vegaprotocol.io/vega@v0.79.0/core/integration/docs/governance.md (about)

     1  ## Governance placeholders
     2  
     3  The integration test framework does not bootstrap the governance engine, but rather replaces it. It submits proposals directly to the execution engine as though it were a proposal that has gone through governance. This document will cover these quasi governance steps to:
     4  
     5  - [Update a market](#Updating-markets)
     6  - [De-/Re-activate markets](#Governance-auctions)
     7    - [Suspend a market](#Suspending-markets)
     8    - [Resume a market](#Resuming-markets)
     9  - [Terminate a market](#Terminating-markets)
    10  - [Set or change network parameters](#Network-parameters)
    11  - [Update assets](#Updating-assets)
    12  
    13  ### Updating markets
    14  
    15  Markets can be updated throughout, some of the paramters that can be changed (things like price monitoring) require setting up new price monitoring paramters (or using a default). How this can be done is outlined in the documentation detailing [setting up markets](markets.md).
    16  
    17  ```cucumber
    18  When the markets are updated:
    19    | id        | price monitoring | linear slippage factor | sla params | liquidity fee settings | risk model   | liquidation strategy  |
    20    | ETH/MAR22 | new-pm           | 1e-3                   | new-sla    | new-fee-conf           | new-risk-mdl | new-liquidation-strat |
    21  ```
    22  
    23  All fields, bar the ID are treated as optional, and are defined as follows:
    24  
    25  ```
    26  | name                       | type                                 | NOTE                                            |
    27  | id                         | string (market ID)                   |                                                 |
    28  | linear slippage factor     | float64                              |                                                 |
    29  | quadratic slippage factor  | float64                              | deprecated                                      |
    30  | data source config         | string (oracle name)                 | not possible to update the product in all cases |
    31  | price monitoring           | string (price monitoring name)       |                                                 |
    32  | risk model                 | string (risk model name)             |                                                 |
    33  | liquidity monitoring       | string (liquidity monitoring name)   | deprecated                                      |
    34  | sla params                 | string (sla params name)             |                                                 |
    35  | liquidity fee settings     | string (fee config name)             |                                                 |
    36  | liquidation strategy       | string (liquidation strategy name)   |                                                 |
    37  | price type                 | Price_Type                           |                                                 |
    38  | decay weight               | decimal                              |                                                 |
    39  | decay power                | decimal                              |                                                 |
    40  | cash amount                | Uint                                 |                                                 |
    41  | source weights             | Source_Weights                       |                                                 |
    42  | source staleness tolerance | Staleness_Tolerance                  |                                                 |
    43  | oracle1                    | string (composite price oracle name) |                                                 |
    44  | oracle2                    | string (composite price oracle name) |                                                 |
    45  | oracle3                    | string (composite price oracle name) |                                                 |
    46  | oracle4                    | string (composite price oracle name) |                                                 |
    47  | oracle5                    | string (composite price oracle name) |                                                 |
    48  | tick size                  | uint                                 |                                                 |
    49  ```
    50  
    51  Details on the [`Price_Type` type](types.md#Price-type).
    52  Details on the [`Source_Weights` type](types.md#Source-weights)
    53  Details on the [`Staleness_Tolerance` type](types.md#Staleness-tolerance)
    54  
    55  Any field that is not set means that aspect of the market configuration is not to be updated.
    56  
    57  ### Governance auctions
    58  
    59  Markets can be put into governance auctions, which can be ended through governance, too.
    60  
    61  #### Suspending markets
    62  
    63  To start a governance auction, the following step is used:
    64  
    65  ```cucumber
    66  When the market states are updated through governance:
    67    | market id | state                            |
    68    | ETH/DEC20 | MARKET_STATE_UPDATE_TYPE_SUSPEND |
    69  ```
    70  
    71  Where the relevant fields are:
    72  
    73  ```
    74  | market id | string (market ID) | required |
    75  | state     | MarketStateUpdate  | required |
    76  | error     | expected error     | optional |
    77  ```
    78  
    79  Details on the [`MarketStateUpdate` type](types.md#Market-state-update)
    80  
    81  #### Resuming markets
    82  
    83  To end a goverance auction, the same step is used like so:
    84  
    85  ```cucumber
    86  When the market states are updated through governance:
    87    | market id | state                           |
    88    | ETH/DEC20 | MARKET_STATE_UPDATE_TYPE_RESUME |
    89  ```
    90  
    91  Where the relevant fields are:
    92  
    93  ```
    94  | market id | string (market ID) | required |
    95  | state     | MarketStateUpdate  | required |
    96  | error     | expected error     | optional |
    97  ```
    98  
    99  Details on the [`MarketStateUpdate` type](types.md#Market-state-update)
   100  
   101  ### Terminating markets
   102  
   103  A market can be terminated through governace, too. This can be done with or without a settlement price:
   104  
   105  ```cucumber
   106  When the market states are updated through governance:
   107    | market id | state                              | settlement price |
   108    | ETH/DEC19 | MARKET_STATE_UPDATE_TYPE_TERMINATE | 976              |
   109  ```
   110  
   111  Where the relevant fields are:
   112  
   113  ```
   114  | market id        | string (market ID) | required |
   115  | state            | MarketStateUpdate  | required |
   116  | settlement price | Uint               | optional |
   117  | error            | expected error     | optional |
   118  ```
   119  
   120  Details on the [`MarketStateUpdate` type](types.md#Market-state-update)
   121  
   122  ### Network parameters
   123  
   124  Setting network parameters is typically done as part of the `Background` part of a feature file, or at the start of a scenario. However, changing some network paramters may have an effect on active markets. In that case, a transaction that failed or succeeded previously is expected to behave differently after the network parameters have been updated. This can be useful to test whether or not network paramter changes are correctly propagated. Setting or updating network paramters is done using this step:
   125  
   126  ```cucumber
   127  Background:
   128    # setting network parameter to an initial value
   129    Given the following network parameters are set:
   130      | name                           | value |
   131      | limits.markets.maxPeggedOrders | 2     |
   132  
   133  Scenario:
   134    When the parties place the following pegged orders:
   135      | party  | market id | side | volume | pegged reference | offset | error                         |
   136      | party1 | ETH/DEC24 | buy  | 100    | BEST_BID         | 5      |                               |
   137      | party1 | ETH/DEC24 | buy  | 200    | BEST_BID         | 10     |                               |
   138      | party1 | ETH/DEC24 | buy  | 250    | BEST_BID         | 15     | error: too many pegged orders |
   139  
   140    Then the following network parameters are set:
   141      | name                           | value |
   142      | limits.markets.maxPeggedOrders | 2     |
   143  
   144    When the parties place the following pegged orders:
   145      | party  | market id | side | volume | pegged reference | offset | error |
   146      | party1 | ETH/DEC24 | buy  | 250    | BEST_BID         | 15     |       |
   147  ```
   148  
   149  _Note: the error is not necessarily the correct value._
   150  
   151  
   152  The fields are both required and defined as follows:
   153  
   154  ```
   155  | name  | string (the network paramter key name)              |
   156  | value | string (must be compatible with the parameter type) |
   157  ```
   158  
   159  ### Updating assets
   160  
   161  Similarly to registering assets, it is possible to re-define an existing asset, though this is a rather niche thing to do, using this step:
   162  
   163  ```cucumber
   164  When the following assets are updated:
   165    | id  | decimal places | quantum |
   166    | BTC | 5              | 20      |
   167  ```
   168  
   169  Where the fields are defined as follows:
   170  
   171  ```
   172  | id             | string  | required |
   173  | decimal places | uint64  | required |
   174  | quantum        | decimal | optional |
   175  ```
   176  
   177  Should this cause an error, the test will fail.