sbtc-yield-maximizer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesesBTC Yield Maximizer
sBTC收益最大化工具
What it does
功能介绍
Compares live Zest sBTC yield against current Bitflow sBTC HODLMM opportunity and routes idle sBTC to the highest safe path. This version executes a real Zest sBTC supply transaction when Zest is the winning route and blocks when HODLMM is better but not safely executable by this standalone skill version.
实时对比Zest sBTC收益与当前Bitflow sBTC HODLMM机会,将闲置sBTC路由至最高安全路径。当Zest为最优路径时,本版本会执行真实的Zest sBTC供应交易;若HODLMM更优,但本独立技能版本无法安全执行,则会阻止操作。
Why agents need it
智能体为何需要它
Agents should not deploy sBTC based on static assumptions. They need a real decision layer that checks current yield, stale pricing risk, HODLMM liquidity quality, and wallet reserves before capital moves. This skill turns that decision into a repeatable, guardrailed write flow.
智能体不应基于静态假设部署sBTC。在转移资金前,它们需要一个实时决策层,检查当前收益、过时定价风险、HODLMM流动性质量以及钱包储备。该技能将这一决策转化为可重复、受防护的写入流程。
Safety notes
安全说明
- Writes to chain. signs and broadcasts a real Zest sBTC supply transaction when Zest is the winning route.
run - Mainnet only. Routing data and write execution target live mainnet protocols.
- Wallet password required. The skill unlocks the local AIBTC wallet at execution time using .
AIBTC_WALLET_PASSWORD - Reserve enforced. The wallet retains at least after the write path.
--reserve-sats - Deploy cap enforced. The routed amount is capped by .
--max-deploy-sats - Gas reserve enforced. The wallet must keep at least .
--min-gas-reserve-ustx - Post-conditions enforced. The Zest service-layer write path uses .
PostConditionMode.Deny - HODLMM stale-price gate enforced. Pools with price divergence above are disqualified from winning.
--max-price-divergence-pct - HODLMM liquidity gates enforced. Pools below the configured TVL or 24h volume floors are disqualified.
- Cooldown enforced. Repeated route execution is blocked until has elapsed.
--cooldown-hours - Explicit confirmation required. refuses to execute unless
runis provided.--confirm=MAXIMIZE - Wallet is re-locked after the attempted write path.
- 写入区块链。当Zest为最优路径时,命令会签署并广播真实的Zest sBTC供应交易。
run - 仅主网适用。路由数据与写入执行针对实时主网协议。
- 需要钱包密码。执行时,技能会使用解锁本地AIBTC钱包。
AIBTC_WALLET_PASSWORD - 强制保留储备。写入操作完成后,钱包至少保留设定的金额。
--reserve-sats - 强制部署限额。路由金额受限制。
--max-deploy-sats - 强制Gas储备。钱包必须至少保留设定的Gas。
--min-gas-reserve-ustx - 强制后置条件。Zest服务层写入流程使用。
PostConditionMode.Deny - 强制HODLMM过时价格门槛。价格偏离度超过的池将被取消最优资格。
--max-price-divergence-pct - 强制HODLMM流动性门槛。低于配置的TVL或24小时交易量下限的池将被取消资格。
- 强制冷却期。在冷却时间结束前,重复路由执行会被阻止。
--cooldown-hours - 需要明确确认。除非提供参数,否则
--confirm=MAXIMIZE命令拒绝执行。run - 写入尝试完成后,钱包会重新锁定。
Commands
命令
doctor
doctor
Checks wallet resolution, STX and sBTC balances, Zest vault reads, Bitflow pool reads, and whether the current configuration can execute the winning route safely.
bash
bun run sbtc-yield-maximizer/sbtc-yield-maximizer.ts doctor检查钱包解析情况、STX与sBTC余额、Zest vault读取情况、Bitflow池读取情况,以及当前配置是否能安全执行最优路由。
bash
bun run sbtc-yield-maximizer/sbtc-yield-maximizer.ts doctorinstall-packs
install-packs
Lists the required runtime packages used by this skill.
bash
bun run sbtc-yield-maximizer/sbtc-yield-maximizer.ts install-packs列出该技能所需的运行时包。
bash
bun run sbtc-yield-maximizer/sbtc-yield-maximizer.ts install-packsstatus
status
Shows live balances, route candidates, route scores, Zest rate reads, the top HODLMM candidate, and the current winning route.
bash
bun run sbtc-yield-maximizer/sbtc-yield-maximizer.ts status显示实时余额、路由候选选项、路由评分、Zest利率读取结果、最优HODLMM候选选项以及当前最优路由。
bash
bun run sbtc-yield-maximizer/sbtc-yield-maximizer.ts statusrun
run
Unlocks the wallet, re-checks the route decision, and executes a real Zest sBTC supply when Zest is the winning safe route.
bash
AIBTC_WALLET_PASSWORD='your-password' bun run sbtc-yield-maximizer/sbtc-yield-maximizer.ts run --confirm=MAXIMIZEExample tuned run:
bash
AIBTC_WALLET_PASSWORD='your-password' bun run sbtc-yield-maximizer/sbtc-yield-maximizer.ts run --wallet-id=b4d575f8-0865-4d6f-b1d6-5627b645a03c --max-deploy-sats=100 --reserve-sats=100 --min-gas-reserve-ustx=100000 --min-hodlmm-volume-usd=1000 --min-hodlmm-tvl-usd=1000 --max-price-divergence-pct=0.5 --confirm=MAXIMIZE解锁钱包,重新检查路由决策,当Zest为最优安全路径时,执行真实的Zest sBTC供应操作。
bash
AIBTC_WALLET_PASSWORD='your-password' bun run sbtc-yield-maximizer/sbtc-yield-maximizer.ts run --confirm=MAXIMIZE示例调优运行命令:
bash
AIBTC_WALLET_PASSWORD='your-password' bun run sbtc-yield-maximizer/sbtc-yield-maximizer.ts run --wallet-id=b4d575f8-0865-4d6f-b1d6-5627b645a03c --max-deploy-sats=100 --reserve-sats=100 --min-gas-reserve-ustx=100000 --min-hodlmm-volume-usd=1000 --min-hodlmm-tvl-usd=1000 --max-price-divergence-pct=0.5 --confirm=MAXIMIZEOutput contract
输出约定
All outputs are JSON to stdout.
Success:
json
{
"status": "success",
"action": "Supplied sBTC to Zest because it was the highest safe executable yield route",
"data": {
"operation": "maximize-yield",
"txid": "0x...",
"explorerUrl": "https://explorer.hiro.so/txid/0x...?chain=mainnet"
},
"error": null
}Blocked:
json
{
"status": "blocked",
"action": "Hold idle sBTC until a safe executable route is available",
"data": {},
"error": {
"code": "PREFLIGHT_BLOCKED",
"message": "No executable route passed the configured safety gates",
"next": "Re-run later or adjust thresholds with explicit operator approval"
}
}Error:
json
{ "error": "descriptive message" }所有输出均为JSON格式并输出至标准输出。
成功输出:
json
{
"status": "success",
"action": "Supplied sBTC to Zest because it was the highest safe executable yield route",
"data": {
"operation": "maximize-yield",
"txid": "0x...",
"explorerUrl": "https://explorer.hiro.so/txid/0x...?chain=mainnet"
},
"error": null
}阻止输出:
json
{
"status": "blocked",
"action": "Hold idle sBTC until a safe executable route is available",
"data": {},
"error": {
"code": "PREFLIGHT_BLOCKED",
"message": "No executable route passed the configured safety gates",
"next": "Re-run later or adjust thresholds with explicit operator approval"
}
}错误输出:
json
{ "error": "descriptive message" }Known constraints
已知限制
- This version executes the Zest route when Zest is the winning route. When HODLMM wins, the skill reports that outcome but does not attempt a direct HODLMM LP deposit.
- Zest sBTC yield is derived from live on-chain Zest vault reads and interpreted as a basis-points-style supply signal. This was verified against the live source, which defines
v0-vault-sbtcand applies rate math in basis points.BPS u10000 - HODLMM opportunity is derived from live Bitflow app and quote APIs using APR, fee run-rate, volume, TVL, and stale-price checks.
- Requires enough sBTC to exceed reserve and enough STX to preserve gas reserve.
- 当Zest为最优路径时,本版本会执行Zest路由;若HODLMM获胜,技能会报告该结果,但不会尝试直接进行HODLMM LP存入操作。
- Zest sBTC收益来源于实时链上Zest vault读取数据,并被解读为基点(basis-points)风格的供应信号。这已通过实时源验证,该源定义了
v0-vault-sbtc并以基点为单位进行利率计算。BPS u10000 - HODLMM机会来源于实时Bitflow应用与报价API,使用APR、费率运行率、交易量、TVL以及过时价格检查得出。
- 需要足够的sBTC以超过储备金额,同时需要足够的STX以保留Gas储备。
Origin
起源
Winner of AIBTC x Bitflow Skills Pay the Bills competition.
Original author: @Ololadestephen
Competition PR: https://github.com/BitflowFinance/bff-skills/pull/243
AIBTC x Bitflow Skills Pay the Bills竞赛获胜作品。
原作者:@Ololadestephen
竞赛PR:https://github.com/BitflowFinance/bff-skills/pull/243