Skip to content

Add per-claim caps and cooldown windows to the insurance pool #10

Description

@Meshmulla

Summary

The insurance pool (soroban/src/insurance_pool.rs) is meant to cover losses, but without limits a single large or rapid series of claims could drain it and destabilize the system. Adding per-claim caps and cooldown windows makes payouts safer and more predictable.

What we'd like

  • A configurable maximum payout per claim (absolute and/or percentage of pool)
  • A cooldown window between claims from the same claimant
  • Clear, specific errors when a claim exceeds the cap or is within cooldown

Where to look

  • soroban/src/insurance_pool.rs — claim logic
  • soroban/src/emergency_fund_recovery.rs — related fund-safety patterns
  • soroban/tests/insurance_pool.test.rs — extend coverage
  • soroban/src/rate_limiter.rs — reusable cooldown/window mechanics

Acceptance criteria

  • Per-claim cap is enforced and admin-configurable
  • Cooldown between claims is enforced per claimant
  • Over-cap and in-cooldown claims revert with descriptive errors
  • Tests cover valid claims, over-cap claims, and cooldown enforcement

Notes

Keep the caps as parameters (with defaults) so they can be tuned via governance without a redeploy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions