<p align="center">
<img src="./assets/banner.png" alt="CuratedLP Banner" width="100%" />
</p>
<h1 align="center">CuratedLP</h1>
<p align="center"><i>AI Agent-Managed Liquidity Vaults on Uniswap v4</i></p>
<p align="center">
A Uniswap v4 hook on Base that turns a standard liquidity pool into a managed vault. Human LPs deposit tokens and choose an AI curator agent. The curator uses Venice AI's private inference — verified inside an EigenCompute TEE — to analyze market data, adjust concentrated liquidity ranges, and set dynamic swap fees. Every execution log is stored on Filecoin with PDP proofs and indexed on-chain via a LogRegistry contract. The human retains full withdrawal rights at all times. The curator's permissions are scoped via MetaMask Delegation Framework — it can rebalance but never withdraw LP funds.
</p>
<p align="center">
<a href="#"><img src="https://img.shields.io/badge/Built%20on-Uniswap%20v4-FF007A?style=for-the-badge&logo=uniswap&logoColor=white" /></a>
<a href="#"><img src="https://img.shields.io/badge/AI-Venice%20AI-7C3AED?style=for-the-badge" /></a>
<a href="#"><img src="https://img.shields.io/badge/Network-Base-0052FF?style=for-the-badge&logo=coinbase&logoColor=white" /></a>
<a href="#"><img src="https://img.shields.io/badge/Hackathon-Synthesis%202026-00D632?style=for-the-badge" /></a>
</p>
<p align="center">
<a href="#-the-problem">Problem</a> •
<a href="#-how-curatedlp-works">How It Works</a> •
<a href="#-system-flow">System Flow</a> •
<a href="#-smart-contracts">Contracts</a> •
<a href="#-integrations">Integrations</a> •
<a href="#-tech-stack">Tech Stack</a> •
<a href="#-quick-start">Quick Start</a>
</p>
Concentrated liquidity on Uniswap v3/v4 offers dramatically higher capital efficiency ā but it demands constant, active management. Most LPs face three painful realities:
| Gap | Why It Matters |
|-----|---------------|
| Active management required | Concentrated LP positions go out of range as prices move. LPs who don't rebalance earn zero fees. Most retail LPs can't watch markets 24/7. |
| No trustless delegation | LPs who want to delegate to a manager must hand over full custody. There's no way to say "you can rebalance but never withdraw my funds." |
| Manager accountability is zero | Fund managers have no verifiable on-chain track record. LPs choose blindly. Poor performance has no consequences, good performance has no proof. |
The result: most concentrated liquidity is either passively mismanaged (earning nothing) or locked in opaque vaults with full-custody risk.
No existing protocol solves all three simultaneously.
How CuratedLP Works
CuratedLP is a complete vault primitive where the AI agent operates autonomously but can never touch LP funds:
LPs deposit wstETH + USDC into the vault. An AI curator ā orchestrated by OpenClaw on a 5-minute heartbeat and deployed on DigitalOcean ā analyzes markets privately via Venice AI inside an EigenCompute TEE. It rebalances the position and adjusts fees via MetaMask delegation. Every decision is logged to Filecoin with verifiable proofs. Performance is recorded on-chain via ERC-8004 ReputationRegistry.
The Lifecycle
| Phase | What Happens | Trust Model |
|-------|-------------|-------------|
| A. Curator Registration | Agent registers with ERC-8004 identity NFT. Identity is load-bearing ā no NFT, no registration. | On-chain identity verification |
| B. LP Deposit | LP deposits wstETH + USDC, receives VaultShare tokens (ERC-20). Hook adds liquidity to the Uniswap v4 pool at the current tick range. | LP retains shares = withdrawal rights |
| C. Delegation Setup | LP creates a MetaMask smart account, delegates rebalance authority to the curator with custom caveats: correct target, allowed functions, fee bounds, rate limiting. | Curator can rebalance, never withdraw |
| D. AI Analysis | Every 5 minutes: agent reads pool state, fetches market data from Uniswap Trading API, sends everything to Venice AI for private inference inside an EigenCompute TEE. Returns attestation hash for verifiability. | Venice AI in TEE ā private, verifiable analysis |
| E. Rebalance | If recommendation differs from current position: agent constructs rebalance calldata, redeems MetaMask delegation. Atomic: remove all liquidity, re-add at new range with new fee. | Caveat enforcer validates every parameter |
| F. Fee Override | beforeSwap hook returns curator's recommended fee via OVERRIDE_FEE_FLAG. Dynamic fees adjust in real-time based on market conditions. | ~200 gas overhead per swap |
| G. Performance Tracking | After each cycle, agent stores the full execution log on Filecoin (IPFS + PDP proofs) and records the CID in LogRegistry on Filecoin mainnet. Performance feedback written to ERC-8004 ReputationRegistry on Base Sepolia. | Verifiable on-chain log trail |
| H. Withdrawal | LP burns VaultShare tokens anytime. Hook removes proportional liquidity and returns tokens. No lockups, no permission needed. | Unconditional withdrawal rights |
Key Features
Scoped Delegation ā Custom CuratedVaultCaveatEnforcer ensures the curator can only call rebalance() and claimPerformanceFee() on the hook contract, with fee bounds and rate limiting enforced on-chain.
Private AI Inference ā Venice AI runs analysis inside an EigenCompute TEE. Market reasoning never touches the chain ā only the resulting rebalance action is visible. Each inference produces a verifiable attestation hash.
Dynamic Fees ā Pool was initialized with DYNAMIC_FEE_FLAG. The curator adjusts swap fees based on volatility, volume, and market conditions ā optimizing LP revenue in real-time.
Verifiable Reputation ā ERC-8004 IdentityRegistry gates registration. ReputationRegistry records performance after every rebalance. LPs can inspect a curator's full history before choosing.
Filecoin Log Storage ā Every execution log (pool state, market data, AI recommendation, action taken) is stored on Filecoin via filecoin-pin with PDP proofs. CIDs are indexed on-chain in a LogRegistry contract on Filecoin mainnet.
System Flow
CURATEDLP
PHASE A: CURATOR REGISTRATION
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Agent
| registerCurator(performanceFeeBps, erc8004IdentityId)
v
CuratedVaultHook
| verify IDENTITY_REGISTRY.ownerOf(identityId) == msg.sender
| verify performanceFeeBps <= 2000 (max 20%)
| store Curator { wallet, identityId, fee, active: true }
|
--> emit CuratorRegistered(curatorId, wallet, identityId)
PHASE B: LP DEPOSIT
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
LP
| deposit(amount0Desired, amount1Desired, amount0Min, amount1Min, minShares, deadline)
v
CuratedVaultHook
| verify deadline not expired, pool initialized
| transferFrom(LP -> hook) for USDC + wstETH
| calculate shares:
| if totalShares == 0: shares = sqrt(amount0 * amount1)
| else: shares = min(a0/total0, a1/total1) * totalShares
|
| āāāā Unlock Pattern āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
| ā hook -> poolManager.unlock(data) ā
| ā poolManager -> hook._unlockCallback(data) ā
| ā hook -> poolManager.modifyLiquidity(+delta) ā
| ā hook settles actual deltas (NOT pre-calculated) ā
| āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā��āāāāāāā
|
--> VaultShares.mint(LP, shares)
PHASE C: METAMASK DELEGATION
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
LP (Delegator) Curator (Delegate)
| |
| toMetaMaskSmartAccount() | toMetaMaskSmartAccount()
| (Implementation.Hybrid) |
| |
| createDelegation(delegate, caveats)
| |
| v
| CuratedVaultCaveatEnforcer checks:
| ā target == CuratedVaultHook address
| ā selector == rebalance() or claimPerformanceFee()
| ā fee parameter within bounds (100-50000 bps)
| ā block.number > lastRebalance + MIN_BLOCKS
|
--> Delegation signed and stored
PHASE D: AI ANALYSIS LOOP (every 5 minutes ā OpenClaw on DigitalOcean)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
OpenClaw (Agent Orchestrator)
|
|-(1)-> Read pool state from Base RPC
| (current tick, liquidity, recent swap volume)
|
|-(2)-> Uniswap Trading API: POST /v1/quote
| (wstETH/USDC price quotes ā real API key required)
|
|-(3)-> EigenCompute TEE: POST /analyze
| Runs inside Intel TDX enclave (http://34.87.99.35:3000)
| Internally calls Venice AI twice:
| a) Sentiment analysis (web search ON)
| b) Rebalance recommendation (web search OFF)
| Model: glm-4.7 (primary) / llama-3.3-70b (fallback)
| āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
| ā System: You manage concentrated liquidity ā
| ā for wstETH/USDC on Uniswap v4. ā
| ā Recommend: tick range, fee (bps), ā
| ā confidence score, reasoning. ā
| ā Respond ONLY in JSON. ā
| ā ā
| ā User: {pool state + prices + sentiment} ā
| āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
| Returns: recommendation + attestation hash
|
|-(4)-> If recommendation differs significantly:
| construct rebalance calldata
| redeem MetaMask delegation ā execute on-chain
|
|-(5)-> Store execution log on Filecoin via filecoin-pin
| Record CID in LogRegistry on Filecoin mainnet
|
--> Log all actions with timestamps + TxIDs + attestation
PHASE E: REBALANCE EXECUTION
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Agent
| redeemDelegations(rebalanceCalldata)
v
DelegationManager
| validate delegation signature
| call CuratedVaultCaveatEnforcer.beforeHook()
| ā correct target, function, fee bounds, rate limit
v
CuratedVaultHook.rebalance(newTickLower, newTickUpper, newFee, maxIdleToken0, maxIdleToken1)
|
| āāāā Atomic Rebalance āāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
| ā 1. Remove ALL liquidity (unlock + negative delta)ā
| ā 2. Update stored tick range + fee ā
| ā 3. Re-add ALL liquidity (unlock + positive delta)ā
| ā 4. Update lastRebalanceBlock ā
| ā If any step fails ā entire tx reverts ā
| āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
--> emit Rebalanced(curatorId, newTickLower, newTickUpper, newFee)
PHASE F: DYNAMIC FEES (every swap)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Swapper
| swap(poolKey, params)
v
CuratedVaultHook._beforeSwap()
| read curator's recommendedFee from storage (warm SLOAD, ~100 gas)
| return (selector, ZERO_DELTA, fee | OVERRIDE_FEE_FLAG)
|
CuratedVaultHook._afterSwap()
| cumulativeVolume += |swapDelta|
| cumulativeFeeRevenue += volume * feeRate
|
--> Fee applied transparently, ~200 gas overhead
PHASE G: REPUTATION FEEDBACK
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Agent (after each rebalance cycle)
|
| compute performance delta (vault value before vs after)
| encode payload: { rebalanceCount, avgFeeRevenue,
| tickAccuracy, timestamp }
|
| REPUTATION_REGISTRY.submitFeedback(curatorIdentityId, payload)
| (Base Sepolia: 0x8004B663056A597Dffe9eCcC1965A193B7388713)
|
--> Permanent, verifiable on-chain reputation trail
PHASE H: LP WITHDRAWAL
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
LP
| withdraw(sharesToBurn)
v
CuratedVaultHook
| proportion = sharesToBurn / totalShares
|
| āāāā Unlock Pattern āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
| ā Remove proportional liquidity (negative delta) ā
| ā Transfer tokens back to LP ā
| āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
| VaultShares.burn(LP, sharesToBurn)
|
--> LP receives wstETH + USDC proportional to shares
TRUST BOUNDARY SUMMARY
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
CURATOR CAN DO CURATOR CANNOT DO
āāāāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāā
Rebalance tick range Withdraw LP funds
Adjust dynamic fee (within bounds) Transfer VaultShare tokens
Claim performance fee Bypass caveat enforcer
Read pool state Exceed rate limits
Call Venice AI via TEE Change curator parameters
Store logs on Filecoin Access other curators' vaults
System Participants
| Actor | Role |
|-------|------|
| Liquidity Provider (LP) | Deposits wstETH + USDC into vault, receives VaultShare tokens, chooses a curator, retains unconditional withdrawal rights |
| AI Curator Agent | Registered with ERC-8004 identity. Orchestrated by OpenClaw on a 5-minute heartbeat (deployed on DigitalOcean). Analyzes markets via Venice AI (inside EigenCompute TEE), rebalances positions via MetaMask delegation, logs decisions to Filecoin |
| OpenClaw | Agent orchestration framework. Runs the curator as a collection of CLI tools on a 5-minute heartbeat cycle: observe (pool state) ā analyze (market data + TEE inference) ā decide ā act ā store (Filecoin). Deployed on DigitalOcean |
| CuratedVaultHook | Uniswap v4 hook ā vault core. Manages deposits, withdrawals, liquidity, dynamic fees. Only the hook can add/remove liquidity from the pool |
| VaultShares | ERC-20 receipt token. Minted on deposit, burned on withdrawal. Represents proportional claim on vault assets |
| CuratedVaultCaveatEnforcer | MetaMask delegation caveat ā validates every curator action against target, function, fee bounds, and rate limits |
| Venice AI | Private inference engine ā analyzes market data and recommends optimal tick ranges and fees |
| EigenCompute TEE | Intel TDX Trusted Execution Environment that wraps Venice AI inference for verifiable computation |
| Filecoin + LogRegistry | Execution logs stored on Filecoin (IPFS + PDP proofs). CIDs indexed on-chain via LogRegistry contract on Filecoin mainnet |
| ERC-8004 Registries | IdentityRegistry gates curator registration. ReputationRegistry records performance history |
Smart Contracts
| Contract | Purpose |
|----------|---------|
| CuratedVaultHook.sol | Core Uniswap v4 hook ā vault deposit/withdraw, liquidity management via unlock pattern, curator rebalance, dynamic fee override in beforeSwap, fee tracking in afterSwap |
| VaultShares.sol | ERC-20 share token. Mint/burn controlled exclusively by the hook. Represents proportional vault ownership |
| CuratedVaultCaveatEnforcer.sol | MetaMask Delegation caveat enforcer ā validates target address, function selector, fee bounds, and rate limiting for every delegated action |
Architecture Decisions
| Decision | Rationale |
|----------|-----------|
| Hook manages all liquidity | beforeAddLiquidity and beforeRemoveLiquidity revert unless sender == hook. Forces all flows through vault functions |
| Separate VaultShares contract | Hook address is fixed by permission bits ā share token needs its own deployment |
| DYNAMIC_FEE_FLAG on pool | Enables curator-controlled fees without redeploying. ~200 gas overhead per swap |
| Atomic rebalance | Remove-all then re-add-all in one tx. If any step fails, entire tx reverts ā no partial state |
| ERC-8004 as primary identity gate | Curators MUST hold an identity NFT. Not decorative ā registerCurator() reverts without it |
| Reputation writes after each cycle | Creates a permanent on-chain track record. LPs can query before choosing a curator |
| Venice AI for private inference | Market analysis stays private. Only the resulting on-chain action (rebalance tx) is visible |
| MetaMask delegation over EOA signing | Scoped permissions with on-chain enforcement. Curator literally cannot call withdraw() |
Integrations
| Integration | Role in CuratedLP | How It's Used | Bounty |
|-------------|-------------------|---------------|--------|
| Uniswap v4 | Core pool infrastructure | v4 hook for vault logic, beforeSwap for dynamic fees, Trading API for price quotes with real API key and TxIDs | Agentic Finance |
| Venice AI | Private market analysis | Agent sends pool state + market data to Venice AI. Recommendation (tick range, fee, confidence) drives on-chain rebalance. Private inference ā reasoning never on-chain | Private Agents, Trusted Actions |
| MetaMask Delegation | Scoped curator permissions | Custom CuratedVaultCaveatEnforcer ā LP delegates rebalance authority with fee bounds and rate limiting. Agent redeems delegation via Pimlico bundler | Best Use of Delegations |
| EigenCompute TEE | Verifiable AI inference | Venice AI sentiment analysis and rebalance recommendation run inside an Intel TDX enclave via EigenCompute. Each inference returns an attestation hash proving computation integrity. Endpoint: http://34.87.99.35:3000 | Verifiable Compute |
| Filecoin | Permanent execution log storage | Every heartbeat cycle produces a full execution log (pool state, market data, AI recommendation, action taken). Stored on Filecoin via filecoin-pin with PDP proofs. CID recorded on-chain in LogRegistry (0x3b53eb6FCc0b0a618db98F05BB4007aFcDbde94d) on Filecoin mainnet. Frontend reads LogRegistry to display full agent history | Decentralized Storage |
| ERC-8004 | Identity + reputation | IdentityRegistry gates curator registration (load-bearing). ReputationRegistry records performance after every rebalance cycle | Identity + Reputation |
cd agent
npm install
cp .env.example .env
# Fill in VENICE_API_KEY, UNISWAP_API_KEY, PIMLICO_API_KEY, etc.
npm start
6. Launch Frontend
cd frontend
npm install
npm run dev
# http://localhost:3000
End-to-End Flow
1. Curator registers with ERC-8004 identity ā identity verified on-chain
2. LP deposits wstETH + USDC ā receives VaultShare tokens
3. LP creates MetaMask delegation ā curator scoped to rebalance only
4. Agent reads pool state from Base RPC ā current tick, liquidity, volume
5. Agent fetches market data via Uniswap API ā price quotes, spread, impact
6. Agent calls Venice AI inside TEE ā verifiable inference, attestation hash
7. Agent rebalances via delegation ā atomic remove + re-add at new range
8. Dynamic fee updates on next swap ā beforeSwap returns new fee
9. Execution log stored on Filecoin ā CID recorded in LogRegistry on-chain
10. Performance written to ReputationRegistry ā verifiable curator track record
11. LP withdraws anytime ā burns shares, receives tokens
| Bounty | Hard Requirement | Status |
|--------|-----------------|--------|
| Uniswap | Real API key from developers.uniswap.org, functional swaps with real TxIDs, open source + README | |
| Venice AI | Venice API for private cognition, outputs feed into on-chain action | |
| MetaMask | Delegation Framework with meaningful innovation (custom CaveatEnforcer) | |
| EigenLayer | EigenCompute TEE wraps Venice AI inference for verifiable computation with attestation | |
| Filecoin | Execution logs stored on Filecoin mainnet with PDP proofs, CIDs indexed on-chain in LogRegistry | |
| ERC-8004 | IdentityRegistry gates registration + ReputationRegistry records performance | |