Managing many DeFi positions — lending, liquid staking, fixed-term vaults — is not passive. It requires monitoring, rotation, and reaction to market changes. Doing it manually consumes time and constant attention. With an AI agent, positions still need management — but they don't demand all your attention. The agent watches, filters, calculates, and alerts you when there's something to decide. You decide. That's the difference between passive management (which rarely works in DeFi) and assisted management (which scales with your portfolio without scaling your time).
Set it up, teach it a strategy, and manage it from Telegram or a mobile web interface. No need to sign transactions with your keys if you don't want to. The pieces already exist. What's missing isn't technology — it's knowing which pieces to use, in what order, and what risks to take.
Editorial notice: This article is for informational purposes only and does not constitute financial advice. Operating in DeFi with automated agents involves significant risks: smart contracts, MEV, execution errors, oracle manipulation, and total loss of capital. No strategy guarantees performance. Data as of April 2026.
What can an AI agent do in DeFi? A concrete example
You have USDC generating 4.1% in a Morpho vault on Base. You decide to rotate that position: exit the vault, move funds to Solana, and buy tokenized stocks. You tell your agent via Telegram: "rotate my Morpho position to xSTOCK on Solana."
The agent executes a sequence of steps:
- Withdraw USDC from the Morpho vault on Base (verify no lock period)
- Calculate total cost: exit gas + cross-chain bridge + entry gas on Solana + slippage
- If the cost exceeds 0.5% of the amount, alert before executing
- Bridge USDC from Base to Solana (choose the route with least slippage)
- Verify that USDC arrived on Solana (confirm balance)
- Buy xSTOCK on Solana with the received USDC
- Confirm the final position and report actual vs. estimated cost
To do this, the agent needs several pieces: a brain to reason through the steps, a platform to live on, tools to connect it with Morpho and Solana, and a saved sequence so it doesn't have to be explained every time. Let's look at each piece.
The brain: what language model does your agent use?
The brain is the language model that reasons, interprets your instructions, and decides what to do at each step. The choice matters: a more powerful model plans a 7-step rotation better; a faster and cheaper one is sufficient for hourly yield monitoring.
| Provider | Models | Strength |
|---|---|---|
| Anthropic | Opus, Sonnet, Haiku | Complex reasoning, multi-step tasks, precise instruction following |
| OpenAI | GPT | Broad ecosystem, code generation, autonomous Codex agent |
| Gemini | Large context window, good speed/cost balance | |
| xAI | Grok | Real-time data integration, access to X information |
| DeepSeek | DeepSeek | High reasoning capability, very low cost |
Not sure which to choose? OpenRouter gives you access to all these models and many more (GLM, MiniMax, Kimi...) with a single account. You buy prepaid credits — they accept stablecoins like USDC — test several for each task, and stick with the one that works best. Some are available for free with usage limits, enough to experiment.
The interesting part: you can use different models for different tasks. Opus for planning a complex strategy. Gemini for routine monitoring. Mixing models reduces cost by 40–60% compared to using one premium model for everything.
The body: where does your agent live?
The brain reasons, but it needs a platform to run on, connect tools, and store what it learns. This is where you choose how you interact with your agent — from an app, from Telegram, or from a development environment.
| Platform | What it is | Supported Models | Strength for DeFi |
|---|---|---|---|
| OpenClaw | Autonomous agent with 44,000+ skill marketplace | Any (Opus, GPT, Gemini, DeepSeek...) | Pre-configured skills for trading, portfolio, DeFi. CoinGecko and DeFiLlama already integrated. Web and mobile management |
| Claude Code | Anthropic agent | Opus, Sonnet, Haiku | Multi-step reasoning, native support for connecting external tools via MCP (the standard we'll see in the next section) |
| Codex | OpenAI autonomous agent | GPT | Code generation, sandbox execution, OpenAI ecosystem |
Important note: the AI agent ecosystem is extremely dynamic. New platforms appear every week. What you see here reflects April 2026 — by the time you read this, options that hadn't launched yet will likely exist. Prioritize those with active communities and verifiable tools.
The tools: how does an agent connect with DeFi?
The agent reasons and the platform executes. But neither can check a price, make a swap, or read a contract without tools that connect it to external applications.
These connections are made via APIs — interfaces that expose an application's services (CoinGecko's API for prices, 1inch's for swaps, DeFiLlama's for yields). The standard that allows the agent to discover and use these APIs is called MCP (Model Context Protocol): the agent knows what tools it has available, understands what each one does, and calls them when needed. You can connect several to the same agent — one for data, another for execution, another for risk.
The key distinction: a read-only tool cannot lose your money; an execution tool can.
What tools allow transaction execution?
| Tool | Function | Networks | Official Link |
|---|---|---|---|
| Symbiosis | Cross-chain swap (any-to-any token) | 50+ (EVM, Solana, Tron, Bitcoin) | GitHub |
| 1inch | DEX aggregator + 15 APIs (swap, balance, portfolio, gas) | 15+ EVM chains | 1inch MCP |
| deBridge | Bridge + cross-chain swap with MEV-aware routing | 25+ EVM + Solana + Tron | agents.debridge.com |
| Tatum | RPC operations + data API on 130+ chains | 130+ (EVM and non-EVM) | tatum.io/mcp |
What tools provide data and risk analysis?
| Tool | Function | Coverage | Official Link |
|---|---|---|---|
| CoinGecko | Prices, volume, market cap, on-chain data | 15,000+ tokens, 200+ networks | docs.coingecko.com |
| DeFiLlama | TVL, yields, volumes, fees per protocol | All indexed protocols | defillama.com/mcp |
| Philidor | Risk scoring of DeFi vaults | 700+ vaults (Morpho, Aave, Spark, Yearn, Beefy) | docs.philidor.io |
For on-chain prices — those protocols use to calculate liquidations — the agent needs oracles: Chainlink (the standard for Aave and Morpho), Pyth (high frequency, useful for arbitrage) or Uniswap TWAP (manipulation-resistant, useful as a second verification source).
Fundamental rule: only trust official tools or those with verifiable code. A malicious connection with access to your wallet can drain your funds.
The skills: how does your agent learn to repeat tasks?
A skill is a sequence of steps that the agent learns and can repeat. The Morpho → Solana rotation from the initial example involves 7 steps with verifications. The first time you explain them. The second time it already knows them. If you save it as a skill — "cross-chain rotation" — the third time you just say "rotate my position" and it executes everything.
Another more common example: you want the agent to check stablecoin yields every week and recommend the best vault according to your criteria:
- Check USDC and USDT yields in Morpho, Aave, and Spark vaults
- Filter by minimum TVL (e.g., only vaults with more than $50M)
- Filter by trusted curator (e.g., only Gauntlet, Steakhouse, or Re7)
- Calculate the average APR of the last 30 days (not the spot rate, which can be a spike)
- Verify if the vault has had any incidents or if the protocol was audited
- Present the 3 best candidates with: average APR, TVL, curator, protocol, chain
That's a skill: "weekly vault review." You launch it with a command, the agent executes the 6 steps and presents the recommendation. If your criteria change, you edit the skill, you don't recreate it. Platforms like OpenClaw have marketplaces with thousands of pre-configured skills; in others like Claude Code, you configure them yourself.
The strategy: what do you want your agent to do?
Tools obtain data. Skills execute sequences. Strategy decides when and why to act — it's what turns a reactive assistant into a system with judgment. Three approaches, from lower to higher risk:
How does an automated yield farming strategy work?
The agent compares yields between protocols and rotates capital to where the net yield (after gas and slippage) is higher. It doesn't predict prices — it follows rules you define: "if USDC yield on Aave falls below 4%, move to Morpho where it's 5.2%." The key is that the agent calculates whether the cost of rotation (gas + slippage) is amortized by the yield difference within a reasonable timeframe. If the difference is 0.3% and the cost to move is 0.5%, the answer is no — and the agent should know that.
Key question: "Compare the net yield of my stablecoins across the 5 protocols with the highest TVL. Is it worth moving if the difference is less than 1%? In how many days will I amortize the cost of the rotation?"
How does a DEX arbitrage strategy work?
The agent detects price differences for the same asset between DEXs or across chains. It buys where it's cheap, sells where it's expensive. The margin is usually minimal (0.1–0.5%) and competition is fierce — specialized bots and MEV searchers compete with a latency advantage measured in milliseconds. an LLM-based agent won't win that race. Where it can contribute: detecting more complex cross-chain arbitrage opportunities that require reasoning (e.g., 3-hop routes between chains where the sum of spreads creates a margin).
Key question: "Is the net margin after gas + slippage + execution risk positive? Is there a multi-hop route that simple bots aren't exploiting?"
How does an automated risk management strategy work?
Probably the most valuable real-world application of a DeFi agent. The agent monitors your open positions 24/7 and acts when conditions change: adds collateral if your loan's health factor on Aave drops below 1.5; withdraws liquidity if a vault's yield compresses below your threshold; or alerts you if the protocol shows signs of risk — sudden TVL drop, exploit in a related protocol, or depeg of collateral.
This is where an agent clearly outperforms a human: it doesn't sleep, doesn't get distracted, and can react to a 20% ETH drop at 3 AM before your position gets liquidated.
Key question: "If ETH drops 20% in an hour, are any of my positions at risk of liquidation? What action should be taken and with what priority?"
Asset management: guardrails, Kelly, and risk control
Identifying an opportunity is not enough. Before deciding how much to allocate, your agent needs to know where NOT to put money.
What guardrails does your agent need before operating?
Depositing into a protocol without audits, significant TVL, and a track record is putting money into something with high uncertainty — and an autonomous agent can do it in seconds if it doesn't have clear limits.
| Guardrail | Rule | Why |
|---|---|---|
| Minimum TVL | Do not operate in protocols with less than X million TVL | Low TVL = low liquidity and high rug pull risk |
| Audits | Only protocols with at least one public audit from a recognized firm | Without an audit, the risk of exploit is not "possible" — it's probable |
| Track record | Minimum 6 months on mainnet without serious incidents | Exploits usually occur in the first few months |
| Maximum concentration | No more than 20% of capital in a single protocol | Diversification protects against component failure |
| Transaction limit | Maximum per individual operation (e.g., $5,000) | An error or exploit doesn't liquidate the entire portfolio |
| Allowed chains | Only chains that the agent has configured and tested | Prevents it from exploring unknown chains looking for high yields |
| Maximum slippage | Cancel if slippage exceeds 0.5–1% | Protects against low liquidity pools and manipulation |
These guardrails are not optional. They are the first thing you configure before giving any execution capability. If a vault offers 25% APR but has $500,000 TVL, no audit, and has been online for 3 weeks — your agent must automatically reject it.
What is the Kelly Criterion and how does it help you allocate capital?
Once the protocol passes the guardrails, the question is: how much to invest? If you allocate too much, a failure destroys you. If you allocate too little, the opportunity doesn't move the needle. Most traders — human and agent — fail here: not due to bad strategy, but due to bad capital management.
The Kelly Criterion solves this problem with mathematics. It's a formula that calculates the exact fraction of your capital you should risk in an opportunity where you have a positive edge — no more, no less. It was developed by John Kelly at Bell Labs in 1956 to optimize telephone signal transmission, and since then it has become the standard for capital management in quantitative funds, casinos, and now DeFi.
f* = (p × b − q) / b
Where: f* = fraction of capital, p = probability of winning, q = probability of losing (1 − p), b = win/loss ratio.
| Example Strategy | p (prob.) | b (W/L ratio) | Kelly | ½ Kelly | Interpretation |
|---|---|---|---|---|---|
| Yield farming stables (rotation) | 80 % | 0.5 | 40 % | 20 % | High probability, low payout → large position |
| Cross-chain arbitrage | 65 % | 1.2 | 26 % | 13 % | Good probability → medium position |
| Directional trading (long ETH) | 55 % | 2.0 | 15 % | 7.5 % | Marginal probability → conservative |
| Bet on YT of Pendle | 45 % | 3.0 | -3 % | 0 % | Negative edge → do not bet |
Why ½ Kelly? Full Kelly assumes you know the exact probabilities. In DeFi, you estimate. A 10% error can turn an optimal position into a ruinous one. ½ Kelly reduces volatility by 75% with only 25% less long-term return. Most quantitative funds use between ¼ and ½ Kelly.
Question for your agent: "Given the history of this strategy, what is the ½ Kelly? If my probability estimate has a 15% margin of error, is it still positive?"
What can go wrong?
| Risk | What happens | How to mitigate |
|---|---|---|
| Malicious tool | An unverified connection drains your wallet | Only official tools. Verify code before connecting |
| MEV / front-running | A bot front-runs your transaction | Anti-MEV protection (Flashbots). Avoid large orders in small pools |
| Outdated oracle | The agent decides with an obsolete price | Always two price sources. Verify timestamp |
| Gas spike | Gas cost turns the operation into a loss | Gas limit. Do not execute during congestion |
| Smart contract exploit | The protocol where you have funds is hacked | Maximum 20% in a single protocol. Audit and TVL guardrails |
| Overfitting | Strategy that works in backtesting but fails in real life | Minimum initial capital. Distrust win rates > 80% |
How much autonomy to give your agent?
| Level | What it does | Risk |
|---|---|---|
| 1. Read-only | Monitors portfolio, compares yields, generates alerts | Zero — does not touch funds |
| 2. Recommendation | Proposes actions with calculated Kelly, awaits your approval | Minimal — you decide |
| 3. Limited execution | Executes within guardrails (max per tx, allowed protocols) | Medium — contained errors |
| 4. Autonomous execution | Operates without approval according to programmed strategy | High — total loss possible |
The honest recommendation: start at level 2. An agent that reads DeFi, applies guardrails, calculates Kelly, and tells you "this position has a ½ Kelly of 13% — should I execute it?" is more valuable than one that operates alone and loses your money faster than you could. LLM trading benchmarks show that models still make serious errors in autonomous execution. The agent's advantage is not in operating faster — it's in processing more information and calculating risk better while you sleep.
How much does it cost to maintain a DeFi agent?
The cost depends on the level of autonomy and the model you use. A read-only agent that monitors and alerts can cost less than $5 per month in model credits. An agent that executes transactions adds the gas costs of each operation.
| Component | Estimated Cost | Note |
|---|---|---|
| LLM Model (monitoring) | $2–10/month | Depends on the model and query frequency. Models like DeepSeek or Kimi are the cheapest |
| LLM Model (strategy planning) | $10–50/month | Frontier models (Opus, GPT) for complex decisions cost more per query |
| Transaction Gas | Variable | On L2s like Base or Arbitrum, < $0.01 per tx. On Ethereum L1, $1–20 depending on congestion |
| Tools (MCPs) | Free – $20/month | CoinGecko, DeFiLlama, and Philidor have free plans. 1inch and deBridge do not charge per query |
For a $10,000 portfolio, a level 2 agent (read + recommendation) can cost $5–15/month. If the agent helps you avoid a single liquidation or find a vault with 1% more yield, it pays for itself in the first month.
Before an agent manages your portfolio, you need to know what you have. Seeing your positions by chain and protocol is the prerequisite for any strategy.
CleanSky shows your DeFi portfolio in real-time — balances, yields, and exposure by chain. Without custodying your funds. Discover how it works.