You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're close to merge PR
Required changes are minimal.
New property rank_rewards is added to DAppTierRewards
Same as tier rewards but contains rank rewards.
New field rank is added to event DAppReward
RankedTier type is still u8 like TierId but it contains 2 values (rank & tier). This is done in order to keep PoV low.
Tier exists on the first byte, use bitwise AND to get the value const tier_id = value & 0xf
to get rank exists on the second byte, do a right shift 4 bits to get the value const rank = value >> 4
You can implement this even before the release because old tier values are from 0 to 3 and the rank will be zero.
DAppStakingApi is bumped to version 2. Nothing is changed here expect the return value which is still the same (u8) but represents different value, which is the encoded RankedTier value, so that's why we bumped it.
Reward calculation
Tier reward is the same rewards[tier]
Rank reward calculation is very simple rank * rank_rewards[tier]
Final amount amount = rewards[tier] + rank * rank_rewards[tier]
The text was updated successfully, but these errors were encountered:
We're close to merge PR
Required changes are minimal.
New property
rank_rewards
is added to DAppTierRewardsSame as tier rewards but contains rank rewards.
New field
rank
is added to event DAppRewardRankedTier type is still u8 like TierId but it contains 2 values (rank & tier). This is done in order to keep PoV low.
Tier exists on the first byte, use bitwise AND to get the value
const tier_id = value & 0xf
to get rank exists on the second byte, do a right shift 4 bits to get the value
const rank = value >> 4
You can implement this even before the release because old tier values are from 0 to 3 and the rank will be zero.
DAppStakingApi is bumped to version 2. Nothing is changed here expect the return value which is still the same (u8) but represents different value, which is the encoded RankedTier value, so that's why we bumped it.
Reward calculation
Tier reward is the same
rewards[tier]
Rank reward calculation is very simple
rank * rank_rewards[tier]
Final amount
amount = rewards[tier] + rank * rank_rewards[tier]
The text was updated successfully, but these errors were encountered: