A sophisticated AI-powered bridge agent built on Polygon that leverages Brian's AI capabilities for cross-chain transactions and DeFi operations. The system integrates with Polygon's Aggregated Blockchain technology and provides a unified bridge interface for seamless cross-chain interactions.
- Intelligent transaction analysis and routing using Brian AI
- Natural language processing for user commands
- Smart contract code generation
- Automated parameter extraction and validation
- Real-time market analysis and recommendations
- Seamless token bridging between supported chains: (WIP)
- Ethereum (Mainnet)
- Polygon (POS)
- Sepolia Testnet
- Amoy Testnet
- Gas optimization across chains
- Transaction validation and security checks
- Bridge fee estimation
- Token swaps with best rate finding
- Portfolio management and tracking
- Real-time token price feeds
- Gas fee optimization
- NFT operations and floor price tracking
- Intuitive chat-based interface
- Real-time transaction status updates
- Portfolio visualization
- Transaction history tracking
- Prompt suggestions and examples
- Framework: Next.js 15.0.4
- Web3 Integration: Ethers.js 5.7.2
- Wallet Connection: Web3-React 6.1.9
- UI Components: TailwindCSS 3.4.1
- AI Integration: @brian-ai/sdk 0.3.5, @ai-sdk/groq 1.0.6
- Primary Network: Polygon POS
- Bridge Protocol: Unified Bridge (AggLayer)
- Smart Contracts: Solidity 0.8.28
- Contract Framework: Hardhat 2.19.4
- Testing: Chai & Mocha
- Core AI: Brian API (brianknows.org)
- Language Model: Groq LLM
- Knowledge Base: Public blockchain data
.
├── contracts/ # Smart contracts
├── frontend/ # Next.js frontend application
├── scripts/ # Deployment and test scripts
├── test/ # Test files
└── config/ # Configuration files
- Node.js v18+
- Hardhat
- Metamask wallet
- Brian API key
- Polygon Amoy (POS) testnet/Mainnet RPC
- Clone the repository
- Install dependencies:
npm install
- Configure environment variables:
cp .env.example .env
- Add your API keys and configuration to
.env
-
Start the local hardhat node:
npx hardhat node
-
Deploy contracts:
npx hardhat run scripts/deploy.js --network polygon
-
Start the frontend:
cd frontend npm run dev
The system consists of three main components:
- AI Agent Core: Interfaces with Brian's API for intelligent decision-making
- Bridge Interface: Manages cross-chain transactions using Unified Bridge (WIP)
- DeFi Operations: Handles automated DeFi interactions
- All sensitive operations require user confirmation
- API keys are stored securely
- Rate limiting for AI operations
- Secure bridge transaction validation (WIP)