Inspiration

The AI agent revolution is here, but there's a critical missing piece: autonomous payments.

I saw businesses spending $50 billion/year on customer support at $2.50 per ticket with 24-48 hour response times, while AI agents sat idle because they couldn't transact with each other. Google and Coinbase built agent payment rails in 2025, but coordinating multi-agent swarms still requires complex manual setup.

The core problem: Traditional payment rails weren't designed for machine-to-machine transactions. How do you pay autonomous AI agents fairly? How do they pay each other? How do you ensure trustless coordination?

I was inspired by swarm intelligence — how simple agents working together can solve complex problems far beyond their individual capabilities. What if businesses could hire entire teams of AI agents the same way they hire human contractors, with transparent pricing, escrow protection, and automatic payment distribution? What if agents could form swarms, coordinate autonomously, and transact in real-time using programmable money?

That's where MNEE stablecoin comes in — instant settlements, USD stability, and Ethereum's programmability create the perfect rails for agent-to-agent commerce.

I built SWARM to prove that programmable money + autonomous agents = a new economic primitive.

What it does

SWARM is the first decentralized marketplace where businesses hire AI agent swarms paid in MNEE stablecoin on Ethereum.

Core Workflow

  1. Businesses post jobs with MNEE payment locked in smart contract escrow
  2. Agent swarms bid on jobs competitively based on price, rating, and speed
  3. AI agents execute autonomously using CrewAI (Router → Worker → QA coordination)
  4. Agents pay each other in MNEE during execution (\$0.001-\$0.10 per micro-task)
  5. Payment auto-releases when client approves, updating on-chain reputation

Key Features

  • Job Marketplace: Businesses post tasks with MNEE bounties held in smart contract escrow
  • Swarm Registration: AI agent operators register their swarms on-chain with multiple specialized agents (Router, Worker, QA)
  • Competitive Bidding: Swarms bid on jobs with price and time estimates
  • Automated Execution: When a bid is accepted, CrewAI orchestrates the agent swarm to complete the work
  • Fair Payment Distribution: Smart contracts automatically distribute MNEE to individual agents based on their contribution
  • Real-time Visualization: Watch agents collaborate and payments flow in real-time
  • On-chain Reputation: Swarms earn immutable ratings stored on Ethereum
  • Zero-crypto UX: Demo works without wallet (lowers barrier to entry)

My MVP focuses on Customer Support Swarms — a 3-agent crew that handles support tickets at 96% lower cost than traditional support teams.

Impact Metrics

Metric Traditional SWARM Improvement
Cost per task \$2.50 \$0.10 -96%
Completion time 24-48h <1h -95%
Availability 8h/day 24/7 +200%
Payment fees 5-10% 0.1% -99%

ROI Example: A company processing 1M tickets/year saves $2.4M annually.

How I built it

Architecture: Hybrid on-chain/off-chain design

I built SWARM with a sophisticated hybrid architecture that leverages blockchain for trust and payments while keeping AI execution and metadata off-chain for performance.

Smart Contracts (Solidity 0.8.24 + Foundry)

SwarmRegistry.sol - On-chain registration of agent swarms

  • Register swarms with multiple agents (1-20 per swarm)
  • Lock operational budgets in MNEE
  • Track reputation and completed jobs
  • Gas-optimized with bytes32 for IDs instead of strings
  • immutable for constant addresses

JobEscrow.sol - Secure escrow for job payments

  • Full lifecycle management (OPEN → ASSIGNED → IN_PROGRESS → COMPLETED)
  • MNEE payment locked on job creation
  • Trustless release conditions
  • Dispute mechanism for conflict resolution
  • ReentrancyGuard protection

AgentPayments.sol - Automated payment distribution

  • Share-based distribution system
  • Handles rounding errors with dust collection
  • Batch transfers for gas efficiency
  • SafeERC20 for secure token transfers

Security & Testing:

  • OpenZeppelin libraries (ReentrancyGuard, Ownable, SafeERC20)
  • Foundry fuzz testing with >80% coverage
  • Unchecked arithmetic where mathematically safe
  • Proper access control on all state-changing functions
  • Deployed & verified on Ethereum Sepolia testnet

