39 REST API Routes: Complete Wallet Control for Your Trading Bot

Your arbitrage bot spotted a 2% price difference between Solana and Ethereum. The window's closing fast — but your bot has to juggle wallet connections across Jupiter, Uniswap, and LI.FI for the bridge. By the time you've signed three transactions and paid $40 in gas, the opportunity's gone. Sound familiar?

The Infrastructure Gap in Automated Trading

Most trading bots are built like Formula 1 cars with bicycle wheels. The strategy engine is sophisticated — multi-protocol arbitrage, MEV extraction, yield farming automation — but the wallet layer is a mess of scattered API keys, manual gas management, and prayer-based transaction signing.

You end up writing the same wallet infrastructure over and over: transaction queueing, gas price monitoring, balance tracking across chains, retry logic when RPCs go down. Meanwhile, your actual alpha-generating code gets maybe 20% of your development time.

The stakes are real. In high-frequency trading environments, a 200ms delay in transaction execution can mean the difference between profit and loss. Gas optimization isn't just about saving fees — it's about execution speed when network congestion spikes.

39 REST API Routes: Your Bot's Financial Operating System

WAIaaS solves this with a comprehensive wallet API designed specifically for automated trading systems. Instead of managing keys, RPCs, and transaction signing yourself, your bot gets 39 REST endpoints that handle everything from basic balance queries to complex multi-step DeFi operations.

Here's what your trading bot actually needs to do its job:

Gas-Conditional Execution: Only Trade When It's Profitable

Your arbitrage bot shouldn't execute when gas costs eat the spread. WAIaaS includes gas conditional execution as a built-in feature:

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": "20000000000",
      "timeoutSeconds": 300
    }
  }'

The transaction sits in the pipeline until gas prices drop below your threshold, then executes automatically. Your bot focuses on finding opportunities; WAIaaS handles the execution timing.

Multi-Protocol DeFi Access: 14 Protocols, One API

Trading bots need to access liquidity wherever it exists. WAIaaS integrates 14 DeFi protocols including Jupiter, Uniswap, Aave, Drift, Hyperliquid, and LI.FI. Same authentication, same response format, same error handling:

# Swap on Jupiter (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"
  }'

# Open leveraged position on Hyperliquid
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": "ETH",
    "is_buy": true,
    "sz": "1.5",
    "limit_px": "3200",
    "order_type": {"limit": {"tif": "Gtc"}}
  }'

No more maintaining separate SDK integrations for each protocol. Your bot makes the same HTTP calls whether it's trading perpetuals on Hyperliquid or swapping tokens on Jupiter.

Cross-Chain Arbitrage: Seamless Bridge Integration

Cross-chain arbitrage requires reliable bridging. WAIaaS includes LI.FI and Across protocol integrations with automatic bridge route optimization:

# Bridge USDC from Ethereum to Solana for arbitrage
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": "0xA0b86a33E6417Eb9fd3BBB7C8e17b0ad98c6b9E0",
    "toToken": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "amount": "1000000000"
  }'

The bridge transaction is automatically included in your bot's transaction pipeline with the same gas conditioning and approval flows as any other operation.

Transaction Simulation: Test Before You Risk Capital

In automated trading, failed transactions aren't just annoying — they cost gas and miss opportunities. WAIaaS includes dry-run simulation for every transaction type:

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",
    "dryRun": true
  }'

Your bot can simulate the entire transaction sequence, get exact gas estimates, and verify execution before committing capital. Critical for MEV bots where transaction reversion means lost gas with no profit.

Account Abstraction: Gasless Execution

For high-frequency strategies, ERC-4337 Account Abstraction enables gasless transactions and batch execution:

# Build UserOp for gasless execution
curl -X POST http://127.0.0.1:3100/v1/userop/build \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{
    "transactions": [
      {"type": "APPROVE", "spender": "0x...", "amount": "1000000"},
      {"type": "CONTRACT_CALL", "to": "0x...", "data": "0x..."}
    ],
    "paymasterService": "pimlico"
  }'

Batch multiple operations into a single UserOp, use paymasters for gasless execution, or enable wallet recovery without seed phrases.

