It's a marketplace where DeFi agents register their strategies.
PrismOS is a non-custodial marketplace where users subscribe to AI agents that autonomously manage their DeFi liquidity positions on Ethereum mainnet.
The problem is twofold. For users, managing a Uniswap LP position is a full-time job — watching prices, adjusting tick ranges, collecting fees, compounding, rebalancing. Most people don't bother. For agent builders, there's no distribution channel and no standard way to offer strategies to users without requiring custody of their funds.
PrismOS connects both sides. An agent registers by claiming an ENS subdomain (yieldbot.prismos.eth) and publishing its strategy, pricing, and permissions as ENS text records — no backend, no custom contracts, fully on-chain and verifiable. Users browse the agent catalog on the frontend, pick one, and subscribe.
When a user subscribes, the frontend creates a ZeroDev Kernel smart account (ERC-4337) with a deterministic address, generates a session key, and sends it to the agent service. The session key lets the agent act on the user's behalf but never withdraw funds. The user then deposits USDC into their smart account.
The agent detects the deposit, reads live pool state from the chain (tick, sqrtPrice, fee tier) via Uniswap V4's StateView contract, computes the optimal swap ratio, executes a swap through LI.FI, then mints an LP position with the exact liquidity computed from post-swap balances. All strategy decisions (tick range, swap amount, liquidity) are made by the agent — the API is a stateless calldata builder that just encodes what it's told.
Once a position exists, the agent runs an hourly management loop. It feeds position state and market data into an AI brain (Claude via Anthropic API with structured tool use, with a rule-based fallback) that decides whether to collect fees, compound, distribute yield, rebalance, or hold. Each decision is executed through the session key.
The system has three services: a Next.js frontend (marketplace + dashboard with real position data from Zerion API), a Hono API (calldata builder with x402 payment middleware for future Yellow Network micropayment settlement), and a Node.js agent (subscribe server, deposit watcher, AI-powered management loop with 40 unit-tested Uniswap V4 math functions).
We've completed a full end-to-end test on Ethereum mainnet: user subscribed, deposited 2 USDC, agent swapped via LI.FI, minted a PAXG/USDC Uniswap V4 position, and the dashboard shows accurate LP values. Zero custom smart contracts — everything is pure protocol composition (ENS, ZeroDev, Uniswap V4, LI.FI, Zerion, Anthropic Claude).
PrismOS is a pnpm monorepo with three services that talk to each other over HTTP: a Next.js frontend (apps/web), a Hono API (apps/api), and a Node.js agent (apps/agent), plus a shared constants package.
The agent registry is built entirely on ENS text records. We use prismos.eth as the root domain, and each agent claims a subdomain (yieldbot.prismos.eth). The agent's strategy, pricing, chain, token pair, risk level, and required permissions are all stored as text records. The frontend reads these via The Graph's ENS subgraph with an on-chain RPC fallback (publicnode) to build the marketplace catalog. No database, no custom registry contract — ENS is the coordination layer.
For account abstraction we use ZeroDev's Kernel SDK (ERC-4337, v3.1). When a user subscribes, the frontend creates a Kernel smart account with an ECDSA validator, then generates a random session key, wraps it in a permission validator (sudo policy for now, scoped permissions planned), and serializes the whole thing. The serialized session key gets sent to the agent service over HTTP — never to the API. On the agent side, we deserialize the permission account using ZeroDev's SDK and send UserOperations through their bundler with a paymaster for gas sponsorship.
The API is deliberately dumb — it's a stateless calldata builder. When the agent needs a swap, it calls POST /api/build with action type "swap" and the API hits LI.FI's REST API (/v1/quote) to get the calldata. For LP operations, the API encodes Uniswap V4 PositionManager.modifyLiquidities() calls with the exact parameters the agent provides (tick range, liquidity, amounts, pool key). The API never decides what to do — it just encodes what it's told.
All the intelligence lives in the agent. We wrote a custom Uniswap V4 math library (v4Math.ts, 40 unit tests) that handles sqrtPriceX96 conversions, tick-to-price mapping, liquidityForAmounts calculations, and optimal swap amount computation. The agent reads live pool state from Uniswap V4's StateView contract via direct RPC calls, computes strategy parameters at runtime, and executes through session keys.
The deposit flow is a 4-phase pipeline: (1) read pool state on-chain and compute optimal swap ratio, (2) swap USDC to token0 via LI.FI, (3) read post-swap balances, compute exact liquidity, and mint an LP position, (4) parse the tx receipt for the ERC-721 Transfer event to extract the position token ID. The whole thing runs autonomously once a user deposits.
For position management, the agent has an AI brain powered by Anthropic's Claude (Haiku model) using structured tool use. We defined a submit_decisions tool that forces Claude to return typed decisions (collect, compound, distribute, rebalance, adjustRange, hold) with confidence scores and parameters. If the API key isn't set, it falls back to rule-based logic. The brain gets fed position state, token prices, spread data, and user config (compound/distribute percentages).
Portfolio data was a pain. We tried computing LP values from on-chain V4 math but the numbers were wrong ($3,992 instead of $2.51). Switched to Zerion's free API which gives accurate portfolio positions with USD values, LP grouping by group_id, and protocol attribution. The position endpoint tries Zerion first, falls back to direct RPC balanceOf calls.
The x402 payment middleware is wired up on the API — every paid endpoint returns pricing info and expects an X-Payment header. The plan is to settle agent fees ($0.01–$0.50 per action) through Yellow Network state channels (ERC-7824/Nitrolite) so micropayments don't get eaten by gas. Currently skipped in dev mode.
The hackiest part: the entire system uses zero custom smart contracts. Everything is protocol composition — ENS for discovery, ZeroDev for AA + session keys, Uniswap V4 for LP, LI.FI for swaps, Zerion for data, Claude for decisions. We tested the full flow end-to-end on Ethereum mainnet with real money (2 USDC), and the swap + mint transactions went through successfully.

