code.vegaprotocol.io/vega@v0.79.0/core/integration/features/activity-streak/0086-ASPR-streak_benefits.feature (about)

     1  Feature: Setting and applying activity streak benefits
     2  
     3    Background:
     4  
     5      # Initialise the network
     6      Given time is updated to "2023-01-01T00:00:00Z"
     7      And the average block duration is "1"
     8      And the following network parameters are set:
     9        | name                                    | value |
    10        | market.fee.factors.makerFee             | 0.01  |
    11        | network.markPriceUpdateMaximumFrequency | 0s    |
    12        | market.auction.minimumDuration          | 1     |
    13        | validators.epoch.length                 | 20s   |
    14        | limits.markets.maxPeggedOrders          | 4     |
    15      And the following network parameters are set:
    16        | name                                         | value                                                                                                                                                                                 |
    17        | rewards.vesting.baseRate                     | 0.1                                                                                                                                                                                   |
    18        | rewards.vesting.minimumTransfer              | 1                                                                                                                                                                                     |
    19        | rewards.vesting.benefitTiers                 | {"tiers": [{"minimum_quantum_balance": "1", "reward_multiplier": "1"}]}                                                                                                               |
    20        | rewards.activityStreak.minQuantumOpenVolume  | 1                                                                                                                                                                                     |
    21        | rewards.activityStreak.minQuantumTradeVolume | 1                                                                                                                                                                                     |
    22        | rewards.activityStreak.benefitTiers          | {"tiers": [{"minimum_activity_streak": 3, "reward_multiplier": "2", "vesting_multiplier": "2"}, {"minimum_activity_streak": 6, "reward_multiplier": "3", "vesting_multiplier": "3"}]} |
    23  
    24      # Initialise the markets
    25      And the following assets are registered:
    26        | id      | decimal places | quantum |
    27        | USD.0.1 | 0              | 1       |
    28      And the markets:
    29        | id          | quote name | asset   | risk model                    | margin calculator         | auction duration | fees         | price monitoring | data source config     | linear slippage factor | quadratic slippage factor | sla params      | decimal places | position decimal places |
    30        | ETH/USD.0.1 | ETH        | USD.0.1 | default-log-normal-risk-model | default-margin-calculator | 1                | default-none | default-none     | default-eth-for-future | 1e-3                   | 0                         | default-futures | 0              | 0                       |
    31      And the liquidity monitoring parameters:
    32        | name       | triggering ratio | time window | scaling factor |
    33        | lqm-params | 1.0              | 3600s       | 1              |
    34      When the markets are updated:
    35        | id          | liquidity monitoring | linear slippage factor | quadratic slippage factor |
    36        | ETH/USD.0.1 | lqm-params           | 1e-3                   | 0                         |
    37  
    38      # Initialise the parties
    39      Given the parties deposit on asset's general account the following amount:
    40        | party                                                            | asset   | amount       |
    41        | lpprov                                                           | USD.0.1 | 10000000000  |
    42        | aux1                                                             | USD.0.1 | 10000000     |
    43        | aux2                                                             | USD.0.1 | 10000000     |
    44        | trader1                                                          | USD.0.1 | 10000000     |
    45        | trader2                                                          | USD.0.1 | 10000000     |
    46        | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | USD.0.1 | 100000000000 |
    47  
    48  
    49      # Exit opening auctions
    50      Given the parties submit the following liquidity provision:
    51        | id  | party  | market id   | commitment amount | fee  | lp type    |
    52        | lp1 | lpprov | ETH/USD.0.1 | 1000000           | 0.01 | submission |
    53      And the parties place the following pegged iceberg orders:
    54        | party  | market id   | peak size | minimum visible size | side | pegged reference | volume | offset |
    55        | lpprov | ETH/USD.0.1 | 5000      | 1000                 | buy  | BID              | 10000  | 1      |
    56        | lpprov | ETH/USD.0.1 | 5000      | 1000                 | sell | ASK              | 10000  | 1      |
    57      When the parties place the following orders:
    58        | party | market id   | side | volume | price | resulting trades | type       | tif     |
    59        | aux1  | ETH/USD.0.1 | buy  | 1      | 990   | 0                | TYPE_LIMIT | TIF_GTC |
    60        | aux1  | ETH/USD.0.1 | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    61        | aux2  | ETH/USD.0.1 | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    62        | aux2  | ETH/USD.0.1 | sell | 1      | 1100  | 0                | TYPE_LIMIT | TIF_GTC |
    63      And the opening auction period ends for market "ETH/USD.0.1"
    64      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/USD.0.1"
    65  
    66  
    67    Scenario Outline: Party builds an activity streak and receives greater benefits than an infrequently active trader (0086-ASPR-008)(0086-ASPR-009)(0086-ASPR-010)
    68      # Expectation: parties activity streak should be incremented if they fulfill the trade volume or open volume requirements
    69  
    70      # Test Cases:
    71      # - party does not meet the lowest activity streak requirement, there multiplier is set to 1
    72      # - party meets the lowest activity streak requirement, party receives a larger share of the rewards
    73      # - party meets the highest activity streak requirement, party receives a larger share of the rewards
    74  
    75      Given the parties submit the following recurring transfers:
    76        | id | from                                                             | from_account_type    | to                                                               | to_account_type                     | asset   | amount | start_epoch | end_epoch | factor | metric                          | metric_asset | markets |
    77        | 1  | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES | USD.0.1 | 10000  | 2           |           | 1      | DISPATCH_METRIC_MAKER_FEES_PAID | USD.0.1      |         |
    78  
    79      Given the network moves ahead "1" epochs
    80      And the current epoch is "1"
    81      Given the parties place the following orders:
    82        | party   | market id   | side | volume | price | resulting trades | type       | tif     |
    83        | aux1    | ETH/USD.0.1 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    84        | trader1 | ETH/USD.0.1 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    85      When the network moves ahead <forward to epoch> epochs
    86      Then the activity streaks at epoch <forward to epoch> should be:
    87        | party   | active for   | inactive for | reward multiplier | vesting multiplier |
    88        | trader1 | <active for> | 0            | <multipliers>     | <multipliers>      |
    89  
    90      Given the parties place the following orders:
    91        | party   | market id   | side | volume | price | resulting trades | type       | tif     |
    92        | aux1    | ETH/USD.0.1 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    93        | trader1 | ETH/USD.0.1 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    94        | aux1    | ETH/USD.0.1 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    95        | trader2 | ETH/USD.0.1 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    96      Then the network moves ahead "1" epochs
    97      Then "trader1" should have vesting account balance of <vesting balance> for asset "USD.0.1"
    98      Then the network moves ahead "1" epochs
    99      Then "trader1" should have vested account balance of <vested balance> for asset "USD.0.1"
   100  
   101      Examples:
   102        | forward to epoch | active for | multipliers | vesting balance | vested balance |
   103        | "1"              | 1          | 1           | "5000"          | "1000"         |
   104        | "3"              | 3          | 2           | "6666"          | "1333"         |
   105        | "6"              | 6          | 3           | "7500"          | "2250"         |