Skip to content

Latest commit

Β 

History

History
70 lines (46 loc) Β· 2.8 KB

File metadata and controls

70 lines (46 loc) Β· 2.8 KB

Async Settlement RWA Vault

An ERC-4626 vault that enforces real T+1/T+2 settlement delays for tokenized real-world assets (Treasuries, private credit) while maintaining maximum capital efficiency and stable NAV.

No forced liquidity buffers. No artificial instant redemptions. Just realistic operations β€” on-chain.

Why This Exists

Most RWA vaults in 2025 are either:

  • Instant (sacrifice yield for liquidity)
  • Fully permissioned/off-chain (no composability)

This vault models the real operational friction of institutional assets:

  • Redemption requests lock price immediately
  • 48-hour configurable delay before claim
  • Admin deposits realized yield in batches

Async redemption flow with RWA-specific enhancements (stable NAV, slippage, compliance rescind).

Key Features

  • Stable NAV accounting β€” override totalAssets() to subtract pending liabilities β†’ no redemption-induced price spikes
  • _decimalsOffset = 12 β€” maximum inflation attack protection for 6-decimal USDC
  • Slippage protection β€” minAssets param in requestRedeem
  • cancelRedeem β€” fat-finger recovery before claimable (with late-cancel block for ops protection)
  • rescindRedemption β€” admin compliance override (sanctions/blocked claims)
  • InsufficientLiquidity error β€” clear UX when vault is dry
  • depositYield β€” admin injects off-chain realized returns

Testing & Proof

  • Unit tests β€” happy paths, edges, reverts
  • Invariant fuzzing β€” 1000 runs Γ— 128 depth β†’ solvency and accounting invariants hold
  • Fork tests β€” mainnet + Sepolia with official Circle USDC (real proxy, blacklist logic)
  • CI β€” fmt, build, unit, invariants, fork, gas snapshot, coverage

Live on Sepolia

Vault: 0x9dC96F7D1161F2E40b1D855C57c5FD2a46cFf6b5 (verified)

Assumptions & Known Trade-offs

  • Yield is realized only β€” admin deposits net returns (matches batch ops)
  • Pending redeemers forfeit accrual during delay β€” incentive to stay
  • Admin is trusted multisig for yield deposit and rescind
  • Compliance events handled by rescindRedemption (funds remain in vault)
  • No on-chain continuous accrual oracle (by design β€” avoids centralization)

Running Locally

forge test -vvv                    # unit + invariants (local Anvil)
forge test --fork-url $MAINNET_RPC # fork tests on mainnet

πŸ‘¨β€πŸ’» Author

Kalyan TR

Former regulated-domain QA (Finance + Healthcare) β†’ transitioning to Web3 Security Active on CodeHawks & Code4rena

GitHub


πŸ“„ License

This project is licensed under the MIT License β€” see LICENSE for details.