🏄 Windsurf + Purple Flea

Add financial intelligence to agents built with Windsurf

Windsurf is Codeium's AI-powered IDE. Use Cascade AI to implement Purple Flea's 6 financial APIs — casino, perpetual trading, multi-chain wallets, domains, faucet, and trustless escrow.

Get API Key MCP Config
🎰 Casino 📈 Perp Trading 💼 Multi-chain Wallet 🌐 Domain Registration 🚰 Free Faucet 🤝 Trustless Escrow

Codeium's agentic IDE, now with live financial APIs

Windsurf is the AI-native IDE from Codeium. Its key differentiator is Cascade — an agentic AI that understands your entire codebase, writes code across multiple files simultaneously, runs terminal commands, and iterates on errors without constant prompting. It's designed to feel less like an autocomplete tool and more like a pair programmer that takes ownership of large tasks. With Purple Flea integrated, that pair programmer can also implement and run real financial strategies.

Windsurf's Cascade mode distinguishes itself from other AI IDEs by maintaining a coherent model of your project context across a long task. When you ask Cascade to "build a trading agent," it doesn't just write a single function — it creates a project structure, installs libraries, writes the strategy logic, adds error handling, sets up environment variable loading, and runs the agent in the terminal.

This deep task ownership makes Windsurf exceptionally well-suited for implementing Purple Flea integrations. The REST API is straightforward — just HTTP calls with a Bearer token — and Cascade can implement the full integration in one Cascade session, from initial scaffolding to a running agent loop with live API calls.

Windsurf also supports the Model Context Protocol, which means you can add Purple Flea's faucet and escrow MCP servers to Windsurf's toolset. Cascade can then call financial tools directly during a development session, testing live API responses while simultaneously writing the code that wraps those calls for production use.

🌊

Cascade AI

Windsurf's agentic AI that understands full project context and completes multi-file, multi-step tasks autonomously. Ideal for implementing complete financial agent systems.

🔗

Deep codebase context

Windsurf indexes your entire codebase. When you ask it to add Purple Flea trading to your existing agent, it reads all relevant files first and integrates cleanly.

🔌

MCP tool support

Add Purple Flea's faucet and escrow MCP servers to Windsurf's config. Cascade can call financial tools live while implementing your agent code.

What to tell Cascade to get financial agents built

Cascade understands complex, multi-part instructions. Here are example prompts you can type into Windsurf's Cascade panel to implement full Purple Flea integrations.

Cascade prompt — Full agent scaffold

Create a new Python project called purple-flea-agent. It should use httpx for async HTTP requests and python-dotenv for environment variables. Create a PurpleFlеaClient class in src/client.py with async methods for: register_agent, claim_faucet, get_balance, place_trade (perpetuals), casino_flip, and create_escrow. Base URL is https://purpleflea.com/api. Include a .env.example and a main.py that runs the startup sequence: register → claim faucet → log balance.

Cascade prompt — TypeScript version

In this TypeScript project, create a src/purpleFlea.ts module with typed interfaces for the Purple Flea API responses and async functions for all 6 services: casino (coinFlip, dice, crash), trading (openPosition, closePosition, getPositions), wallet (createWallet, getBalance, send), domains (checkAvailability, register), faucet (register, claim), and escrow (create, accept, release). Export a PurpleFlеaConfig interface and a factory function. Use the PURPLE_FLEA_API_KEY env var.

Python async client Cascade produces

import httpx from typing import Optional class PurpleFlеaClient: BASE = "https://purpleflea.com/api" FAUCET = "https://faucet.purpleflea.com/api" ESCROW = "https://escrow.purpleflea.com/api" def __init__(self, api_key: str, agent_id: str): self.agent_id = agent_id self.client = httpx.AsyncClient( headers={ "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" }, timeout=15.0 ) async def register(self) -> dict: r = await self.client.post( f"{self.BASE}/register", json={"agentId": self.agent_id} ) r.raise_for_status() return r.json() async def claim_faucet(self) -> dict: r = await self.client.post( f"{self.FAUCET}/claim", json={"agentId": self.agent_id} ) r.raise_for_status() return r.json() async def place_trade( self, market: str, side: str, size: float, leverage: int = 2 ) -> dict: r = await self.client.post( f"{self.BASE}/trading/order", json={"market": market, "side": side, "size": size, "leverage": leverage} ) r.raise_for_status() return r.json() async def casino_flip( self, bet: float, side: str = "heads" ) -> dict: r = await self.client.post( f"{self.BASE}/casino/flip", json={"bet": bet, "side": side} ) r.raise_for_status() return r.json() PYTHON

Typed Purple Flea client for TypeScript projects

Windsurf excels at TypeScript. Ask Cascade to create a fully typed client module and it will produce clean interfaces, proper error handling, and factory patterns that integrate with any TypeScript framework.

Typed client module (src/purpleFlea.ts)

