Skip to content

Add per-epoch premium disposition policy (COMPOUND vs DISTRIBUTE) with claimable distributions - #360

Merged
techisigu merged 3 commits into
Zenith-options:mainfrom
emilylevi025-wq:drips/275
Oct 24, 2026
Merged

techisigu merged 3 commits into
Zenith-options:mainfrom
emilylevi025-wq:drips/275

Conversation

@emilylevi025-wq

Copy link
Copy Markdown
Contributor

Summary

Add per-epoch premium disposition policy (COMPOUND vs DISTRIBUTE) with claimable distributions

What was solved

#275 — Implement Premium Distribution vs. Auto-Compounding Policy for Vault Epochs

Add a per-vault, per-epoch premium disposition policy (COMPOUND vs DISTRIBUTE) fixed at epoch open, with COMPOUND folding premiums into NAV before the snapshot and DISTRIBUTE routing premiums to an index-based claim accumulator that share holders at the snapshot can claim pro-rata, plus /vaults surfaces showing the mode and claimable amount/deadline.

Addressed:

  • Changed: src/lib/api/vaults.ts
  • Introduce a per-vault policy enum COMPOUND | DISTRIBUTE, with the mode fixed at epoch open and immutable for that epoch so it cannot be chosen after outcomes are known.
  • COMPOUND path: add collected premiums to vault assets before the NAV snapshot is committed, affecting NAV-per-share for all holders.
  • DISTRIBUTE path: move premiums to a distribution claim contract/account using an index-based claim-on-demand accumulator (not per-holder pushes); every snapshot share holder can claim pro-rata.

Changes

  • src/lib/api/vaults.ts (modify)

Approach

  1. Locate the vault/epoch contract sources and the /vaults API client and UI routes; confirm the epoch struct and snapshot commit point before editing.
  2. Add a per-vault PremiumPolicy enum (COMPOUND | DISTRIBUTE) stored at epoch open so the mode is immutable for that epoch, and expose it in vault configuration.
  3. Implement COMPOUND by folding collected premiums into vault assets before the NAV snapshot; implement DISTRIBUTE via an index-based claim accumulator funded from premiums, reusing the epoch snapshot, with a documented deadline/rollover for unclaimed amounts.
  4. Keep share accounting, fee accrual, and HWM identical across modes; handle mid-epoch transfers, redeemed holders, and rounding dust so sum(claims)+residual == collected premium.
  5. Surface the current mode in /vaults detail and portfolio, and for DISTRIBUTE show claimable amount and deadline per depositor via the vaults API client.
  6. Add unit tests for both modes (fee interaction, dust, conservation property) and Playwright coverage of the claim flow and mode indicator.

Issues

Closes #275

@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@emilylevi025-wq Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

techisigu and others added 2 commits October 24, 2026 20:34
- src/lib/api/vaults.ts: merged [markers] — model resolved the conflict markers

Co-authored-by: Simple Agent <agent@simple.dev>
- src/lib/api/vaults.ts: merged [markers] — model resolved the conflict markers

Co-authored-by: Simple Agent <agent@simple.dev>
@techisigu
techisigu merged commit e80271c into Zenith-options:main Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Premium Distribution vs. Auto-Compounding Policy for Vault Epochs

2 participants