Skip to content

feat(contract): implement repayment-waterfall delinquency handling - #65

Merged
codemagician1949 merged 1 commit into
IntensifierLab:mainfrom
kulayddon:feat/issue-21-delinquency-handling
Aug 21, 2026
Merged

codemagician1949 merged 1 commit into
IntensifierLab:mainfrom
kulayddon:feat/issue-21-delinquency-handling

Conversation

@kulayddon

Copy link
Copy Markdown
Contributor

Closes #21

  • set_grace_period() configures a per-pool grace period (seconds)
  • mark_invoice_due() registers when an invoice's repayment became due, starting the grace-period clock
  • declare_default() errors if the due date isn't set, the invoice is already defaulted, or the grace period hasn't elapsed; otherwise marks the invoice defaulted and applies the loss to pool-manager's reserve (apply_reserve_delta), which reduces capital/NAV and so proportionally reduces every LP's share value
  • InvoiceDefaulted event emitted
  • Tests: default after grace period reduces pool capital, blocked before grace elapses, blocked on double-default, blocked with no due date

@kulayddon
kulayddon force-pushed the feat/issue-21-delinquency-handling branch 2 times, most recently from 361c811 to 0e12ff0 Compare August 19, 2026 15:15
- set_grace_period() configures a per-pool grace period (seconds)
- mark_invoice_due() registers when an invoice's repayment became due,
  starting the grace-period clock
- declare_default() errors if the due date isn't set, the invoice is
  already defaulted, or the grace period hasn't elapsed; otherwise marks
  the invoice defaulted and applies the loss to pool-manager's reserve
  (apply_reserve_delta), which reduces capital/NAV and so proportionally
  reduces every LP's share value
- InvoiceDefaulted event emitted
- Distinct from the existing circuit breaker (aggregate default-volume
  surge protection) — this is per-invoice grace-period tracking
- InvoiceDueKey/InvoiceDefaultedKey carry a marker field so their storage
  slots can't collide with other single-Symbol keys (contracttype tuple
  structs have no type discriminant)
- Tests: default after grace period reduces pool capital, blocked before
  grace elapses, blocked on double-default, blocked with no due date

Closes IntensifierLab#21
@kulayddon
kulayddon force-pushed the feat/issue-21-delinquency-handling branch from 0e12ff0 to 43de267 Compare August 21, 2026 01:17
@codemagician1949
codemagician1949 merged commit ad44bcd into IntensifierLab:main Aug 21, 2026
3 checks passed
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.

feat(contract): implement repayment-waterfall delinquency handling

2 participants