Skip to content

No active stake count getter in FarmingPool #240

Description

@ritaifeoluwa

Description

The FarmingPool contract does not have a way to query the total number of active stakes across all users. While individual stakes are queryable, there is no aggregate count.

Current behavior

No active stake count getter.

Expected behavior

Maintain a running count:

fn active_stake_count(env: &Env) -> u32 {
    env.storage().instance().get(&DataKey::ActiveStakeCount).unwrap_or(0)
}

Increment on first stake, decrement when stake is fully removed.

Why this matters

Protocol analytics need active stake counts for adoption metrics.

Labels

enhancement, farming-pool, good first issue

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions