You're building a trading bot that needs to make swaps, borrow against positions, and bet on election outcomes. But every protocol has its own API, quirks, and authentication flow. Jupiter uses one format, Aave another, and Polymarket requires USDC.B on Polygon with specific signatures. Your code becomes a mess of adapters and edge cases.
This fragmentation slows development and creates bugs. One protocol changes their API, your bot breaks. Gas estimation works differently on each one. Error handling is inconsistent. You spend more time on protocol integration than trading logic.
WAIaaS solves this by providing one unified API for 14 DeFi protocols across EVM and Solana. Your bot makes the same REST call whether it's swapping on Jupiter, lending on Aave, or betting on Polymarket. The system handles gas, signatures, error handling, and protocol-specific quirks automatically.
One API, 14 Protocols
WAIaaS integrates 14 DeFi protocol providers: aave-v3, across, dcent-swap, drift, erc8004, hyperliquid, jito-staking, jupiter-swap, kamino, lido-staking, lifi, pendle, polymarket, zerox-swap. Each provider follows the same action-based pattern.
Instead of learning each protocol's SDK, you make standardized calls:
# Jupiter swap (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"
}'
The same pattern works for every protocol. Lend on Aave:
curl -X POST http://127.0.0.1:3100/v1/actions/aave-v3/supply \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{"asset": "USDC", "amount": "1000"}'
Bet on Polymarket:
curl -X POST http://127.0.0.1:3100/v1/actions/polymarket/buy \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{"market": "presidential-election-2024", "outcome": "yes", "amount": "100"}'
Cross-Chain Made Simple
Your strategy needs to bridge assets between chains, swap on the best DEX, and lend where rates are highest. WAIaaS handles the complexity through cross-chain bridging via LI.FI and Across protocols.
Bridge USDC from Ethereum to Solana, then swap to SOL and stake with Jito — all through the same API interface. No manual bridge monitoring or transaction sequencing.
Real-Time Position Monitoring
Trading strategies need to track positions across multiple protocols. WAIaaS provides a unified positions endpoint:
curl http://127.0.0.1:3100/v1/wallet/defi-positions \
-H "Authorization: Bearer wai_sess_<token>"
This returns your lending positions on Aave, liquid staking on Lido, perpetual futures on Hyperliquid, and prediction market bets on Polymarket — all in one response. No need to query each protocol separately and normalize the data.
Risk Management Built In
DeFi strategies can blow up quickly. WAIaaS includes a policy engine with 21 policy types to prevent disasters. Set maximum leverage for perpetual futures, limit loan-to-value ratios for lending, or restrict which markets your bot can trade:
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": "PERP_MAX_LEVERAGE",
"rules": {"maxLeverage": 5.0}
}'
The system enforces these limits automatically. Your bot can't accidentally open a 50x position or lend volatile assets as collateral.
Simulation Before Execution
DeFi transactions can fail for many reasons — insufficient liquidity, slippage, gas estimation errors. WAIaaS includes dry-run simulation for all transactions:
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
}'
This simulates the transaction without executing it, showing you gas costs, slippage, and potential failures before you commit real funds.
TypeScript SDK
For TypeScript applications, the SDK provides a clean interface:
import { WAIaaSClient } from '@waiaas/sdk';
const client = new WAIaaSClient({
baseUrl: 'http://127.0.0.1:3100',
sessionToken: process.env.WAIAAS_SESSION_TOKEN,
});
// Execute DeFi action across any protocol
const result = await client.executeAction('jupiter-swap', 'swap', {
inputMint: 'So11111111111111111111111111111111111111112',
outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
amount: '1000000000'
});
// Monitor positions across all protocols
const positions = await client.getDeFiPositions();
console.log('Total value locked:', positions.totalValueUsd);
The SDK handles authentication, retries, and error handling automatically. Your application code focuses on strategy logic, not protocol plumbing.
Production Deployment
WAIaaS runs as a self-hosted daemon, giving you full control over your trading infrastructure. Deploy with Docker:
git clone https://github.com/minhoyoo-iotrust/WAIaaS.git
cd WAIaaS
docker compose up -d
The Docker deployment includes auto-provision with secure defaults, healthchecks, and persistent data storage. Your trading system stays online even through restarts.
Quick Start: Multi-Protocol Trading Bot
Here's how to build a cross-protocol arbitrage bot in 5 steps:
Deploy WAIaaS:
docker compose up -dCreate wallets: Use the CLI to set up EVM and Solana wallets with session tokens
Set policies: Configure spending limits and allowed protocols to prevent runaway trades
Monitor prices: Query multiple DEXs through the unified API to find arbitrage opportunities
Execute trades: Make simultaneous swaps across protocols when spreads are profitable
The unified API means your arbitrage logic works the same whether you're trading Ethereum/Polygon via 0x or Solana via Jupiter.
What's Next
This gives you the foundation for sophisticated DeFi strategies without protocol integration headaches. The 39 REST API routes cover everything from basic swaps to complex derivatives trading.
Ready to simplify your DeFi development? Check out the full documentation and examples at https://github.com/minhoyoo-iotrust/WAIaaS, or visit https://waiaas.ai to see all supported protocols and features.
Top comments (0)