DEV Community

Cover image for Automated Staking: Lido on Ethereum, Jito on Solana
Wallet Guy
Wallet Guy

Posted on

Automated Staking: Lido on Ethereum, Jito on Solana

Your DeFi trading bot connects to Jupiter for swaps, Aave for lending, Lido for staking, Hyperliquid for perps, and Drift for Solana futures. That's five different APIs, five authentication systems, and five different ways transactions can fail. What if you could access all 14 DeFi protocols through a single, unified API?

The Multi-Protocol Integration Nightmare

Every DeFi protocol has its own SDK, its own quirks, and its own way of handling transactions. Jupiter wants you to build routes and calculate slippage. Aave requires health factor monitoring. Lido has its own staking contracts. Hyperliquid uses WebSocket connections for order management. Each protocol is a separate integration project.

For developers building yield strategies, arbitrage bots, or portfolio management tools, this fragmentation is expensive. You spend more time wrestling with protocol APIs than building your actual strategy. And when something breaks at 3 AM, you need to debug five different systems.

One API for 14 DeFi Protocols

WAIaaS solves this with a unified DeFi API that abstracts away protocol complexity. Instead of learning Jupiter's routing engine, Aave's liquidation mechanics, and Hyperliquid's order types, you make simple REST calls to execute actions across all protocols.

The system integrates 14 DeFi protocols: aave-v3, across, dcent-swap, drift, erc8004, hyperliquid, jito-staking, jupiter-swap, kamino, lido-staking, lifi, pendle, polymarket, and zerox-swap. Each protocol becomes an "action provider" with a consistent interface.

Here's how automated staking works across both chains:

Liquid Staking: Lido (Ethereum) + Jito (Solana)

Instead of managing separate staking contracts, you call one endpoint that handles both Ethereum and Solana liquid staking:

# Stake ETH via Lido
curl -X POST http://127.0.0.1:3100/v1/actions/lido-staking/stake \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{
    "amount": "1.5"
  }'
Enter fullscreen mode Exit fullscreen mode
# Stake SOL via Jito
curl -X POST http://127.0.0.1:3100/v1/actions/jito-staking/stake \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{
    "amount": "10.0"
  }'
Enter fullscreen mode Exit fullscreen mode

Both calls return the same response format:

{
  "id": "tx_01234567-89ab-cdef",
  "status": "PENDING",
  "action": "lido-staking/stake",
  "amount": "1.5",
  "estimatedRewards": "0.045",
  "stakingToken": "stETH"
}
Enter fullscreen mode Exit fullscreen mode

WAIaaS handles the protocol differences—Lido's stETH minting, Jito's validator selection, slippage protection, and transaction retry logic. You get liquid staking tokens back without touching Solidity or Rust.

Cross-Protocol DeFi Positions Dashboard

The real power emerges when you query positions across all protocols. While Jupiter shows swap history and Aave shows lending positions, WAIaaS aggregates everything:

curl http://127.0.0.1:3100/v1/wallet/defi-positions \
  -H "Authorization: Bearer wai_sess_<token>"
Enter fullscreen mode Exit fullscreen mode

Response includes staking positions from multiple protocols:

{
  "positions": [
    {
      "protocol": "lido-staking",
      "type": "STAKING",
      "token": "stETH",
      "amount": "1.5",
      "valueUsd": "3750.00",
      "apy": "3.2%"
    },
    {
      "protocol": "jito-staking", 
      "type": "STAKING",
      "token": "jitoSOL",
      "amount": "10.0",
      "valueUsd": "1200.00",
      "apy": "7.1%"
    },
    {
      "protocol": "aave-v3",
      "type": "LENDING",
      "token": "USDC",
      "supplied": "5000.0",
      "apy": "4.8%"
    }
  ],
  "totalValueUsd": "9950.00"
}
Enter fullscreen mode Exit fullscreen mode

This unified view enables sophisticated strategies. Your bot can rebalance between Lido staking and Aave lending based on yield spreads, or move funds from Ethereum to Solana when Jito rates exceed Lido by your threshold.

Multi-Chain Arbitrage Example

Here's a real scenario: Jito staking yields 7% while Lido yields 3%. Your bot unstakes from Lido, bridges to Solana via LI.FI, and stakes with Jito—all through the same API:

# 1. Unstake from Lido
curl -X POST http://127.0.0.1:3100/v1/actions/lido-staking/unstake \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{"amount": "1.0"}'

# 2. Bridge ETH to Solana via LI.FI
curl -X POST http://127.0.0.1:3100/v1/actions/lifi/bridge \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{
    "fromChain": "ethereum",
    "toChain": "solana", 
    "amount": "1.0",
    "fromToken": "ETH",
    "toToken": "SOL"
  }'

# 3. Stake SOL with Jito
curl -X POST http://127.0.0.1:3100/v1/actions/jito-staking/stake \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{"amount": "15.0"}'
Enter fullscreen mode Exit fullscreen mode

Each step returns a transaction ID you can monitor. The 7-stage transaction pipeline handles validation, policy checks, execution, and confirmation. If step 2 fails, step 3 never executes.

Advanced: Perpetual Futures + Hedged Staking

WAIaaS enables complex strategies combining staking with derivatives. Stake ETH via Lido for yield, then hedge price risk with Hyperliquid perps:

# Stake 10 ETH with Lido
curl -X POST http://127.0.0.1:3100/v1/actions/lido-staking/stake \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{"amount": "10.0"}'

# Hedge with short ETH perp on Hyperliquid
curl -X POST http://127.0.0.1:3100/v1/actions/hyperliquid/place-order \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{
    "symbol": "ETH",
    "side": "sell",
    "size": "10.0",
    "orderType": "market"
  }'
Enter fullscreen mode Exit fullscreen mode

You earn Lido staking rewards while being price-neutral. WAIaaS handles Hyperliquid's WebSocket authentication, order management, and position tracking alongside Ethereum staking contracts.

Risk Management Across Protocols

The policy engine provides unified risk management across all 14 protocols. Set spending limits that apply to staking, swapping, and perp trading:

curl -X POST http://127.0.0.1:3100/v1/policies \
  -H "X-Master-Password: <password>" \
  -d '{
    "type": "ACTION_CATEGORY_LIMIT",
    "rules": {
      "staking_daily_limit_usd": 5000,
      "perp_max_position_usd": 10000,
      "bridge_delay_seconds": 300
    }
  }'
Enter fullscreen mode Exit fullscreen mode

The system blocks dangerous operations—like staking more than your daily limit or opening oversized perp positions—before they reach the blockchain.

Getting Started with Multi-Protocol DeFi

Deploy WAIaaS and start building across protocols:

  1. Start the daemon: docker run -d -p 3100:3100 -e WAIAAS_AUTO_PROVISION=true ghcr.io/minhoyoo-iotrust/waiaas:latest

  2. Create wallets for both chains: Use the CLI to set up Ethereum and Solana wallets with waiaas quickset --mode mainnet

  3. Configure RPC endpoints: Add your Ethereum and Solana RPC URLs to connect to mainnet protocols

  4. Set DeFi policies: Configure spending limits and protocol restrictions before going live

  5. Start with staking: Test Lido and Jito staking calls, then expand to swaps, lending, and perp trading

The 39 REST API routes, 14 protocol integrations, and unified position tracking give you everything needed for sophisticated DeFi strategies. Instead of managing multiple SDKs, you build once and deploy across all major protocols.

Ready to unify your DeFi integrations? Check out the code at GitHub or explore the full protocol documentation at waiaas.ai.

Top comments (0)