🏢 MetaGPT + Purple Flea

A Financially Autonomous
MetaGPT Software Company

MetaGPT models a software company with roles: Product Manager, Architect, Engineer, QA. Purple Flea gives each role crypto wallets and payment capabilities — so your agent company can earn revenue, pay contributors, and manage its own treasury.

Get API Key See CAMEL-AI Integration

MetaGPT Roles with Financial Superpowers

In MetaGPT, each agent has a defined role with specific responsibilities. Add financial capabilities to each role using Purple Flea's API.

Product Manager

Budget Allocation

Allocates treasury funds to features, pays contractors, tracks burn rate via wallet API.

Architect

Infrastructure Costs

Pays for compute, storage, and domain names using Purple Flea domain + wallet APIs.

Engineer

Bounty Claims

Claims crypto bounties via escrow when feature branches merge to main.

QA Engineer

Bug Bounties

Earns crypto for each critical bug found. Payments released via escrow on verification.

Data Analyst

Market Research

Pays micropayments for data feeds, sentiment APIs, and market intelligence subscriptions.

CFO Agent

Treasury Management

Maintains reserves, pays operating costs, and handles profit distribution to shareholders.

Example: Financially Autonomous MetaGPT Team

A MetaGPT team that builds software and gets paid when clients accept deliverables — all on-chain, no human treasury manager needed.

# MetaGPT + Purple Flea: financially autonomous software company
import asyncio, httpx
from metagpt.roles import ProductManager, Architect, Engineer, QAEngineer
from metagpt.team import Team

PURPLE_FLEA_KEY = "your-api-key"

class PurpleFleatreasury:
    """Shared treasury for the MetaGPT software company."""

    def __init__(self, api_key: str):
        self.api_key = api_key

    async def get_balance(self) -> float:
        async with httpx.AsyncClient() as client:
            r = await client.get(
                "https://purpleflea.com/api/wallet/balance",
                headers={"X-API-Key": self.api_key}
            )
            return r.json()["balance_usd"]

    async def pay_role(self, role_name: str, addr: str, amount: float, reason: str):
        async with httpx.AsyncClient() as client:
            r = await client.post(
                "https://purpleflea.com/api/wallet/send",
                json={
                    "to": addr,
                    "amount_usdc": amount,
                    "memo": f"[{role_name}] {reason}"
                },
                headers={"X-API-Key": self.api_key}
            )
            print(f"Paid ${amount} USDC to {role_name} ({reason})")
            return r.json()

    async def create_client_escrow(self, client_addr: str, amount: float) -> str:
        """Client deposits payment into escrow before work begins."""
        async with httpx.AsyncClient() as client:
            r = await client.post(
                "https://escrow.purpleflea.com/create",
                json={
                    "recipient": "0xOurCompanyWallet",
                    "amount_usdc": amount,
                    "release_condition": "client_approval"
                },
                headers={"X-API-Key": self.api_key}
            )
            return r.json()["escrow_id"]

async def run_software_project(requirements: str, client_budget_usd: float):
    treasury = PurpleFleatreasury(PURPLE_FLEA_KEY)

    # Client locks payment in escrow
    escrow_id = await treasury.create_client_escrow(
        client_addr="0xClientAddress",
        amount=client_budget_usd
    )
    print(f"Client escrow created: {escrow_id}")

    # MetaGPT team builds the software
    team = Team()
    team.hire([
        ProductManager(),
        Architect(),
        Engineer(),
        QAEngineer(),
    ])
    team.invest(client_budget_usd)
    team.run_project(requirements)

    await team.run(n_round=5)

    # Distribute earnings to team members
    allocations = [
        ("ProductManager", "0xPM",  0.25),
        ("Architect",      "0xArch", 0.25),
        ("Engineer",        "0xEng",  0.35),
        ("QAEngineer",      "0xQA",   0.15),
    ]

    for role, addr, share in allocations:
        await treasury.pay_role(
            role_name=role,
            addr=addr,
            amount=client_budget_usd * share,
            reason=f"Project completion share ({share*100:.0f}%)"
        )

    print(f"Project complete. ${client_budget_usd} distributed to {len(allocations)} roles.")

# Run the financially autonomous software company
asyncio.run(run_software_project(
    requirements="Build a real-time crypto price dashboard with alerts",
    client_budget_usd=500
))

Financial Workflows for Agent Companies

📝

Client Intake with Escrow

Before any work starts, the Product Manager agent creates a client escrow. Work only begins after the escrow is funded — no payment risk for either party.

💰

Milestone Payments

Break large projects into milestones. Each milestone completion triggers an escrow partial release. Align incentives throughout the project lifecycle.

🎯

Performance Bonuses

QA agents earn bonus USDC for every critical bug caught before deployment. Engineering agents earn for code quality scores above threshold.

📊

Operating Budget

Architect agent manages infrastructure costs — paying for domains, compute, and external APIs from the company treasury automatically.

MetaGPT + Purple Flea = Fully Autonomous Agent Company

MetaGPT handles the software development process (requirements, architecture, code, QA). Purple Flea handles the financial layer (client payments, team compensation, treasury management). Together, you have an agent company that can take on client work, deliver software, and distribute earnings — entirely autonomously. This is the first time in history that a software company with no human employees is economically viable.

Build Your Agent Company

Get a Purple Flea API key and pair it with MetaGPT to create a financially autonomous software development team.