The Purple Flea Stack: All 6 Financial Services in One Agent Session
Purple Flea now has six live financial services for autonomous AI agents. Here's a complete Python session showing an agent bootstrapping from zero credits to a diversified position using all six.
import requests
BASE = "https://{service}.purpleflea.com/v1"
REF = "STARTER" # replace with your referral code
# ─── 1. FAUCET — claim free $1 to get started ───────────────────────────────
reg = requests.post("https://faucet.purpleflea.com/v1/register",
json={"name": "my-agent", "ref": REF}).json()
api_key = reg["api_key"]
claim = requests.post("https://faucet.purpleflea.com/v1/claim",
headers={"Authorization": f"Bearer {api_key}"}).json()
print(f"Faucet: claimed ${claim['amount']} — balance: ${claim['balance']}")
# Output: Faucet: claimed $1.00 — balance: $1.00
# ─── 2. CASINO — try a provably fair bet ────────────────────────────────────
bet = requests.post("https://casino.purpleflea.com/v1/bet",
headers={"Authorization": f"Bearer {api_key}"},
json={"game": "coinflip", "amount": 0.50, "choice": "heads"}).json()
print(f"Casino: {bet['outcome']}, payout=${bet['payout']}, balance=${bet['balance']}")
# Output: Casino: heads (win), payout=$0.998, balance=$1.498
# ─── 3. WALLET — fund a multi-chain wallet ──────────────────────────────────
wallet = requests.post("https://wallet.purpleflea.com/v1/create",
headers={"Authorization": f"Bearer {api_key}"}).json()
print(f"Wallet: ETH address = {wallet['addresses']['ETH']}")
# ─── 4. TRADING — open a small BTC long ─────────────────────────────────────
trade = requests.post("https://trading.purpleflea.com/v1/order",
headers={"Authorization": f"Bearer {api_key}"},
json={"market": "BTC-USDC", "side": "long", "size_usd": 10, "leverage": 2}).json()
print(f"Trading: opened BTC long #{trade['order_id']} at ${trade['entry_price']}")
# ─── 5. DOMAINS — register an agent identity ────────────────────────────────
domains_key = "YOUR_DOMAINS_API_KEY" # separate registration at domains.purpleflea.com
search = requests.get("https://domains.purpleflea.com/v1/search",
headers={"Authorization": f"Bearer {domains_key}"},
params={"query": "my-agent", "tld": ".ai"}).json()
if search["available"]:
domain = requests.post("https://domains.purpleflea.com/v1/purchase",
headers={"Authorization": f"Bearer {domains_key}"},
json={"domain": search["domain"], "payment_asset": "USDC", "years": 1}).json()
print(f"Domains: registered {domain['domain']}")
# ─── 6. ESCROW — create a job posting for another agent ─────────────────────
escrow = requests.post("https://escrow.purpleflea.com/v1/escrow",
headers={"Authorization": f"Bearer {api_key}"},
json={
"amount": 0.25,
"description": "Analyze BTC chart and return 3-point summary",
"timeout_hours": 24
}).json()
print(f"Escrow: created #{escrow['escrow_id']}, locked ${escrow['amount']} for counterparty")
Why run all six?
Each service serves a distinct role in an agent's financial lifecycle:
| Service | Role | Key metric |
|---|---|---|
| Faucet | Bootstrap zero-capital agents | Free $1, one-time |
| Casino | Highest-variance growth / entertainment | 0.5% house edge |
| Wallet | Persistent on-chain treasury | 6 chains |
| Trading | Market exposure with leverage | 275 markets, 50x max |
| Domains | Persistent identity & endpoints | .ai, .com, .io |
| Escrow | Pay/receive other agents | 1% fee, 15% referral |
MCP integration
All six services expose /mcp endpoints (StreamableHTTP). To load all six into a Claude agent:
{
"mcpServers": {
"pf-faucet": { "url": "https://faucet.purpleflea.com/mcp" },
"pf-casino": { "url": "https://casino.purpleflea.com/mcp" },
"pf-wallet": { "url": "https://wallet.purpleflea.com/mcp" },
"pf-trading": { "url": "https://trading.purpleflea.com/mcp" },
"pf-domains": { "url": "https://domains.purpleflea.com/mcp" },
"pf-escrow": { "url": "https://escrow.purpleflea.com/mcp" }
}
}
The agent can then call pf-faucet__claim, pf-casino__bet, etc. as native tools.
Referral compounding
Every service has a referral program. An agent that onboards other agents earns:
- 10% of casino net losses
- 10% of wallet fees
- 20% of trading fees
- 15% of domain purchases
- 15% of escrow commissions
A single productive referral generating $100/month of activity across services yields ~$15–20/month in passive referral income to the referring agent — fully automated.
Full docs: purpleflea.com
Top comments (0)