
Coalition
Agents pool USDC to acquire shared compute and monetize unused capacity.
Demo
About
Coalition lets AI agents pool money together to acquire shared compute they could not afford or efficiently use alone. It is a trustless coordination layer for funding, provisioning, and exchanging unused capacity. The problem is simple: compute infrastructure is usually priced for one owner, while many AI agents only need a fraction of a server. A powerful GPU server can cost around $20/hour, yet several agents may each need only a small share. Renting separately is inefficient, while purchasing the full resource alone may be unaffordable. Coalition makes it possible for agents to coordinate a shared purchase and divide the resulting capacity. Agents commit USDC toward a shared funding goal. Each commitment is locked in a smart contract, which tracks contributions and pays the compute provider once the pool reaches its target. If the funding goal is not reached before the deadline, participants can be refunded. This removes the need for a human intermediary to hold funds or manually settle a partially funded agreement. Once the resource is acquired, a Go orchestrator running on the VPS provisions each participating agent with a Docker container and enforces its allocated CPU and memory limits. Agents can therefore share the same infrastructure while retaining isolated execution environments. Coalition also addresses uneven resource usage. Agents may contribute equally but consume different amounts of the capacity they purchased. Instead of leaving unused capacity idle, an outside agent can purchase access to that spare capacity. The payment is settled atomically to the original participants according to the resale allocation, allowing agents that received less value from their initial contribution to recover more of their cost. In the current implementation, the funding model uses equal upfront contributions, while resale redistributes value based on unused capacity. A future extension will allow agents to choose between paying upfront for guaranteed access and recovering unused capacity through resale, or waiting for more participants and paying according to their actual allocation. ENS provides verified, human-readable agent identities tied to their funding wallets. The contract verifies that the ENS name resolves to the wallet participating in the pool, reducing the risk of impersonation or funding the wrong identity. The Graph indexes pool state and events, allowing the dashboard and participating agents to track commitments, funding progress, settlement, and capacity transactions transparently. Multicall3 is used for atomic resale settlement. Coalition turns “a group of AI agents want to share a resource” into an enforceable financial agreement: agents pool capital, smart contracts enforce the commitments, providers get paid automatically, unused capacity can be resold, and the economic history remains transparent and verifiable.
How it's made
Coalition is built as five cooperating programs: a Foundry Solidity ResourcePool contract on Arc, a viem-based TypeScript SDK, a Next.js dashboard, a stdlib-only Go orchestrator, and a The Graph subgraph. The entire application is hosted on a VPS. We initially planned to deploy the Next.js application on Vercel, but Coalition requires persistent application-level state, long-running orchestration, access to the agent pool services, and coordination with the shared compute environment. Vercel's serverless and edge-oriented execution model was not suitable for that architecture, so we moved the Next.js application onto the same VPS as the orchestrator and compute services. The VPS acts as the shared compute resource. Agents do not simply receive an on-chain entitlement; the Go orchestrator converts that entitlement into actual access to the VPS, allowing agents to run workloads inside Docker-enforced CPU and memory limits. The on-chain core manages funding rounds, participant commitments, exact-fill settlement, deadlines, dropouts, forfeitures, and refunds. Each round is isolated by `roundId`. The filling commit settles inline and pays the provider automatically, while expired rounds use pull-based refunds. Dropouts forfeit their committed stake, and the contract records ERC-8004 reputation feedback for completion or dropout. The contract has no owner, upgradeability, or pause authority; the provider is only authorized to start rounds. The TypeScript SDK is the shared integration layer. It uses viem for Arc interactions, keeps all USDC amounts as `bigint` atomic units, and handles the distinction between Arc's 18-decimal native USDC and 6-decimal ERC-20 USDC. It also integrates ENSv2 for identity resolution and ERC-8004 for agent identity and reputation. The Next.js dashboard performs all on-chain writes through server-side route handlers. Circle Developer-Controlled Wallets create and control the agent wallets, execute USDC approvals and contract calls, and replace the need for local private-key management. Funding uses parallel approvals but strictly sequential commits so the final commit can trigger inline settlement. The resale flow uses Multicall3 to execute multiple USDC `transferFrom` payouts in one atomic transaction, preventing partial payment states. Circle App Kit handles treasury transfers, while Circle's x402 Gateway is integrated into a Next.js route through an Express-compatible middleware shim for quota payments. The Go orchestrator is the bridge between blockchain settlement and real compute. It runs on the VPS, verifies an agent's purchased entitlement, reserves capacity, creates and manages Docker containers, and enforces CPU and memory limits. It maintains a concurrency-safe ledger, meters usage using integer micro-CU/MB accounting, confirms or rolls back reservations, and reaps workloads that exceed their budgets or lose authorization. This gives agents actual, controlled access to the shared VPS rather than merely recording resource ownership on-chain. The resale market calculates prices from the funding pool's target and ranks sellers by how unevenly their contributed share has been used. It generates a fill plan whose payouts sum exactly to the quoted amount, with division dust distributed deterministically. Once payment is verified, the orchestrator provisions the corresponding compute entitlement on the VPS. The Graph subgraph indexes pool commitments, settlements, dropouts, refunds, and reputation feedback. It is not just a dashboard data source: pool discovery, roster reads, and the autonomous resale decision loop depend on it. The agent loop fails closed when pool health is unavailable. Several implementation details were particularly hacky. Because Circle Contracts on Arc rejects Shanghai `PUSH0` bytecode, we pinned the Solidity build to the Paris EVM. Because existing subgraph indexing depended on legacy event shapes, we emit both legacy and round-scoped events in the same transaction, preserving compatibility while supporting isolated rounds. Because resale involves multiple payouts that must either all succeed or all fail, we use one Multicall3 aggregate for the USDC transfers, and the Go service verifies the receipt's transfer logs in order. Because floating-point accounting and concurrent reservations can introduce nondeterminism, we use integer metering, explicit NaN/Inf rejection, and last-claimant dust absorption to keep concurrency and refund accounting deterministic. The result is a full path from agent identity and USDC commitment, through smart-contract settlement, to actual Docker-enforced workloads on a shared VPS and secondary-market resale of unused capacity.