FlexiYield

Cross-chain USDC yield optimizer. One-click deposits to best rates via Avail Nexus.

FlexiYield

Created At

ETHOnline 2025

Project Description

The Problem

DeFi users holding USDC face fragmented yields across blockchains. A user might earn 5.2% APY on Ethereum while Arbitrum offers 7.3% APY for the same asset through the same protocol. Currently, accessing better yields requires manual research, bridging to target chains, network switching, multiple approvals, and separate supply transactions. This multi-step process is expensive, time-consuming, and technically intimidating, causing most users to accept suboptimal yields.

Our Solution

FlexiYield is a cross-chain yield aggregator that automatically finds the highest USDC lending rates across major blockchains and enables one-click deposits. We combine bridging and protocol deposits into one seamless transaction using Avail Nexus SDK's "Bridge & Execute" functionality, turning 3-5 transactions into a single click.

How It Works

Yield Discovery: FlexiYield displays real-time USDC lending rates across Ethereum, Polygon, Arbitrum, and Base, showing APY, protocol, TVL, and highlighting the best rate. One-Click Deposit: Users connect their wallet, select their preferred yield opportunity, and click "Supply." FlexiYield detects their current chain and balance automatically. Automated Cross-Chain Execution: Using Avail Nexus SDK, FlexiYield creates a single cross-chain intent that atomically bridges USDC from the source chain to the destination chain AND supplies it to Aave V3 in one transaction. No manual bridging, no network switching, no multiple approvals. Earn Yield: Users receive aUSDC (Aave interest-bearing tokens) on the destination chain, earning interest automatically. They can withdraw anytime with accumulated earnings.

User Journey Example Sarah has 10,000 USDC on Ethereum earning 5.2% APY. Before FlexiYield: Research rates, bridge to Arbitrum manually, switch networks, approve Aave, supply tokens. Total: 3-5 transactions, $20 in gas, 15 minutes, high complexity. With FlexiYield: Connect wallet, see Arbitrum offers 7.3%, click "Supply to Arbitrum Aave," confirm. Total: 1 transaction, optimized gas, 2 minutes, zero complexity. Impact: Sarah now earns $730/year instead of $520/year—an extra $210 annually for 2 minutes of work.

Key Features

Multi-Chain Yield Aggregation: Real-time APY comparison across 4+ chains with best rates highlighted One-Click Cross-Chain Deposits: Single transaction powered by Avail Nexus "Bridge & Execute" Atomic Operations: Bridge and supply happen together or not at all—no stuck funds Clean Interface: Modern, responsive design with clear transaction status updates Non-Custodial: Users maintain full control of funds at all times Gas Optimization: Batched operations reduce overall transaction costs Multi-Wallet Support: Works with MetaMask, WalletConnect, Coinbase Wallet

Innovation & Differentiation

vs. Direct Protocol Usage: Aave/Compound require manual bridging first; FlexiYield automates everything. vs. Yield Aggregators: Yearn/Beefy are single-chain focused; FlexiYield is cross-chain native. vs. Portfolio Dashboards: Zapper/DeBank show yields but don't enable cross-chain deposits; FlexiYield is actionable. vs. Manual Cross-Chain DeFi: 1 transaction vs. 3-5 transactions, 2 minutes vs. 15+ minutes, simple UX vs. high complexity. Our Innovation: We're the first to combine yield aggregation with atomic cross-chain execution using Avail Nexus's "Bridge & Execute" feature, making cross-chain yield optimization accessible to everyone, not just DeFi experts.

Target Users & Impact

Primary Users: USDC holders seeking passive income, yield farmers wanting efficiency, DeFi newcomers intimidated by complexity, multi-chain users tired of managing assets. Real-World Impact: Users earn 20-50% more yield by accessing best rates, save 13+ minutes per transaction, gain accessibility to DeFi without technical knowledge, and improve capital efficiency across protocols.

Technical Challenges Solved

