โœฆ Google ADK ยท FunctionTool Compatible

Purple Flea Tools for Google ADK

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.

Get API Key Read the Docs

Financial tools built for Gemini agents

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.

๐Ÿ’ณ

flea.wallet.create

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.

๐Ÿ“ˆ

flea.trading.open_position

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.

๐ŸŽฐ

flea.casino.coin_flip

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.

๐Ÿค

flea.escrow.create

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.

๐ŸŒ

flea.domains.register

Register ENS or Unstoppable domains on behalf of an agent. Useful for persistent identity, human-readable payment addresses, and cross-session agent continuity.

๐Ÿ”

flea.swap.execute

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.


One install, all tools ready

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.

$ pip install purpleflea-google-adk
View on PyPI โ†’

Requires Python 3.10+. Install the ADK separately if needed: pip install google-adk


A Gemini crypto agent in 25 lines

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.

crypto_agent.py
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)

All tools, ready to wrap with FunctionTool

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.

flea.wallet.create flea.wallet.get_balance flea.wallet.send flea.trading.open_position flea.trading.close_position flea.trading.get_positions flea.casino.coin_flip flea.casino.dice_roll flea.casino.roulette flea.domains.register flea.domains.lookup flea.swap.execute flea.escrow.create flea.escrow.release
tool_signature_example.py
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
    """
    ...

Built around Gemini's function calling

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.

โšก

Parallel Calls

Gemini 2.0 can call wallet, trading, and casino tools simultaneously in one step.

๐Ÿ”’

Non-Custodial

Your agent holds its own private keys. Purple Flea never has custody of funds.

๐Ÿงฉ

Zero Schema Boilerplate

Type hints + docstrings are all you need. ADK generates the JSON schema automatically.

๐Ÿ“ก

Streaming Support

Use ADK's streaming runner to get partial tool results as trades execute on-chain.

๐Ÿ”

State Persistence

ADK's session state automatically persists wallet addresses and position IDs across turns.

๐ŸŒ

Multi-Agent

Wire multiple ADK agents together. Use escrow tools to trustlessly settle payments between them.


Deploy to Vertex AI Agent Engine

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.

Vertex AI Agent Engine

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 โ†’
deploy_vertex.py
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}")

Earn commissions on every agent transaction

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
referral_example.py
# 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 across every AI framework

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.

๐Ÿฆœ LangChain โ†’ โš™๏ธ Mastra โ†’ โ–ฒ Vercel AI SDK โ†’ ๐Ÿ“Š Trading API โ†’ ๐Ÿ” Haystack โ†’ ๐Ÿšฐ Agent Faucet โ†’ ๐Ÿค Agent Escrow โ†’ ๐Ÿšข CrewAI โ†’

Give your Gemini agent real financial power

Get your free API key in seconds. Claim your faucet balance and run your first on-chain transaction inside a Google ADK agent in under five minutes.

Get API Key Browse Docs