ASyncVolt
Multi-chain ERC-7540 vault powered by Avail Nexus - deposit USDC from any chain with one click
Problem Statement
AsyncVault is a production-ready ERC-7540 asynchronous vault that leveragesAvail Nexus SDKto enable seamless cross-chain deposits and withdrawals from any EVM chain. Users can deposit USDC from Ethereum Sepolia, Base Sepolia, or Arbitrum Sepolia into a single unified vault - no manual bridging required.The Problem: Liquidity FragmentationTraditional DeFi vaults force users to manually bridge assets to the vault's chain, pay multiple transaction fees, wait for bridge confirmation, and switch networks multiple times. This creates poor UX, high friction, and fragmented liquidity across chains.Our Solution: Three Key InnovationsAvail Nexus Integration- Unified Cross-Chain AccessDeposit USDC from ANY supported chain (Ethereum, Base, Arbitrum, Optimism)Single-click cross-chain deposits via Avail's intent-based bridgingUsers never leave the app - Nexus handles bridging automaticallyNo manual bridging - seamless cross-chain UXERC-7540 Asynchronous Pattern- Perfect for Cross-ChainTwo-step deposit/redeem flow (request → claim) naturally fits cross-chain delaysReserve mechanism guarantees settlement even during market volatilityFair share pricing based on real-time vault valueSafe for asynchronous operations (bridges, oracle updates, etc.)Operator Pattern- Automated ClaimingSaves users a click - operator bot auto-claims deposits/redeemsNo waiting for manual confirmationBackend polling ensures timely executionOpt-in: users can self-claim if they prefer controlResult: Bundle fragmented liquidity across chains into a single vault with zero-friction UX.Why This MattersTraditional approach: 8 steps, 2 tools, 10+ minutes (manual bridge, switch networks, approve, deposit, manually claim)AsyncVault with Avail Nexus: 3 steps, 1 tool, 2-3 minutes (click bridge button, sign intent, auto-claimed by bot)Proof of SuccessIntent #1379: https://explorer.nexus-folly.availproject.org/intent/1379Successfully bridged 0.25 USDC from Ethereum Sepolia → Arbitrum SepoliaCompleted in ~28 secondsProof of working Avail Nexus integration in productionDeployed ContractsAsyncVault (Arbitrum Sepolia):0x604737c0Ae78cE6C8391eDfEA08f1D8077677d09Verified on Blockscout: https://arbitrum-sepolia.blockscout.com/address/0x604737c0Ae78cE6C8391eDfEA08f1D8077677d09Share Token: asUSDC (Async USDC Vault Shares)25+ comprehensive Foundry tests passingForked chain testing completed
Solution
Technologies & PartnersAvail Nexus SDK(Primary Integration):Used@avail-project/nexus-widgetspackage for cross-chain bridgingIntegratedBridgeButtoncomponent in Next.js frontendImplemented state management to keep widget mounted during chain switches (critical fix!)Successfully created Intent #1379 proving working integrationLeveraged Avail's decentralized solver network for optimal bridge routingSmart Contracts(Foundry):Solidity ^0.8.20 with OpenZeppelin ERC-4626 baseNovel ERC-7540 implementation extending ERC-4626 for async operationsInspired by Centrifuge's implementation pattern25+ tests covering deposits, redeems, profit/loss, reserves, operator access controlForked chain testing on both Ethereum and Arbitrum SepoliaFrontend(Next.js 14):TypeScript + React + Tailwind CSSServer-side components for operator and market simulator botsQuickNode RPC integration to bypass MetaMask caching (critical for fresh vault state)Dynamic chain switching and multi-chain USDC supportReal-time vault balance updatesCircle USDC:Primary asset across all chains (Ethereum, Arbitrum, Base, Optimism Sepolia)Used official Circle USDC contractsIntegrated Circle testnet faucet for easy testingBlockscout:Contract verification on Arbitrum SepoliaUsed Blockscout MCP for development and debuggingExplorer integration for transaction trackingTechnical Highlights1. Cross-Chain Architecture:User on Base → Avail Nexus Widget → Intent Created → Solver Fulfills → USDC on Arbitrum → Operator Auto-Claims → Shares Minted2. Operator Pattern Implementation:Hybrid detection: event listeners + polling loopTransaction queueing to prevent nonce collisionsSaves users from manual claim transactions (better UX)3. Market Simulator Bot:Geometric Brownian Motion model (10% APY, 80% volatility)Directly transfers USDC to/from vault for realistic profit/lossEmits events for indexer trackingDemonstrates robust vault accounting in async mode4. ERC-7540 Reserve Mechanism:Assets immediately reserved on redeem requestPrevents underfunding even if vault suffers losses before claimCritical for async vaults where time elapses between request and claimChallenges & SolutionsChallenge 1: Avail widget was disappearing after user interactionRoot Cause: React conditional rendering unmounted the BridgeButton when state changed from 'idle' → 'bridging' → 'bridge_complete'Solution: Modified rendering condition to keep button mounted through all states while Avail handles internal chain switchingImpact: Widget now stays open throughout entire bridge flowChallenge 2: MetaMask aggressively cached contract stateRoot Cause:eth_callresponses were cached, causing stale vault balances in UISolution: Bypassed MetaMask by using direct QuickNode RPC calls viafetch()for all state readsImpact: UI now shows fresh vault state in real-time, critical for bot modeChallenge 3: Testing cross-chain deposits without mainnet fundsRoot Cause: Needed to test Avail intents on testnets with limited solver activitySolution: Used Circle faucets, carefully selected stable chains (Base Sepolia), and documented timing expectationsImpact: Successfully created Intent #1379 proving integration worksChallenge 4: ERC-7540 implementation guidance was limitedRoot Cause: ERC-7540 is a new standard with few production implementationsSolution: Studied Centrifuge's pattern, implemented reserve mechanism, added comprehensive testsImpact: Robust async vault that handles profit/loss events between request and claim phasesHacky/Notable ElementsDynamic Chain Detection: Auto-detects vault chain from.envand selects correct USDC contract addresses across 4+ chainsOperator Bot as Next.js API Route: Runs as serverless function instead of separate process - unique architecture for hackathon contextQuickNode RPC Bypass: Directfetch()calls to QuickNode instead of using ethers providers - unconventional but necessary for fresh stateFork Testing Strategy: Mirrors deployment script logic to ensure tests match production configuration exactlyWhat Makes This SpecialFirst ERC-7540 vaultwith native Avail Nexus integrationPerfect synergy: Async vault pattern + intent-based bridging naturally complement each otherProduction-quality: Not just a demo - deployed, tested, verified, and workingReal problem solved: Multi-chain liquidity fragmentation with measurable UX improvement (8 steps → 3 steps)GitHub RepositoryPrimary Repository: hamiha70/OpenSecret (Monorepo)Repository Description: Repo for ETHOnline 2025Repository Structure:/contracts-foundry- Solidity contracts with Foundry/frontend- Next.js 14 dApp with Avail Nexus integration/docs- Comprehensive documentation + screenshots/docs/screenshots- Demo images for READMEAdditional InformationPrize TracksPrimary: Avail Nexus - Best DeFi or Payments app ($5,000 pool)README clearly explains how Avail Nexus SDK is used (code examples, architecture diagrams)Meaningful integration: cross-chain user onboarding, not just token bridgingLive demo with successful Intent #1379 on Avail ExplorerDeFi-focused: yield-generating USDC vaultSecondary:Circle - USDC Adoption (using official USDC contracts across all chains)Blockscout - Development & Verification (contract verified, MCP integration)Demo AssetsScreenshots: Available in/docs/screenshots/Cross-chain deposit UIAvail Nexus widget in actionBridge complete confirmationIntent Explorer showing Intent #1379Live Contract: https://arbitrum-sepolia.blockscout.com/address/0x604737c0Ae78cE6C8391eDfEA08f1D8077677d09Successful Intent: https://explorer.nexus-folly.availproject.org/intent/1379Testing InstructionsConnect MetaMask to any supported testnet (Ethereum, Base, Arbitrum, Optimism Sepolia)Get testnet USDC from Circle faucet: https://faucet.circle.com/Visit deployed app (or run locally:cd frontend && npm run dev)Click "Bridge from [Your Chain]" to test cross-chain deposit via Avail NexusWatch operator bot auto-claim your shares after bridge completes!Future RoadmapImplement "Bridge & Execute" for one-click bridge + depositAdd Envio indexer for event history dashboardDeploy to AWS with stable URLsSupport more chains (Polygon, Avalanche)Decentralize operator with keeper network (Gelato/Chainlink)Multi-asset support (USDT, DAI)Built with ❤️ for a multi-chain futurePowered by: Avail Nexus | ERC-7540 | Foundry | Next.js | Circle USDC | Blockscout
Hackathon
ETHOnline 2025
2025
Contributors
- hamiha70
97 contributions