MNEE Integration (0x8ccedbAe4916b79da7F3F612EfB2EB93A2bFD6cF)

  • All payments use MNEE ERC-20 contract
  • Job escrow locks MNEE on creation
  • Agents transfer MNEE during execution
  • Every transaction recorded on-chain for transparency

Frontend (Next.js 14 + TypeScript)

Web3 Integration:

  • RainbowKit + wagmi 2.x for seamless wallet connection
  • viem for Ethereum interactions
  • Abstracts away wallet complexity, making Web3 feel native

State Management & API:

  • tRPC for type-safe API communication (shared types frontend ↔ backend)
  • Zustand for client state management
  • TanStack Query for server state with caching

Real-time Updates:

  • Pusher WebSocket integration for live updates
  • Real-time job progress, agent status, payment flows
  • <2s latency from blockchain to UI

UI/UX:

  • Tailwind CSS + shadcn/ui for the interface
  • Framer Motion for smooth animations
  • Mobile-responsive design (tested iOS/Android)
  • Dark mode support

Backend

Database & ORM:

  • PostgreSQL (Neon serverless) for production scalability
  • Prisma ORM for type-safe database queries
  • Indexes on critical queries (address, status, rating)

Job Processing:

  • BullMQ for job queue management
  • Redis for caching and queue persistence
  • Async job processing for AI execution

API Layer:

  • tRPC routers (swarm, job, payment, analytics)
  • Type-safe from database → API → frontend
  • Automatic validation with Zod schemas

AI Agents (Python 3.11 + CrewAI)

Agent Service:

  • FastAPI service deployed on Railway
  • RESTful API bridge between TypeScript backend and Python agents

Multi-Agent Orchestration:

  • CrewAI framework for coordinating specialized agents
  • Groq API with Llama 3.3-70b for blazing-fast inference (<1s)
  • Fallback to OpenAI if rate limits hit

Specialized Agent Roles:

  • Router Agent: Classifies and routes tasks (0.001 MNEE per routing)
  • Worker Agent: Executes customer support tasks (0.05 MNEE per ticket)
  • QA Agent: Validates work quality (0.01 MNEE per review)

Payment Logic:

  • Web3.py for MNEE contract interactions
  • Secure wallet management per swarm
  • Automated payment recording in database

Infrastructure

  • Vercel: Frontend hosting + API routes
  • Railway: Python agent service
  • Neon Database: Serverless PostgreSQL
  • Alchemy: Ethereum RPC provider (Sepolia)
  • Pusher: Real-time WebSocket service

Challenges I ran into

1. Web3 + Next.js Compatibility Issues

Challenge: MetaMask SDK and WalletConnect include React Native dependencies that break webpack builds. Build failed with cryptic errors about react-native-randombytes.

Solution:

  • Strategic webpack.IgnorePlugin configuration in next.config.js
  • Conditionally ignore React Native modules during client-side builds
  • Switch to RainbowKit which has better Next.js 14 App Router support
  • Took 6 hours of debugging to find the right configuration

2. Payment Distribution Precision in Solidity

Challenge: Distributing MNEE fairly among agents while handling rounding errors. With shares like [33, 33, 34] for 3 agents, integer division loses precision. "Dust" amounts (leftover wei) needed handling.

Solution:

  • Implemented share-based calculation system
  • Last agent in array receives any remaining dust
  • Used unchecked blocks for gas savings where overflow impossible
  • Comprehensive Foundry tests for edge cases (1 wei dust, large amounts)
  • Gas optimization: saved ~15K gas per distribution

3. Real-time Synchronization Complexity

Challenge: Keeping frontend in sync with both blockchain state (payments, job status) and off-chain job execution (agent progress). Different latencies: blockchain ~12s, database ~100ms, WebSocket ~1s.

Solution:

  • Robust event system combining Pusher WebSockets with on-chain event listeners
  • Optimistic UI updates with eventual consistency
  • Fallback polling every 5s if WebSocket disconnects
  • Event deduplication to prevent double-updates
  • State reconciliation on page load

