Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: handle withdrawable and withdrawn staking events #189

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

gusin13
Copy link
Contributor

@gusin13 gusin13 commented Jan 2, 2025

Fixes - #188

@gusin13 gusin13 force-pushed the 188-add-staked-withdrawable-tvl branch from b91d9da to 20960c9 Compare January 3, 2025 11:50
}

// HandleWithdrawntakerStats decrements the withdrawable delegations count and
// increments the withdrawn delegations count for the given staking tx hash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can't think of a case where we need to know the withdrawn tvl or delegation as this number will always incrementing. more like a historical number.
If we remove this particular stat, will it make the solution a bit easier?

StakerPkHex string `bson:"_id"`
ActiveTvl int64 `bson:"active_tvl"`
ActiveDelegations int64 `bson:"active_delegations"`
WithdrawableTvl int64 `bson:"withdrawable_tvl"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a gap for the unbonding here.
If a delegation is unbonding, we deduce it from the activeTvl directly, right? but only add to the withdrawableTvl once the unbonding timelock expired.

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