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
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:
Update during stake/unstake/lock/unlock.
Why this matters
Protocol analytics need deposit/withdrawal totals for flow analysis.
Labels
enhancement, farming-pool, help wanted