Cross-Chain State Management: Tracking user balances across multiple chains using multi-chain wallet configuration. Atomic Bridge + Execute: Ensuring supply happens after successful bridge through Avail Nexus intent system with built-in failure handling. Real-Time Yield Data: Handling frequently changing APY rates through periodic API polling and intelligent caching. Gas Optimization: Reducing expensive cross-chain operations via batched intents through Avail Nexus. User Experience: Abstracting all complexity behind a simple "Supply" button that anyone can use.

Avail Nexus Integration

FlexiYield leverages Avail Nexus SDK's most powerful feature: "Bridge & Execute." This allows us to create atomic cross-chain intents where bridging and protocol interaction happen in a single operation. If the supply transaction fails on the destination chain, the bridge reverts, ensuring users never have stuck funds. This creates a trustless, seamless experience that's impossible with traditional bridging solutions. Benefits: Atomic operations eliminate multi-step failures, gas optimization through batched intents, superior UX with no manual network switching, and built-in security through intent-based architecture.

Security & Safety

FlexiYield is built with security as a priority. The platform is non-custodial—users maintain full control of their funds. We only integrate with audited, battle-tested protocols like Aave V3. All transactions have clear previews before execution. The codebase is open-source for community review. We follow a testnet-first development approach. Risk Management: Users are informed about smart contract risks, bridge infrastructure risks, market volatility, and network conditions. Transparent communication ensures informed decision-making.

Why FlexiYield Matters

FlexiYield represents the future of DeFi user experience where users focus on outcomes—earning optimal yields—rather than technical complexity like bridging, networks, and protocols. By leveraging Avail Nexus's innovative cross-chain infrastructure, we make the best yields accessible to everyone, not just DeFi experts. This is what mainstream DeFi adoption looks like: simple, efficient, and user-focused. FlexiYield proves that sophisticated cross-chain operations can be as easy as a single click. Mission: Democratize access to optimal DeFi yields across all blockchains.

How it's Made

Core Architecture

FlexiYield is built as a modern web application using Next.js 14 with React for the frontend framework. We started with Avail's official Nexus NextJS template as our foundation, which provided the essential boilerplate for integrating their SDK. The entire UI is styled with Tailwind CSS to create a clean, responsive interface that works seamlessly on both desktop and mobile devices. TypeScript is used throughout the project for type safety and better developer experience.

Avail Nexus Integration - The Heart of the Project

The most critical piece of FlexiYield is the Avail Nexus SDK integration, specifically using their nexus-core package. This is what makes our one-click cross-chain deposits possible. We implemented their "Bridge & Execute" functionality, which allows us to create atomic cross-chain intents. When a user wants to deposit USDC from Ethereum to Arbitrum's Aave pool, we construct a single intent that includes both the bridging operation and the Aave supply call. This was particularly tricky because we had to ensure proper error handling—if the Aave supply fails on the destination chain, the entire intent reverts, preventing users from having bridged funds stuck without being deposited.

Blockchain Interactions

For wallet connections and blockchain interactions, we used Wagmi v2, which provides React hooks for Ethereum functionality. This handles wallet detection, connection flows, and multi-chain support. We configured Wagmi to support Ethereum, Polygon, Arbitrum, and Base simultaneously, allowing users to see their USDC balances across all chains in real-time. Viem is used underneath Wagmi for lower-level contract interactions, transaction signing, and event listening.

DeFi Protocol Integration

Integrating with Aave V3 required direct smart contract interactions. We had to understand Aave's pool architecture and implement the supply function calls correctly. Each chain has its own Aave V3 pool contract address and USDC token address, so we created a configuration mapping for all supported chains. The tricky part was handling approvals—users need to approve the Aave pool contract to spend their USDC before supplying, and this had to be seamlessly integrated into our transaction flow.

Real-Time Yield Data

Getting accurate, real-time APY data was a challenge. We use Aave's public APIs to fetch current lending rates for USDC across all supported chains. The data is fetched periodically and cached on the frontend to avoid excessive API calls. We also query on-chain data for TVL metrics using Viem to show users liquidity information. The yield comparison table automatically highlights the best rate, making it immediately clear where users should deposit.

Cross-Chain State Management

One of the hackiest parts of the project was managing state across multiple chains. When a user initiates a cross-chain deposit, we needed to track the transaction through multiple stages: approval on source chain, intent creation, bridging status, and final supply confirmation on destination chain. We built a custom state machine that listens to events from both Avail Nexus and Aave contracts, updating the UI in real-time as the transaction progresses. This involved polling transaction receipts and parsing event logs to determine success or failure at each step.

User Experience Optimizations

To make the experience as smooth as possible, we implemented several UX enhancements. The wallet connection automatically detects which chain the user is on and shows their USDC balance without requiring manual network switching. Transaction status is displayed with clear, friendly messages instead of technical jargon. Loading states are shown at every step so users know something is happening. Error messages are descriptive and actionable, telling users exactly what went wrong and how to fix it.

Particularly Hacky Solutions

The most notable hack was handling the timing between bridging and executing on the destination chain. Avail Nexus handles this internally, but we needed to show accurate status updates to users. We implemented a polling mechanism that checks transaction status every few seconds and updates the UI accordingly. This involved tracking intent IDs across chains and querying multiple RPC endpoints simultaneously.

Another hacky solution was our fallback mechanism for yield data. If the Aave API is down or slow, we fall back to cached data with a warning banner telling users the rates might be slightly outdated. This ensures the app remains functional even if external services have issues.

Testing Strategy

We developed and tested extensively on testnets—Sepolia for Ethereum, Mumbai for Polygon, Arbitrum Sepolia, and Base Sepolia. This allowed us to test the full cross-chain flow without using real funds. We used Aave's testnet faucets to get test USDC and verified that the entire bridge-and-supply flow worked correctly before even thinking about mainnet deployment.

Deployment

The application is deployed on Vercel, which integrates seamlessly with Next.js. We set up automatic deployments from our GitHub repository, so every push to the main branch triggers a new production build. Environment variables are used to manage RPC endpoints, API keys, and contract addresses for different networks.

Partner Technology Benefits

Avail Nexus SDK was absolutely essential to this project. Without their "Bridge & Execute" functionality, we would have had to build separate bridging and execution flows, resulting in a much worse user experience. Their SDK abstracted away the complexity of cross-chain messaging and state synchronization, allowing us to focus on building a great product rather than solving low-level infrastructure problems.

Wagmi and Viem made blockchain interactions significantly easier. Their React hooks pattern fits naturally with our Next.js architecture, and their TypeScript support caught many potential bugs during development.

What Made This Project Challenging

The biggest challenge was understanding and debugging cross-chain transactions. When something fails in a multi-step cross-chain operation, it's not always clear where the failure occurred. We had to build comprehensive logging and error tracking to identify issues during testing. Another challenge was managing gas fees—cross-chain operations can be expensive, and we had to optimize our intent construction to minimize costs for users.

Technical Debt & Future Improvements

Given the hackathon timeframe, we made some pragmatic choices. The yield data could be more sophisticated—currently we show raw APY numbers, but we could calculate effective yields accounting for gas costs. The UI could be more polished with better animations and transitions. We also want to implement transaction history so users can track all their past deposits and withdrawals.

Why This Tech Stack Works

This combination of technologies—Next.js, Avail Nexus, Wagmi, and Aave—creates a powerful, user-friendly application. Each piece solves a specific problem: Next.js handles the web application, Avail Nexus handles cross-chain complexity, Wagmi handles blockchain interactions, and Aave provides the DeFi yield opportunities. Together, they enable a seamless experience that would have been impossible to build from scratch in a hackathon timeframe.

background image mobile

Join the mailing list

Get the latest news and updates