LIQUID STAKING

Liquid Staking API for AI Agents

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.

View Docs Get API Key
6
Supported Protocols
~4%
Avg ETH Staking APY
5
API Endpoints
4
MCP Tools
Overview

What is Liquid Staking?

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.

💎
Stake ETH, Get LST
Deposit ETH into Lido, Rocket Pool, or another liquid staking protocol. You instantly receive stETH, rETH, or cbETH — a token that represents your staked position plus all future yield. The conversion happens automatically with no unbonding period at deposit.
📊
Yield Accrues Automatically
Your LST balance (or exchange rate) grows over time as Ethereum staking rewards accumulate. stETH rebases daily — your token balance increases. rETH and cbETH use exchange rate models — each token becomes worth more ETH over time. No manual claiming needed.
🔓
Maintain Liquidity
LSTs are fully fungible ERC-20 tokens. Unlike native ETH staking (which requires a 1-5 day withdrawal queue), LSTs can be swapped on DEXs or used in DeFi protocols immediately. Agents can unstake gradually via protocol redemption or swap on Curve/Uniswap instantly.

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.


Protocols

Supported Liquid Staking Protocols

Purple Flea integrates with all major liquid staking protocols. Each protocol has different tradeoffs in decentralization, liquidity, DeFi integration, and yield.

Lido
stETH
~3.8%
APY
The largest liquid staking protocol by TVL. stETH rebases daily — your balance grows automatically. Deepest liquidity and widest DeFi integration of any LST.
Largest TVL Rebase Model
Rocket Pool
rETH
~3.5%
APY
Decentralized protocol requiring node operators to post ETH collateral. rETH uses exchange rate model, ideal for DeFi protocols that don't support rebasing tokens.
Decentralized Exchange Rate
Coinbase Staking
cbETH
~3.2%
APY
Coinbase Wrapped Staked ETH. Institutional-grade custody and compliance. High liquidity across major exchanges. Exchange rate model for compatibility.
Institutional Exchange Rate
Ankr
ankrETH
~3.6%
APY
Ankr's multi-chain liquid staking solution. ankrETH is available across multiple EVM chains. Exchange rate model. Enables cross-chain staking strategies.
Multi-chain Exchange Rate
Swell
swETH
~3.9%
APY
Swell Network's LST with deep EigenLayer integration. Bonus SWELL token rewards on top of base staking yield. Native restaking support.
Bonus Rewards EigenLayer Ready
Frax Finance
frxETH
~4.1%
APY
Frax's two-token staking system: frxETH pegs to ETH, sfrxETH captures all staking yield. Often highest base APY among major LSTs due to protocol design.
High APY Dual Token

REST API

API Endpoints

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 — GET /v1/liquid-staking/apy
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 }
  ]
}

Integration

Autonomous Staking Agent — Python

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.

Python — Liquid Staking Agent with Auto-Rebalance
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

Yield Data

Protocol Yield Comparison

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.


Composability

DeFi Composability of LSTs

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.

Restake on EigenLayer

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.

Use as Lending Collateral

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.

Provide DEX Liquidity

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.

Yield Aggregators

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.


MCP Integration

MCP Tools for Liquid Staking

Agents using the Purple Flea MCP server can call liquid staking operations directly as tool calls. Configure your agent with the MCP config generator.

liquid_stake_eth
liquid_unstake
get_lst_balance
get_staking_apy
swap_lst
MCP Tool Call — liquid_stake_eth
{
  "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 }

Related APIs

Build the Full Yield Stack

Liquid staking is the foundation layer. Combine it with restaking, lending, and aggregators for maximum autonomous yield generation.

GET STARTED

Put Your Agent's ETH to Work

Get an API key and start earning liquid staking yield autonomously in minutes. No KYC, no manual management, no waiting around.