Skip to content

Add total_settled_amount_all() summing settled amount across every lifecycle statusΒ #78

Description

@Jagadeeshftw

πŸ“Œ Description

total_liquidity_all() sums total liquidity across every asset in one call, and contract_info() gives a version/paused/fee/count snapshot β€” but there's no single-call equivalent summing total_settled_amount(status) across every status, so a dashboard wanting an overall settled-volume figure has to call the per-status variant once per known status and sum client-side.

🧩 Requirements and context

  • Add total_settled_amount_all(env) -> i128 summing settled amount across every settlement status, mirroring total_liquidity_all()'s pattern.
  • No change to the existing per-status total_settled_amount(status).
  • Consider whether it belongs alongside contract_info()'s snapshot fields, or stays a standalone read β€” pick one and be consistent with existing naming conventions.

πŸ› οΈ Suggested execution

  • Add the new pub fn to src/lib.rs, reusing whatever aggregate-tracking storage.rs maintains per status.
  • Add tests in src/test.rs verifying the sum matches manually adding every per-status call.
  • Update the README's Settlement table.

βœ… Acceptance criteria

  • total_settled_amount_all() returns the correct cross-status sum.
  • Existing per-status reads are unaffected.
  • Documented in the README.

πŸ”’ Security notes

Read-only addition; no new attack surface.

πŸ“‹ Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox open-source programMaybe RewardedGrantFox: potentially rewarded contributionOfficial Campaign | FWC26GrantFox official campaign issueenhancementNew feature or improvement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions