Nexus Browser extension - unifies cross-chain bridging with defi workflows for Aave, Morpho
A powerful browser extension that brings unified multi-chain liquidity to DeFi applications through intelligent transaction interception and automated cross-chain bridging. Built on the Avail Nexus SDK, this extension seamlessly integrates chain abstraction into any Web3 dApp without requiring protocol modifications.
This browser extension acts as an intelligent middleware layer between users and DeFi protocols, automatically detecting insufficient token balances and bridging assets from other chains to fulfill transactions. It transforms the fragmented multi-chain experience into a unified liquidity layer.
Content Script (nexusCA.tsx):
Background Service Worker (background.ts):
Popup UI (popup.tsx):
Injected Components:
IntentModal: User interface for approving cross-chain bridge intentsAllowanceModal: Token allowance approval flowNexusSteps: Progress tracking for multi-step bridging operationsThe extension has specialized integrations for:
Clone and Install
git clone <repository-url>
cd nexus-hyperliquid-poc
npm install
Build the Extension
npm run build
Create Distribution Zip (Optional)
npm run zip
# or build + zip in one command
npm run build-zip
chrome://extensionsdist/ folder from the project directoryFor active development with hot reload:
npm run dev
Then load the dist/ folder as an unpacked extension. Changes will rebuild automatically.
nexus-hyperliquid-poc/
āāā src/
ā   āāā injected/
ā   ā   āāā nexusCA.tsx          # Main content script & transaction interceptor
ā   ā   āāā cache.ts             # Unified balance caching
ā   ā   āāā caEvents.ts          # Nexus SDK event handlers
ā   ā   āāā checkNexus.ts        # Nexus initialization checks
ā   ā   āāā domModifier.ts       # DOM manipulation utilities
ā   ā   āāā networkInterceptor.ts # Network request interceptor
ā   āāā components/
ā   ā   āāā intent-modal.tsx     # Bridge intent approval UI
ā   ā   āāā allowance-modal.tsx  # Token allowance UI
ā   ā   āāā event-modal.tsx      # Progress tracking UI
ā   ā   āāā expandable-row.tsx   # Collapsible UI components
ā   āāā utils/
ā   ā   āāā constants.ts         # Token mappings & chain configs
ā   ā   āāā multicall.ts         # Multicall contract ABIs
ā   ā   āāā lido.abi.ts         # Lido protocol integration
ā   ā   āāā aave.abi.ts         # Aave V3 protocol integration
ā   ā   āāā lifi.abi.ts         # LiFi protocol integration
ā   ā   āāā publicClient.ts     # Viem public client setup
ā   āāā background.ts            # Service worker
ā   āāā popup.tsx               # Extension popup UI
ā   āāā manifest.json           # Extension manifest
āāā public/                     # Static assets
āāā vite.config.ts             # Vite build configuration
āāā package.json
Core Architecture & Technology Stack Nexus Bridge is built as a Manifest V3 Chrome Extension using modern web technologies that seamlessly integrate with existing DeFi protocols without requiring any changes to their codebases.Majorly made with using Nexus Bridge
Frontend Stack:
React 19 with TypeScript for robust UI components and type safety Vite 7 as the build tool with custom web extension plugins for optimized bundling Shadow DOM for UI isolation to prevent conflicts with dApp styling Tailwind CSS for consistent styling across injected components Web3 Integration:
Viem 2.33 for Ethereum interactions and smart contract calls EIP-6963 for universal wallet detection across MetaMask, Rabby, Rainbow, and other wallets Avail Nexus SDK as the core chain abstraction layer powering cross-chain bridging The Most Challenging Part - Seamless DeFi Integration The biggest technical hurdle was integrating with existing DeFi UIs without breaking them. We had to reverse-engineer how major protocols like Lido, Aave, and Morpho structure their interfaces and inject our functionality at exactly the right moments.
DOM Mutation Observation Strategy: We use intelligent mutation observers that watch for specific UI elements appearing on DeFi sites. When a user opens Lido's staking interface, our extension detects this and injects a "Unified ETH" button. For Aave, we watch for USDC supply modals and immediately show unified balance options.
Transaction Interception Magic: The most "hacky" but crucial part is intercepting Web3 provider calls before they reach the blockchain. We hook into eth_sendTransaction calls, analyze the transaction data to understand what DeFi action is being attempted, and determine if cross-chain bridging is needed. This happens completely transparently to both the user and the dApp.
Protocol-Specific Smart Contract Integration: Each protocol required deep analysis of their smart contract interfaces. For Lido, we hook into their submit function for ETH staking. For Aave V3, we intercept supply calls for USDC lending. For Morpho, we detect vault deposit transactions. This required studying each protocol's ABI and understanding their exact function signatures.
Partner Technology Integration - Avail Nexus SDK Avail Nexus SDK was absolutely crucial for handling the complex cross-chain infrastructure. Instead of building our own bridge aggregation, Nexus provides enterprise-grade bridging with automatic route optimization.
Key Benefits of Nexus SDK:
Automatic Route Optimization - Finds the cheapest and fastest bridge paths across 8+ chains Circle CCTP Integration - Native USDC bridging with 1:1 minting instead of wrapped tokens Multi-Chain Balance Aggregation - Real-time balance fetching across Ethereum, Arbitrum, Base, Polygon, etc. Intent-Based Architecture - Users approve outcomes rather than complex transaction sequences Notable Technical Innovations Unified Balance Caching System: We built a sophisticated caching layer that aggregates token balances across all supported chains in real-time. This creates the illusion of having one unified balance rather than fragmented balances across multiple chains.
Automated Post-Bridge Execution: The trickiest engineering challenge was automatically executing DeFi actions after bridging completes. Cross-chain bridges take 2-5 minutes, but we needed to seamlessly continue the user's intended action once tokens arrive. We implemented smart polling mechanisms that detect when bridged tokens arrive and automatically trigger the original DeFi function.
Shadow DOM UI Injection: To avoid CSS conflicts with existing dApps, we inject all UI components using isolated Shadow DOM. This ensures our modals and buttons don't break the original dApp styling while maintaining a native look and feel.
Multi-Wallet EIP-6963 Support: Rather than hardcoding specific wallet integrations, we implemented EIP-6963 for universal wallet discovery. This means our extension automatically works with any compliant Web3 wallet without requiring separate integrations.
Cross-Chain Bridge Flow Engineering The most complex engineering challenge was handling the asynchronous nature of cross-chain bridging while maintaining a smooth user experience. We had to design state management that tracks bridge progress, handles failures gracefully, and provides clear feedback throughout the multi-minute process.
Smart Contract Interaction Optimization: We optimized gas usage by batching operations where possible and implementing intelligent gas estimation that accounts for cross-chain scenarios. The extension automatically reserves gas for the final DeFi transaction when calculating bridge amounts.
Security & Non-Custodial Design Zero-Trust Architecture: The extension never has access to private keys or funds. All transactions are signed by the user's existing wallet, and we only intercept and analyze transaction data for optimization purposes.
Transaction Simulation: Before executing any bridge or DeFi operation, the Nexus SDK simulates transactions to ensure they will succeed, preventing failed transactions and wasted gas fees.
This project essentially creates a unified liquidity layer that makes multi-chain DeFi feel like single-chain DeFi, all while maintaining the security and decentralization that users expect.
This covers the technical depth while focusing on the innovation and engineering challenges rather than code snippets! š„

