Extend Gemini-powered agents with real financial capabilities. Purple Flea provides
FunctionTool-compatible
wrappers for crypto wallets, Hyperliquid perpetual trading, provably fair casino games,
trustless escrow, and ENS domain registration.
Google ADK (Agent Development Kit) is Google's official framework for building production-grade
agents powered by Gemini models. ADK uses a FunctionTool
pattern where Python functions become tools the model can call. Purple Flea wraps every
financial operation as a clean, typed Python function that slots directly into this pattern โ
no adapters, no boilerplate, no schema files required.
Provision a non-custodial wallet for any agent. Returns an address, private key reference, and initial balance. Supports ETH, BTC, SOL, TRX, XMR, and a dozen EVM chains.
Go long or short on any Hyperliquid perpetual market. Pass market symbol, side, size in USD, and optional leverage. Returns fill price, position ID, and liquidation price.
Provably fair coin flip with on-chain result verification. Agents bet a wager, choose heads or tails, and receive a cryptographic proof hash alongside the payout amount.
Lock funds in a trustless escrow contract between two agents. The 1% platform fee is split automatically on release. Referrers earn 15% of the fee with zero extra code.
Register ENS or Unstoppable domains on behalf of an agent. Useful for persistent identity, human-readable payment addresses, and cross-session agent continuity.
Cross-chain token swaps via aggregated DEX routing. Gemini can call this function with a natural-language intent; Purple Flea resolves the best route automatically.
The Google ADK integration ships as a standalone PyPI package that has
google-adk
as a peer dependency. It automatically registers all Purple Flea functions in a format
Gemini can parse, including parameter descriptions and return type schemas.
Requires Python 3.10+. Install the ADK separately if needed:
pip install google-adk
Create a fully functional Gemini-powered crypto agent. The agent can create wallets, open perpetual positions, play casino games, and register domains โ all from natural language, because ADK maps function signatures directly to Gemini's native function calling format.
import os from google.adk.agents import LlmAgent from google.adk.tools import FunctionTool from purpleflea import PurpleFleas # Instantiate the Purple Flea SDK flea = PurpleFleas(api_key=os.getenv("PURPLE_FLEA_API_KEY")) # Build a Gemini agent with financial tools agent = LlmAgent( name="crypto_agent", model="gemini-2.0-flash", instruction="You are a financial agent. Use the tools " "to manage crypto, trade perps, and play casino games.", tools=[ FunctionTool(flea.wallet.create), FunctionTool(flea.trading.open_position), FunctionTool(flea.trading.close_position), FunctionTool(flea.casino.coin_flip), FunctionTool(flea.domains.register), FunctionTool(flea.escrow.create), FunctionTool(flea.wallet.get_balance), ] ) # The agent can now be queried in natural language response = agent.query("Create an ETH wallet and open a $50 long on ETH-PERP") print(response.text)
Every function in the Purple Flea SDK is annotated with full Python type hints and docstrings. ADK uses these annotations to auto-generate the JSON schema that Gemini reads โ so the model always knows exactly what parameters each tool expects.
def open_position( market: str, side: str, size_usd: float, leverage: int = 1, referral: str = "" ) -> dict: """Open a perpetual position on Hyperliquid. Args: market: Market symbol, e.g. 'ETH-PERP' or 'BTC-PERP'. side: 'long' or 'short'. size_usd: Position size in USD. leverage: Leverage multiplier (1โ50). referral: Optional referral code for fee sharing. Returns: fill_price, position_id, liquidation_price, pnl_usd """ ...
Gemini 2.0 Flash and Gemini 2.0 Pro support parallel function calling โ the model can invoke multiple tools simultaneously in a single reasoning step. Purple Flea tools are designed to be safe for parallel execution. You can open a trading position and create a wallet at the same time, and both calls will succeed independently.
Every Purple Flea function returns a flat dictionary with clearly named keys. Gemini can read the return value directly into its reasoning context and decide on follow-up actions โ for example, checking the fill price of a trade and then automatically setting a stop-loss if the fill is above a threshold.
Tool schemas are generated at import time from Python type annotations, so there is no separate schema definition step. If you update a function signature, the schema updates automatically the next time your agent starts.
Purple Flea tools are fully compatible with Vertex AI Agent Engine. Deploy your Gemini-powered financial agent to Google Cloud with one command and get a managed, scalable endpoint with built-in logging and IAM.
Agent Engine is Google's fully managed runtime for ADK agents. It handles autoscaling, session management, tool execution sandboxing, and Cloud Logging integration. Deploy a Purple Flea financial agent to a production Vertex AI endpoint in minutes โ no Kubernetes, no Docker configuration, no infrastructure management required.
Purple Flea API keys are injected as Secret Manager references at deploy time, so your credentials never touch source code or container images. All tool invocations are logged with full request and response bodies for audit compliance.
Vertex AI Guide โfrom google.cloud import aiplatform from google.adk.deploy import VertexDeployer # Point at your existing ADK agent module deployer = VertexDeployer( project="my-gcp-project", location="us-central1", agent_module="crypto_agent", ) # Inject Purple Flea key from Secret Manager deployer.add_secret( env_key="PURPLE_FLEA_API_KEY", secret_id="purple-flea-api-key", version="latest" ) endpoint = deployer.deploy( display_name="purple-flea-crypto-agent", min_replica_count=1, max_replica_count=10 ) print(f"Deployed to: {endpoint.resource_name}")
Add your referral code to any tool call and earn a percentage of the platform fee on every transaction. Referral earnings are paid out in real-time to your Purple Flea wallet with no minimums, no vesting periods, and no cap on total earnings.
| Product | Platform Fee | Your Referral Cut | ADK Function |
|---|---|---|---|
| Perpetual Trading | 0.05% per side | 20% | flea.trading.open_position |
| Casino Games | 2% house edge | 10% | flea.casino.coin_flip |
| Crypto Wallets | 0.5% on swaps | 10% | flea.wallet.create |
| Domain Registration | $2 flat fee | 15% | flea.domains.register |
| Escrow Payments | 1% of escrowed amount | 15% | flea.escrow.create |
# Pass referral_code to the PurpleFleas constructor # โ it's automatically forwarded to every tool call flea = PurpleFleas( api_key=os.getenv("PURPLE_FLEA_API_KEY"), referral_code="your_code_here" ) # Every FunctionTool call now earns referral commission agent = LlmAgent( tools=[FunctionTool(flea.trading.open_position), ...] )
Purple Flea provides first-class integrations for every major agent framework. Each integration uses the framework's own native tool pattern so you never fight abstractions.