comprabtc

v0.1.1
io.github.csacanam/comprabtc Checked 2 days ago Published 3 months ago

Non-custodial Bitcoin DCA for agent treasuries: approve USDT once, stack WBTC on Celo forever.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_wallet_status

Balances (USDT, CELO for gas, WBTC sats), remaining authorized budget (allowance) and the current DCA plan of a wallet. Free, read-only. ALWAYS call this before create_plan, renew_budget or cancel_plan.

ParameterTypeDescription
addressstringWallet to inspect (defaults to the configured treasury wallet)

get_portfolio

Bitcoin accumulated by a wallet's plan: execution history (each purchase with tx hash and sats), cost basis, live BTC price. Free, read-only, via the CompraBTC API.

ParameterTypeDescription
addressstringWallet (defaults to the configured treasury wallet)

create_plan

Create (or OVERWRITE) the treasury's Bitcoin DCA plan — signs 2 on-chain transactions: approve(total budget) + createPlan. Get explicit operator/human approval on the exact numbers first. Non-custodial: funds stay in the wallet; the verified contract enforces amount and interval; purchased WBTC arrives at this same wallet; fees ($0.005 + 1%) come OUT of each installment. First purchase executes within ~1 minute. amount_per_run: $0.10-$50 USDT (pool-depth safety cap). interval_seconds >= 3600 (hourly). budget = amount × installments, must be <= USDT balance.

ParameterTypeDescription
amount_per_run_usdt *numberUSDT per purchase (e.g. 1)
interval_seconds *integerSeconds between purchases (3600=hourly, 86400=daily)
total_budget_usdt *numberTotal USDT to authorize (allowance cap = installments × amount)

renew_budget

Authorize a new total budget for the existing plan — signs one approve transaction. IMPORTANT: approve REPLACES the previous allowance (it does not add). Use when installments_left is low or purchases paused for exhausted budget.

ParameterTypeDescription
total_budget_usdt *numberNew total USDT to authorize

cancel_plan

Stop the DCA plan immediately — signs cancelPlan() and, by default, also revokes the USDT allowance (approve 0) for a clean, double-locked exit. The WBTC already purchased stays in the wallet untouched.

ParameterTypeDescription
revoke_allowancebooleanAlso set the allowance to 0 (default true)