code.vegaprotocol.io/vega@v0.79.0/core/integration/features/rewards/0056-REWA-209.feature (about)

     1  Feature: Team Rewards
     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.001 |
    11              | network.markPriceUpdateMaximumFrequency | 0s    |
    12              | market.auction.minimumDuration          | 1     |
    13              | validators.epoch.length                 | 60s   |
    14              | limits.markets.maxPeggedOrders          | 4     |
    15              | referralProgram.minStakedVegaTokens     | 0     |
    16  
    17          # Initialise the markets
    18          And the following assets are registered:
    19              | id       | decimal places | quantum |
    20              | USD-1-10 | 1              | 10      |
    21          And the markets:
    22              | 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 |
    23              | ETH/USD-1-10 | ETH        | USD-1-10 | default-log-normal-risk-model | default-margin-calculator | 1                | default-none | default-none     | default-eth-for-future | 1e-3                   | 0                         | default-futures | 0              | 0                       |
    24              | ETH/USD-2-10 | ETH        | USD-1-10 | default-log-normal-risk-model | default-margin-calculator | 1                | default-none | default-none     | default-eth-for-future | 1e-3                   | 0                         | default-futures | 0              | 0                       |
    25  
    26          # Initialise the parties
    27          Given the parties deposit on asset's general account the following amount:
    28              | party                                                            | asset    | amount      |
    29              | lpprov                                                           | USD-1-10 | 20000000000 |
    30              | aux1                                                             | USD-1-10 | 20000000    |
    31              | aux2                                                             | USD-1-10 | 20000000    |
    32              | aux3                                                             | USD-1-10 | 20000000000 |
    33              | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | USD-1-10 | 20000000000 |
    34              | party1                                                           | USD-1-10 | 20000000000 |
    35              | party2                                                           | USD-1-10 | 20000000000 |
    36              | party3                                                           | USD-1-10 | 20000000000 |
    37  
    38          # Exit opening auctions
    39          Given the parties submit the following liquidity provision:
    40              | id  | party  | market id    | commitment amount | fee  | lp type    |
    41              | lp1 | lpprov | ETH/USD-1-10 | 1000000           | 0.01 | submission |
    42              | lp1 | lpprov | ETH/USD-2-10 | 1000000           | 0.01 | submission |
    43          And the parties place the following pegged iceberg orders:
    44              | party  | market id    | peak size | minimum visible size | side | pegged reference | volume | offset |
    45              | lpprov | ETH/USD-1-10 | 5000      | 1000                 | buy  | BID              | 10000  | 1      |
    46              | lpprov | ETH/USD-1-10 | 5000      | 1000                 | sell | ASK              | 10000  | 1      |
    47              | lpprov | ETH/USD-2-10 | 5000      | 1000                 | buy  | BID              | 10000  | 1      |
    48              | lpprov | ETH/USD-2-10 | 5000      | 1000                 | sell | ASK              | 10000  | 1      |
    49          When the parties place the following orders:
    50              | party | market id    | side | volume | price | resulting trades | type       | tif     |
    51              | aux1  | ETH/USD-1-10 | buy  | 1      | 990   | 0                | TYPE_LIMIT | TIF_GTC |
    52              | aux1  | ETH/USD-1-10 | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    53              | aux2  | ETH/USD-1-10 | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    54              | aux2  | ETH/USD-1-10 | sell | 1      | 1100  | 0                | TYPE_LIMIT | TIF_GTC |
    55              | aux1  | ETH/USD-2-10 | buy  | 1      | 990   | 0                | TYPE_LIMIT | TIF_GTC |
    56              | aux1  | ETH/USD-2-10 | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    57              | aux2  | ETH/USD-2-10 | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    58              | aux2  | ETH/USD-2-10 | sell | 1      | 1100  | 0                | TYPE_LIMIT | TIF_GTC |
    59          And the opening auction period ends for market "ETH/USD-1-10"
    60          When the network moves ahead "1" blocks
    61          And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/USD-1-10"
    62          And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/USD-2-10"
    63  
    64          # Create a team
    65          And the following teams with referees are created:
    66              | referrer  | prefix | code            | team name | referees | balance  | asset    |
    67              | referrer1 | ref1   | referral-code-1 | team1     | 3        | 10000000 | USD-1-10 |
    68  
    69      @TeamStep
    70      Scenario: Given a recurring transfer scoping multiple markets and specifying a non-zero target_notional_volume. When the volume is spread evenly across the markets, if the cumulative volume is less than the target, the rewards distributed are scaled accordingly (participants in each market with the same score should receive the same amount of rewards). (0056-REWA-234).
    71  
    72          Given the parties submit the following recurring transfers:
    73              | id | from                                                             | from_account_type    | to                                                               | to_account_type                     | entity_scope | individual_scope | asset    | amount | start_epoch | end_epoch | factor | metric                          | metric_asset | markets                   | target_notional_volume |
    74              | 1  | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES | INDIVIDUALS  | ALL              | USD-1-10 | 10000  | 1           |           | 1      | DISPATCH_METRIC_MAKER_FEES_PAID | USD-1-10     | ETH/USD-1-10,ETH/USD-2-10 | 400000                 |
    75          # 2 individuals not in a team, 2 in a team, same metrics
    76          # all the individuals can receive rewards =10k/4 = 2,500 - the traded notional is 2x the target but still the amount paid is only 2500 each.
    77          And the parties place the following orders:
    78              | party     | market id    | side | volume | price | resulting trades | type       | tif     |
    79              | aux1      | ETH/USD-1-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    80              | party1    | ETH/USD-1-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    81              | aux1      | ETH/USD-1-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    82              | party2    | ETH/USD-1-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    83              | aux3      | ETH/USD-1-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    84              | ref1-0001 | ETH/USD-1-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    85              | aux3      | ETH/USD-1-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    86              | ref1-0002 | ETH/USD-1-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    87              | aux1      | ETH/USD-2-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    88              | party1    | ETH/USD-2-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    89              | aux1      | ETH/USD-2-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    90              | party2    | ETH/USD-2-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    91              | aux3      | ETH/USD-2-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    92              | ref1-0001 | ETH/USD-2-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    93              | aux3      | ETH/USD-2-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    94              | ref1-0002 | ETH/USD-2-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    95  
    96          When the network moves ahead "1" epochs
    97          Then parties should have the following vesting account balances:
    98              | party     | asset    | balance |
    99              | party1    | USD-1-10 | 2500    |
   100              | party2    | USD-1-10 | 2500    |
   101              | ref1-0001 | USD-1-10 | 2500    |
   102              | ref1-0002 | USD-1-10 | 2500    |