Cross-Chain Bridging for AI Agents: LI.FI and Across
Your trading bot needs to move funds from Ethereum to Solana, then swap for USDC, then stake on Jito — all programmatically. Instead of juggling multiple APIs, wallet connections, and bridge interfaces, what if you could execute cross-chain strategies with simple REST calls?
The Multi-Chain DeFi Problem
DeFi is fragmented across chains. Your yield strategy might require Aave lending on Ethereum, Jupiter swaps on Solana, and Drift perpetuals — but each protocol has different APIs, signing patterns, and wallet requirements. Building a cross-chain trading system means:
- Managing wallets on multiple chains
- Learning each protocol's SDK (Jupiter, Across, LI.FI all have different interfaces)
- Handling bridge timing and gas optimization
- Coordinating transaction sequences across chains
The complexity compounds when you're building AI agents that need to execute these strategies autonomously. Your agent shouldn't need to understand Ethereum gas mechanics AND Solana transaction versions AND bridge settlement times.
Cross-Chain Bridges in WAIaaS
WAIaaS provides unified REST APIs for cross-chain bridging through LI.FI and Across protocols. Your AI agent gets one interface to move funds between any supported chains, with automatic route optimization and transaction monitoring.
LI.FI aggregates bridge liquidity across protocols like Hop, Connext, and Stargate. Across specializes in fast, capital-efficient bridging between major EVM chains. WAIaaS handles the complexity — your agent just specifies source chain, destination chain, and amount.
Bridge Integration Example
Here's how to bridge USDC from Ethereum to Polygon using LI.FI:
curl -X POST http://127.0.0.1:3100/v1/actions/lifi/bridge \
-H "Content-Type: application/json" \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{
"fromChain": "ethereum-mainnet",
"toChain": "polygon-mainnet",
"fromToken": "0xA0b86a33E6441146C3039A5CB6EfF1f1De03aAef",
"toToken": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
"amount": "100000000",
"recipient": "0x742d35Cc6B99D100c3b3AA5F9A05d6d4b2f5B8A4"
}'
WAIaaS returns the transaction ID immediately. The bridge operation happens asynchronously — you can monitor progress through the transaction status API:
curl http://127.0.0.1:3100/v1/transactions/<tx-id> \
-H "Authorization: Bearer wai_sess_<token>"
The response includes bridge-specific status like settlement time estimates and destination transaction hashes once available.
Cross-Chain Strategy Automation
With 14 DeFi protocol providers integrated (Aave, Jupiter, Lido, Drift, Hyperliquid, and more), you can build sophisticated cross-chain strategies. Here's a yield optimization sequence:
- Bridge USDC from Ethereum to Solana via LI.FI
- Swap half to SOL using Jupiter
- Stake SOL with Jito liquid staking
- Use remaining USDC for Drift perpetual position
Each step is a single API call:
# Step 1: Bridge USDC ETH → SOL
curl -X POST http://127.0.0.1:3100/v1/actions/lifi/bridge \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{"fromChain": "ethereum-mainnet", "toChain": "solana-mainnet", ...}'
# Step 2: Swap USDC → SOL on Jupiter
curl -X POST http://127.0.0.1:3100/v1/actions/jupiter-swap/swap \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{"inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "outputMint": "So11111111111111111111111111111111111111112", ...}'
# Step 3: Stake SOL with Jito
curl -X POST http://127.0.0.1:3100/v1/actions/jito-staking/stake \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{"amount": "5000000000"}'
# Step 4: Open Drift perp position
curl -X POST http://127.0.0.1:3100/v1/actions/drift/place-order \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{"marketIndex": 0, "direction": "long", "baseAssetAmount": "1000000000"}'
Policy-Controlled Bridge Operations
Cross-chain bridges involve significant funds movement. WAIaaS policy engine provides granular controls for bridge operations:
# Create bridge-specific policy
curl -X POST http://127.0.0.1:3100/v1/policies \
-H "X-Master-Password: <password>" \
-d '{
"type": "ALLOWED_NETWORKS",
"rules": {
"networks": [
{"network": "ethereum-mainnet"},
{"network": "polygon-mainnet"},
{"network": "solana-mainnet"}
]
}
}'
This policy blocks bridge operations to unauthorized chains. Combined with SPENDING_LIMIT policies, you can require human approval for large bridge amounts while allowing smaller automated operations.
The policy engine supports 21 policy types with 4 security tiers: INSTANT, NOTIFY, DELAY, APPROVAL. Bridge operations exceeding your delay threshold get queued for the specified delay period, giving you time to cancel if needed.
Multi-Chain Portfolio Monitoring
WAIaaS aggregates DeFi positions across all integrated protocols. One API call shows your complete cross-chain exposure:
curl http://127.0.0.1:3100/v1/defi/positions \
-H "Authorization: Bearer wai_sess_<token>"
Response includes positions from Aave (Ethereum), Jupiter LP pools (Solana), Jito staking (Solana), Drift perpetuals (Solana), and other protocols — with USD values, health factors, and yield rates unified in one response.
Transaction Pipeline and Gas Optimization
WAIaaS runs a 7-stage transaction pipeline that handles bridge complexities automatically:
- Stage 1-3: Validation, authentication, policy checks
- Stage 4: Gas condition waiting — bridges execute only when gas meets your threshold
- Stage 5: Execution with automatic retry logic
- Stage 6-7: Confirmation monitoring across both chains
Gas conditional execution is crucial for bridges since they involve two transaction fees. Set your gas threshold to avoid executing during fee spikes:
# Transaction waits until Ethereum gas < 30 gwei
curl -X POST http://127.0.0.1:3100/v1/actions/across/bridge \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{
"fromChain": "ethereum-mainnet",
"gasCondition": {"maxGasPrice": "30000000000"},
...
}'
Getting Started with Cross-Chain DeFi
Here's how to set up cross-chain bridging in 5 minutes:
- Start WAIaaS with Docker:
git clone https://github.com/minhoyoo-iotrust/WAIaaS.git
cd WAIaaS
docker compose up -d
- Create wallets on multiple chains:
npm install -g @waiaas/cli
waiaas quickset --mode mainnet # Creates Ethereum + Solana wallets
Fund your wallets — deposit tokens you want to bridge
Create bridge policies:
waiaas quickstart # Sets up reasonable default policies
- Test a bridge operation using the REST API examples above
Your wallets are now ready for cross-chain DeFi automation. The 39 REST API route modules handle everything from bridge routing to transaction monitoring.
Advanced Bridge Features
For production systems, WAIaaS offers additional bridge capabilities:
- Dry-run simulation: Test bridge operations without execution using
"dryRun": true - Batch operations: Bridge multiple tokens in one transaction
- Custom recipients: Bridge directly to different addresses on destination chain
- Route optimization: LI.FI automatically finds cheapest/fastest bridge routes
The MCP integration provides 45 tools that AI agents like Claude can use directly — including bridge operations, balance checks, and position monitoring across all chains.
What's Next
Cross-chain DeFi strategies are just getting started. WAIaaS gives you the infrastructure to build sophisticated AI agents that can arbitrage yield opportunities, rebalance portfolios, and execute complex strategies across the entire DeFi ecosystem.
Ready to build cross-chain DeFi automation? Check out the full documentation and examples at https://github.com/minhoyoo-iotrust/WAIaaS, or explore the live API reference at https://waiaas.ai.