code.vegaprotocol.io/vega@v0.79.0/core/integration/features/spot/liquidity_provision/0044-LIME-047.feature (about)

     1  Feature: Spot market SLA
     2  
     3    Scenario: 001 0044-LIME-047, when a liquidity provider has fraction_of_time_on_book = 0, market.liquidity.commitmentMinTimeFraction = 0.6, market.liquidity.sla.nonPerformanceBondPenaltySlope = 0.2, market.liquidity.sla.nonPerformanceBondPenaltyMax = 0.6
     4  
     5      Given time is updated to "2023-07-20T00:00:00Z"
     6  
     7      Given the fees configuration named "fees-config-1":
     8        | maker fee | infrastructure fee |
     9        | 0         | 0                  |
    10      Given the log normal risk model named "lognormal-risk-model-1":
    11        | risk aversion | tau  | mu | r   | sigma |
    12        | 0.001         | 0.01 | 0  | 0.0 | 1.2   |
    13  
    14      And the price monitoring named "price-monitoring-1":
    15        | horizon | probability | auction extension |
    16        | 360000  | 0.999       | 300               |
    17  
    18      And the liquidity sla params named "SLA-1":
    19        | price range | commitment min time fraction | performance hysteresis epochs | sla competition factor |
    20        | 1           | 0.6                            | 2                             | 0.2                    |
    21  
    22      Given the following assets are registered:
    23        | id  | decimal places |
    24        | ETH | 1              |
    25        | BTC | 1              |
    26  
    27      And the following network parameters are set:
    28        | name                                                | value |
    29        | network.markPriceUpdateMaximumFrequency             | 2s    |
    30        | market.liquidity.earlyExitPenalty                   | 0.25  |
    31        | market.liquidity.bondPenaltyParameter               | 0.2   |
    32        | market.liquidity.sla.nonPerformanceBondPenaltySlope | 0.2   |
    33        | market.liquidity.sla.nonPerformanceBondPenaltyMax   | 0.6   |
    34        | market.liquidity.maximumLiquidityFeeFactorLevel     | 0.4   |
    35        | validators.epoch.length                             | 2s    |
    36  
    37      And the spot markets:
    38        | id      | name    | base asset | quote asset | risk model             | auction duration | fees          | price monitoring   | sla params |
    39        | BTC/ETH | BTC/ETH | BTC        | ETH         | lognormal-risk-model-1 | 1                | fees-config-1 | price-monitoring-1 | SLA-1      |
    40      And the following network parameters are set:
    41        | name                                             | value |
    42        | market.liquidity.providersFeeCalculationTimeStep | 1s    |
    43        | market.liquidity.stakeToCcyVolume                | 1     |
    44  
    45      Given the parties deposit on asset's general account the following amount:
    46        | party  | asset | amount |
    47        | party1 | ETH   | 10000  |
    48        | party2 | BTC   | 500    |
    49        | lp1    | ETH   | 4000   |
    50        | lp1    | BTC   | 60     |
    51        | lp2    | ETH   | 4000   |
    52        | lp2    | BTC   | 60     |
    53  
    54      And the average block duration is "1"
    55  
    56      Given the liquidity monitoring parameters:
    57        | name               | triggering ratio | time window | scaling factor |
    58        | updated-lqm-params | 0.2              | 20s         | 0.8            |
    59  
    60      When the spot markets are updated:
    61        | id      | liquidity monitoring | linear slippage factor | quadratic slippage factor |
    62        | BTC/ETH | updated-lqm-params   | 0.5                    | 0.5                       |
    63  
    64      When the parties submit the following liquidity provision:
    65        | id  | party | market id | commitment amount | fee | lp type    |
    66        | lp1 | lp1   | BTC/ETH   | 3000              | 0.1 | submission |
    67  
    68      Then the network moves ahead "1" blocks
    69      And the network treasury balance should be "0" for the asset "ETH"
    70      And the global insurance pool balance should be "0" for the asset "ETH"
    71      And the global insurance pool balance should be "0" for the asset "BTC"
    72      And the party "lp1" lp liquidity fee account balance should be "0" for the market "BTC/ETH"
    73      Then the party "lp1" lp liquidity bond account balance should be "3000" for the market "BTC/ETH"
    74  
    75      Then the market data for the market "BTC/ETH" should be:
    76        | mark price | trading mode                 | auction trigger         | target stake | supplied stake | open interest |
    77        | 0          | TRADING_MODE_OPENING_AUCTION | AUCTION_TRIGGER_OPENING | 2400         | 3000           | 0             |
    78  
    79      # place orders and generate trades
    80      And the parties place the following orders:
    81        | party  | market id | side | volume | price | resulting trades | type       | tif     | reference    | only |
    82        | party1 | BTC/ETH   | buy  | 6      | 8     | 0                | TYPE_LIMIT | TIF_GTC | party-order5 |      |
    83        | party1 | BTC/ETH   | buy  | 1      | 15    | 0                | TYPE_LIMIT | TIF_GTC | party-order3 |      |
    84        | party2 | BTC/ETH   | sell | 1      | 15    | 0                | TYPE_LIMIT | TIF_GTC | party-order4 |      |
    85        | party2 | BTC/ETH   | sell | 6      | 24    | 0                | TYPE_LIMIT | TIF_GTC | party-order6 |      |
    86  
    87      When the network moves ahead "2" blocks
    88  
    89      Then the following trades should be executed:
    90        | buyer  | price | size | seller |
    91        | party1 | 15    | 1    | party2 |
    92  
    93      Then the market data for the market "BTC/ETH" should be:
    94        | mark price | trading mode            | auction trigger             | target stake | supplied stake | open interest |
    95        | 15         | TRADING_MODE_CONTINUOUS | AUCTION_TRIGGER_UNSPECIFIED | 2400         | 3000           | 0             |
    96  
    97      Then the network moves ahead "5" blocks
    98      And the network treasury balance should be "600" for the asset "ETH"
    99      Then the party "lp1" lp liquidity bond account balance should be "2400" for the market "BTC/ETH"
   100  
   101