Multi-Chain Trading Bots: 18 Networks, 2 Chain Types, One Unified API
Multi-chain trading bots face a critical challenge: managing wallet operations across 18 networks and 2 chain types while maintaining millisecond-level execution speeds. Traditional approaches force developers to juggle multiple wallet libraries, RPC connections, and transaction formats — creating complexity that kills performance when markets move fast.
Why Multi-Chain Trading Complexity Kills Bot Performance
Modern trading opportunities span multiple blockchains. A profitable arbitrage might require swapping on Jupiter (Solana), hedging on Hyperliquid (EVM), and bridging liquidity via LI.FI — all within seconds. Bot developers waste weeks building wallet infrastructure instead of optimizing trading strategies.
Gas costs compound the problem. Your bot spots a 0.3% arbitrage opportunity, but gas spikes make the trade unprofitable. Without gas-conditional execution, you're burning ETH on failed trades while competitors with better infrastructure capture the alpha.
Risk management becomes even harder across chains. How do you enforce position limits when your bot trades Solana perpetuals, Ethereum lending, and cross-chain bridges simultaneously? Manual policy enforcement is too slow and error-prone for algorithmic trading.
One API for 18 Networks, 15 DeFi Protocols
WAIaaS provides a unified wallet infrastructure that abstracts away multi-chain complexity. Your trading bot makes the same API calls whether executing on Ethereum mainnet or Solana devnet.
The system supports 2 chain types (EVM and Solana) across 18 networks, with 15 DeFi protocol integrations including Jupiter (Solana DEX), Hyperliquid (perpetual futures), Drift (leveraged trading), and LI.FI (cross-chain bridging).
Here's how your bot executes a cross-chain arbitrage:
# 1. Swap SOL to USDC on Jupiter (Solana)
curl -X POST http://127.0.0.1:3100/v1/actions/jupiter-swap/swap \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "5000000000",
"slippageBps": 50
}'
# 2. Bridge USDC to Ethereum via LI.FI
curl -X POST http://127.0.0.1:3100/v1/actions/lifi/quote \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{
"fromChain": "solana",
"toChain": "ethereum",
"fromToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"toToken": "0xA0b86a33E6441E13C7E0AD6AF53fD9c1B53eB7Ac",
"fromAmount": "5000000"
}'
# 3. Execute leveraged position on Hyperliquid
curl -X POST http://127.0.0.1:3100/v1/actions/hyperliquid/order \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{
"coin": "ETH",
"is_buy": true,
"sz": "0.1",
"limit_px": "3800",
"order_type": {"limit": {"tif": "Gtc"}},
"reduce_only": false
}'
Gas-Conditional Execution Saves Your PnL
Gas spikes can turn profitable trades into losses. WAIaaS includes gas-conditional execution — transactions only execute when gas prices meet your threshold.
Set gas conditions when submitting transactions:
curl -X POST http://127.0.0.1:3100/v1/transactions/send \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{
"type": "TRANSFER",
"to": "0x742d35Cc6634C0532925a3b8D64C8ba4E7C2F8c3",
"amount": "0.1",
"gasCondition": {
"maxGasPrice": "30000000000",
"timeoutMinutes": 60
}
}'
The transaction pipeline queues your trade and executes only when gas drops below 30 gwei. If gas stays high for 60 minutes, the transaction expires — protecting your strategy from high-fee execution.
Risk Controls That Don't Slow You Down
Trading bots need risk management without latency penalties. WAIaaS enforces 21 policy types across 4 security tiers: INSTANT (no delay), NOTIFY (execute + alert), DELAY (time-locked), and APPROVAL (manual override).
Configure spending limits with tier-based execution:
curl -X POST http://127.0.0.1:3100/v1/policies \
-H "X-Master-Password: <password>" \
-d '{
"walletId": "<wallet-uuid>",
"type": "SPENDING_LIMIT",
"rules": {
"instant_max_usd": 1000,
"notify_max_usd": 5000,
"delay_max_usd": 25000,
"delay_seconds": 300,
"daily_limit_usd": 50000
}
}'
Your bot executes trades up to $1,000 instantly. Trades between $1,000-$5,000 execute immediately with notifications. Larger positions get a 5-minute delay (cancellable if market moves against you). Trades above $25,000 require manual approval.
Set protocol-specific risk limits:
# Max 10x leverage on perpetual futures
curl -X POST http://127.0.0.1:3100/v1/policies \
-H "X-Master-Password: <password>" \
-d '{
"type": "PERP_MAX_LEVERAGE",
"rules": {"maxLeverage": 10}
}'
# Whitelist approved lending assets
curl -X POST http://127.0.0.1:3100/v1/policies \
-H "X-Master-Password: <password>" \
-d '{
"type": "LENDING_ASSET_WHITELIST",
"rules": {
"assets": ["USDC", "ETH", "WBTC", "SOL"]
}
}'
Real-Time Position Monitoring
Track DeFi positions across all protocols with a single API call:
curl http://127.0.0.1:3100/v1/defi/positions \
-H "Authorization: Bearer wai_sess_<token>"
Response includes lending positions, perpetual futures, staking rewards, and liquidity pool shares — giving your bot a unified view of portfolio exposure.
The system monitors incoming transactions and sends real-time notifications when positions change or new funds arrive:
curl http://127.0.0.1:3100/v1/incoming/summary \
-H "Authorization: Bearer wai_sess_<token>"
Quick Start: Deploy a Trading Bot
Install and initialize WAIaaS
npm install -g @waiaas/cli waiaas init --auto-provision waiaas startCreate trading wallets
# Solana wallet for DEX trades waiaas wallet create solana-trading solana mainnet # Ethereum wallet for DeFi positions waiaas wallet create ethereum-trading evm ethereum-mainnetCreate bot sessions
waiaas quickset --mode mainnet # Outputs session tokens for your botSet risk policies
# Configure spending limits and protocol restrictions # See policy examples aboveStart trading
# Your bot uses the session tokens to execute trades # All wallet operations via unified REST API
For more advanced setups, see Docker Deployment: ghcr.io/minhoyoo-iotrust/waiaas:latest with Auto-Provision for production infrastructure and Policy Engine: 21 Types, 4 Security Tiers, Default-Deny for comprehensive risk management.
What's Next
Your trading bot now has unified wallet infrastructure across 18 networks with built-in risk controls and gas optimization. Focus on strategy development instead of wallet management. Check out the GitHub repository for the full codebase or visit waiaas.ai for detailed documentation and API reference.