sbtc-auto-funnel

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

sBTC Auto-Funnel

sBTC 自动归集生息工具

Monitors sBTC balance against a configurable reserve threshold and routes any excess to Zest Protocol's lending pool for yield. Built from 1400+ cycles of autonomous DeFi operations where every sat of revenue gets put to work immediately.
监控sBTC余额与可配置的储备阈值,将超出部分转入Zest Protocol的借贷池以获取收益。基于1400+次自主DeFi操作周期构建,每一分收入都能立即投入运作。

What it does

功能介绍

Agents earn sBTC from bounties, inbox payments, x402 services, and trading. Idle sats earn nothing. This skill checks liquid sBTC balance, compares it against a reserve floor, and supplies the difference to Zest — turning passive holdings into yield-bearing positions.
Agent通过赏金、收件箱付款、x402服务及交易赚取sBTC。闲置的sats(聪)无法产生收益。本技能会检查流动sBTC余额,与储备下限对比,将差额存入Zest——将被动持有转化为生息头寸。

Why agents need it

Agent为何需要它

Without automated yield routing, agents accumulate idle sBTC that could be earning interest from Zest borrowers. The auto-funnel pattern ensures revenue is deployed within the same cycle it arrives, compounding over hundreds of cycles.
如果没有自动收益路由,Agent会累积闲置的sBTC,而这些本可以通过Zest的借款人赚取利息。自动归集模式确保收入在到账的同一周期内就被部署,在数百个周期内复利增长。

Commands

命令

doctor

doctor

Pre-flight checks: wallet connectivity, sBTC balance readable, Zest pool accessible, STX gas available.
bash
bun run sbtc-auto-funnel/sbtc-auto-funnel.ts doctor
预检检查:钱包连接性、sBTC余额可读性、Zest池可访问性、STX gas可用性。
bash
bun run sbtc-auto-funnel/sbtc-auto-funnel.ts doctor

run --action=check

run --action=check

Read-only balance check. Reports liquid sBTC, Zest position, reserve threshold, and whether a funnel is actionable.
bash
bun run sbtc-auto-funnel/sbtc-auto-funnel.ts run --action=check
只读余额检查。报告流动sBTC、Zest持仓、储备阈值,以及是否可执行归集操作。
bash
bun run sbtc-auto-funnel/sbtc-auto-funnel.ts run --action=check

run --action=funnel

run --action=funnel

Calculates excess above reserve, validates gas, and outputs the MCP command to supply to Zest. Does NOT auto-execute — agent decides.
bash
bun run sbtc-auto-funnel/sbtc-auto-funnel.ts run --action=funnel
计算超出储备的金额,验证gas,输出存入Zest的MCP命令。不会自动执行——由Agent决定是否执行。
bash
bun run sbtc-auto-funnel/sbtc-auto-funnel.ts run --action=funnel

install-packs

install-packs

No additional packages required.
无需额外安装包。

Safety notes

安全说明

  • Reserve floor enforced in code: Default 200,000 sats. Hard-coded minimum 50,000 sats — cannot be set lower.
  • Minimum funnel amount: Won't supply less than 10,000 sats (gas cost would exceed yield benefit).
  • Gas validation: Requires 150,000 uSTX before proceeding. Blocks if insufficient.
  • Supply-only: This skill NEVER borrows. Supply to Zest only. Borrowing requires separate operator approval.
  • No auto-execute: Outputs the
    zest_supply
    MCP command payload. Agent decides whether to broadcast.
  • Balance verification: Reads on-chain balance via API, not cached values. Stale data cannot trigger a supply.
  • 代码强制执行储备下限:默认200,000聪。硬编码最低50,000聪——无法设置更低。
  • 最低归集金额:不会存入少于10,000聪(gas成本会超过收益)。
  • Gas验证:执行前需要150,000 uSTX。如果不足则阻止操作。
  • 仅存入:本技能绝不会借贷。仅向Zest存入资金。借贷需要单独的操作员批准。
  • 无自动执行:输出
    zest_supply
    MCP命令负载。由Agent决定是否广播。
  • 余额验证:通过API读取链上余额,而非缓存值。过期数据无法触发存入操作。

Output contract

输出合约

json
{
  "status": "success | error | blocked",
  "action": "string",
  "data": {
    "balance": {
      "sbtc_liquid": 271010,
      "zest_position": 245000,
      "reserve_threshold": 200000,
      "excess": 71010,
      "funnel_amount": 70000
    },
    "mcp_command": {
      "tool": "zest_supply",
      "params": { "asset": "sBTC", "amount": "70000" }
    }
  },
  "error": null
}
json
{
  "status": "success | error | blocked",
  "action": "string",
  "data": {
    "balance": {
      "sbtc_liquid": 271010,
      "zest_position": 245000,
      "reserve_threshold": 200000,
      "excess": 71010,
      "funnel_amount": 70000
    },
    "mcp_command": {
      "tool": "zest_supply",
      "params": { "asset": "sBTC", "amount": "70000" }
    }
  },
  "error": null
}

On-Chain Proof

链上证明

OperationTxidBlockResult
Zest supply 70k satsaed49fc3...7377225
(ok true)
Zest supply 175k satsprevious supply txmainnet
(ok true)
操作Txid区块结果
Zest存入7万聪aed49fc3...7377225
(ok true)
Zest存入17.5万聪previous supply tx主网
(ok true)

Architecture

架构

[Agent earns sBTC] → [check balance] → [excess > reserve?]
                                              ↓ yes
                              [validate gas] → [output zest_supply command]
                                              ↓ no
                              [report: no action needed]
The skill is stateless — it reads current on-chain balance each invocation. No local state files needed.
[Agent earns sBTC] → [check balance] → [excess > reserve?]
                                              ↓ yes
                              [validate gas] → [output zest_supply command]
                                              ↓ no
                              [report: no action needed]
本技能无状态——每次调用时读取当前链上余额。无需本地状态文件。

Limitations

局限性

  • Uses MCP tool
    sbtc_get_balance
    for balance reads. If MCP server is unreachable, falls back to Hiro API.
  • Zest position read uses
    zest_get_position
    . Position data is informational only (not used in funnel decision).
  • Reserve threshold is configurable per-run but has a hard floor of 50k sats to prevent accidental full depletion.
  • 使用MCP工具
    sbtc_get_balance
    读取余额。如果MCP服务器不可达,则回退到Hiro API。
  • Zest持仓读取使用
    zest_get_position
    。持仓数据仅作参考(不用于归集决策)。
  • 储备阈值可在每次运行时配置,但有5万聪的硬下限,以防止意外耗尽全部资金。

Origin

起源

Winner of AIBTC x Bitflow Skills Pay the Bills competition. Original author: @secret-mars Competition PR: https://github.com/BitflowFinance/bff-skills/pull/83
AIBTC x Bitflow Skills Pay the Bills竞赛获胜作品。 原作者:@secret-mars 竞赛PR:https://github.com/BitflowFinance/bff-skills/pull/83