feat(yield): automated liquidity reserve rebalancing & cross-asset yield aggregation vault - #424
Open
gelluisaac wants to merge 1 commit into
Open
Conversation
…eld aggregation vault (Nullifier-Systems#408) Idle escrow collateral now earns 4-8% APY while a dynamic 20% liquid reserve keeps cash-trade settlements instant. Contract layer: - Standalone Soroban YieldVaultContract (ERC-4626-style share accounting). Harvests raise the exchange rate without minting shares; the Nullifier-Systems#408 contributor invariant (rate NEVER decreases) is enforced arithmetically (rounding favors depositors) plus a defensive RateWouldDecrease guard. Full-exit sentinel exempt. - Escrow-side entry points: multisig-gated set_yield_vault / deploy_idle_to_vault and permissionless recall_from_vault (ceil-rounded share sizing so payouts never undershoot a waiting settlement; full-drain captures accrued yield). - Push-model deposits with balance-delta verification: contracts can deposit without SAC allowance dances, EOAs without approvals. Off-chain layer: - Migration 010: yield_vault_configs + provider_vault_shares (issue referenced 026; renumbered sequential per Nullifier-Systems#401 precedent). - buffer-optimizer.ts: demand-coverage + hysteresis-band policy in pure bigint/bps math. - strategy-adapter.ts: deterministic sim adapter, RPC-deadline Soroban adapter, assertExchangeRateNeverDecreases. - yieldRebalanceWorker.ts: per-tick compounding + optimizer-driven deploy/recall execution. - routes/yield-vaults.ts: POST /yield/harvest (rejects rate regressions pre-commit), provider withdraw funded buffer-first with sized instant-recall leg, admin config/rebalance, public snapshot. Per-vault promise locks serialize mutations. - liquidity-netting.ts: planInstantSettlementDraw(); store.ts: in-memory mirrors of migration 010; stellar.ts vault budgets. Frontend: - ProviderYieldPortal (/provider/yield): APY chart (pure SVG), TVL/buffer/health cards, harvest button, liquid-buffer slider; fully i18n'd (en/es). Tests: 11 Rust (share math, lifecycle monotonicity, escrow deploy/recall integration, fail-closed panics), 9 buffer-optimizer unit cases, 4-test concurrency stress suite (no double-spend under 50-way parallel withdrawals, stroop-exact conservation while a harvest races the storm, deterministic draw plans). Closes Nullifier-Systems#408
|
@gelluisaac is attempting to deploy a commit to the jotelfootball-tech's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Idle escrow collateral now earns 4-8% APY while a dynamic 20% liquid reserve keeps cash-trade settlements instant.
Contract layer:
Off-chain layer:
Frontend:
Tests: 11 Rust (share math, lifecycle monotonicity, escrow deploy/recall integration, fail-closed panics), 9 buffer-optimizer unit cases, 4-test concurrency stress suite (no double-spend under 50-way parallel withdrawals, stroop-exact conservation while a harvest races the storm, deterministic draw plans).
Closes #424