Skip to content

No total banked credits aggregate in FarmingPool #246

Description

@ritaifeoluwa

Description

The FarmingPool contract does not have a way to query the total amount of credits banked across all users. While individual user credits are queryable, there is no aggregate.

Current behavior

No banked credits aggregate.

Expected behavior

Maintain a running total:

fn total_banked_credits(env: &Env) -> i128 {
    env.storage().instance().get(&DataKey::TotalBankedCredits).unwrap_or(0)
}

Update during checkpoints and withdrawals.

Why this matters

Protocol analytics need total banked credits for reward distribution calculations.

Labels

enhancement, farming-pool, help wanted

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or requestfarming-poolFarmingPool contracthelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions