Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple interface for group policies #857

Open
christoph2806 opened this issue Feb 2, 2025 · 0 comments
Open

Simple interface for group policies #857

christoph2806 opened this issue Feb 2, 2025 · 0 comments
Labels
Milestone

Comments

@christoph2806
Copy link
Member

christoph2806 commented Feb 2, 2025

Proposal:

We need an interface to create policies with arbitrary number of beneficiaries and otherwise identical parameters.

  • In the product contract, you should be able to call applyForPolicy with a list of tuples (address, premium) which would then create a single policy but connected to a list of (address, premium) tuples.
  • For each address, the premium should be collected,
  • In case of a payout, each beneficiary receives a pro-rata amount of the payout.
  • There is only a single policy to reduce gas costs
  • It should be possible to add more beneficiaries as long as the policy is in theApplied state.
  • In case of a very large number of beneficiaries, the payout could be conducted in batches, to prevent reaching the gas limit.

Rationale:

  • This could massively reduce gas cost for the typical scenario where we have only a very small number of different risks but for each risk we have a large number of beneficiaries with otherwise identical parameters.
  • Adding more beneficiaries should be a very gas efficient process
  • Payout in batches would also reduce the gas cost per beneficiary massively.
  • For large numbers of beneficiaries, the total gas cost should converge to the gas costs of the token transfer for premium and payout.
@christoph2806 christoph2806 added this to the GIF v3 milestone Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant