DashClaw governed agent spend reference app.
TreasuryClaw is a reusable demo template that shows how an autonomous agent can propose a financial action, route it through DashClaw policy and approval gates, record the outcome, and attach verifiable receipts. It started as a Synthesis Hackathon 2026 project; the hackathon proof remains documented, but the repo is now framed as a DashClaw reference implementation rather than production treasury software.
TreasuryClaw combines live ETH price reads, portfolio rebalance logic, DashClaw approval policies, and two spend/receipt rails:
-
Mode A: Governed paid API spend
- Uses AgentCash to make a paid API request.
- Routes the spend intent through DashClaw governance.
- Verified with a Base transaction receipt from the hackathon run.
-
Mode B: On-chain identity and decision receipts
- Registers an ERC-8004-compatible agent identity.
- Writes DashClaw decision receipt hashes to Ethereum Mainnet.
- Uses mocked swap execution in the demo loop to avoid mainnet trading/gas risk.
The honest core claim is governed-agent-spend: an agent can evaluate live
inputs, propose a spend or swap, pass through policy enforcement and human
approval, and leave an auditable trail.
- DashClaw governance and action creation path.
- DashClaw approval behavior for governed API actions.
- AgentCash paid API spend backed by a funded wallet.
- ERC-8004 identity registration on Ethereum Mainnet.
- DashClaw decision receipt hash written to Ethereum Mainnet.
- Multi-source ETH/USD price fetch code in
src/price-feed.js. - Portfolio rebalance and risk scoring in
src/market-analyzer.js. - Governed paid-spend request shaping in
src/governed-paid-spend.js. - Unit tests for the pure helper paths.
- The final Uniswap swap inside
src/demo.jsis mocked. The demo records a mock swap reference so the governance and receipt flow can complete without spending mainnet gas on an actual trade. src/treasury-agent.jsis an integration skeleton for a continuous treasury loop. It contains stubs for the real OpenClaw/Venice/on-chain balance path.npm run test:policiesrequires a reachable DashClaw instance and valid credentials.
npm run demo:paidUse this to show a governed paid API spend request flowing through DashClaw and AgentCash.
node src/demo.js --cycles 1 --auto-approveUse this to show live ETH price reads, portfolio analysis, DashClaw governance, and an Ethereum Mainnet decision receipt. The swap result in this path is intentionally mocked.
npm run verify:localThis runs the unit tests and syntax checks without executing paid API calls, mainnet transactions, or approval-changing operations.
src/demo.js: Mode B demo runner for governance plus on-chain decision receipts.src/treasury-agent.js: Continuous agent-loop reference skeleton.src/price-feed.js: Live ETH price reads from public sources.src/market-analyzer.js: Rebalance and risk logic.src/uniswap-swap.js: Uniswap Trading API helper.src/sepolia-swap.js: Sepolia SwapRouter helper retained for testnet experiments.src/onchain-receipts.js: Ethereum Mainnet self-transaction receipt hash writer.src/erc8004.js: Ethereum Mainnet ERC-8004 identity and feedback helpers.src/honest-framing.js: Helper for honest claim-surface selection.src/governed-paid-spend.js: Mode A governed AgentCash request helper.scripts/policy-smoke-test.mjs: DashClaw policy verification script.docs/dashclaw-reference-app-plan.md: Plan for keeping this as a reference app while extracting reusable DashClaw product ideas.
This repo intentionally avoids committing secrets. Use .env.example as the
template and keep .env local.
Common env vars:
DASHCLAW_BASE_URLDASHCLAW_API_KEYRPC_URLorETHEREUM_MAINNET_RPC_URLPRIVATE_KEYorETHEREUM_MAINNET_PRIVATE_KEYTREASURY_WALLETUNISWAP_API_KEY
Built for the Synthesis Hackathon, March 17-22, 2026. The verified run links and submission notes are preserved in:
docs/submission-status.mddocs/demo-runbook.mddocs/policy-origin-story.mddocs/dashclaw-integration-guide.md
MIT License.