The AI-Optimized Bridge Router is a decentralized application (DApp) that helps users move assets across multiple blockchains securely, quickly, and at the lowest possible cost.
Today, users face a fragmented experience when bridging assets:
- They must manually compare fees, speed, and reliability across multiple bridges.
- They often worry about the security of each bridge, especially after historical exploits.
- Switching between multiple UIs and RPCs adds unnecessary friction.
This project solves these issues by aggregating available cross-chain bridge services into a single interface and applying real-time analytics and AI-driven scoring to recommend the best route for a given transfer.
-
Bridge Aggregation Connects to top bridging protocols (Connext, Hop, Axelar, Wormhole, etc.) and fetches real-time data such as fees, liquidity, and finality times.
-
Quote Comparison Displays normalized bridge quotes side by side, allowing users to quickly compare costs, speeds, and risks.
-
Security Scoring Uses a heuristic scoring system based on audits, exploit history, and custodial risk. Later versions may include AI-based scoring.
-
Route Recommendation Combines cost, speed, and security metrics into a weighted ranking system. Users can adjust their preferences (e.g., prioritize cheapest vs. safest).
-
Transaction Simulation Previews expected gas costs, target contract addresses, and warnings before a transfer is initiated.
-
Unified Claim & Execution Provides a single button for routing or claiming, redirecting seamlessly to the user’s wallet or the selected bridge’s execution flow.
- Machine learning-based scoring (trained on historical data).
- Multi-hop routing across chains.
- Expansion to 10+ bridges.
- Telegram/Discord notifications when a better route becomes available.
- Smart contract: router contract for atomic multi-hop transfers
This project uses pre-commit hooks (similar to Husky + Prettier) to ensure code quality:
# Install pre-commit (one-time setup)
pip install pre-commit
# Setup hooks for this project
./scripts/setup-hooks.sh
# Or manually:
pre-commit installsrc/
├── main.rs # Axum app entry point
├── config/ # Environment & config handling
├── db/ # SQLx connection & migrations
├── cache/ # Redis integration
├── routes/ # API route handlers
├── services/ # Business logic (bridges, scoring, recommendation)
├── models/ # Database models and DTOs
├── utils/ # Helpers and error handling
└── telemetry/ # Logging and metrics
- All APIs return JSON using
serde::Serialize. - Errors use
thiserrorandanyhowfor context-rich handling. - Logging uses
tracingwith structured events. - Secrets are loaded via
dotenvyandconfig, never hardcoded. - Integration tests live in
/testswith real API health checks.
We welcome contributions! To keep the project organized, please follow these steps:
-
Clone the repo:
-
Copy
.env.exampleto.envand fill in required values. -
Run database migrations:
cargo sqlx migrate run
-
Start backend:
cargo run
-
Start frontend (from
frontend/):npm install npm run dev
master: Stable branch.- Feature branches:
feature/<name>(e.g.,feature/bridge-aggregator). - Bugfix branches:
fix/<name>.
Follow Conventional Commits:
feat:new featurefix:bug fixchore:maintenance tasksdocs:documentation changesrefactor:code changes without new features
Example:
feat(bridge-client): add Connext API integration
- Open a PR against
master. - Ensure CI passes (tests + lint).
- Request at least one reviewer.
-
Write integration tests for new endpoints in
/tests. -
Run tests before PR submission:
cargo test
- Check open issues before creating a new one.
- Use labels (
backend,frontend,security,docs).