Aegis Vault
Aegis Vault is a verifiable AI-managed trading vault on 0G where users define strict on-chain risk mandates, operators compete by committing AI models + strategies on-chain, and smart contracts enforc
视频




技术栈
描述
Aegis Vault is a non-custodial, AI-managed trading vault for crypto assets. Users deposit capital, choose a risk profile, and an AI strategy trades within rules the user defines — without ever taking custody of the funds. Today, anyone who wants AI-driven trading has two bad options. DeFi protocols are trust-minimized but offer no alpha. Centralized AI bots offer alpha but require giving up custody and trusting an off-chain operator. Aegis Vault is the third option: **alpha-seeking strategies with the trust model of DeFi.** The user's funds stay in a smart contract they control. The AI can only propose trades — the contract decides whether to execute them based on guardrails the user set at deposit time (max position size, daily loss cap, cooldown between trades, allowed assets, stop-loss).
The product has three audiences:
Vault owners (depositors)** pick an operator from a marketplace, set their risk profile, and deposit. They keep withdraw rights at all times. They can pause the vault, swap operators, or pull funds whenever they want.
Operators** are independent strategy providers who register on-chain, publish their AI strategy, and earn performance + management fees from vaults that hire them. Their stake and reputation are on-chain and slashable if they violate the strategy they committed to. - **Governance token holders** vote on protocol parameters, slashing decisions, and which operators are blacklisted.
Beyond the basic vault**, the product includes a **privacy mode** that hides trade decisions from MEV front-runners until execution, an **operator marketplace** with public fee schedules and reputation, and an **insurance pool** that backstops operator misbehavior. Everything that matters — deposits, trades, policy changes, fee accruals, governance votes — is verifiable on-chain.
本次黑客松进展
Built Aegis Vault from zero to live on 0G Aristotle Mainnet during the hackathon window — 18 contracts deployed, organic AI-driven executions verified on-chain.
### Smart contracts (Track 2 sealed mode)
- Designed & implemented sealed strategy mode from scratch: `VaultPolicy` extended with `sealedMode` + `attestedSigner`, `ExecutionIntent` with `attestationReportHash`, `commitIntent()` + `executeIntent(intent, sig)` with commit-reveal + ECDSA verify
- Full EIP-712 typed data hashing with domain separator binding chain ID + vault address (cross-chain replay protection)
- Aggressive slimming: 16KB vault → 3.4KB via 3 external DELEGATECALL libraries (SealedLib, ExecLib, IOLib) + EIP-1167 factory (19KB → 2.7KB)
- 18 contracts total on mainnet (factory, vault impl, 3 libraries, registry v2, staking, reputation, governance, treasury, insurance, NAV calc, venue adapter, mocks)
### Operator marketplace v2
- Extended `OperatorRegistry` with `publishManifest(uri, hash, bonded)` + `declareAIModel(model, provider, endpoint)` — operators commit strategy + AI model on-chain
- Bonded manifests are slashable by governance if execution deviates from published rules
- Frontend: AI model dropdown (fetched live from 0G Compute `listService()`) + manifest JSON upload form (auto-computes keccak256 hash)
- Marketplace displays AI badge + bonded/manifest indicators per operator
### Production-grade orchestrator
- Vault indexer (O(1) lookups, event-driven, persists across restarts) — replaces O(N) RPC scans
- Multi-wallet executor pool with `NonceManager` + deterministic sharding (`hash(vault) % poolSize`) — no nonce collisions across parallel cycles
- Parallel vault processing via `p-limit` (configurable `VAULT_CONCURRENCY`)
- Exponential backoff retry (3x for tx, 2x for 0G Compute), session idempotency, 60s block-polling timeout
- Decentralized operator model — each operator self-hosts their orchestrator, manages only vaults that selected them
### Frontend (React 19 + wagmi + viem)
- 6-step Create Vault wizard with sealed mode toggle, 3-persona landing page CTAs
- Operator register flow with AI model selection + strategy manifest publish
- Operator marketplace with AI + manifest badges, Governance M-of-N UI, Token Faucet, AI Actions journal feed
- Full 0G mainnet integration
### Frontend UX hardening (Operator Register + Create Vault)
- **Toast notification system** (sonner) — global success/error toasts replace silent failures across all on-chain writes
- **Blockchain error parser** (`lib/txErrors.js`) — maps viem reverts (`InsufficientAllowance`, `TierCapExceeded`, `OperatorFrozen`, gas, nonce, user reject) to human-readable titles + remediation steps
- **Granular TX phase tracking** (`lib/txPhase.js`) — distinguishes "waiting for wallet signature" vs "confirming on-chain" vs "success" so users always know what they're waiting on
- **Reusable `ConfirmModal`** — pre-submit review for both Operator Register (fees, mandate, recommended policy) and Create Vault (deposit, risk, assets, executor, year-one fee estimate)
- **`NetworkWarning` component** — auto-detects when required contract isn't deployed on the connected chain and offers a one-click `switchChain()` to the right network
- **Draft auto-save** (`lib/useDraftState.js`) — per-wallet localStorage persistence with debounced writes, "Reset draft" affordance, and automatic clear on successful on-chain confirm
- **Real-time validation** — Operator manifest JSON parsed on every keystroke (visual valid/invalid state), fee sliders show inline cap warnings, Create Vault tier-cap warning surfaces at deposit step (not buried in Step 6), min-1-asset enforced before Continue
- **Multi-phase deploy progress** — elapsed-seconds counter, "Don't close this tab" warning, per-phase status (Deploy → Approve → Deposit), parsed-error retry with phase-aware recovery
- **Mobile + accessibility** — sticky mobile progress bar, ARIA roles on mandate radios / asset checkboxes / sealed-mode switch, `aria-current="step"` on the wizard stepper, sliders with `aria-valuemin/max/now`
- **Removed auto-redirect on success** — operator register now shows persistent confirmation card with explorer link + "Go to marketplace" CTA, so users can verify their tx before navigating away
### CI/CD + Testing + Docs
- `.github/workflows/security.yml` — Slither static analysis on every push
- 28/28 tests passing for slim build (sealed mode, commit-reveal, EIP-712)
- Complete docs: README, ARCHITECTURE, DEMO, OPERATOR_GUIDE, STRATEGY_MANIFEST + example JSON, AI_AGENT_DECISION_FLOW
### Metrics
- **100+ commits** during hackathon
- **~12,000 lines** of Solidity + TypeScript + documentation
- **18 contracts** deployed to 0G Aristotle mainnet
- **Multiple verified on-chain executions** including organic AI-driven sealed mode flow
融资状态
**Current status:** 🟡 Not actively fundraising. Bootstrapped through hackathon.
**Team & funding context:**
- **Solo builder** (self-funded, hackathon-bootstrapped)
- **Built from scratch during hackathon** — no prior codebase, no grants, no pre-committed capital
- **Gas costs self-covered** (~7 0G for full mainnet deploy + testing)
- **No token planned** — protocol revenue flows to `ProtocolTreasury` contract, governed by M-of-N multi-sig; intended for audit costs, bug bounties, insurance pool top-ups
**What seed funding would enable (if/when raised):**
| Priority | Item | Estimated cost |
|---|---|---|
| 1 | Smart contract audit (Certik / OpenZeppelin / Trail of Bits) | $30–80k |
| 2 | Insurance underwriting (Nexus Mutual or native pool capitalization) | $50–200k |
| 3 | Dedicated orchestrator infrastructure (multi-region, monitoring, SLA) | $30k/yr |
| 4 | Frontend redesign + compliance review for regulated capital access | $40k |
| 5 | Operator bootstrap grants (pay first 5 operators to run orchestrators) | $50k |
| 6 | Community + developer relations | $30k/yr |
**Total target seed raise:** $500k–$1M — to ship Aegis to audited, insured, institutional-grade production.
**Asks from 0G Foundation / hackathon organizers:**
- Dedicated 0G RPC endpoint for orchestrator (current public RPC has reliability issues)
- Access to TEE-attested 0G Compute providers (for genuine hardware-grade sealed mode)
- Feedback on vault factory gas patterns (block gas limit fluctuations caused deployment challenges)
- Connection to ecosystem insurance partners if/when we mature
**Open to:**
- Ecosystem grants (builds-on-0G grants, Track 2 winner prize)
- Strategic angel investors (DeFi operators, TradFi hedge funds exploring AI vaults)
- Technical partnerships (Gelato for keeper network, The Graph for subgraph indexing, Pyth for extended oracle coverage)
**Not open to:**
- Extractive token launches
- Retail-only accelerators without regulatory support
- Anything that would compromise the "contract enforces" trust model
**Timeline:**
- **Short-term** (4 weeks post-hackathon): polish, public beta with 3 whitelisted operators, first external deposits
- **Medium-term** (3 months): smart contract audit, launch ERC-4626 vault shares, strategy template registry
- **Long-term** (6–12 months): seed fundraise conditional on traction (TVL > $1M, >10 active operators, audit-clean report)