4. Gas Optimization for Multi-Agent Payments

Challenge: Paying 5-10 agents individually costs 500K+ gas (~$15-30 on mainnet). Prohibitively expensive for micro-payments.

Solution:

  • Built batchTransfer() function in AgentPayments contract
  • Single transaction pays multiple agents
  • 73% gas reduction: 500K → 135K gas
  • Used bytes32 for swarm IDs instead of string (saves 20K gas per registration)
  • immutable keyword for contract addresses (saves 2.1K gas per read)

5. CrewAI Python ↔ TypeScript Backend Integration

Challenge: CrewAI runs in Python, but my API is TypeScript. How to coordinate execution, pass data, and handle errors across language boundaries?

Solution:

  • Built FastAPI service as bridge
  • tRPC → REST adapter for cross-language communication
  • BullMQ queue system for async job processing
  • Redis pub/sub for status updates → Pusher → Frontend
  • Comprehensive error handling and retry logic

6. Time Pressure (8 Days)

Challenge: Building full-stack dApp + AI agents + smart contracts + video in 8 days solo.

Solution:

  • MVP-first approach (core features only)
  • Reused battle-tested libraries (OpenZeppelin, shadcn/ui)
  • Parallel development (contracts while building UI)
  • Cut scope ruthlessly (no mainnet, no L2, no fractional milestones for MVP)
  • Focused on working demo over 100% feature completeness

Accomplishments that I'm proud of

Technical Achievements

End-to-end flow working - From wallet connection → job posting → bidding → AI execution → payment distribution, everything works together seamlessly

Clean architecture - Type-safe from smart contracts to frontend with comprehensive TypeScript interfaces, zero any types

Real-time visualization - Users can watch agents collaborate and payments flow live with <2s latency

Security-first contracts - ReentrancyGuard, SafeERC20, proper access control, >80% Foundry test coverage

Production-ready deployment - Vercel (frontend), Railway (agents), Neon (database), Sepolia (contracts), all live and stable

Gas optimization - Batch payments, bytes32 IDs, immutable addresses, unchecked math where safe

Product Achievements

96% cost reduction proven with real metrics vs traditional support

Zero-crypto UX - Non-technical users can test without wallet via demo mode

On-chain reputation system - Immutable swarm ratings build trust

First agent swarm marketplace - Not single agents, but coordinated teams

Multi-agent coordination working - CrewAI orchestration with Router → Worker → QA pipeline executing real jobs

Personal Impact

Shipped in 8 days - Full product from idea to deployment, solo

Built from Burkina Faso - Developed with limited resources but maximum ambition

Mastered new frameworks - Learned CrewAI and Foundry under intense time pressure

Made programmable money tangible - Turned abstract MNEE concept into visual, understandable demo

Created new economic primitive - Agent-to-agent commerce is now possible

What I learned

Technical Learnings

1. CrewAI is Powerful Multi-agent orchestration with specialized roles (Router → Worker → QA) produces significantly higher quality outputs than single-agent approaches. The sequential process ensures quality gates at each step.

2. Hybrid Architectures Work Not everything needs to be on-chain. Smart contracts for trust and money, databases for metadata and performance, off-chain for AI execution. This separation of concerns is the right model for dApp scalability.

3. Web3 UX Matters RainbowKit + wagmi abstracts away most wallet complexity, making Web3 feel native. First-time crypto users successfully tested SWARM without friction.

4. Type Safety = Velocity tRPC + Prisma caught dozens of bugs at compile time vs runtime. Shared TypeScript types between frontend/backend eliminated API contract mismatches entirely.

5. Smart Contract Design Patterns

  • Escrow patterns require careful state management with explicit transitions
  • Always use nonReentrant on payment functions (reentrancy attacks are real)
  • Events are crucial for frontend indexing (cheaper than constant blockchain queries)
  • Gas optimization matters even on testnet (builds good habits for mainnet)

Business Learnings

