code.vegaprotocol.io/vega@v0.79.0/core/integration/features/rewards/0056-REWA-099.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 | party1 | USD-1-10 | 10000000000 | 34 | party2 | USD-1-10 | 10000000000 | 35 | party3 | USD-1-10 | 10000000000 | 36 37 # Exit opening auctions 38 Given the parties submit the following liquidity provision: 39 | id | party | market id | commitment amount | fee | lp type | 40 | lp1 | lpprov | ETH/USD-1-10 | 1000000 | 0.01 | submission | 41 And the parties place the following pegged iceberg orders: 42 | party | market id | peak size | minimum visible size | side | pegged reference | volume | offset | 43 | lpprov | ETH/USD-1-10 | 5000 | 1000 | buy | BID | 10000 | 1 | 44 | lpprov | ETH/USD-1-10 | 5000 | 1000 | sell | ASK | 10000 | 1 | 45 When the parties place the following orders: 46 | party | market id | side | volume | price | resulting trades | type | tif | 47 | aux1 | ETH/USD-1-10 | buy | 1 | 990 | 0 | TYPE_LIMIT | TIF_GTC | 48 | aux1 | ETH/USD-1-10 | buy | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 49 | aux2 | ETH/USD-1-10 | sell | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 50 | aux2 | ETH/USD-1-10 | sell | 1 | 1100 | 0 | TYPE_LIMIT | TIF_GTC | 51 And the opening auction period ends for market "ETH/USD-1-10" 52 When the network moves ahead "1" blocks 53 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/USD-1-10" 54 55 # Create a team 56 And the following teams with referees are created: 57 | referrer | prefix | code | team name | referees | balance | asset | 58 | referrer1 | ref1 | referral-code-1 | team1 | 3 | 10000000 | USD-1-10 | 59 60 @TeamStep 61 Scenario: 0056-REWA-099 scope individuals is paid out to all eligible parties (in team only), 0056-REWA-201 62 63 Given the parties submit the following recurring transfers: 64 | id | from | from_account_type | to | to_account_type | entity_scope | individual_scope | asset | amount | start_epoch | end_epoch | factor | metric | metric_asset | markets | 65 | 1 | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES | INDIVIDUALS | IN_TEAM | USD-1-10 | 10000 | 1 | | 1 | DISPATCH_METRIC_MAKER_FEES_PAID | USD-1-10 | ETH/USD-1-10 | 66 # 3 individuals not in a team, 3 in a team, same metrics 67 # only the individuals in a team can receive rewards =10k/3 = 3,333 each 68 And the parties place the following orders: 69 | party | market id | side | volume | price | resulting trades | type | tif | 70 | aux1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 71 | party1 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 72 | aux1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 73 | party2 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 74 | aux1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 75 | party3 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 76 | aux3 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 77 | ref1-0001 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 78 | aux3 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 79 | ref1-0002 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 80 | aux3 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 81 | ref1-0003 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 82 When the network moves ahead "1" epochs 83 Then parties should have the following vesting account balances: 84 | party | asset | balance | 85 | ref1-0001 | USD-1-10 | 3333 | 86 | ref1-0002 | USD-1-10 | 3333 | 87 | ref1-0003 | USD-1-10 | 3333 | 88 #And "ref1-0002" should have vesting account balance of "0" for asset "USD-1-10" 89 90 91 @TeamStep 92 Scenario: 0056-REWA-211 if an `eligible keys` list is specified in the recurring transfer, only parties included in the list and meeting other eligibility criteria should receive a score (if they meet the criteria for one) 93 Given the parties submit the following recurring transfers: 94 | id | from | from_account_type | to | to_account_type | entity_scope | individual_scope | asset | amount | start_epoch | end_epoch | factor | metric | metric_asset | markets | eligible_keys | 95 | 1 | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES | INDIVIDUALS | IN_TEAM | USD-1-10 | 10000 | 1 | | 1 | DISPATCH_METRIC_MAKER_FEES_PAID | USD-1-10 | ETH/USD-1-10 | ref1-0002,ref1-0003 | 96 # 3 individuals not in a team, 3 in a team, same metrics 97 # only the individuals in a team can receive rewards =10k/3 = 3,333 each 98 And the parties place the following orders: 99 | party | market id | side | volume | price | resulting trades | type | tif | 100 | aux1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 101 | party1 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 102 | aux1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 103 | party2 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 104 | aux1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 105 | party3 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 106 | aux3 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 107 | ref1-0001 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 108 | aux3 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 109 | ref1-0002 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 110 | aux3 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 111 | ref1-0003 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 112 When the network moves ahead "1" epochs 113 Then parties should have the following vesting account balances: 114 | party | asset | balance | 115 | ref1-0002 | USD-1-10 | 5000 | 116 | ref1-0003 | USD-1-10 | 5000 | 117 118 @TeamStep 119 Scenario: 0056-REWA-098 scope individuals is paid out to all eligible parties (not in team only) 120 121 Given the parties submit the following recurring transfers: 122 | id | from | from_account_type | to | to_account_type | entity_scope | individual_scope | asset | amount | start_epoch | end_epoch | factor | metric | metric_asset | markets | 123 | 1 | a3c024b4e23230c89884a54a813b1ecb4cb0f827a38641c66eeca466da6b2ddf | ACCOUNT_TYPE_GENERAL | 0000000000000000000000000000000000000000000000000000000000000000 | ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES | INDIVIDUALS | NOT_IN_TEAM | USD-1-10 | 10000 | 1 | | 1 | DISPATCH_METRIC_MAKER_FEES_PAID | USD-1-10 | ETH/USD-1-10 | 124 # 3 individuals not in a team, 3 in a team, same metrics 125 # only the individuals NOT in a team can receive rewards =10k/3 = 3,333 each 126 And the parties place the following orders: 127 | party | market id | side | volume | price | resulting trades | type | tif | 128 | aux1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 129 | party1 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 130 | aux1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 131 | party2 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 132 | aux1 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 133 | party3 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 134 | aux3 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 135 | ref1-0001 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 136 | aux3 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 137 | ref1-0002 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 138 | aux3 | ETH/USD-1-10 | sell | 10 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 139 | ref1-0003 | ETH/USD-1-10 | buy | 10 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 140 When the network moves ahead "1" epochs 141 Then parties should have the following vesting account balances: 142 | party | asset | balance | 143 | party1 | USD-1-10 | 3333 | 144 | party2 | USD-1-10 | 3333 | 145 | party3 | USD-1-10 | 3333 | 146 #And "ref1-0002" should have vesting account balance of "0" for asset "USD-1-10"