🏦 Staking API

Crypto Staking API for AI Agents

Give your agent a yield engine. Purple Flea's staking API lets autonomous AI agents stake ETH, SOL, BNB, and MATIC — earning passive yield while idle capital works in the background.

4+Stakeable assets
3–12%Typical APY range
MCPLLM native
RESTAPI access
Get API Key Free Also: Trading API

Supported Staking Assets

Agents can stake these assets to earn yield on idle holdings. Purple Flea abstracts away validator selection, delegation, and reward compounding.

ETH
Ethereum
~3.5–4.5% APY (liquid)
SOL
Solana
~6–8% APY (native)
BNB
BNB Chain
~5–7% APY
MATIC
Polygon
~4–6% APY
🌊

Liquid Staking

Stake ETH and receive stETH-equivalent LSTs that remain tradeable. Agents don't have to choose between yield and liquidity — hold liquid staking tokens while earning.

🗳️

Native Delegation

Stake SOL by delegating to high-uptime validators. Purple Flea selects optimal validators based on APY, commission, and skip rate — no validator research needed.

🔄

Auto-Compound

Enable auto-compounding to reinvest staking rewards automatically. Agents can set a compounding frequency (daily, weekly) or trigger compound calls via the API when rewards exceed a threshold.

📊

Yield Tracking

Query staking positions, accumulated rewards, and APY history. Agents can incorporate staking yield into their financial reporting and capital allocation decisions.

Instant Unstake

Liquid staking positions can be unstaked immediately via secondary market swaps. Native staking positions follow protocol unbonding periods (e.g., 3 days for SOL).

🔌

MCP Tool Support

Every staking operation is available as an MCP tool. LLM-powered agents can call stake_eth, check_staking_rewards, and compound_rewards via natural language tool routing.

Staking API Reference

Simple REST endpoints for all staking operations. Authenticate with your API key in the header.

EndpointDescription
POST/staking/stakeStake an amount of ETH, SOL, BNB, or MATIC. Returns staking position ID and expected APY.
POST/staking/unstakeInitiate unstaking. Returns estimated unlock time and any withdrawal fees.
GET/staking/positionsList all active staking positions for the agent wallet. Includes staked amount, rewards, and APY.
GET/staking/rewardsQuery accumulated unclaimed rewards across all positions.
POST/staking/compoundClaim and restake rewards for a position. Triggers on-chain reward collection.
GET/staking/apyCurrent APY rates by asset and staking provider. Updated every 10 minutes.
POST/staking/auto-compoundEnable/disable automatic compounding with configurable threshold and frequency.

Agent Staking Automation

Build agents that manage yield-generating positions autonomously. Here's a complete staking manager with auto-compound logic.

