feat(trading): add cap reward fee multiple on the reward cards (#5999)

This commit is contained in:
m.ray 2024-03-14 18:42:23 +02:00 committed by GitHub
parent bd14c2a39a
commit be8de04686
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 51 additions and 1 deletions

View File

@ -384,6 +384,25 @@ const RewardCard = ({
})}
</span>
</span>
{/** CAPPED AT */}
{dispatchStrategy.capRewardFeeMultiple && (
<span className="flex flex-col">
<span className="text-muted text-xs">{t('Capped at')}</span>
<Tooltip
description={t(
'Reward will be capped at {{capRewardFeeMultiple}} X of taker fees paid in the epoch',
{
capRewardFeeMultiple:
dispatchStrategy.capRewardFeeMultiple,
}
)}
>
<span data-testid="cappedAt">
x{dispatchStrategy.capRewardFeeMultiple}
</span>
</Tooltip>
</span>
)}
</div>
{/** DISPATCH METRIC DESCRIPTION */}
{dispatchStrategy?.dispatchMetric && (

View File

@ -79,6 +79,7 @@ query ActiveRewards(
startEpoch
endEpoch
dispatchStrategy {
capRewardFeeMultiple
dispatchMetric
dispatchMetricAssetId
marketIdsInScope

View File

@ -18,7 +18,7 @@ export type ActiveRewardsQueryVariables = Types.Exact<{
}>;
export type ActiveRewardsQuery = { __typename?: 'Query', transfersConnection?: { __typename?: 'TransferConnection', edges?: Array<{ __typename?: 'TransferEdge', node: { __typename?: 'TransferNode', transfer: { __typename?: 'Transfer', amount: string, id: string, from: string, fromAccountType: Types.AccountType, to: string, toAccountType: Types.AccountType, reference?: string | null, status: Types.TransferStatus, timestamp: any, gameId?: string | null, reason?: string | null, asset?: { __typename?: 'Asset', id: string, symbol: string, decimals: number, name: string, quantum: string, status: Types.AssetStatus } | null, kind: { __typename?: 'OneOffGovernanceTransfer' } | { __typename?: 'OneOffTransfer' } | { __typename?: 'RecurringGovernanceTransfer' } | { __typename?: 'RecurringTransfer', startEpoch: number, endEpoch?: number | null, dispatchStrategy?: { __typename?: 'DispatchStrategy', dispatchMetric: Types.DispatchMetric, dispatchMetricAssetId: string, marketIdsInScope?: Array<string> | null, entityScope: Types.EntityScope, individualScope?: Types.IndividualScope | null, teamScope?: Array<string | null> | null, nTopPerformers?: string | null, stakingRequirement: string, notionalTimeWeightedAveragePositionRequirement: string, windowLength: number, lockPeriod: number, distributionStrategy: Types.DistributionStrategy, rankTable?: Array<{ __typename?: 'RankTable', startRank: number, shareRatio: number } | null> | null } | null } }, fees?: Array<{ __typename?: 'TransferFee', transferId: string, amount: string, epoch: number } | null> | null } } | null> | null } | null };
export type ActiveRewardsQuery = { __typename?: 'Query', transfersConnection?: { __typename?: 'TransferConnection', edges?: Array<{ __typename?: 'TransferEdge', node: { __typename?: 'TransferNode', transfer: { __typename?: 'Transfer', amount: string, id: string, from: string, fromAccountType: Types.AccountType, to: string, toAccountType: Types.AccountType, reference?: string | null, status: Types.TransferStatus, timestamp: any, gameId?: string | null, reason?: string | null, asset?: { __typename?: 'Asset', id: string, symbol: string, decimals: number, name: string, quantum: string, status: Types.AssetStatus } | null, kind: { __typename?: 'OneOffGovernanceTransfer' } | { __typename?: 'OneOffTransfer' } | { __typename?: 'RecurringGovernanceTransfer' } | { __typename?: 'RecurringTransfer', startEpoch: number, endEpoch?: number | null, dispatchStrategy?: { __typename?: 'DispatchStrategy', capRewardFeeMultiple?: string | null, dispatchMetric: Types.DispatchMetric, dispatchMetricAssetId: string, marketIdsInScope?: Array<string> | null, entityScope: Types.EntityScope, individualScope?: Types.IndividualScope | null, teamScope?: Array<string | null> | null, nTopPerformers?: string | null, stakingRequirement: string, notionalTimeWeightedAveragePositionRequirement: string, windowLength: number, lockPeriod: number, distributionStrategy: Types.DistributionStrategy, rankTable?: Array<{ __typename?: 'RankTable', startRank: number, shareRatio: number } | null> | null } | null } }, fees?: Array<{ __typename?: 'TransferFee', transferId: string, amount: string, epoch: number } | null> | null } } | null> | null } | null };
export type RewardsHistoryQueryVariables = Types.Exact<{
partyId: Types.Scalars['ID'];
@ -150,6 +150,7 @@ export const ActiveRewardsDocument = gql`
startEpoch
endEpoch
dispatchStrategy {
capRewardFeeMultiple
dispatchMetric
dispatchMetricAssetId
marketIdsInScope

View File

@ -29,6 +29,7 @@
"Best offer": "Best offer",
"Browse": "Browse",
"By using the Vega Console, you acknowledge that you have read and understood the <0>Vega Console Disclaimer</0>": "By using the Vega Console, you acknowledge that you have read and understood the <0>Vega Console Disclaimer</0>",
"Capped at": "Capped at",
"Cancel": "Cancel",
"Change (24h)": "Change (24h)",
"Changes have been proposed for this market. <0>View proposals</0>": "Changes have been proposed for this market. <0>View proposals</0>",
@ -299,6 +300,7 @@
"Rewards funded using the pro-rata strategy should be distributed pro-rata by each entity's reward metric scaled by any active multipliers that party has": " Rewards funded using the pro-rata strategy should be distributed pro-rata by each entity's reward metric scaled by any active multipliers that party has",
"Rewards history": "Rewards history",
"Rewards multipliers": "Rewards multipliers",
"Reward will be capped at {{capRewardFeeMultiple}} X of taker fees paid in the epoch": "Reward will be capped at {{capRewardFeeMultiple}} X of taker fees paid in the epoch",
"SCCR": "SCCR",
"Search": "Search",
"See all markets": "See all markets",

View File

@ -4959,6 +4959,8 @@ export type Query = {
* If a team does not have at least the number of epochs worth of data, it is ignored.
*/
teamsStatistics?: Maybe<TeamsStatisticsConnection>;
/** Time weighted notional position is a metric used to determine if a reward should be paid to a party */
timeWeightedNotionalPosition?: Maybe<TimeWeightedNotionalPosition>;
/** Get total transfer fee discount available */
totalTransferFeeDiscount?: Maybe<TotalTransferFeeDiscount>;
/** Get a list of all trades and apply any given filters to the results */
@ -5462,6 +5464,15 @@ export type QueryteamsStatisticsArgs = {
};
/** Queries allow a caller to read data and filter data via GraphQL. */
export type QuerytimeWeightedNotionalPositionArgs = {
assetId: Scalars['ID'];
epochSeq?: InputMaybe<Scalars['Int']>;
gameId: Scalars['ID'];
partyId: Scalars['ID'];
};
/** Queries allow a caller to read data and filter data via GraphQL. */
export type QuerytotalTransferFeeDiscountArgs = {
assetId: Scalars['String'];
@ -6615,6 +6626,22 @@ export type TimeUpdate = {
timestamp: Scalars['Timestamp'];
};
export type TimeWeightedNotionalPosition = {
__typename?: 'TimeWeightedNotionalPosition';
/** Settlement asset for this position */
assetId: Scalars['ID'];
/** Epoch the time weighted notional position was calculated for */
epoch: Scalars['Int'];
/** Game the time weighted notional position was calculated for */
gameId: Scalars['ID'];
/** Time of the last block in which the metric was updated */
lastUpdated: Scalars['Timestamp'];
/** Party holding the position */
partyId: Scalars['ID'];
/** Time weighted notional position */
timeWeightedNotionalPosition: Scalars['String'];
};
/** Returns total transfer fee discount available */
export type TotalTransferFeeDiscount = {
__typename?: 'TotalTransferFeeDiscount';