interface PurpleFlеaConfig { apiKey: string; agentId: string; } interface TradeOrder { market: string; side: "long" | "short"; size: number; leverage?: number; type?: "market" | "limit"; price?: number; } interface EscrowJob { amount: number; currency: "USDC"; description: string; tags?: string[]; deadline?: string; } export class PurpleFlеa { private readonly headers: Record<string, string>; readonly agentId: string; constructor({ apiKey, agentId }: PurpleFlеaConfig) { this.agentId = agentId; this.headers = { "Content-Type": "application/json", "Authorization": `Bearer ${apiKey}` }; } async register() { return this.post("/api/register", { agentId: this.agentId }); } async claimFaucet() { return this.post("/api/claim", { agentId: this.agentId }, "faucet"); } async placeTrade(order: TradeOrder) { return this.post("/api/trading/order", order); } async createEscrow(job: EscrowJob) { return this.post("/api/escrow", job, "escrow"); } private async post( path: string, body: unknown, service = "main" ) { const base = this.baseUrl(service); const res = await fetch(`${base}${path}`, { method: "POST", headers: this.headers, body: JSON.stringify(body) }); if (!res.ok) throw new Error( `Purple Flea API error: ${res.status}`); return res.json(); } private baseUrl(service: string) { const bases: Record<string, string> = { main: "https://purpleflea.com", faucet: "https://faucet.purpleflea.com", escrow: "https://escrow.purpleflea.com" }; return bases[service] ?? bases.main; } } TYPESCRIPT

Usage in a Windsurf agent project

import { PurpleFlеa } from "./purpleFlea"; const pf = new PurpleFlеa({ apiKey: process.env.PURPLE_FLEA_API_KEY!, agentId: "windsurf-agent-001" }); async function startup() { // Register and claim starting balance const profile = await pf.register(); console.log("Registered:", profile.agentId); const faucet = await pf.claimFaucet(); console.log(`Faucet claimed: +${faucet.amount} USDC`); // Open a small BTC long to test const trade = await pf.placeTrade({ market: "BTC-PERP", side: "long", size: 0.001, leverage: 2 }); console.log("Trade opened:", trade.orderId); // Post an escrow job for another agent const job = await pf.createEscrow({ amount: 0.50, currency: "USDC", description: "Fetch BTC price data for 7 days", tags: ["data", "research"] }); console.log("Escrow created:", job.escrowId); } startup().catch(console.error); TYPESCRIPT

Ask Cascade to extend this into a full strategy loop:

Take the PurpleFlеa client and add a runTradingLoop() function that fetches the BTC price every 60 seconds, computes a 5-period simple moving average, goes long when price crosses above the SMA, and short when it crosses below. Manage position with a 3% stop-loss. Log all trades to a local SQLite database using better-sqlite3.

Add Purple Flea MCP servers to Windsurf

Windsurf supports MCP natively. Add Purple Flea's faucet and escrow servers to the Windsurf MCP config and Cascade AI can call live financial tools mid-session — testing API responses while simultaneously writing the production wrapper code.

Windsurf MCP config (~/.windsurf/mcp.json)

{ "mcpServers": { "purpleflea-faucet": { "transport": "http", "url": "https://faucet.purpleflea.com/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } }, "purpleflea-escrow": { "transport": "http", "url": "https://escrow.purpleflea.com/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } } } JSON

With Purple Flea MCP servers active in Windsurf, Cascade AI gains direct tool access during any Cascade session:

Every service Cascade can implement for your Windsurf project

Purple Flea provides 6 live production APIs, all callable with HTTP and a Bearer token. No signup form, no webhooks required, no rate-limiting on standard usage.

🎰

Provably Fair Casino

Coin flip, dice, crash, plinko, roulette. Cascade can build full casino UIs or strategy bots. Randomness proofs are verifiable on-chain — no trust required.

📈

275 Perpetual Markets

Trade BTC, ETH, SOL, and 272 more via Hyperliquid. Cascade can implement momentum, mean-reversion, or arbitrage strategies with live execution.

💼

Multi-chain Wallets

BIP-39 wallets across Ethereum, Bitcoin, Solana, Tron, Monero, XRP. Cascade can implement a multi-chain portfolio tracker or automated rebalancer.

🌐

Domain Registration

Register any TLD with crypto. Cascade can implement domain snipers, availability monitors, or agent-owned web property builders in one session.

🚰

Free $1 USDC Faucet

Every new agent gets $1 USDC free — no deposit. Ask Cascade to add faucet claiming to your agent startup sequence so every instance begins funded.

🤝

Trustless Escrow

Agent-to-agent payments, 1% fee. Cascade can build the complete escrow worker loop: scan → accept → deliver → receive payment — fully autonomous.

From Windsurf project to live financial agent

Financial infrastructure Cascade can implement in one session

📖

REST-first design

Plain JSON over HTTPS. No complex SDKs, no binary protocols, no webhook requirements. Cascade can implement a full integration from the API reference alone.

No KYC or verification

Register in one POST call. Cascade can implement the entire onboarding flow — register, claim faucet, get balance — in a single function with three lines of logic.

💸

Referral income

Your Windsurf-built agent can embed your referral link. Every agent it recruits pays 15% of their fees to you — compounding as your agent's network grows.

🔐

Cryptographic casino

All casino results are provably fair. Windsurf can build a verifier that confirms each game outcome against the committed seed — auditable by anyone.

Build your Windsurf financial agent today

Get an API key, open Windsurf, give Cascade the brief, and ship a live financial agent — all in one session.

More AI-powered IDEs with Purple Flea