Skip to content

Stop Vault Interest from Creating Unbacked or Repeated Yield - #122

Merged
Nabeelahh merged 1 commit into
Vaulty-X:mainfrom
ahmadogo:feat/vault
Aug 22, 2026
Merged

Stop Vault Interest from Creating Unbacked or Repeated Yield#122
Nabeelahh merged 1 commit into
Vaulty-X:mainfrom
ahmadogo:feat/vault

Conversation

@ahmadogo

Copy link
Copy Markdown
Contributor

The task has been completed according to all acceptance criteria and constraints.

Summary of Accomplishments
Per-Vault Last-Accrual Timestamp Tracking:

Added VaultKey::LastAccrual(VaultId) in

state.rs
, initialized to created_at on vault creation.
Accrual now calculates elapsed time strictly as elapsed = now.saturating_sub(last_accrual) and advances last_accrual to now.
Eliminated Overlapping & Repeated Accrual:

Implemented in

interest.rs
.
Invocations at the same timestamp yield 0 additional interest (elapsed == 0).
Split period accruals $[t_0, t_1]$ and $[t_1, t_2]$ are strictly disjoint and match $[t_0, t_2]$.
Backed Withdrawable Balances & Informational Yield:

VaultKey::Balance and balances_map strictly reflect deposited principal (1:1 backed by real tokens in vault custody).
Accrued interest is stored in VaultKey::VaultInterest as non-withdrawable informational metrics unless backed by on-chain funding.

Closes #118

@Nabeelahh
Nabeelahh merged commit 58564a2 into Vaulty-X:main Aug 22, 2026
1 check failed
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.

Stop Vault Interest from Creating Unbacked or Repeated Yield

2 participants