
Comprabtc
io.github.csacanam由 GitHub 账号 csacanam 发布v0.1.1更新于 Oct 24, 2026
Non-custodial Bitcoin DCA for agent treasuries: approve USDT once, stack WBTC on Celo forever.
概览
让助手在 Celo 上用资金钱包创建、监控、续订或取消非托管的比特币定投计划。
- 可以做什么
- CompraBTC 是一个本地 MCP 服务器,对应 Celo 上的非托管比特币定投代理。它提供检查计划状态、创建、续订或取消计划以及跟踪所获 WBTC 持仓的工具。计划只需定义一次,即每个周期固定数量的 USDT;链上执行器每次运行提取一期,换成 WBTC 直接发送到用户钱包。读取操作无需钱包私钥,创建、续订和取消需要签名。
- 适用场景
- 当助手或代理资金库需要在 Celo 上运行周期性比特币累积计划,并希望助手直接管理该计划时使用。适合能自行签署设置交易的代理钱包,或由助手协助、在网页应用中签名的人类用户。
- 运行要求
- 通过 npm 包 comprabtc-mcp 以 npx 在本地以 stdio 运行。需要 Node.js 以及访问 Celo 主网。创建、续订和取消需要 COMPRABTC_WALLET_PRIVATE_KEY,即持有 USDT 的资金钱包。COMPRABTC_MAX_PER_RUN_USDT 可选,用于限制每期 USDT 支出(默认 50)。
安装
在 SourceWeft 中
- 打开 控制台中的 Comprabtc,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
CompraBTC
Non-custodial Bitcoin DCA agent on Celo. Define your plan once — $X every hour/day in BTC — and an on-chain agent buys Bitcoin for you, straight into your own wallet. Funds never leave your wallet between purchases.
- Live app: https://comprabtc.vercel.app (works in MiniPay and any injected wallet)
- Agent API: https://comprabtc-api.vercel.app (
GET /service descriptor ·GET /api/statspublic metrics) - Built for the Celo Agentic Payments & DeFAI Hackathon — leaderboard
Deployed contracts (Celo mainnet, chain 42220)
Swaps route through the USDT/WBTC 0.3% Uniswap V3 pool. Protocol fee: 1% + $0.005 flat per execution, with on-chain hard caps (≤1%, ≤$0.05 flat) and a revert if the fee would ever eat the installment.
Agent identity: ERC-8004 #9665 on Celo mainnet (8004scan). Every transaction carries ERC-8021 attribution tags.
How it works
- The user approves USDT to
DCAExecutor(cap = total plan budget) and creates a plan with on-chain limits (amount per run, minimum interval). Cancelling = one click (cancelPlanorapprove(0)). - The keeper discovers plans from
PlanCreatedevents, and each cycle pays the execution API with an x402 micropayment before callingexecute()— so every purchase is also an agent-to-agent payment. - On-chain limits mean even a compromised keeper can't overcharge: it can never pull more than
amountPerRunor execute beforeminIntervalelapses. - Users get Telegram alerts on every purchase (link from Settings in the app).
Repository layout
Running locally
Frontend (needs NEXT_PUBLIC_EXECUTOR_ADDRESS, NEXT_PUBLIC_API_URL, NEXT_PUBLIC_ATTRIBUTION_CODE, NEXT_PUBLIC_TELEGRAM_BOT in frontend/.env.local):
Backend + keeper (Node 22; see backend/src/config.ts for required env vars — executor address, keeper key, Supabase credentials, x402 API key; DB schema in backend/supabase/schema.sql + migrations in the same folder):
Locally the keeper runs as an in-process loop (setInterval). Deployed on Vercel the whole Express app is a single function and the keeper is driven by Vercel Cron hitting GET /api/cron/keeper (guarded by CRON_SECRET, schedule in backend/vercel.json) — serverless instances are frozen and reused, so an interval there would fire duplicated, off-schedule ticks. Anything the keeper needs to remember between ticks (alert cooldowns, digest cadence, last scanned block) lives in agent_keeper_state, not in memory.
Contracts:
For AI agents
An agent with its own funded wallet can set up a Bitcoin savings plan in two transactions — and so can an agent assisting a human (the web app handles the signing):
- MCP server (treasury DCA):
claude mcp add comprabtc -- npx -y comprabtc-mcp— tools to check status, create/renew/cancel the plan and track the portfolio, signing with the treasury's own wallet. Seemcp/README.md. - Agent skill:
npx skills add csacanam/comprabtc— covers plan creation (viem), monitoring, budget math, cancelling, and the permissionless x402 execution trigger. - Service descriptor (machine-readable how-to):
GET https://comprabtc-api.vercel.app/· LLM index: comprabtc.vercel.app/llms.txt - Agent identity: ERC-8004 #9665 on Celo — metadata · 8004scan
Transparency
Operator wallets (declared):
On-chain volume is real user capital. Each plan starts with a user's own approve; the keeper pulls one installment per run via transferFrom and the purchased WBTC goes straight to the user's wallet, where it stays. No custody, no round-trips — the volume is actual BTC purchases with real economic intent.
x402 is internal metering with an open door. The keeper pays x402 on every run, so each x402 payment maps to one real executed purchase — not standalone dust. /api/execute is permissionless and auto-registers plans from on-chain events, so any external agent or human can invoke it and settle their own x402; it is not a closed loop.
Hackathon tracks
- Track 1 — on-chain revenue: protocol fee charged inside
execute(), every tx tagged with ERC-8021 attribution. - Track 2 — x402 payments: the keeper pays
/api/executeper run via the Celo x402 facilitator. The endpoint is permissionless — any agent can pay to trigger an execution. - Track 4 — Aigora: agent registered on the Aigora marketplace (#395) + feedback PRs at trionlabs/aigora-skills.
License
MIT
来源:README.md,提交 e527f1d
工具
0版本历史
1- v0.1.1最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。