-
Notifications
You must be signed in to change notification settings - Fork 55
ZRX Portal - Staking Simulator #316
Description
One of the most requested features by ZRX Portal users is a tool that helps them simulate rewards based on a prospective stake.
The design team at 0xLabs prepared mocks of a sliding widget to be added to the Portal.
Designs
Behavior
Refer to prototype mode in the Figma file.
The widget slides laterally from the right. It's pre-populated with staking pool data, in condensed view. The additional data is available when clicking on 'more settings'.
At the bottom, the reward and the yearly return is estimated and returned to the user.
It's possible to manually enter values. When pool-related metrics are manually entered, the dropdown menu switched to 'Manual'.
Data (WIP)
Here's a rough mapping of the 0xAPI endpoints to be used to calculate the different fields
- Balance: via web3 call similarly to how it's done in the account page
- Fees generated by pool: https://api.0x.org/staking/pools/<POOL_ID> ->
totalProtocolFeesGeneratedInEthincurrentEpochStats - StakerRewards percentage: https://api.0x.org/staking/pools/<POOL_ID> -> 1-
operatorShareincurrentEpochStats - ZRX Staked in this Pool: https://api.0x.org/staking/pools/<POOL_ID> ->
zrxStakedincurrentEpochStats - Fees generated by all pools: via web3 hook here
- ZRX Staked by all Pool: https://api.0x.org/staking/epochs ->
zrxStakedincurrentEpoch(or nextEpoch if in the staking pool page)
Access
This widget is contextually available in multiple locations in the Portal:
- in the staking pool page, via a dedicated CTA button.
- in the account page, via a 'Calculate Rewards' button near the estimated reward for the staked pool. This section will have to be updated as well (as per designs)