# agent_staking_manager.py — autonomous yield on idle capital import requests, time from datetime import datetime, timedelta PURPLE_FLEA_API = "https://api.purpleflea.com/v1" API_KEY = "pf_your_key_here" class AgentStakingManager: def __init__(self, wallet_id: str): self.wallet_id = wallet_id self.session = requests.Session() self.session.headers["X-API-Key"] = API_KEY def get_apy_rates(self) -> dict: # Fetch current APY by asset r = self.session.get(f"{PURPLE_FLEA_API}/staking/apy") r.raise_for_status() return r.json()["rates"] def stake(self, asset: str, amount: float) -> dict: payload = { "wallet_id": self.wallet_id, "asset": asset, # "ETH", "SOL", "BNB", "MATIC" "amount": amount, "mode": "liquid", # "liquid" or "native" "auto_compound": True } r = self.session.post(f"{PURPLE_FLEA_API}/staking/stake", json=payload) r.raise_for_status() result = r.json() print(f"Staked {amount} {asset} at {result['apy']:.1f}% APY — position: {result['position_id']}") return result def collect_and_compound(self): # Get all positions with pending rewards r = self.session.get(f"{PURPLE_FLEA_API}/staking/rewards?wallet_id={self.wallet_id}") r.raise_for_status() rewards = r.json()["positions"] for pos in rewards: if pos["pending_rewards_usd"] > 1.0: # compound if > $1 compound_r = self.session.post( f"{PURPLE_FLEA_API}/staking/compound", json={"position_id": pos["position_id"]} ) compound_r.raise_for_status() print(f"Compounded ${pos['pending_rewards_usd']:.2f} on {pos['asset']} position") def rebalance_to_best_apy(self): # Move unstaked capital to highest-yield asset rates = self.get_apy_rates() best_asset = max(rates, key=lambda x: rates[x]["apy"]) best_apy = rates[best_asset]["apy"] # Check wallet balances balances_r = self.session.get(f"{PURPLE_FLEA_API}/wallet/balance?wallet_id={self.wallet_id}") balances = balances_r.json()["balances"] for asset_balance in balances: idle_amount = asset_balance["available_usd"] / asset_balance["price_usd"] if asset_balance["asset"] == best_asset and idle_amount > 10: self.stake(best_asset, idle_amount * 0.8) # stake 80% of idle print(f"Deployed idle {best_asset} at {best_apy:.1f}% APY") # Run the staking manager in a loop if __name__ == "__main__": manager = AgentStakingManager(wallet_id="wallet_abc123") while True: manager.collect_and_compound() manager.rebalance_to_best_apy() time.sleep(3600) # check hourly

Why Agents Should Stake

Most AI agent wallets hold idle crypto between operations. Staking turns this dead capital into compounding yield — without changing the agent's primary strategy.

1

Idle Capital Is Costing You

An agent holding $10,000 ETH for a month loses ~$29–$37 in foregone staking yield (3.5–4.5% APY). Over a year across a fleet of 100 agents, that's $35,000–$45,000 left on the table. Staking turns waiting time into revenue.

2

Liquid Staking Doesn't Lock Capital

With liquid staking (stETH for ETH, mSOL for SOL), agents receive liquid tokens that can be sold immediately. There's no tradeoff between yield and operational readiness — the agent can exit the position within seconds if needed.

3

Compounding Accelerates Returns

Daily compounding on a 4% APY position produces ~4.08% effective APY. Over 5 years, the difference between simple and compounding yield on $50,000 is over $2,100. Purple Flea handles the compound transactions automatically.

4

Multi-Asset Yield Diversification

Spread staking across ETH, SOL, and BNB to reduce protocol risk. If one network's validator set experiences issues, the other positions continue earning. Purple Flea shows APY by asset so agents can optimize allocation.

Staking + Trading: The Full Loop

Agents using Purple Flea can earn yield on idle capital while simultaneously running perpetual futures trades. Liquid staked ETH (stETH) can even be used as collateral in some protocols — though Purple Flea's trading margin is separate. The result: passive staking yield + active trading alpha, from a single API key.

MCP Tool Integration

The Purple Flea MCP server exposes staking as natural-language tool calls. LLM agents can manage staking positions through tool routing without custom API code.

# Example: LLM agent using MCP to manage staking from anthropic import Anthropic import anthropic.types as at client = Anthropic() mcp_server = "https://api.purpleflea.com/mcp" response = client.messages.create( model="claude-opus-4-6", max_tokens=4096, tools=[{ "type": "mcp", "server_url": mcp_server, "api_key": "pf_your_key" }], messages=[{ "role": "user", "content": "Check my staking rewards and compound anything over $5. Then stake 50% of my idle ETH balance at the best available rate." }] ) # Claude autonomously calls: check_staking_rewards, compound_rewards, stake_eth print(response.content[0].text)

The MCP server returns structured data so the LLM can reason about positions — e.g., "Your 2.5 ETH staking position has earned 0.008 ETH ($27.20) in rewards since last compound."

Start Earning Yield Autonomously

Connect your AI agent to Purple Flea's staking API. Stake, compound, and earn yield — all from a single API key, with no validator research required.