Make big draw stake-weighted and add min_epochs eligibility - #31
Merged
Conversation
- Update DrawType::Big to use stake-weighted selection (same as regular) - Add min_epochs_regular and min_epochs_big to staking-hub Config - Track per-user first stake epoch via USER_STAKE_EPOCH storage map - Add StakerInfo query for off-chain snapshot builder to check eligibility - Add UpdateConfig support for min_epochs params - Add unit tests for epoch tracking, staker info query, and config https://claude.ai/code/session_01NEJPs6qUL9kmJUNHj54Njy
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Both deploy_testnet.sh and deploy_testnet_fast.sh now include min_epochs_regular and min_epochs_big in the staking-hub instantiation message (defaulting to 1). https://claude.ai/code/session_01NEJPs6qUL9kmJUNHj54Njy
Each new stake now resets the user's stake_epoch to the current epoch, so newly added funds must also satisfy the min_epochs eligibility requirement before appearing in draw snapshots. https://claude.ai/code/session_01NEJPs6qUL9kmJUNHj54Njy
Query staker_info for the user's stake epoch and show an eligibility card in the portfolio overview. Compares epochs staked against min_epochs_regular and min_epochs_big from the hub config, showing a green/amber status for each draw type with remaining epochs count. https://claude.ai/code/session_01NEJPs6qUL9kmJUNHj54Njy
Add #[allow(clippy::too_many_arguments)] to update_config and apply rustfmt to test code. https://claude.ai/code/session_01NEJPs6qUL9kmJUNHj54Njy
Queries base_yield_bps, regular_pool_bps, big_pool_bps, and protocol_fee_bps from the staking hub config to show how staking rewards are split. Users can adjust stake amount and assumed INJ staking APR via a slider to see projected annual breakdowns. https://claude.ai/code/session_01NEJPs6qUL9kmJUNHj54Njy
Uses ChainGrpcMintApi (annual provisions) and ChainGrpcStakingApi (bonded pool, per-validator commission) to compute the effective staking APR. Validators are read from the staking hub config so the APR reflects the actual delegation set. The calculator slider now defaults to the live on-chain value when available. https://claude.ai/code/session_01NEJPs6qUL9kmJUNHj54Njy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://claude.ai/code/session_01NEJPs6qUL9kmJUNHj54Njy