Automate EigenLayer restaking with Purple Flea's agent-native API. Stake ETH, stETH, rETH, and cbETH across multiple AVSs, delegate to operators, and compound rewards — all via REST or MCP tools with no manual intervention.
Restaking is a mechanism pioneered by EigenLayer that allows ETH stakers to put their staked assets to work securing additional protocols beyond Ethereum itself — earning additional yield in the process.
How it works for AI agents: An agent holds idle ETH or LSTs in its Purple Flea wallet. Rather than letting them sit unused, the agent calls POST /v1/restaking/stake to deposit into EigenLayer, then POST /v1/restaking/delegate to select a high-yield operator. The agent can monitor rewards with GET /v1/restaking/rewards and auto-claim when a threshold is reached.
All restaking endpoints follow Purple Flea's standard REST conventions. Authentication uses your API key via Authorization: Bearer pf_live_... header.
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/restaking/stake | Stake ETH, rETH, stETH, cbETH, ankrETH, or swETH into EigenLayer. Specify asset, amount, and optional operator address. |
| GET | /v1/restaking/position | Retrieve current restaking position: deposited amounts per LST, total USD value, current operator delegation, and unstaking queue status. |
| GET | /v1/restaking/rewards | Fetch accumulated restaking rewards across all delegated AVSs. Returns per-AVS reward amounts, total USD value, and last claim timestamp. |
| POST | /v1/restaking/claim | Claim accumulated restaking rewards to the agent's wallet. Optionally specify avs_address to claim from a single AVS, or omit to claim all pending rewards. |
| GET | /v1/restaking/avs | List all available AVSs with current APY, total restaked TVL, operator count, risk tier, and supported LSTs. Sorted by APY descending by default. |
| POST | /v1/restaking/delegate | Delegate restaked assets to a specific EigenLayer operator. Specify operator_address and optionally the LSTs to redelegate. Undelegation triggers a 7-day withdrawal queue. |
# List AVSs sorted by APY curl https://api.purpleflea.com/v1/restaking/avs \ -H 'Authorization: Bearer pf_live_your_key' # Response { "avs": [ { "name": "EigenDA", "address": "0x870679E138bCdf293b7Ff14dD44b70FC97e12fc0", "apy": 4.2, "tvl_usd": 1240000000, "operator_count": 42, "risk_tier": "low", "supported_lsts": ["ETH", "stETH", "rETH", "cbETH"] }, { "name": "AltLayer MACH", "apy": 6.1, "tvl_usd": 340000000, "risk_tier": "medium" } ] }
Purple Flea's Restaking API accepts all six major Liquid Staking Tokens supported by EigenLayer, as well as native ETH for direct restaking.
This example shows an autonomous AI agent that monitors its ETH balance, stakes idle ETH when it exceeds a threshold, selects the highest-APY AVS, and auto-claims rewards weekly.
import requests import time from datetime import datetime, timedelta API_KEY = "pf_live_your_api_key" BASE_URL = "https://api.purpleflea.com" HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"} # Configuration STAKE_THRESHOLD_ETH = 0.5 # Stake when wallet holds > 0.5 ETH idle CLAIM_THRESHOLD_USD = 10.0 # Claim rewards when > $10 accumulated PREFERRED_LST = "stETH" # Preferred LST for restaking def get_best_avs(): """Find the highest-APY AVS with acceptable risk.""" r = requests.get(f"{BASE_URL}/v1/restaking/avs", headers=HEADERS) avs_list = r.json()["avs"] # Filter to low/medium risk only, pick highest APY safe_avs = [a for a in avs_list if a["risk_tier"] in ["low", "medium"]] return max(safe_avs, key=lambda x: x["apy"]) def check_and_stake(): """Stake idle ETH above threshold.""" wallet = requests.get(f"{BASE_URL}/v1/wallet/balance", headers=HEADERS).json() eth_balance = wallet["balances"]["ETH"] if eth_balance > STAKE_THRESHOLD_ETH: stake_amount = eth_balance - 0.1 # Keep 0.1 ETH for gas best_avs = get_best_avs() print(f"Staking {stake_amount:.4f} ETH into AVS: {best_avs['name']} ({best_avs['apy']}% APY)") r = requests.post(f"{BASE_URL}/v1/restaking/stake", headers=HEADERS, json={ "asset": "ETH", "amount": str(stake_amount), "operator": best_avs["top_operator_address"] }) return r.json() def check_and_claim_rewards(): """Claim rewards if above threshold.""" rewards = requests.get(f"{BASE_URL}/v1/restaking/rewards", headers=HEADERS).json() total_usd = rewards["total_usd_value"] if total_usd >= CLAIM_THRESHOLD_USD: print(f"Claiming ${total_usd:.2f} in restaking rewards") r = requests.post(f"{BASE_URL}/v1/restaking/claim", headers=HEADERS, json={}) return r.json() # Main agent loop while True: print(f"[{datetime.now().isoformat()}] Running restaking checks...") check_and_stake() check_and_claim_rewards() pos = requests.get(f"{BASE_URL}/v1/restaking/position", headers=HEADERS).json() print(f"Current position: ${pos['total_usd_value']:.2f} restaked") time.sleep(3600) # Check every hour
Restaking introduces additional risk on top of base Ethereum staking. Agents should understand and configure appropriate risk tolerances before deploying capital.
/v1/restaking/position endpoint shows queue status and estimated unlock timestamps.Restaking unlocks a category of autonomous yield strategies that are impossible with manual management — perfectly suited for always-on AI agents.
All restaking operations are available as MCP tools for agents running via the Purple Flea MCP server. Use these tool names in your agent's system prompt or tool calls.
{
"tool": "restaking_claim",
"parameters": {
"agent_id": "agent_abc123",
"avs_address": "all",
"min_usd_threshold": 10
}
}
// Returns: { claimed_usd: 14.23, tx_hash: "0xabc...", rewards_by_avs: {...} }
Restaking works best as part of a broader yield strategy. Combine it with liquid staking, lending, and aggregators for maximum agent yield.
Get an API key and connect your agent to EigenLayer in minutes. Full documentation and Python/Node.js examples in the API reference.