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
![Screenshot 2024-06-05 at 10 30 48 PM](https://private-user-images.githubusercontent.com/3055344/337002782-6699fb8e-70d8-482d-a603-e80b8dedfbb1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4MDg2ODUsIm5iZiI6MTcyNDgwODM4NSwicGF0aCI6Ii8zMDU1MzQ0LzMzNzAwMjc4Mi02Njk5ZmI4ZS03MGQ4LTQ4MmQtYTYwMy1lODBiOGRlZGZiYjEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjhUMDEyNjI1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OGJmYzBlMzczZTVkNGM4MjJjMmFlMTU0NzkzYTdkYjUzMGI5ZGE2ZWVhMjQ4NTYwMWJkYzVlNjVjODA3ZDkwZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.5RPu69tLsr2T3s8wwjw3Aeaem1Ck0N_XMqihHAQKLsU)
rank_rewards
is added to DAppTierRewardsSame as tier rewards but contains rank rewards.
New field
![Screenshot 2024-06-05 at 10 29 28 PM](https://private-user-images.githubusercontent.com/3055344/337002926-438769c8-f18b-4649-8da2-f3710af2b4ba.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4MDg2ODUsIm5iZiI6MTcyNDgwODM4NSwicGF0aCI6Ii8zMDU1MzQ0LzMzNzAwMjkyNi00Mzg3NjljOC1mMThiLTQ2NDktOGRhMi1mMzcxMGFmMmI0YmEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjhUMDEyNjI1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDdhNGMxNjUzMGU4M2M4YzVhY2RjNmZiZTAzMjUwYTkzNWVmYTcxODNlOGU4YTI3MDg5MTI4YzAzZjgzNzVkNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.JaFki1_IWRZ5-9nJX8lwww8BhBoHifuxWqJ2LrjxIjk)
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.
![Screenshot 2024-06-05 at 10 44 22 PM](https://private-user-images.githubusercontent.com/3055344/337005292-f016bbcb-0876-4b7d-81ef-315b6082ec84.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4MDg2ODUsIm5iZiI6MTcyNDgwODM4NSwicGF0aCI6Ii8zMDU1MzQ0LzMzNzAwNTI5Mi1mMDE2YmJjYi0wODc2LTRiN2QtODFlZi0zMTViNjA4MmVjODQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjhUMDEyNjI1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTNhMWM1YzFhYmMxNWIxNTQxNjUzMzM0MmNjMjRkMDE4Y2JkMGFiMWQ1YzBkODY5YjMxMjY1YTMyY2M4NDgxYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.kMo0TIxq_TXvufo20ZSUKElZR-t2kTlTRgdrwqx1CWU)
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: