Skip to content

Make big draw stake-weighted and add min_epochs eligibility - #31

Merged
danvaneijck merged 7 commits into
mainfrom
claude/update-staking-draw-weights-Y8rPd
Feb 12, 2026
Merged

Make big draw stake-weighted and add min_epochs eligibility#31
danvaneijck merged 7 commits into
mainfrom
claude/update-staking-draw-weights-Y8rPd

Conversation

@danvaneijck

Copy link
Copy Markdown
Owner
  • 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

- 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
@vercel

vercel Bot commented Feb 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chance-staking Ready Ready Preview, Comment Feb 12, 2026 4:28am

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
@danvaneijck
danvaneijck merged commit dddfd00 into main Feb 12, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants