Bittery Integration
Bittery Action Widget
https://partner.b14g.xyz/ibitteryBittery Stats API
This part outlines the API endpoints and data structures for retrieving information related to the current Bittery staking round.
1. Get Total BTC Deposited
API:
Example Response:
The users array contains a list of participants. Each user object includes:
address: The Ethereum address of the user.totalBtc: The total amount of BTC deposited by the user in this round (unit: wei).
To calculate the total BTC deposited across all participants in the current round, sum the totalBtc values from each element within the users array.
Based on the example response above:
2. Get Total Reward
API:
Example Response:
The totalReward field represents the estimated total reward for the current round (unit: wei).
Based on the example response above:
3. Get User Reward Contributions
API:
Example Response:
This API returns a list of the user's deposited BTC contributions (depositedYieldBtcs). Each element in the depositedYieldBtcs array represents a deposit and includes details such as the deposited btcAmount and the corresponding roundReward for that deposit (unit: wei).
To calculate the total reward contributions for a specific user, sum the roundReward values from each element within the depositedYieldBtcs array.
Based on the example response above:
4. Calculate Win Chance
The win chance can be estimated by dividing the Total Reward by the User Reward Contributions.
Formula:
Using the example values from above:
This can be interpreted as approximately a 1 in 1.09 chance.
5. Get User BTC Deposited
API:
Example Response:
This API returns details of a specific user's BTC deposits. The totalBtcDeposited field represents the total amount of BTC deposited by the user across all their contributions in the current round (unit: wei).
Based on the response above:
Last updated