Intelligent DeFi

Thanks to Karthik, Ismael from Lagrange, Nikhil from Aethos, Soubhik, Gautham, and Brandon for reviewing drafts of this piece.

Ethereum gave birth to DeFi with the launch of Maker in December 2017. Uniswap and Compound launched soon after, forming an economy around ETH and ERC20s. Since then, we’ve witnessed an onchain financial renaissance with concentrated liquidity enabling greater capital efficiency, the evolution of perps, and even the invention of flash loans, a concept not possible in tradfi.

But we seem to have hit a wall. AMM LPs have lost >$700M in MEV since The Merge. Derivative exchanges have centralized their risk engines and orderbooks for greater efficiency. And we’re unable to provide personalized loans, giving better rates to those with lower default risk or easy access to fixed-rate loans for set periods of time.

Many of the problems stem from Ethereum’s constraints as a finite state machine. It’s gas-constrained, has 12-second block times, and can’t natively take in offchain data. Modular architectures provide a way forward by offloading heavy computation and integrating external data without sacrificing Ethereum’s core security.

If the EVM is the glue that lets developers write arbitrary business logic, then what form should the coprocessors take? While Vitalik describes these coprocessors as precompiles or opcodes, we need a broader solution. We need coprocessors that can handle tasks too computationally expensive or impractical for Ethereum’s limited state machine, and—most importantly—they must be verifiable.

modified diagram from Vitalik’s Glue and coprocessor architectures

Developers have been building efficient, specialized services for years, but verifiability changes the game entirely. This is where EigenLayer comes in: it provides the infrastructure to create decentralized networks of node operators, economically aligned to run your arbitrary node software.

We call these decentralized networks Actively Validated Services (AVSs), and they drastically decrease the cost of building verifiable, trustless services.

The intersection of DeFi and AVSs unlocks a range of powerful new use cases:

  1. Trustless offchain compute (coprocessors): Run heavy computations offchain and return the results onchain with minimal gas fees, secured by zero-knowledge proofs or cryptoeconomic guarantees. Think free limit orders or even AI model calls, all verifiable and decentralized.
  2. Trustless offchain data (verifiable oracles, zkTLS): Pull real-world data—like prices, volatility, real-time liquidity, even sports data—securely into DeFi.
  3. And beyond: Auction networks, policy layers, decentralized orderbooks—AVSs extend DeFi into previously unreachable areas.

We call this new paradigm Intelligent DeFi because it brings real-time adaptability and personalization to decentralized finance. Leveraging trustless offchain compute and data, Intelligent DeFi enables smarter decisions. In this blog, we dive into 10 use cases that showcase its potential.

Exchanges

Exchanges are a core primitive of DeFi, yet less than 15% of spot and 6% of derivatives trading happens onchain. Intelligent DeFi can close this gap, making DEXs more competitive with their offchain counterparts.

1. VIP tier: volume-based fee tiers

Centralized exchanges offer tiered fees based on volume, not just to build loyalty, but to subsidize market makers, enabling them to quote tighter spreads and offer better prices to retail traders. This generates more volume for the exchange.

Implementing volume-based fees on a DEX is challenging. To determine traders’ volumes, a DEX would need to either:

  • Dynamically compute the volume
  • Store and update the volume for every trader with every trade
    • Tracking rolling 30-day volumes adds further complexity, requiring historical storage and subtraction

Both methods are prohibitively expensive onchain. But by outsourcing computation to a coprocessor like Lagrange or Brevis, we can verifiably compute traders’ volumes for every transaction.

How does this work?

  1. Coprocessors index and store a subset of blockchain data in a queryable relational database.
  2. The AMM (or Uniswap hook) smart contract calls the coprocessor to run a SQL query that calculates the trader’s fees over a set period.
  3. The coprocessor returns the verified results to the AMM via a callback, along with a zero-knowledge proof confirming the computation on historical blockchain data.
How onchain contracts can interact with zkCoprocessor Lagrange.

2. Dynamic, asymmetric fees for AMMs

Loss versus rebalancing (LVR) is a major problem affecting LP profitability in AMMs. LVR occurs due to the price discrepancies between continuously trading offchain exchanges and onchain AMMs, which only trade every block or 12 seconds for Ethereum Mainnet. A lot can happen in a block, and at the start of the next block, searchers arbitrage price differences between exchanges.

To improve LP profitability, AMMs can introduce dynamic fees and asymmetric fees:

  1. Dynamic Fees: Adjust fees based on market volatility. LPs generally fare worse during periods of high volatility. During high volatility, higher fees protect LPs from toxic trades, while lower fees during stable periods encourage volume. This reduces liquidity fragmentation across different fee tiers, making the user experience simpler for LPs. Check out this very basic proof of concept.
  2. Asymmetric Fees: Inspired by Alex Nezlobin, asymmetric fees would adjust the spread based on external price data. For example, if ETH trades at $1000 on DEXs and $1050 on CEXs, instead of maintaining a symmetrical spread around the DEX price, the AMM could buy at $980 and sell at $1060, reflecting more realistic market conditions.