Risk Management: Built-In Safety Rails

Trading bots need safety rails that don't interfere with legitimate strategies. WAIaaS implements a 3-layer security model designed for automated systems:

Layer 1: Session Authentication

Your bot gets a JWT session token with configurable limits:

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>",
    "maxRenewals": 1000,
    "ttlSeconds": 3600,
    "absoluteLifetimeSeconds": 86400
  }'

Sessions can be configured per strategy — your scalping bot gets short TTL with high renewal limits, while your yield farming bot gets longer sessions with fewer renewals.

Layer 2: Policy Engine

Policies define spending limits and approval thresholds without breaking automated execution:

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,    # Execute immediately under $1k
      "notify_max_usd": 5000,     # Send notification $1k-$5k
      "delay_max_usd": 20000,     # 15min delay $5k-$20k
      "delay_seconds": 900,
      "daily_limit_usd": 50000    # Hard daily limit
    }
  }'

Small trades execute instantly. Large trades get time delays for human review. Your bot keeps running while the policy engine prevents catastrophic losses.

Layer 3: Kill Switch

When something goes wrong, you need an emergency stop that works even if your bot is compromised:

# Emergency stop all bot activity
curl -X POST http://127.0.0.1:3100/v1/sessions/<session-id>/revoke \
  -H "X-Owner-Signature: <ed25519-signature>" \
  -H "X-Owner-Message: <signed-message>"

Owner authentication bypasses compromised bot credentials and immediately stops all transaction activity.

Performance and Reliability

7-Stage Transaction Pipeline

WAIaaS processes transactions through a 7-stage pipeline: validation → authentication → policy → wait → execute → confirm → monitoring. Each stage is optimized for low latency while maintaining security guarantees.

Failed transactions at any stage return detailed error codes your bot can handle programmatically:

{
  "error": {
    "code": "INSUFFICIENT_BALANCE",
    "message": "Balance 0.5 SOL insufficient for transaction requiring 0.8 SOL",
    "domain": "VALIDATION", 
    "retryable": false
  }
}

Multi-Chain RPC Management

WAIaaS handles RPC endpoint management, failover, and load balancing across 15 networks. Your bot makes the same API calls whether targeting Ethereum mainnet, Solana, or Arbitrum. No more managing separate RPC configurations or handling network-specific errors.

Real-Time Balance and Position Tracking

Trading bots need accurate balance information for position sizing:

# Get current balance across all tokens
curl http://127.0.0.1:3100/v1/wallet/balance \
  -H "Authorization: Bearer wai_sess_<token>"

# Get DeFi positions across all protocols  
curl http://127.0.0.1:3100/v1/wallet/defi-positions \
  -H "Authorization: Bearer wai_sess_<token>"

Responses include USD valuations, lending positions, liquidity provider stakes, and perpetual futures positions across all integrated protocols.

Quick Start: Deploy Your Trading Infrastructure

Get a complete wallet infrastructure running in under 5 minutes:

  1. Deploy with Docker: One command gets you the full API server with data persistence:
git clone https://github.com/minhoyoo-iotrust/WAIaaS.git
cd WAIaaS
docker compose up -d
  1. Create wallets: Set up separate wallets for different strategies:
npm install -g @waiaas/cli
waiaas init --auto-provision
waiaas start
waiaas quickset --mode mainnet
  1. Configure your bot: Replace your wallet management code with HTTP calls to http://127.0.0.1:3100. The complete OpenAPI spec is available at http://127.0.0.1:3100/doc.

  2. Set policies: Configure risk limits that match your strategy requirements.

  3. Start trading: Your bot now has enterprise-grade wallet infrastructure with gas optimization, cross-chain support, and built-in risk management.

Production-Ready from Day One

WAIaaS isn't a prototype — it's a complete financial infrastructure with 611+ test files, Docker deployment, comprehensive monitoring, and production security practices. Trading bots using WAIaaS are already executing millions in volume across Solana and EVM chains.

Ready to upgrade your trading bot's infrastructure? Check out the complete codebase at GitHub or explore the full documentation at waiaas.ai.