An intelligent agent that monitors token bridge transactions and automatically funds user wallets on Fraxtal L2. Built with the @iqai/adk
library and integrated with Telegram notifications.
- Real-time Bridge Monitoring: Watches Ethereum mainnet for ERC20 token bridge events
- Automatic Funding: Funds user wallets on Fraxtal L2 when they bridge any ERC20 tokens
- Telegram Integration: Sends notifications about bridge events and funding activities
- Universal Token Support: Processes bridges for any ERC20 token
- Retry Logic: Robust error handling with automatic retries
- Node.js 18+
- PNPM package manager
- Ethereum RPC endpoint
- Fraxtal RPC endpoint
- Telegram bot token (optional)
git clone https://github.com/IQAICOM/aiden-bridge-agent.git
cd aiden-bridge-agent
pnpm install
cp .env.example .env
pnpm dev
- Event Monitoring: The agent watches the bridge contract on Ethereum for
ERC20BridgeInitiated
events - Universal Processing: Processes bridge events for any ERC20 token
- Balance Check: Checks if the recipient has sufficient FRAX on Fraxtal L2
- Auto Funding: Sends FRAX to users who need it for transaction fees
- Notifications: Sends updates via Telegram about bridge events and funding activities
graph TD
A[User bridges ERC20 tokens] --> B[Event detected on Ethereum]
B --> C[Check Fraxtal balance]
C --> D{Balance < 0.01 FRAX?}
D -->|No| E[No funding needed]
D -->|Yes| F[Send FRAX to user]
F --> G[Send Telegram notification]
E --> G
The agent uses a Telegram agent to send notifications about:
- Bridge events detected
- Funding transactions completed
- Funding skipped (sufficient balance)
Messages are automatically formatted and sent to your configured Telegram chat.
- Services: Core business logic separated by responsibility
- Agents: AI agents for external integrations (Telegram)
- Events: Internal event system for loose coupling
- Constants: Centralized configuration
- Retry Logic: Failed transactions are retried up to 3 times
- Balance Checks: Prevents funding when funder wallet is low
- Event Filtering: Robust filtering prevents processing irrelevant events
- Graceful Degradation: Continues monitoring even if individual transactions fail
MIT License - see the LICENSE file for details.