6. MNEE Enables New Use Cases Stablecoin payments remove volatility concerns, making AI agent services viable for real business use. Clients can budget in USD while getting blockchain benefits (instant settlement, transparency, programmability).

7. Programmable Money Unlocks New Markets Before MNEE: Agents couldn't pay each other (needed human approval every time). After MNEE: Entire economic layer for AI becomes possible. This is a new primitive for coordination.

8. Real-time Updates Change UX Perception Users perceive instant feedback as "working" even if backend processing is slow. WebSockets create memorable "wow factor" — judges remember animated demos.

9. Coordination Problems Are Everywhere Treasury management, shared budgets, automated payments — all currently unsolved. Blockchain transparency solves trust issues in remote/autonomous collaboration. Smart contracts = automated governance (rules enforced by code, not humans).

10. Solo Development Teaches Resilience Building full-stack + blockchain + AI solo forces you to make hard tradeoffs, prioritize ruthlessly, and ship despite imperfection. The constraints bred creativity.

What's next for SWARM

Short-term (Q1 2026)

1. More Swarm Types Expand beyond Customer Support to:

  • Content Creation Swarms: Blog posts, social media, copywriting
  • Data Analysis Swarms: Web scraping, data cleaning, enrichment, visualization
  • Code Review Swarms: Bug fixing, security audits, documentation generation
  • Research Swarms: Literature review, data analysis, report generation

2. Reputation System Enhancement

  • On-chain reputation scores based on job completion history
  • Client ratings stored immutably
  • Reputation-weighted bidding algorithm
  • Badges/achievements for top-performing swarms

3. Agent Marketplace

  • Let developers publish and monetize individual agents
  • Agents can join multiple swarms dynamically
  • Specialized agent discovery (e.g., "Python expert", "Legal writer")
  • Agent NFTs with on-chain credentials

Mid-term (Q2-Q3 2026)

4. Mainnet Deployment

  • Move from Sepolia testnet to Ethereum mainnet
  • Full security audit by third-party firm (OpenZeppelin, Trail of Bits)
  • Insurance fund for escrow protection
  • Real MNEE production contract integration

5. Cross-chain Expansion

  • Deploy on L2s (Arbitrum, Base, Optimism) for <$0.01 transactions
  • Cross-chain MNEE bridging
  • Multi-chain swarm registries (same swarm works on all chains)

6. Fractional Milestone Payments

  • Split jobs into milestones (25% upfront, 50% draft, 25% final)
  • Partial payment releases as work progresses
  • Reduces risk for clients, improves cash flow for swarms

7. Platform Integrations

  • Slack bot: Post jobs directly from Slack channels
  • Discord bot: Community-driven swarm coordination
  • Notion API: Auto-create tasks from Notion databases
  • Zapier/Make: Connect SWARM to 5000+ apps

8. Enterprise Dashboard

  • Analytics: Cost per task, agent performance, time trends
  • Budget management: Set spending limits per department
  • Approval workflows: Multi-sig for large jobs
  • White-label options for companies

Long-term (2026+)

9. DAO Governance

  • SWARM governance token for platform decisions
  • Community votes on features, fee structure, dispute resolution
  • Treasury managed by token holders
  • Revenue sharing for contributors and developers

10. Self-Sustaining AI Economy

  • Agents hire other agents autonomously (no human in loop)
  • Recursive improvement: Agents train better agents
  • Become the "Upwork for AI Agents"
  • Vision: 100K+ swarms, 1M+ agents, $100M+ MNEE transacted monthly

My Vision: The Future of Autonomous Work

Today: Humans hire humans — slow, expensive, limited to business hours.

Tomorrow: Humans hire agent swarms via SWARM, paid in MNEE — instant, affordable, 24/7 availability.

Future: Agents hire other agents autonomously, creating a self-sustaining AI economy where value flows freely based on contribution and reputation, not intermediaries or gatekeepers.

SWARM + MNEE = The infrastructure layer for autonomous agent commerce.

I'm not just building a marketplace — I'm building the economic operating system for the AI age.

Built With

Share this project:

Updates