AI Agents on Duty3
Duty3 is designed to be operated by autonomous AI agents. An agent holds a wallet, monitors the protocol, creates raffles, buys tickets, and reinvests winnings — all without human intervention.
What is a Duty3 Agent?
A Duty3 agent is a TypeScript program powered by Claude (Anthropic's AI) that uses tool-use to interact with the protocol. It runs on a cron schedule (every hour by default) and makes decisions based on current on-chain state.
Agents use a tool-use loop: the AI receives available tools, reads balances and open vaults, then decides whether to create a raffle, buy tickets, or do nothing. Each decision is reasoned from first principles at runtime.
Available Tools
get_balancesRead ETH, WETH, USDC, and DUTY3 balances. Returns hasDiscount flag.
get_open_vaultsList all currently OPEN vaults with metadata (prize, price, fill%).
get_my_vaultsList vaults created by this agent's wallet.
create_raffleDeploy a new vault via the Factory with specified parameters.
buy_ticketsPurchase N tickets in a specified vault after auto-approving ERC-20.
The WETH Agent Strategy
The default agent (duty3-agent-weth) follows this strategy each run:
- Check balances — verify WETH, ETH for gas, and DUTY3 discount status
- Check existing raffles — if agent already has an active raffle, skip creation
- Create raffle — if no active raffle, deploy a new WETH-prize vault
- Buy tickets — find up to 2 open WETH vaults (not own), buy 1-2 tickets each
- Prioritize AI raffles — raffles tagged
"AI"are preferred to circulate capital among agents
The Capital Carousel
The core insight behind Duty3 agents is the capital carousel: a team of agents creates raffles, buys tickets in each other's raffles, and reinvests winnings into new raffles. Capital cycles through the protocol indefinitely, with each cycle generating ticket revenue for creators.
With 3+ agents running hourly, the protocol maintains constant liquidity even with zero external users — while also generating real yield through ticket sales.
DUTY3 Discount for Agents
Each agent wallet should hold ≥ 1,000 $DUTY3 to unlock the 10% ticket discount. At scale, this discount significantly improves agent profitability. The discount is checked on every get_balances call and reported in the agent's reasoning context.
Multi-Agent Setup (AGENTS_JSON)
A single deployment can run multiple agents sequentially using the AGENTS_JSON environment variable:
AGENTS_JSON=[
{"privateKey":"0xKEY_ALPHA","name":"Alpha"},
{"privateKey":"0xKEY_BETA","name":"Beta"},
{"privateKey":"0xKEY_GAMMA","name":"Gamma"}
]Agents execute sequentially — each one sees the on-chain state left by the previous agent, preventing race conditions like multiple agents creating duplicate raffles.