Stake ETH and receive yield-bearing LSTs (stETH, rETH, cbETH) through a single API call. Your agent earns ~4% APY while keeping the token liquid for DeFi, restaking, or lending — no manual custody required.
Traditional ETH staking locks your ETH in a validator, making it illiquid for the duration of the staking period. Liquid staking protocols solve this by issuing a representative token — a Liquid Staking Token (LST) — that you receive in return for your staked ETH.
Why this matters for AI agents: An agent receiving payments in ETH can instantly put idle ETH to work earning ~3.5–4.5% APY with a single API call — without losing access to the capital. The LST can later be used as collateral in Aave, restaked on EigenLayer via /restaking-api, or swapped back to ETH at any time. It's the foundation of autonomous treasury management.
Purple Flea integrates with all major liquid staking protocols. Each protocol has different tradeoffs in decentralization, liquidity, DeFi integration, and yield.
All liquid staking operations are accessible via REST. Authenticate with your Purple Flea API key. All amounts are in ETH denominated strings to preserve precision.
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/liquid-staking/stake | Deposit ETH and receive liquid staking tokens. Specify protocol (lido, rocketpool, coinbase, ankr, swell, frax), amount_eth, and optional slippage_bps. Returns LST amount received and transaction hash. |
| POST | /v1/liquid-staking/unstake | Initiate LST redemption back to ETH. Specify protocol and amount_lst. Returns estimated completion time (protocol redemption queue) and withdrawal ID for monitoring. |
| GET | /v1/liquid-staking/balance | Get current LST balances across all protocols. Returns per-protocol holdings with ETH equivalent, USD value, accrued yield since deposit, and pending withdrawal status. |
| GET | /v1/liquid-staking/apy | Get current staking APY by protocol, updated every 15 minutes. Includes 7-day and 30-day trailing APY for trend analysis. Useful for agent yield comparisons before staking. |
| POST | /v1/liquid-staking/swap | Swap between liquid staking tokens (e.g., stETH to rETH). Routed through Curve, Uniswap, or 1inch for best execution. Specify from_lst, to_lst, amount, and max_slippage_bps. |
curl https://api.purpleflea.com/v1/liquid-staking/apy \ -H 'Authorization: Bearer pf_live_your_key' # Response { "updated_at": "2026-03-06T09:00:00Z", "protocols": [ { "id": "frax", "token": "frxETH", "apy_7d": 4.12, "apy_30d": 4.05 }, { "id": "swell", "token": "swETH", "apy_7d": 3.92, "apy_30d": 3.88 }, { "id": "lido", "token": "stETH", "apy_7d": 3.81, "apy_30d": 3.79 }, { "id": "ankr", "token": "ankrETH", "apy_7d": 3.64, "apy_30d": 3.61 }, { "id": "rocketpool", "token": "rETH", "apy_7d": 3.52, "apy_30d": 3.49 }, { "id": "coinbase", "token": "cbETH", "apy_7d": 3.21, "apy_30d": 3.18 } ] }
This example demonstrates an agent that monitors its wallet balance, automatically stakes ETH above a reserve threshold, monitors APY across protocols, and auto-rebalances to the highest-yield LST when the spread exceeds 20 basis points.
import requests import time from datetime import datetime API_KEY = "pf_live_your_api_key" BASE_URL = "https://api.purpleflea.com" HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"} ETH_RESERVE = 0.05 # Keep 0.05 ETH liquid for gas STAKE_THRESHOLD = 0.1 # Stake when idle ETH > 0.1 REBALANCE_BPS = 20 # Rebalance if spread > 20bps APY def get_best_protocol(protocols): """Return the protocol with highest 7-day APY.""" return max(protocols, key=lambda p: p["apy_7d"]) def stake_idle_eth(balance, apys): """Stake ETH above reserve into highest-yield protocol.""" idle_eth = balance["ETH"] if idle_eth <= (STAKE_THRESHOLD + ETH_RESERVE): return None stake_amount = idle_eth - ETH_RESERVE best = get_best_protocol(apys["protocols"]) print(f"Staking {stake_amount:.4f} ETH via {best['id']} ({best['apy_7d']}% APY)") r = requests.post(f"{BASE_URL}/v1/liquid-staking/stake", headers=HEADERS, json={ "protocol": best["id"], "amount_eth": str(stake_amount), "slippage_bps": 30 }) return r.json() def check_rebalance(holdings, apys): """Check if we should swap to a higher-yield LST.""" protocols = apys["protocols"] best = get_best_protocol(protocols) for holding in holdings: current_apy = next((p["apy_7d"] for p in protocols if p["id"] == holding["protocol"]), 0) spread_bps = (best["apy_7d"] - current_apy) * 100 if spread_bps > REBALANCE_BPS and holding["protocol"] != best["id"]: print(f"Rebalancing {holding['token']} → {best['token']} (+{spread_bps:.0f}bps)") requests.post(f"{BASE_URL}/v1/liquid-staking/swap", headers=HEADERS, json={ "from_lst": holding["token"], "to_lst": best["token"], "amount": holding["balance"], "max_slippage_bps": 50 }) # Main agent loop while True: ts = datetime.now().isoformat() print(f"[{ts}] Running liquid staking checks...") wallet = requests.get(f"{BASE_URL}/v1/wallet/balance", headers=HEADERS).json() apys = requests.get(f"{BASE_URL}/v1/liquid-staking/apy", headers=HEADERS).json() holdings = requests.get(f"{BASE_URL}/v1/liquid-staking/balance", headers=HEADERS).json()["holdings"] stake_idle_eth(wallet["balances"], apys) check_rebalance(holdings, apys) time.sleep(1800) # Run every 30 minutes
APY varies by protocol and market conditions. The table below shows indicative current ranges. Use the /v1/liquid-staking/apy endpoint for live data in your agent.
| Protocol | Token | APY (7d) | Yield Model | Best For |
|---|---|---|---|---|
| Frax Finance | frxETH / sfrxETH |
4.1% | Dual token | Max yield |
| Swell Network | swETH |
3.9% | Exchange rate | EigenLayer restaking |
| Lido | stETH |
3.8% | Rebase daily | Max liquidity |
| Ankr | ankrETH |
3.6% | Exchange rate | Multi-chain |
| Rocket Pool | rETH |
3.5% | Exchange rate | DeFi collateral |
| Coinbase | cbETH |
3.2% | Exchange rate | Institutional trust |
APY rates are indicative and change continuously. Not financial advice. Past performance does not guarantee future yield.
The real power of liquid staking is composability — an LST is just an ERC-20 token that can be plugged into any DeFi protocol while still earning staking yield. Agents can stack multiple yield sources simultaneously.
Deposit stETH, rETH, or cbETH into EigenLayer to earn additional yield from AVS rewards on top of base staking APY. Combine with the Restaking API for full automation. Total yield: base APY + AVS rewards.
Supply stETH or rETH to Aave or Compound as collateral and borrow USDC against it. Your LST continues earning staking yield while unlocking liquidity. See DeFi Lending API for automation tools.
Add stETH/ETH or rETH/ETH to Curve's liquid staking pools to earn trading fees on top of staking yield. Purple Flea's yield aggregator routes liquidity to the highest-return pool automatically.
Protocols like Yearn and Convex automatically compound LST yields across multiple DeFi strategies. Use the Yield Aggregator API to route capital to optimal compounding vaults.
Agents using the Purple Flea MCP server can call liquid staking operations directly as tool calls. Configure your agent with the MCP config generator.
{
"tool": "liquid_stake_eth",
"parameters": {
"protocol": "lido",
"amount_eth": "1.5",
"slippage_bps": 30
}
}
// Returns: { lst_received: "1.487", token: "stETH", tx_hash: "0xabc...", apy: 3.81 }
Liquid staking is the foundation layer. Combine it with restaking, lending, and aggregators for maximum autonomous yield generation.
Get an API key and start earning liquid staking yield autonomously in minutes. No KYC, no manual management, no waiting around.