Skip to content

No total deposits/withdrawals aggregate in FarmingPool #251

Description

@ritaifeoluwa

Description

The FarmingPool contract does not have a way to query the total amount of tokens transferred in/out of the contract. While individual transfers are trackable via events, there is no aggregate.

Current behavior

No transfer aggregate.

Expected behavior

Maintain running totals:

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

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

Update during stake/unstake/lock/unlock.

Why this matters

Protocol analytics need deposit/withdrawal totals for flow analysis.

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