14-Protocol Arbitrage Bot: Spotting Opportunities Across All Major DeFi Venues

Spotting arbitrage opportunities across 15 DeFi protocols is just the first challenge for trading bot builders. The real test comes when your bot needs to execute a multi-step arbitrage trade across Jupiter, Hyperliquid, and LI.FI before the price gap closes—and your wallet infrastructure becomes the bottleneck.

Why Multi-Protocol Infrastructure Matters

Modern arbitrage opportunities rarely exist within a single protocol. The most profitable trades often require:

Each protocol has its own SDK, authentication method, and transaction format. Building this infrastructure from scratch means months of integration work—time your competitors are using to capture alpha.

The Multi-Protocol Trading Infrastructure Solution

WAIaaS provides a unified wallet service that connects your trading bot to 15 DeFi protocols through a single REST API. Instead of managing multiple wallets and SDKs, your bot makes one API call per action.

Supported Trading Protocols

The platform integrates these DeFi protocols for comprehensive arbitrage strategies:

DEX/Swap Protocols:

Perpetual Futures:

Cross-Chain Bridging:

Lending/Borrowing:

Liquid Staking:

Prediction Markets:

Gas Conditional Execution

One critical feature for arbitrage bots is gas conditional execution. Your transactions only execute when gas prices meet your threshold:

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": "0x742d35Cc6634C0532925a3b8D098342E92CcB1C1",
    "amount": "1.0",
    "gasCondition": {
      "maxGasPrice": "20000000000",
      "waitTimeout": 300
    }
  }'

This prevents your bot from executing unprofitable trades when network congestion spikes.

Cross-Protocol Arbitrage Example

Here's how a bot executes a complete arbitrage cycle across multiple protocols:

Step 1: Check available liquidity across protocols

# Check Jupiter liquidity for SOL/USDC
curl -X POST http://127.0.0.1:3100/v1/actions/jupiter-swap/quote \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{
    "inputMint": "So11111111111111111111111111111111111111112",
    "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "amount": "1000000000"
  }'

# Check Drift perpetual funding rates
curl -X POST http://127.0.0.1:3100/v1/actions/drift/get-market-info \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{"market": "SOL-PERP"}'

Step 2: Execute the arbitrage sequence

# Swap SOL for USDC on Jupiter
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": "1000000000",
    "slippageBps": 50
  }'

# Open leveraged SOL position on Drift
curl -X POST http://127.0.0.1:3100/v1/actions/drift/open-position \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{
    "market": "SOL-PERP",
    "direction": "long",
    "baseAssetAmount": "10000000",
    "leverage": 3
  }'

Step 3: Bridge profits to Ethereum for next opportunity

# Bridge USDC to Ethereum via LI.FI
curl -X POST http://127.0.0.1:3100/v1/actions/lifi/bridge \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{
    "fromChain": "solana",
    "toChain": "ethereum",
    "fromToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "toToken": "0xA0b86a33E6441a8e58c5BAb0E0F8fC7cc6a7A5d9",
    "amount": "1000000000"
  }'

Transaction Simulation for Risk Management

Before executing any arbitrage trade, simulate it to check profitability and catch reverts:

curl -X POST http://127.0.0.1:3100/v1/transactions/send \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{
    "type": "TRANSFER",
    "to": "recipient-address",
    "amount": "0.1",
    "dryRun": true
  }'

This returns the expected outcome without spending gas, letting you validate trade logic before execution.

Policy-Based Risk Controls

Set automated risk limits to prevent catastrophic losses:

curl -X POST http://127.0.0.1:3100/v1/policies \
  -H "X-Master-Password: my-secret-password" \
  -d '{
    "walletId": "<wallet-uuid>",
    "type": "SPENDING_LIMIT",
    "rules": {
      "instant_max_usd": 1000,
      "daily_limit_usd": 50000,
      "monthly_limit_usd": 500000
    }
  }'

The system automatically blocks trades exceeding your risk thresholds, even if your bot logic fails.

Quick Start: Deploy Your Arbitrage Bot

Step 1: Start WAIaaS with Docker

git clone https://github.com/minhoyoo-iotrust/WAIaaS.git
cd WAIaaS
docker compose up -d

Step 2: Create trading wallets

# Create Solana wallet for Jupiter/Drift
curl -X POST http://127.0.0.1:3100/v1/wallets \
  -H "X-Master-Password: my-secret-password" \
  -d '{"name": "solana-arb", "chain": "solana", "environment": "mainnet"}'

# Create Ethereum wallet for 0x/Aave
curl -X POST http://127.0.0.1:3100/v1/wallets \
  -H "X-Master-Password: my-secret-password" \
  -d '{"name": "ethereum-arb", "chain": "evm", "environment": "mainnet"}'

Step 3: Create bot sessions

curl -X POST http://127.0.0.1:3100/v1/sessions \
  -H "X-Master-Password: my-secret-password" \
  -d '{"walletId": "<solana-wallet-uuid>"}'

Step 4: Set risk policies

curl -X POST http://127.0.0.1:3100/v1/policies \
  -H "X-Master-Password: my-secret-password" \
  -d '{
    "walletId": "<wallet-uuid>",
    "type": "ALLOWED_TOKENS",
    "rules": {
      "tokens": [
        {"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "symbol": "USDC"},
        {"address": "So11111111111111111111111111111111111111112", "symbol": "SOL"}
      ]
    }
  }'

Step 5: Start trading

Your bot now has access to 15 DeFi protocols through a single API. Begin with simple Jupiter swaps, then expand to cross-protocol arbitrage as opportunities emerge.

For ongoing development, Building DeFi Trading Bots with Hyperliquid Integration covers advanced perpetual futures strategies, while Cross-Chain Bridge Arbitrage: Automated Profit from Price Differences explores multi-chain opportunities.

What's Next

Start with the basic setup above to test your arbitrage logic across protocols. The 39 REST API routes give you complete control over wallet operations, while the 7-stage transaction pipeline ensures reliable execution even during network congestion.

Ready to build your multi-protocol arbitrage bot? Get the complete infrastructure at GitHub or explore more capabilities at waiaas.ai.