Repository navigation
Vault security & realtime: KMS signer, emergency redemption, live ticks, TWAB - #363
Merged
techisigu merged 6 commits intoOct 24, 2026
Merged
Conversation
…M Signing and Rol Closes Zenith-options#269
… Path That Bypass Closes Zenith-options#270
…demption Queue St Closes Zenith-options#271
…) Tracking for Va Closes Zenith-options#272
|
@vincentpeter0041-art 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! 🚀 |
- .env.local.example: merged [markers] — model resolved the conflict markers - docs/security/invariants.md: merged [markers] — model resolved the conflict markers - src/env.ts: merged [markers] — model resolved the conflict markers - 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Vault security & realtime: KMS signer, emergency redemption, live ticks, TWAB
What was solved
#269 — Implement Vault Admin Key Custody With KMS/HSM Signing and Role Rotation
Add a KMS/HSM-backed vault admin signing service with per-role policy enforcement, role separation and rotation, audit logging, non-secret signer configuration, and a key-management policy document — without touching the approval/timelock workflow or contract-side authorization.
Addressed:
#270 — Implement an Emergency Break-Glass Withdrawal Path That Bypasses Epoch Locks
Add a narrowly-scoped emergency break-glass redemption path for vault depositors, gated by a single on-chain
emergency_conditions_met()predicate (halt flag, stale NAV, or lifecycle failure state), priced off the last committed epoch snapshot NAV, with a configurable bps exit penalty, per-epoch rate limits and TVL caps, a distinct event for observability/audit, and corresponding frontend adapter + operator console + confirm-dialog disclosure. Normal epoch-boundary redemption and queued-withdrawal processing are explicitly out of scope.Addressed:
emergency_redeem) callable only when at least one objective on-chain trigger is true: operator-set halt flag, NAV timestamp older than the staleness window, or lifecycle state machine reporting a failure state.emergency_conditions_met()predicate.#271 — Stream Live Vault NAV, Epoch Progress, and Redemption Queue State Over the Existing Spot Feed
Extend the existing shared SpotFeed WebSocket context to also deliver live vault data (NAV per share, epoch number, seconds-to-epoch-close, queue depth, last-updated) keyed by vault id, expose typed hooks like useVaultTicks(vaultId), and render these live on the /vaults list and detail surfaces with a stale/offline indicator and reconnect-with-backoff. Reuse the existing socket owner and message envelope/versioning rather than adding a new realtime mechanism.
Addressed:
#272 — Implement Time-Weighted Average Balance (TWAB) Tracking for Vault Shares
Add a checkpointed cumulative-balance TWAB accumulator to the SEP-41 vault share token so governance weight and future tiering mechanisms read duration-weighted stake instead of instantaneous balances. Implement binary-searchable checkpoints written only on share mint/burn/transfer, expose balance_at(account, timestamp) and twab(account, start, end), specify rounding/zero-window semantics, document checkpoint retention/compaction, and migrate governance voting weight to read TWAB.
Addressed:
Changes
src/env.ts(modify).env.local.example(modify).github/workflows/release.yml(modify)security/key-management-policy.md(create)src/lib/api/vaults.ts(modify)src/lib/context/SpotFeedContext.tsx(create)docs/realtime-protocol.md(modify)docs/governance-proposal-wizard.md(modify)docs/security/invariants.md(modify)Approach
Issues
Closes #269
Closes #270
Closes #271
Closes #272