code.vegaprotocol.io/vega@v0.79.0/core/integration/features/rewards/0056-REWA-104.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  
    25      # Initialise the parties
    26      Given the parties deposit on asset's general account the following amount:
    27        | party                                                            | asset    | amount      |
    28        | lpprov                                                           | USD-1-10 | 10000000000 |
    29        | aux1                                                             | USD-1-10 | 10000000    |
    30        | aux2                                                             | USD-1-10 | 10000000    |
    31        | aux3                                                             | USD-1-10 | 10000000000 |
    32        | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | USD-1-10 | 10000000000 |
    33  
    34      # Exit opening auctions
    35      Given the parties submit the following liquidity provision:
    36        | id  | party  | market id    | commitment amount | fee  | lp type    |
    37        | lp1 | lpprov | ETH/USD-1-10 | 1000000           | 0.01 | submission |
    38      And the parties place the following pegged iceberg orders:
    39        | party  | market id    | peak size | minimum visible size | side | pegged reference | volume | offset |
    40        | lpprov | ETH/USD-1-10 | 5000      | 1000                 | buy  | BID              | 10000  | 1      |
    41        | lpprov | ETH/USD-1-10 | 5000      | 1000                 | sell | ASK              | 10000  | 1      |
    42      When the parties place the following orders:
    43        | party | market id    | side | volume | price | resulting trades | type       | tif     |
    44        | aux1  | ETH/USD-1-10 | buy  | 1      | 990   | 0                | TYPE_LIMIT | TIF_GTC |
    45        | aux1  | ETH/USD-1-10 | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    46        | aux2  | ETH/USD-1-10 | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    47        | aux2  | ETH/USD-1-10 | sell | 1      | 1100  | 0                | TYPE_LIMIT | TIF_GTC |
    48      And the opening auction period ends for market "ETH/USD-1-10"
    49      When the network moves ahead "1" blocks
    50      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/USD-1-10"
    51  
    52      # Create the teams
    53      Given the following teams with referees are created:
    54        | referrer  | prefix | code            | team name | referees | balance  | asset    |
    55        | referrer1 | ref1   | referral-code-1 | team1     | 2        | 10000000 | USD-1-10 |
    56        | referrer2 | ref2   | referral-code-2 | team2     | 2        | 10000000 | USD-1-10 |
    57  
    58    @TeamStep
    59    Scenario: 0056-REWA-104 rewards only go to the specified team
    60  
    61      Given the parties submit the following recurring transfers:
    62        | id | from                                                             | from_account_type    | to                                                               | to_account_type                     | entity_scope | teams | ntop | asset    | amount | start_epoch | end_epoch | factor | metric                          | metric_asset | markets      |
    63        | 1  | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES | TEAMS        | team1 | 1    | USD-1-10 | 10000  | 1           |           | 1      | DISPATCH_METRIC_MAKER_FEES_PAID | USD-1-10     | ETH/USD-1-10 |
    64      # ntop is set to 1, and only 1 team receives the rewards, so no numbers to crunch here
    65      And the parties place the following orders:
    66        | party     | market id    | side | volume | price | resulting trades | type       | tif     |
    67        | aux1      | ETH/USD-1-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    68        | ref1-0001 | ETH/USD-1-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    69        | aux3      | ETH/USD-1-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    70        | ref1-0002 | ETH/USD-1-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    71        | aux1      | ETH/USD-1-10 | sell | 21     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    72        | ref2-0001 | ETH/USD-1-10 | buy  | 21     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    73        | aux1      | ETH/USD-1-10 | sell | 5      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    74        | ref2-0002 | ETH/USD-1-10 | buy  | 5      | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    75      When the network moves ahead "1" epochs
    76      Then parties should have the following vesting account balances:
    77        | party     | asset    | balance |
    78        | ref1-0001 | USD-1-10 | 5000    |
    79        | ref1-0002 | USD-1-10 | 5000    |
    80        | ref2-0001 | USD-1-10 | 0       |
    81        | ref2-0002 | USD-1-10 | 0       |
    82  
    83    @TeamStep
    84    Scenario: 0056-REWA-104 if ntop equates to less than 1 member of the team, round up to 1
    85  
    86      Given the parties submit the following recurring transfers:
    87        | id | from                                                             | from_account_type    | to                                                               | to_account_type                     | entity_scope | teams | ntop | asset    | amount | start_epoch | end_epoch | factor | metric                          | metric_asset | markets      |
    88        | 1  | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES | TEAMS        | team1 | 0.1  | USD-1-10 | 10000  | 1           |           | 1      | DISPATCH_METRIC_MAKER_FEES_PAID | USD-1-10     | ETH/USD-1-10 |
    89      # ntop is set to 1, and only 1 team receives the rewards, so no numbers to crunch here
    90      And the parties place the following orders:
    91        | party     | market id    | side | volume | price | resulting trades | type       | tif     |
    92        | aux1      | ETH/USD-1-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    93        | ref1-0001 | ETH/USD-1-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    94        | aux3      | ETH/USD-1-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    95        | ref1-0002 | ETH/USD-1-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    96        | aux1      | ETH/USD-1-10 | sell | 21     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    97        | ref2-0001 | ETH/USD-1-10 | buy  | 21     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    98        | aux1      | ETH/USD-1-10 | sell | 5      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    99        | ref2-0002 | ETH/USD-1-10 | buy  | 5      | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
   100      When the network moves ahead "1" epochs
   101      Then parties should have the following vesting account balances:
   102        | party     | asset    | balance |
   103        | ref1-0001 | USD-1-10 | 5000    |
   104        | ref1-0002 | USD-1-10 | 5000    |
   105        | ref2-0001 | USD-1-10 | 0       |
   106        | ref2-0002 | USD-1-10 | 0       |
   107  
   108    @TeamStep
   109    Scenario: 0056-REWA-104 if nobody is eligible, no fees are received
   110  
   111      Given the parties submit the following recurring transfers:
   112        | id | from                                                             | from_account_type    | to                                                               | to_account_type                     | entity_scope | teams | ntop | asset    | amount | start_epoch | end_epoch | factor | metric                          | metric_asset | markets      |
   113        | 1  | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES | TEAMS        | team1 | 0.1  | USD-1-10 | 10000  | 1           |           | 1      | DISPATCH_METRIC_MAKER_FEES_PAID | USD-1-10     | ETH/USD-1-10 |
   114      # ntop is set to 1, and only 1 team receives the rewards, so no numbers to crunch here
   115      And the parties place the following orders:
   116        | party     | market id    | side | volume | price | resulting trades | type       | tif     |
   117        | aux1      | ETH/USD-1-10 | sell | 21     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
   118        | ref2-0001 | ETH/USD-1-10 | buy  | 21     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
   119        | aux1      | ETH/USD-1-10 | sell | 5      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
   120        | ref2-0002 | ETH/USD-1-10 | buy  | 5      | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
   121      When the network moves ahead "1" epochs
   122      Then parties should have the following vesting account balances:
   123        | party     | asset    | balance |
   124        | ref1-0001 | USD-1-10 | 0       |
   125        | ref1-0002 | USD-1-10 | 0       |
   126        | ref2-0001 | USD-1-10 | 0       |
   127        | ref2-0002 | USD-1-10 | 0       |