Why Trading Bots Need Unified DeFi Infrastructure: One Wallet, 14 Protocols
Your arb bot spotted the opportunity — USDC trading at a premium on one DEX while borrowing rates are low on Aave. But by the time you've connected to three different protocols, signed multiple transactions, and paid gas fees twice, the opportunity vanished. Trading bots need unified DeFi infrastructure that executes fast, manages risk automatically, and doesn't drain profits through inefficient wallet management.
Why Trading Infrastructure Matters
Profitable trading happens in microseconds, but most bots waste precious time on wallet plumbing. You're either building custom integrations for every protocol (Jupiter, Drift, Aave, Pendle), managing gas optimization manually, or accepting that failed transactions will eat your margins. Professional trading requires professional infrastructure — not a collection of ad-hoc scripts calling different APIs with separate private keys.
The stakes are real: MEV opportunities disappear in blocks, arbitrage windows close when gas spikes, and liquidation protection requires split-second execution across multiple venues. Your trading logic should focus on alpha generation, not wrestling with transaction management.
Unified DeFi Access for Trading Bots
WAIaaS provides a single wallet that connects to 15 DeFi protocols through one API. Your trading bot makes the same API call whether it's swapping on Jupiter (Solana), lending on Aave (Ethereum), or trading perpetuals on Hyperliquid. The wallet handles chain routing, gas optimization, and transaction batching automatically.
Here's how a cross-protocol arbitrage bot executes in three API calls:
# Check positions across all protocols
curl http://127.0.0.1:3100/v1/wallet/defi-positions \
-H "Authorization: Bearer wai_sess_<token>"
# Execute Jupiter swap on Solana
curl -X POST http://127.0.0.1:3100/v1/actions/jupiter-swap/swap \
-H "Content-Type: application/json" \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000000"
}'
# Hedge position on Hyperliquid perps
curl -X POST http://127.0.0.1:3100/v1/actions/hyperliquid/place-order \
-H "Content-Type: application/json" \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{
"coin": "SOL",
"is_buy": false,
"sz": "10",
"limit_px": "185.5",
"order_type": {"limit": {"tif": "Ioc"}}
}'
No private key management, no gas estimation, no RPC reliability issues. The wallet infrastructure handles execution while your bot handles strategy.
Gas-Conditional Execution
Smart trading bots don't just execute — they execute profitably. WAIaaS includes gas conditional execution that queues transactions until gas prices meet your threshold. Your arbitrage opportunity stays profitable even if gas spikes during execution.
# Send with gas condition: only execute if gas < 50 gwei
curl -X POST http://127.0.0.1:3100/v1/transactions/send \
-H "Content-Type: application/json" \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{
"type": "TRANSFER",
"to": "recipient-address",
"amount": "0.1",
"gasCondition": {
"maxGasPrice": "50000000000"
}
}'
The transaction waits in queue until gas conditions are met, preserving your profit margins automatically.
Risk Management Built In
Professional trading requires position limits, slippage protection, and kill switches. WAIaaS policies enforce risk controls at the infrastructure level — your bot can't accidentally drain the entire wallet on a single bad trade.
# Set trading limits policy
curl -X POST http://127.0.0.1:3100/v1/policies \
-H "Content-Type: application/json" \
-H "X-Master-Password: my-secret-password" \
-d '{
"walletId": "<wallet-uuid>",
"type": "SPENDING_LIMIT",
"rules": {
"instant_max_usd": 1000,
"daily_limit_usd": 10000,
"monthly_limit_usd": 50000
}
}'
The wallet enforces these limits automatically. No matter what your bot tries to do, it can't exceed position limits or drain capital beyond configured thresholds.
Multi-Protocol Portfolio Management
Real trading strategies span multiple protocols: you might swap on Jupiter, lend on Kamino, stake with Jito, and hedge on Drift. WAIaaS provides unified access to all 15 integrated protocols through consistent API endpoints.
# Get complete DeFi portfolio across all protocols
curl http://127.0.0.1:3100/v1/wallet/defi-positions \
-H "Authorization: Bearer wai_sess_<token>"
Response includes positions from lending protocols (Aave, Kamino), DEXs (Jupiter, 0x), perpetual futures (Hyperliquid, Drift), staking (Lido, Jito), and prediction markets (Polymarket). Your bot sees the complete picture in one API call.
Cross-Chain Bridge Automation
Multi-chain strategies require reliable bridging. WAIaaS integrates LI.FI and Across protocols for automated cross-chain transfers. Your bot can bridge assets as part of larger trading strategies without managing bridge-specific APIs.
# Bridge USDC from Ethereum to Solana via 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",
"toChain": "solana",
"fromToken": "0xA0b86a33E6441E059a81CE3d2F0c4D6A99c1A8BC",
"toToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"amount": "1000000000"
}'
Bridge, swap, and trade — all coordinated through one wallet infrastructure.
Transaction Batching and Simulation
Complex trading strategies often require multiple transactions executed atomically. WAIaaS supports transaction batching and includes dry-run simulation to test strategies before risking capital.
# Simulate complex strategy before execution
curl -X POST http://127.0.0.1:3100/v1/transactions/send \
-H "Content-Type: application/json" \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{
"type": "BATCH",
"transactions": [
{"type": "TRANSFER", "to": "address1", "amount": "0.1"},
{"type": "CONTRACT_CALL", "to": "0xDEF1...", "data": "0x123..."}
],
"dryRun": true
}'
The simulation returns success/failure and gas estimates without executing on-chain. Only commit capital when you know the strategy will work.
Quick Start for Trading Bots
- Deploy with Docker — Production-ready infrastructure in 30 seconds:
git clone https://github.com/minhoyoo-iotrust/WAIaaS.git
cd WAIaaS
docker compose up -d
- Create trading wallet and session:
# Create wallet
curl -X POST http://127.0.0.1:3100/v1/wallets \
-H "Content-Type: application/json" \
-H "X-Master-Password: my-secret-password" \
-d '{"name": "trading-bot", "chain": "solana", "environment": "mainnet"}'
# Create session for bot authentication
curl -X POST http://127.0.0.1:3100/v1/sessions \
-H "Content-Type: application/json" \
-H "X-Master-Password: my-secret-password" \
-d '{"walletId": "<wallet-uuid>"}'
Configure risk policies — Set position limits and gas conditions
Integrate with your trading bot — Use the 39 REST API endpoints or TypeScript/Python SDKs
Monitor via Admin UI — Track performance and positions at http://127.0.0.1:3100/admin
What's Next
Your trading bot deserves infrastructure that matches its sophistication. WAIaaS handles wallet management, protocol integrations, and risk controls so you can focus on generating alpha. Ready to upgrade your trading infrastructure? Check out the complete setup at GitHub and explore the full platform at waiaas.ai.