code.vegaprotocol.io/vega@v0.79.0/core/integration/features/verified/finite-rewards.feature (about)

     1  Feature: Team Rewards
     2  
     3      Setup a maker fees received team game with a fee cap.
     4  
     5    We want to make it so that one team is allocated rewards and the other team is allocated rewards.
     6  
     7    - Team A should have also paid rewards and not have their rewards capped.
     8    - Team B should not have paid rewards and have their rewards capped.
     9  
    10    Question is what happens to the left over rewards.
    11  
    12  
    13    Background:
    14  
    15      And the average block duration is "1"
    16      And the following network parameters are set:
    17        | name                                    | value |
    18        | referralProgram.minStakedVegaTokens     | 0     |
    19        | market.fee.factors.makerFee             | 0.01  |
    20        | network.markPriceUpdateMaximumFrequency | 0s    |
    21        | validators.epoch.length                 | 60s   |
    22  
    23      # Initialise the markets
    24      And the following assets are registered:
    25        | id      | decimal places | quantum |
    26        | USD-0-1 | 0              | 1       |
    27      And the markets:
    28        | 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 |
    29        | 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                       |
    30  
    31      # Initialise the parties
    32      Given the parties deposit on asset's general account the following amount:
    33        | party                                                            | asset   | amount        |
    34        | aux1                                                             | USD-0-1 | 1000000000000 |
    35        | aux2                                                             | USD-0-1 | 1000000000000 |
    36        | party1                                                           | USD-0-1 | 1000000000000 |
    37        | party2                                                           | USD-0-1 | 1000000000000 |
    38        | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | USD-0-1 | 1000000000000 |
    39  
    40      # Exit opening auctions
    41      When the parties place the following orders:
    42        | party | market id   | side | volume | price | resulting trades | type       | tif     |
    43        | aux1  | ETH/USD-0-1 | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    44        | aux2  | ETH/USD-0-1 | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    45      And the opening auction period ends for market "ETH/USD-0-1"
    46      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/USD-0-1"
    47  
    48      Given the parties create the following referral codes:
    49        | party  | code            | is_team | team  |
    50        | party1 | referral-code-1 | true    | team1 |
    51      Given the parties create the following referral codes:
    52        | party  | code            | is_team | team  |
    53        | party2 | referral-code-1 | true    | team2 |
    54  
    55    Scenario: Check a one-off pay out can be done with start epoch = end epoch
    56  
    57      Given the current epoch is "0"
    58      When the parties submit the following recurring transfers:
    59        | id | from                                                             | from_account_type    | to                                                               | to_account_type                         | entity_scope | asset   | amount | start_epoch | end_epoch | factor | metric                              | metric_asset | markets     | lock_period | window_length | ntop | cap_reward_fee_multiple |
    60        | 1  | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES | TEAMS        | USD-0-1 | 100    | 1           | 2         | 1      | DISPATCH_METRIC_MAKER_FEES_RECEIVED | USD-0-1      | ETH/USD-0-1 | 10          | 1             | 1    | 1                       |
    61      Then the network moves ahead "1" epochs
    62  
    63      ## pary1
    64      And the parties place the following orders:
    65        | party  | market id   | side | volume | price | resulting trades | type       | tif     |
    66        | aux1   | ETH/USD-0-1 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    67        | party1 | ETH/USD-0-1 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    68        | party1 | ETH/USD-0-1 | buy  | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    69        | aux1   | ETH/USD-0-1 | sell | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    70      And the following trades should be executed:
    71        | buyer  | size | price | seller | aggressor side | buyer maker fee | seller maker fee |
    72        | party1 | 10   | 1000  | aux1   | buy            | 100             | 0                |
    73        | party1 | 10   | 1000  | aux1   | sell           | 0               | 100              |
    74  
    75      # party2
    76      And the parties place the following orders:
    77        | party  | market id   | side | volume | price | resulting trades | type       | tif     |
    78        | aux1   | ETH/USD-0-1 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    79        | party2 | ETH/USD-0-1 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    80      And the following trades should be executed:
    81        | buyer  | size | price | seller | aggressor side | buyer maker fee |
    82        | party2 | 10   | 1000  | aux1   | buy            | 100             |
    83  
    84      When the network moves ahead "1" epochs
    85      And parties should have the following vesting account balances:
    86        | party  | asset   | balance |
    87        | party1 | USD-0-1 | 100     |
    88        | party2 | USD-0-1 | 0       |
    89  
    90  
    91      ## pary1
    92      And the parties place the following orders:
    93        | party  | market id   | side | volume | price | resulting trades | type       | tif     |
    94        | aux1   | ETH/USD-0-1 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    95        | party1 | ETH/USD-0-1 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    96        | party1 | ETH/USD-0-1 | buy  | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    97        | aux1   | ETH/USD-0-1 | sell | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    98      And the following trades should be executed:
    99        | buyer  | size | price | seller | aggressor side | buyer maker fee | seller maker fee |
   100        | party1 | 10   | 1000  | aux1   | buy            | 100             | 0                |
   101        | party1 | 10   | 1000  | aux1   | sell           | 0               | 100              |
   102  
   103      # party2
   104      And the parties place the following orders:
   105        | party  | market id   | side | volume | price | resulting trades | type       | tif     |
   106        | aux1   | ETH/USD-0-1 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
   107        | party2 | ETH/USD-0-1 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
   108      And the following trades should be executed:
   109        | buyer  | size | price | seller | aggressor side | buyer maker fee |
   110        | party2 | 10   | 1000  | aux1   | buy            | 100             |
   111  
   112      When the network moves ahead "1" epochs
   113      And parties should have the following vesting account balances:
   114        | party  | asset   | balance |
   115        | party1 | USD-0-1 | 200     |
   116        | party2 | USD-0-1 | 0       |
   117  
   118      Then debug transfers