From Alex Nezlobin’s twitter thread

In both cases, AMMs need trusted external data—like CEX prices or volatility—to adjust fees. But traditional oracles introduce risks: centralized operators can fail or deliver stale data. Instead, zkTLS (web proofs) offers a better approach. By cryptographically verifying data directly from web servers, zkTLS removes the need to trust third parties. It gives you tamper-proof data in real-time, ensuring AMMs can compute dynamic, asymmetric fees securely, whether onchain or through a coprocessor.

3. Auction to redistribute MEV to AMM LPs

Another way to boost LP profitability involves not just offchain compute, but a decentralized auction network. Currently, searchers compete in auctions to get their transactions at the top of the block. Effectively, the arbitrage goes to a mix of searchers, builders, and proposers, rather than the LPs and swappers.

Instead, AMMs can auction off the right to be the first swap through the pool. If the auction is competitive, most of the LVR will be recaptured. This can then be distributed pro-rata to the underlying LPs in the range of the swap, reducing overall arbitrage and enabling LPs to provide tighter spreads. Sorella is building this in the form of a Uniswap v4 hook.

The challenge is running a low-latency, censorship-resistant auction. It’d be too complex and expensive to run the auction onchain: each bid would require gas. By the time the winner is chosen, a block would have passed, rendering the auction incomplete. A centralized party could conduct the auction offchain, but this goes against the general ethos of DeFi, while also giving them a last look to potentially extract value for themself.

The solution is a decentralized set of operators running a leaderless auction, eliminating the need for a single entity and preserving the integrity of the process. The operators select the winning bid and return proceeds to LPs.

0:00
/0:49

From Paradigm’s Leaderless Auctions

Derivatives

While most derivatives are traded on exchanges, Intelligent DeFi unlocks unique use cases specific to this asset class. Let’s dive in!

4. Advanced margin system

Currently, traders can’t express cross-asset viewpoints, like SOLETH or cross, without severely limiting their leverage. Most perp DEXs calculate margin linearly based on the sum of a trader’s open interest across different positions.

For example, if I deposit $10k and take a $50k long on ETH and a $50k short on BTC, that counts as 10x leverage. But this is a different risk profile from someone who simply longs $100k on ETH, and these accounts shouldn’t be treated the same. Ideally, traders should be able to leverage more than 5x ETHBTC without facing such rigid constraints.

The issue lies in onchain compute limits. Specifically, the system needs to account for collaterals (of every spot asset), positions (of every perp asset), unrealized PnL, each perp’s initial and maintenance margin factors, and correlations / delta hedging. This is especially true as DEXs expand to multiple asset types, like perps and options.

By leveraging a coprocessor for more complex calculations to determine accounts’ margin factors, DEXs can create a more customized risk engine tailored to their users’ needs. This enables more flexible, delta-neutral strategies and ensures that liquidations only happen when truly necessary.

To offer even more flexibility, coprocessors can adjust margin requirements dynamically, factoring in real-time liquidity from major CEXs and the open interest in each pool.

Aevo relies on a centralized risk engine to determine worst-case scenarios, providing better margin parameters for high-value traders. Coprocessors enable unique ways of calculating margin without compromising on decentralization. From Aevo’s docs.

5. Pricing an options AMM

AMMs for derivatives, especially options, are exciting yet controversial. Some believe that they can never be priced accurately; others believe that derivatives only make sense for high-volume assets and that orderbooks are superior for said assets. Nonetheless, Panoptic, Deri, and others believe that AMMs are the ultimate method to provide liquidity, including for options.

For an options AMM to truly take off, one key factor will be the inclusion of offchain data—such as volatility, historical pricing, and real-time market signals. Additionally, offchain compute will be necessary to model more advanced pricing frameworks like Black-Scholes. Integrating these external data points with onchain trading mechanisms will be crucial to ensure accurate pricing, lower slippage, and better capital efficiency for options traders.

Lending

Lending protocols face unique challenges, where AI and offchain compute can drive smarter, more dynamic solutions.

6. AI system for parameters

Currently, governance manually updates parameters around lending markets in protocols like Aave and Compound. Generally, a risk service provider like Gauntlet runs model-based simulations and proposes changes to parameters like base rates, collateral factors, liquidation factors, and more. During more serious incidents, they can propose to delist or freeze an asset.

