code.vegaprotocol.io/vega@v0.79.0/core/integration/features/teams/0083-RFPR-063-bulk.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        | another1                                                         | USD-1-10 | 10000000000 |
    34        | another2                                                         | USD-1-10 | 10000000000 |
    35  
    36      # Exit opening auctions
    37      Given the parties submit the following liquidity provision:
    38        | id  | party  | market id    | commitment amount | fee  | lp type    |
    39        | lp1 | lpprov | ETH/USD-1-10 | 1000000           | 0.01 | submission |
    40      And the parties place the following pegged iceberg orders:
    41        | party  | market id    | peak size | minimum visible size | side | pegged reference | volume | offset |
    42        | lpprov | ETH/USD-1-10 | 5000      | 1000                 | buy  | BID              | 10000  | 1      |
    43        | lpprov | ETH/USD-1-10 | 5000      | 1000                 | sell | ASK              | 10000  | 1      |
    44      When the parties place the following orders:
    45        | party | market id    | side | volume | price | resulting trades | type       | tif     |
    46        | aux1  | ETH/USD-1-10 | buy  | 1      | 990   | 0                | TYPE_LIMIT | TIF_GTC |
    47        | aux1  | ETH/USD-1-10 | buy  | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    48        | aux2  | ETH/USD-1-10 | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    49        | aux2  | ETH/USD-1-10 | sell | 1      | 1100  | 0                | TYPE_LIMIT | TIF_GTC |
    50      And the opening auction period ends for market "ETH/USD-1-10"
    51      When the network moves ahead "1" blocks
    52      And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/USD-1-10"
    53  
    54      # Create the teams
    55      Given the following teams with referees are created:
    56        | referrer  | prefix | code            | team name | referees | balance  | asset    | closed | allow list |
    57        | referrer1 | ref1   | referral-code-1 | team1     | 20       | 10000000 | USD-1-10 | true   | another1   |
    58        | referrer2 | ref2   | referral-code-2 | team2     | 20       | 10000000 | USD-1-10 | true   |            |
    59  
    60    @Closed
    61    Scenario: 0083-RFPR-063 with bulk team creation
    62  
    63      When the parties apply the following referral codes:
    64        | party    | code            | is_team | team  | reference | error                                     |
    65        | another2 | referral-code-2 | true    | team2 | some ref  | party is not allowed to join team "team2" |
    66      When the parties apply the following referral codes:
    67        | party    | code            | is_team | team  | reference |
    68        | another1 | referral-code-1 | true    | team1 | some ref  |
    69      Given the parties submit the following recurring transfers:
    70        | id | from                                                             | from_account_type    | to                                                               | to_account_type                     | entity_scope | teams       | ntop | asset    | amount | start_epoch | end_epoch | factor | metric                          | metric_asset | markets      |
    71        | 1  | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES | TEAMS        | team1,team2 | 0.2  | USD-1-10 | 10000  | 1           |           | 1      | DISPATCH_METRIC_MAKER_FEES_PAID | USD-1-10     | ETH/USD-1-10 |
    72      ## Bunch of orders:
    73      # Team1: 20, 10, 10, 10, 1 (out of 20)
    74      # Team2: 21, 19, 10, 5 (out of 10)
    75      # TopN 0.2 should be based on 50/4 and 40/2 -> 12.5 and 20
    76      # This is then divided between 5 parties in team1, 4 in team2 respectively,
    77      # so team1 parties receive 12.5/5 (or 2.5), whereas team2 referees receive 20/4 (or 5)
    78      # We expect to see the vesting account balances of team2 to be 2x those of team1
    79      And the parties place the following orders:
    80        | party     | market id    | side | volume | price | resulting trades | type       | tif     |
    81        | aux1      | ETH/USD-1-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    82        | ref1-0001 | 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-0002 | 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-0003 | ETH/USD-1-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    87        | aux3      | ETH/USD-1-10 | sell | 20     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    88        | ref1-0004 | ETH/USD-1-10 | buy  | 20     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    89        | aux3      | ETH/USD-1-10 | sell | 1      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    90        | ref1-0005 | ETH/USD-1-10 | buy  | 1      | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    91        | aux1      | ETH/USD-1-10 | sell | 21     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    92        | ref2-0001 | ETH/USD-1-10 | buy  | 21     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    93        | aux1      | ETH/USD-1-10 | sell | 5      | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    94        | ref2-0002 | ETH/USD-1-10 | buy  | 5      | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    95        | aux1      | ETH/USD-1-10 | sell | 19     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    96        | ref2-0003 | ETH/USD-1-10 | buy  | 19     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    97        | aux1      | ETH/USD-1-10 | sell | 10     | 1000  | 0                | TYPE_LIMIT | TIF_GTC |
    98        | ref2-0004 | ETH/USD-1-10 | buy  | 10     | 1000  | 1                | TYPE_LIMIT | TIF_GTC |
    99      When the network moves ahead "1" epochs
   100      Then parties should have the following vesting account balances:
   101        | party     | asset    | balance |
   102        | ref1-0001 | USD-1-10 | 952     |
   103        | ref1-0002 | USD-1-10 | 952     |
   104        | ref1-0003 | USD-1-10 | 952     |
   105        | ref1-0004 | USD-1-10 | 952     |
   106        | ref1-0005 | USD-1-10 | 952     |
   107        | ref1-0006 | USD-1-10 | 0       |
   108        | ref2-0001 | USD-1-10 | 1309    |
   109        | ref2-0002 | USD-1-10 | 1309    |
   110        | ref2-0003 | USD-1-10 | 1309    |
   111        | ref2-0004 | USD-1-10 | 1309    |
   112        | ref2-0005 | USD-1-10 | 0       |
   113      #And "ref1-0002" should have vesting account balance of "0" for asset "USD-1-10"