Let your AI agents vote in DAOs, submit governance proposals, and manage DAO treasury allocations autonomously. Purple Flea supports Compound Governor, Snapshot, Tally, and OpenZeppelin Governor out of the box.
DAOs (Decentralized Autonomous Organizations) govern trillions of dollars in on-chain assets through token-based voting. Protocol upgrades, treasury allocations, parameter changes, and risk framework adjustments all flow through governance — and historically, most token holders simply do not vote.
AI agents change this equation fundamentally. An agent can monitor all active proposals across dozens of DAOs simultaneously, analyze each proposal's economic implications using an LLM, and cast votes within seconds of a proposal going live. Agents represent stakeholders around the clock, in every time zone, without fatigue.
Purple Flea's governance API gives your agent complete DAO participation capabilities: read proposals, analyze with any LLM, delegate tokens, cast votes on-chain or via Snapshot's gasless off-chain system, and submit new proposals.
Purple Flea integrates with every major governance framework, covering the full spectrum from gasless off-chain voting to fully on-chain executable governance.
The most widely forked governance contract. Used by Compound, Uniswap, and hundreds of DeFi protocols. Proposals require quorum, timelock delays, and on-chain execution. Full support for propose, vote, queue, and execute lifecycle.
The dominant off-chain voting platform used by thousands of DAOs. Gasless — agents sign EIP-712 messages rather than on-chain transactions. Purple Flea handles signature generation, space resolution, and vote submission via the Snapshot Hub API.
Tally aggregates governance data across multiple protocols and provides a unified interface for proposal discovery, voting, and delegation. Purple Flea's Tally integration covers cross-protocol portfolio governance.
The modern modular governance standard. Purple Flea supports all OZ Governor extensions including GovernorVotes, GovernorTimelockControl, and GovernorCountingSimple with configurable voting modules.
Purple Flea exposes the complete governance lifecycle as simple API calls. Every operation is chain-aware — the same method works whether you're voting on Compound (Ethereum), Uniswap (Ethereum), or a custom Governor deployment on any EVM chain.
getProposals
Fetch all active proposals for a DAO with full text, vote counts, quorum status, and time remaining
getProposal
Get full proposal details including description text, calldata, proposer, and current state
castVote
Vote for (1), against (0), or abstain (2) on any proposal with optional reason string
delegateTokens
Delegate voting power to another address (including self-delegation to activate votes)
submitProposal
Create a new governance proposal with targets, values, calldatas, and description
getVotingPower
Query current and historical voting power at any block number
snapshotVote
Cast gasless off-chain votes on Snapshot spaces with EIP-712 signatures
An agent managing a yield-focused portfolio holds governance tokens in multiple DeFi protocols — COMP, UNI, AAVE, CRV. Rather than letting those tokens sit idle, the agent monitors all four DAOs for active proposals, uses an LLM to analyze each proposal's impact on LP yields and protocol risk, and votes automatically according to a pre-configured preference framework (e.g., "always vote for security improvements, vote against fee reductions below 0.05%").
The agent runs as a background process, checking for new proposals every 30 minutes. When a proposal enters voting period, the agent analyzes it within 60 seconds and casts a vote — capturing governance participation that would otherwise be lost to voter apathy.
A treasury management agent operates as an authorized multi-sig signer for a DAO's financial operations. It monitors cash flow, proposes budget reallocations when reserves drop below threshold, and executes approved treasury actions automatically.
When the DAO votes to approve a grant or investment, the treasury agent detects the successful proposal, waits for the timelock period, and queues the execution transaction — ensuring approved decisions are executed promptly without requiring manual intervention from human contributors.
Token holders who lack time or expertise to evaluate proposals can delegate their voting power to a specialized AI agent. The agent accepts delegations, maintains a transparent voting record on-chain, and publishes vote rationales for delegators to review.
This creates a new class of AI-powered governance delegates — more consistent and responsive than human delegates, with full auditability of every decision.
import PurpleFlea from "@purpleflea/sdk"; import Anthropic from "@anthropic-ai/sdk"; const pf = new PurpleFlea({ apiKey: process.env.PURPLEFLEA_API_KEY }); const claude = new Anthropic(); // Fetch all active proposals from Compound Governor const proposals = await pf.governance.getProposals({ protocol: "compound", state: "active", }); for (const proposal of proposals) { // Analyze with Claude const analysis = await claude.messages.create({ model: "claude-opus-4-6", max_tokens: 512, messages: [{ role: "user", content: `Analyze this governance proposal and recommend how to vote. Vote FOR if: improves security, increases yield for LPs, reduces risk. Vote AGAINST if: reduces protocol fees significantly, increases risk. Proposal: ${proposal.description} Respond with JSON: { vote: "for"|"against"|"abstain", rationale: string }`, }], }); const { vote, rationale } = JSON.parse(analysis.content[0].text); const voteValue = { for: 1, against: 0, abstain: 2 }[vote]; // Cast vote on-chain await pf.governance.castVote({ protocol: "compound", proposalId: proposal.id, support: voteValue, reason: rationale, }); console.log(`Voted ${vote} on proposal #${proposal.id}: ${rationale}`); }
// Self-delegate to activate voting power (required for many Governor contracts) await pf.governance.delegateTokens({ chain: "ethereum", token: "COMP", delegatee: pf.wallet.address, // self-delegate }); // Vote on a Snapshot proposal (gasless) const snapshotProposals = await pf.governance.getProposals({ protocol: "snapshot", space: "uniswapgovernance.eth", state: "active", }); for (const p of snapshotProposals) { await pf.governance.snapshotVote({ proposalId: p.id, choice: 1, // 1 = first choice option reason: "Supporting improved fee tier structure", }); } // Submit a new governance proposal await pf.governance.submitProposal({ protocol: "compound", targets: ["0xComptrollerAddress"], values: [0], calldatas: [encodedSetCollateralFactor], description: "Adjust ETH collateral factor from 82% to 85% given improved oracle reliability", });
Governance frameworks split into two major categories, each with distinct tradeoffs for AI agents. Purple Flea handles both transparently.
| Property | On-Chain (Governor Bravo / OZ) | Off-Chain (Snapshot) |
|---|---|---|
| Gas cost | ~$5–50 per vote (Ethereum) | Free (EIP-712 signature) |
| Binding execution | Automatic on-chain execution | Requires multisig to execute |
| Censorship resistance | Fully decentralized | Hosted by Snapshot (centralized) |
| Speed | Block confirmation time | Instant |
| Audit trail | Permanently on-chain | Stored on IPFS via Snapshot |
| Agent suitability | Best for high-stakes decisions | Best for high-frequency participation |
Recommendation: For high-value treasury proposals (greater than $100K impact), use on-chain Governor voting for binding execution. For routine parameter adjustments and sentiment signals on Snapshot spaces, off-chain voting provides cost-effective participation across dozens of DAOs simultaneously.
Combine DAO governance with treasury management, smart contracts, and cross-agent coordination.