feat(house): house vault module — capital, policy caps, modes, clearing API#122
Draft
JaeLeex wants to merge 1 commit into
Draft
feat(house): house vault module — capital, policy caps, modes, clearing API#122JaeLeex wants to merge 1 commit into
JaeLeex wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
JaeLeex
marked this pull request as draft
July 8, 2026 12:34
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
nunchi-house: the house vault module of the hybrid AMM stack (PRD in PRD: Hybrid AMM design — house + CBC + off-chain bin manager #119). Owns vault capital accounting (free balance + per-market clearing reservations), per-vault risk policy (market allowlist, allocation cap, net-inventory cap, leverage ceiling),live/frozen/haltoperating modes, and the authorized-submitter registry.authorized_submitter,reserve_clearing_quote/release_clearing_quote, purevalidate_clearing_fill, andsettle_clearing_fill. Exposure caps bind only on exposure-increasing fills, so vaults can always trade back toward flat; the leverage ceilingL_maxcheck runs against the keeper-posted oracle price at settlement.NetInventory) rather than relying on platform signed-integer codec behavior.clob/perpetualsmodule pattern: transaction ops + ledger + db + genesis + optional rpc + deterministic tests,stability_scope!(ALPHA).Deliberate v1 boundaries
coins(same seam feat(clob): add spot order book module #117 took for fills).perpetuals).vaultstaxonomy entry — fold-in vs standalone is PRD open question 1.Test plan
cargo test -p nunchi-house(13 tests: codec, genesis, owner gates, mode gates, flat-book withdrawal, reservation caps, settlement round trip, frozen reduce-only, halt, net-inventory + leverage caps)cargo check --workspace --all-targetscargo check -p nunchi-house --no-default-featurescargo clippy -p nunchi-house --all-targets -- -D warningsStacking
Base is
jae/hybrid-amm-design(#119) →jae/spot-clob-module(#117). Landing order per the PRD: #117 → #119 → this → CBC. No chain wire tags allocated yet (coordinated against the final module set,perpetuals/ROADMAP.md§1).