AgentFund

A DeFi vault marketplace where AI trading strategies are minted as iNFTs (ERC-7857) on 0G.

AgentFund

Created At

Open Agents

Project Description

AgentFund ๐Ÿค–๐Ÿ’ธ

A marketplace where AI trading strategies are NFTs. Mint your agent. Earn royalties on every dollar it manages. Forever.


โœจ The Idea

For DeFi to feel like a real product, capital has to be put to work without anyone babysitting it. AgentFund is the marketplace for that.

  • ๐ŸŽจ Creators mint a strategy as an intelligent NFT โ€” an iNFT. The agent's prompt, its model pointer, and a royalty cut all live on-chain.
  • ๐Ÿ’ฐ Depositors browse the marketplace, pick a strategy, and deposit USDC into its ERC-4626 vault. The agent trades on their behalf.
  • ๐Ÿ” Royalties flow forever. 70% of fees to LPs, 20% to the protocol, 10% to the iNFT creator. The strategy is a portable asset โ€” transfer it, lease it, upgrade it. Its intelligence travels with it.

The agent itself is the interesting part. Its brain runs on 0G Compute (sealed inference, TEE-attested). Its memory lives on 0G Storage (append-only decision logs). Its routing intelligence comes from Uniswap (live mainnet liquidity). Its execution lands on-chain through KeeperHub (with a per-trade spending cap as the autonomous-payment ceiling).


๐Ÿง  How It Works

                user deposits USDC
                       โ”‚
                       โ–ผ
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ”‚ StrategyVault (ERC-4626) โ”‚
          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚     Agent Loop on 0G        โ”‚
       โ”‚                             โ”‚
       โ”‚  ๐Ÿ“Š Analyst                 โ”‚
       โ”‚     ๐Ÿฆ„ Uniswap quote        โ”‚
       โ”‚     ๐ŸŸฆ 0G Compute (TEE)     โ”‚
       โ”‚                             โ”‚
       โ”‚  ๐Ÿ›ก๏ธ Risk gate                โ”‚
       โ”‚     ๐ŸŸฆ 0G Storage memory     โ”‚
       โ”‚                             โ”‚
       โ”‚  โšก Executor                 โ”‚
       โ”‚     ๐ŸฆŠ KeeperHub exec        โ”‚
       โ”‚     ๐ŸŸฆ Settle on 0G          โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ”‚
        fees split โ†’ LPs + protocol + creator

Every tick is a real, end-to-end on-chain swap on 0G Galileo.


๐ŸŸฆ 0G โ€” agents as on-chain assets

Four primitives, all live on Galileo testnet:

iNFT registry (StrategyINFT) โ€” token #1 minted with on-chain intelligenceHash and 10% creator royalty

Vault StrategyVault โ€” ERC-4626, royalty-aware fee distribution

Settlement router SettlementRouter โ€” Uniswap-V2-shaped router native to 0G

Sealed inference 0G Compute via qwen/qwen-2.5-7b-instruct โ€” every analyst tick returns a TEE-attested receipt id stored alongside the decision

Append-only memory 0G Storage at strategy/<id>/decisions and strategy/<id>/executions โ€” the agent learns over time without forgetting

๐Ÿ”— Live agent-driven swap on 0G: https://chainscan-galileo.0g.ai/tx/0x37ace190b10902790f4ebb9bb1f883a0d1f3c371cf2f12972c45384afa819dde โ€” 100 mUSDC in, 99.95 mUSDT out, executed end-to-end by the agent.


๐Ÿฆ„ Uniswap โ€” routing intelligence

The agent doesn't pretend to know markets. On every tick it calls Uniswap's Trade API on mainnet:

  1. POST /v1/quote with the strategy's pair, size, and slippage tolerance
  2. Pulls back amountOut, priceImpact, the full route across pools, and gasFeeUsd
  3. Feeds those numbers directly into the 0G Compute prompt

So even though settlement happens on 0G, every decision is grounded in real mainnet liquidity. The LLM is never asked to guess prices it can't see.

๐Ÿ“ Code: apps/web/lib/uniswap/client.ts apps/web/lib/agent/analyst.ts


๐ŸฆŠ KeeperHub โ€” autonomous execution with a spending cap

Every executor decision flows through KeeperHub's Direct Execution API:

  • The agent's runtime wallet is the org's https://chainscan-galileo.0g.ai/address/0xb62b29BfA8A23fc13Fa1301F0c75ca7cDDF9f250 provisioned at app.keeperhub.com

  • Each call: POST /api/execute/contract-call with the swap calldata and network: "16602" (0G Galileo)

  • The org-level spending cap is the per-execution autonomous-payment ceiling โ€” exactly the role the x402 standard is reaching for

  • KeeperHub job IDs are recorded in 0G Storage alongside every settlement, so the audit trail is complete

๐Ÿ“ Code: apps/web/lib/keeperhub/client.ts


๐ŸŒ Live Deployment

Network: 0G Galileo testnet ยท Chain ID: 16602 ยท Explorer: https://chainscan-galileo.0g.ai

StrategyINFT (registry) 0xa71a26a93F318F82a7DbA6aAf8aef9cD2c5B7E15

StrategyVault `0x0C9955428da76AD04539AbFF63f6Abe76441aca2

SettlementRouter 0x3AF5B121dE056755d8D751b21f7885dE03A87efE`

Mock USDC (mUSDC) | 0xb38124095d7Dce2483A449f7555f457f936B9c47 |

Mock USDT (mUSDT) | 0x15B934832E1E15072441AE7815F996F636fd1D42` |

How it's Made

Strategy iNFT #1 โ€” "Conservative USDC Yield" โ€” minted with intelligenceHash = 0x036c6d4555cf0634fd6e2284372c7a95fd8ef2130352fa67f58765d596a24c75, royalty 1000 bps to creator.

๐Ÿ› ๏ธ Stack

Next.js 15 ยท TypeScript ยท Tailwind ยท viem ยท wagmi ยท Foundry ยท 0G Compute + Storage ยท Uniswap Trade API ยท KeeperHub Direct Execution

๐Ÿš€ Run It Yourself

See DEPLOY.md for local setup and the demo walkthrough.

background image mobile

Join the mailing list

Get the latest news and updates