This appr`oach has two major flaws:

  1. The latency is far too long. When I was a delegate for Aave DAO, proposals took at least a week to go through.
  2. Governance is not well-informed to vote on lending parameters, nor are all members fully active. The recent Compound governance attack is a prime example of this.
Aave’s governance process takes at least 5 days, from their docs.

Morpho and Euler v2 move a step in the right direction. They modularize the risk management portion, enabling anyone to curate their own instance of a lending platform. Users choose where to park their assets based on the curator’s track record and reputation. This approach can minimize delays in updating parameters.

But in an ideal system, parameters would update automatically, responding in real-time to both onchain and offchain liquidity. AI-driven models simulate various scenarios, predicting and preventing worst-case outcomes. These models rely on AI-focused coprocessors like Ritual, Sentient, Hyperbolic, Ora, and Valence to process vast amounts of data offchain—accounting for volatility, liquidity shifts, and risk correlations—before verifiably publishing results onchain.

7. Personalized loans via account history and liquidation risk

In traditional finance, borrowers with strong credit histories receive better loan terms, but in DeFi, everyone gets the same lending terms, regardless of their risk profile or track record. While beneficial, I believe DeFi has the ability to combine the best of both worlds: offering fair trustless loans to anyone, and loans with favorable terms to repeat, identified borrowers with low liquidation risk.

Without differentiation, DeFi lending protocols can’t offer customized terms, such as lower collateral requirements or better interest rates, to low-risk borrowers. This lack of personalization not only limits the potential upside for repeat users but also makes lending markets inefficient.

Offering personalized loans first requires an anti-sybil solution to ensure that only verified users receive better terms. Solutions like WorldCoin or Coinbase Verifications prevent malicious actors from repeatedly exploiting the protocol with bad debt.

Once borrowers are verified, the protocol can collect onchain information to build a liquidity profile, including:

  • # of loans, both current and historical
  • Repayment history of previous loans
  • Onchain net worth and outstanding debt
  • NFTs owned (if the lending protocol partners with NFT projects to offer subsidized terms)

The protocol can even look at other addresses tied to the same identity to get a more holistic view!

Finally, a coprocessor can assess liquidation risk and generate custom collateral factors and interest rates, ensuring tailored loan terms for each borrower.

8. Compliant privacy mixers

In August 2022, the U.S. Office of Foreign Assets Control (OFAC) sanctioned Tornado Cash for enabling money laundering. Privacy, however, is a fundamental right and serves legitimate purposes: people should be able to transfer funds to another account or a friend without exposing their full transaction history.

The problem is that existing privacy mixers don’t differentiate between legitimate users and bad actors. This lack of compliance makes them a target for sanctions and prevents broader adoption.

What if we could create a privacy protocol that only accepts compliant funds? The protocol would manage risks and adhere to regulations, and privacy-conscious users would flock to the system. But determining compliance requires various onchain and offchain data and is a nontrivial task. Ideally, smart contracts can call an API that enforces compliance by approving only valid transactions.

Aethos is a policy layer that does exactly this. It enables developers to set rules at the smart contract level, ensuring that transactions follow specific compliance policies. For example, a compliant privacy mixer could set rate limits, time locks, and block transactions in which the depositing or withdrawing address is OFAC-sanctioned or tied to a DeFi hack.

From Aethos’s docs

Incorporating real-time, rule-based policies into smart contracts opens a new wave of institutional-friendly DeFi, where compliance and DeFi values are no longer at odds.

9. Automated rebalancing yield protocols

DeFi offers an abundance of yield opportunities, across various assets and protocols—staking, restaking, lending, AMM liquidity pools, RWAs, and more. Users each have unique risk preferences, tied to the protocol type, chain (Ethereum, Solana, etc.), and asset denomination, along with external market risks. With so many choices, some traders turn to yield protocols to automate their capital allocation.

So much yield. Not financial advice. From DeFiLlama.

These protocols can leverage AI models to optimize yields across multiple sources. Developers set predefined risk parameters (e.g., capping exposure to 15% per protocol or avoiding protocols with under $100M in TVL), and AI models handle the rest, adjusting the portfolio to meet these criteria while maximizing returns.

Going further, AI models can create fully customized yield strategies for each user, based on their onchain activity and preferences collected through a brief questionnaire. This level of personalization—previously unthinkable—is now within reach, thanks to the scalability of AI.

On the backend, AI-driven coprocessors monitor and rebalance portfolios. They only trigger changes when the benefits justify the gas costs, ensuring efficient, data-driven portfolio management.

10. Hyper-targeted incentives programs

Incentives are core to crypto and DeFi. DeFi summer only truly kicked off with Compound’s introduction of liquidity mining in 2020. By offering rewards for specific user actions, protocols were able to bootstrap growth and activity.

But as the space matures, protocols are seeking more precise targeting and often move to offchain programs. AMMs may focus on incentivizing active liquidity. NFT marketplaces and prediction markets might reward liquidity near the orderbook price. Lending protocols could encourage borrowing from non-loopers for at least 20% of their interest.

With coprocessors, protocols can define complex reward conditions and issue payouts in real time. This moves away from the increasingly unpopular points system and provides users with certainty that rewards will be paid, reducing the cost of capital for protocols. Gearbox is already shifting to Lagrange’s coprocessor to handle multi-asset rewards with different payout mechanics. By making incentives more efficient, DeFi can continue to grow while rewarding the most valuable actions.

Conclusion

The intersection of DeFi and AVSs will lead to a new financial revolution. From MEV-recapturing AMMs to real-time policies in privacy protocols, these use cases are just a glimpse of what can be built when we push the limits of decentralized finance. If you’re interested in building in Intelligent DeFi or AVSs to support new Intelligent DeFi products, join the BuildOnEigen telegram chat, follow on Twitter, and reach out directly to the Developer Relations team (@dabit3)