Skip to content

feat(yield): automated liquidity reserve rebalancing & cross-asset yield aggregation vault - #424

Open
gelluisaac wants to merge 1 commit into
Nullifier-Systems:mainfrom
gelluisaac:feat-408-yield-aggregation-vault
Open

feat(yield): automated liquidity reserve rebalancing & cross-asset yield aggregation vault #424
gelluisaac wants to merge 1 commit into
Nullifier-Systems:mainfrom
gelluisaac:feat-408-yield-aggregation-vault

Conversation

@gelluisaac

@gelluisaac gelluisaac commented Aug 24, 2026

Copy link
Copy Markdown

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 [FEAT] Automated Liquidity Reserve Rebalancing & Cross-Asset Yield Aggregation Vault #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 [FEAT] Enterprise Multi-Tenant RBAC/ABAC & KMS Key Delegation Architecture #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 #424

…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
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

@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.

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.

1 participant