code.vegaprotocol.io/vega@v0.79.0/core/integration/features/rewards/0056-REWA-210.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 | party4 | USD-1-10 | 20000000000 | 38 39 # Exit opening auctions 40 Given the parties submit the following liquidity provision: 41 | id | party | market id | commitment amount | fee | lp type | 42 | lp1 | lpprov | ETH/USD-1-10 | 1000000 | 0.01 | submission | 43 | lp1 | lpprov | ETH/USD-2-10 | 1000000 | 0.01 | submission | 44 And the parties place the following pegged iceberg orders: 45 | party | market id | peak size | minimum visible size | side | pegged reference | volume | offset | 46 | lpprov | ETH/USD-1-10 | 5000 | 1000 | buy | BID | 10000 | 1 | 47 | lpprov | ETH/USD-1-10 | 5000 | 1000 | sell | ASK | 10000 | 1 | 48 | lpprov | ETH/USD-2-10 | 5000 | 1000 | buy | BID | 10000 | 1 | 49 | lpprov | ETH/USD-2-10 | 5000 | 1000 | sell | ASK | 10000 | 1 | 50 When the parties place the following orders: 51 | party | market id | side | volume | price | resulting trades | type | tif | 52 | aux1 | ETH/USD-1-10 | buy | 1 | 990 | 0 | TYPE_LIMIT | TIF_GTC | 53 | aux1 | ETH/USD-1-10 | buy | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 54 | aux2 | ETH/USD-1-10 | sell | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 55 | aux2 | ETH/USD-1-10 | sell | 1 | 1100 | 0 | TYPE_LIMIT | TIF_GTC | 56 | aux1 | ETH/USD-2-10 | buy | 1 | 990 | 0 | TYPE_LIMIT | TIF_GTC | 57 | aux1 | ETH/USD-2-10 | buy | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 58 | aux2 | ETH/USD-2-10 | sell | 1 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 59 | aux2 | ETH/USD-2-10 | sell | 1 | 1100 | 0 | TYPE_LIMIT | TIF_GTC | 60 And the opening auction period ends for market "ETH/USD-1-10" 61 When the network moves ahead "1" blocks 62 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/USD-1-10" 63 And the trading mode should be "TRADING_MODE_CONTINUOUS" for the market "ETH/USD-2-10" 64 65 # Create a team 66 And the following teams with referees are created: 67 | referrer | prefix | code | team name | referees | balance | asset | 68 | referrer1 | ref1 | referral-code-1 | team1 | 4 | 10000000 | USD-1-10 | 69 70 @TeamStep 71 Scenario: Given a recurring transfer scoping multiple markets and specifying a non-zero target_notional_volume. When the volume is spread unevenly 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 STILL receive the same amount of rewards). (0056-REWA-236). 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 | 10000000 | 75 And the parties place the following orders: 76 | party | market id | side | volume | price | resulting trades | type | tif | 77 | aux1 | ETH/USD-1-10 | sell | 100 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 78 | party1 | ETH/USD-1-10 | buy | 100 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 79 | aux1 | ETH/USD-1-10 | sell | 100 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 80 | party2 | ETH/USD-1-10 | buy | 100 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 81 | aux3 | ETH/USD-1-10 | sell | 100 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 82 | ref1-0001 | ETH/USD-1-10 | buy | 100 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 83 | aux3 | ETH/USD-1-10 | sell | 100 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 84 | ref1-0002 | ETH/USD-1-10 | buy | 100 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 85 | aux1 | ETH/USD-2-10 | sell | 50 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 86 | party3 | ETH/USD-2-10 | buy | 50 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 87 | aux1 | ETH/USD-2-10 | sell | 50 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 88 | party4 | ETH/USD-2-10 | buy | 50 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 89 | aux3 | ETH/USD-2-10 | sell | 50 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 90 | ref1-0003 | ETH/USD-2-10 | buy | 50 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 91 | aux3 | ETH/USD-2-10 | sell | 50 | 1000 | 0 | TYPE_LIMIT | TIF_GTC | 92 | ref1-0004 | ETH/USD-2-10 | buy | 50 | 1000 | 1 | TYPE_LIMIT | TIF_GTC | 93 94 When the network moves ahead "1" epochs 95 # first the reward is scaled to 60% 96 # then market 1 gets 2/3 of the reward and market 2 gets a 1/3 and in each market the reward is split equally between the relevant parties 97 # because of rounding it doesn't get 500 as expected but 499 98 Then parties should have the following vesting account balances: 99 | party | asset | balance | 100 | party1 | USD-1-10 | 1000 | 101 | party2 | USD-1-10 | 1000 | 102 | party3 | USD-1-10 | 499 | 103 | party4 | USD-1-10 | 499 | 104 | ref1-0001 | USD-1-10 | 1000 | 105 | ref1-0002 | USD-1-10 | 1000 | 106 | ref1-0003 | USD-1-10 | 499 | 107 | ref1-0004 | USD-1-10 | 499 |