yield-hunter
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseYield Hunter Skill
Yield Hunter Skill
Provides an autonomous yield hunting daemon that monitors your wallet's sBTC balance and automatically deposits to Zest Protocol's lending pool to earn yield. The daemon runs in the foreground and can be stopped with Ctrl+C or the subcommand.
stopState is persisted to between runs.
~/.aibtc/yield-hunter-state.jsonRequirements:
- Mainnet only (Zest Protocol is mainnet-only)
- Unlocked wallet with sBTC balance
- STX balance for transaction fees (Stacks gas is paid in STX, not sBTC)
提供一个自主的收益狩猎守护进程,监控您钱包中的sBTC余额,并自动存入Zest Protocol的借贷池以赚取收益。该守护进程在前台运行,可通过Ctrl+C或子命令停止。
stop运行期间,状态会持久化到文件中。
~/.aibtc/yield-hunter-state.json要求:
- 仅支持主网(Zest Protocol仅在主网可用)
- 已解锁且拥有sBTC余额的钱包
- 用于支付交易手续费的STX余额(Stacks网络的手续费以STX支付,而非sBTC)
Usage
使用方法
bun run yield-hunter/yield-hunter.ts <subcommand> [options]bun run yield-hunter/yield-hunter.ts <subcommand> [options]Subcommands
子命令
start
启动
Start autonomous yield hunting. Runs in the foreground until stopped.
bun run yield-hunter/yield-hunter.ts start [--threshold 10000] [--reserve 0] [--interval 600]Options:
- (optional) — Minimum sBTC balance in satoshis before depositing (default: 10000 = 0.0001 sBTC)
--threshold <sats> - (optional) — sBTC in satoshis to keep liquid, never deposited (default: 0 — deposit all)
--reserve <sats> - (optional) — Check interval in seconds (default: 600 = 10 minutes)
--interval <seconds>
What it does:
- Verifies wallet is unlocked and on mainnet
- Fetches current Zest Protocol APY
- Runs an immediate balance check
- Schedules periodic checks at the configured interval
- When wallet sBTC >= (threshold + reserve), deposits (balance - reserve) to Zest
Output:
json
{
"success": true,
"message": "Yield hunter started",
"pid": 12345,
"config": {
"minDepositThreshold": "10000",
"minDepositThresholdFormatted": "0.00010000 sBTC",
"reserve": "0",
"reserveFormatted": "0.00000000 sBTC",
"checkIntervalSeconds": 600,
"asset": "sBTC"
},
"note": "Running in foreground. Press Ctrl+C to stop."
}启动自主收益狩猎功能。在前台运行,直到被停止。
bun run yield-hunter/yield-hunter.ts start [--threshold 10000] [--reserve 0] [--interval 600]选项:
- (可选)——存入前的最低sBTC余额(单位:聪,默认值:10000 = 0.0001 sBTC)
--threshold <sats> - (可选)——保留的sBTC余额(单位:聪,不会被存入,默认值:0 —— 全部存入)
--reserve <sats> - (可选)——检查间隔(单位:秒,默认值:600 = 10分钟)
--interval <seconds>
功能说明:
- 验证钱包已解锁且处于主网
- 获取当前Zest Protocol的年化收益率(APY)
- 立即执行一次余额检查
- 按照配置的间隔定期执行检查
- 当钱包sBTC余额 >=(阈值 + 保留余额)时,将(余额 - 保留余额)存入Zest
输出示例:
json
{
"success": true,
"message": "Yield hunter started",
"pid": 12345,
"config": {
"minDepositThreshold": "10000",
"minDepositThresholdFormatted": "0.00010000 sBTC",
"reserve": "0",
"reserveFormatted": "0.00000000 sBTC",
"checkIntervalSeconds": 600,
"asset": "sBTC"
},
"note": "Running in foreground. Press Ctrl+C to stop."
}stop
停止
Stop the running yield hunter process.
bun run yield-hunter/yield-hunter.ts stopSends SIGTERM to the running daemon. Your existing Zest positions remain untouched.
Output:
json
{
"success": true,
"message": "Yield hunter stopped (PID: 12345)",
"stats": {
"checksRun": 24,
"depositsExecuted": 3,
"totalDeposited": "300000",
"totalDepositedFormatted": "0.00300000 sBTC"
}
}停止运行中的收益猎手进程。
bun run yield-hunter/yield-hunter.ts stop向运行中的守护进程发送SIGTERM信号。您在Zest中的现有持仓不会受到影响。
输出示例:
json
{
"success": true,
"message": "Yield hunter stopped (PID: 12345)",
"stats": {
"checksRun": 24,
"depositsExecuted": 3,
"totalDeposited": "300000",
"totalDepositedFormatted": "0.00300000 sBTC"
}
}status
状态查询
Get the current yield hunter status, configuration, and recent activity.
bun run yield-hunter/yield-hunter.ts statusWhen a wallet is active and on mainnet, also fetches current wallet balance and Zest position.
Output:
json
{
"running": true,
"pid": 12345,
"network": "mainnet",
"config": {
"minDepositThreshold": "10000",
"minDepositThresholdFormatted": "0.00010000 sBTC",
"reserve": "0",
"reserveFormatted": "0.00000000 sBTC",
"effectiveThreshold": "10000",
"checkIntervalMs": 600000,
"checkIntervalSeconds": 600,
"asset": "sBTC"
},
"stats": {
"lastCheck": "2024-01-01T12:00:00.000Z",
"totalDeposited": "300000",
"totalDepositedFormatted": "0.00300000 sBTC",
"checksRun": 24,
"depositsExecuted": 3,
"lastError": null,
"currentApy": "5.00%"
},
"currentPosition": {
"walletSbtc": "150000",
"walletSbtcFormatted": "0.00150000 sBTC",
"availableToDeposit": "150000",
"availableToDepositFormatted": "0.00150000 sBTC",
"zestSupplied": "300000",
"zestSuppliedFormatted": "0.00300000 sBTC",
"zestBorrowed": "0"
},
"recentLogs": [
{ "timestamp": "2024-01-01T12:00:00.000Z", "type": "info", "message": "Wallet sBTC: 0.00150000 sBTC" }
]
}获取当前收益猎手的状态、配置和近期活动。
bun run yield-hunter/yield-hunter.ts status当钱包处于活跃状态且在主网时,还会获取当前钱包余额和Zest持仓情况。
输出示例:
json
{
"running": true,
"pid": 12345,
"network": "mainnet",
"config": {
"minDepositThreshold": "10000",
"minDepositThresholdFormatted": "0.00010000 sBTC",
"reserve": "0",
"reserveFormatted": "0.00000000 sBTC",
"effectiveThreshold": "10000",
"checkIntervalMs": 600000,
"checkIntervalSeconds": 600,
"asset": "sBTC"
},
"stats": {
"lastCheck": "2024-01-01T12:00:00.000Z",
"totalDeposited": "300000",
"totalDepositedFormatted": "0.00300000 sBTC",
"checksRun": 24,
"depositsExecuted": 3,
"lastError": null,
"currentApy": "5.00%"
},
"currentPosition": {
"walletSbtc": "150000",
"walletSbtcFormatted": "0.00150000 sBTC",
"availableToDeposit": "150000",
"availableToDepositFormatted": "0.00150000 sBTC",
"zestSupplied": "300000",
"zestSuppliedFormatted": "0.00300000 sBTC",
"zestBorrowed": "0"
},
"recentLogs": [
{ "timestamp": "2024-01-01T12:00:00.000Z", "type": "info", "message": "Wallet sBTC: 0.00150000 sBTC" }
]
}configure
配置
Update yield hunter configuration. Changes are saved immediately and take effect on the next check cycle.
bun run yield-hunter/yield-hunter.ts configure [--threshold 20000] [--reserve 5000] [--interval 300]Options:
- (optional) — New minimum deposit threshold in satoshis
--threshold <sats> - (optional) — New reserve amount in satoshis
--reserve <sats> - (optional) — New check interval in seconds (minimum: 10)
--interval <seconds>
Output:
json
{
"success": true,
"changes": [
"Deposit threshold set to 0.00020000 sBTC",
"Reserve set to 0.00005000 sBTC"
],
"config": {
"minDepositThreshold": "20000",
"minDepositThresholdFormatted": "0.00020000 sBTC",
"reserve": "5000",
"reserveFormatted": "0.00005000 sBTC",
"checkIntervalMs": 600000,
"checkIntervalSeconds": 600,
"asset": "sBTC"
},
"note": "Changes saved. The running daemon will pick them up on the next check cycle."
}更新收益猎手的配置。更改会立即保存,并在下一次检查周期生效。
bun run yield-hunter/yield-hunter.ts configure [--threshold 20000] [--reserve 5000] [--interval 300]选项:
- (可选)——新的最低存入阈值(单位:聪)
--threshold <sats> - (可选)——新的保留余额(单位:聪)
--reserve <sats> - (可选)——新的检查间隔(单位:秒,最小值:10)
--interval <seconds>
输出示例:
json
{
"success": true,
"changes": [
"Deposit threshold set to 0.00020000 sBTC",
"Reserve set to 0.00005000 sBTC"
],
"config": {
"minDepositThreshold": "20000",
"minDepositThresholdFormatted": "0.00020000 sBTC",
"reserve": "5000",
"reserveFormatted": "0.00005000 sBTC",
"checkIntervalMs": 600000,
"checkIntervalSeconds": 600,
"asset": "sBTC"
},
"note": "Changes saved. The running daemon will pick them up on the next check cycle."
}Notes
注意事项
- State is stored in
~/.aibtc/yield-hunter-state.json - PID tracking uses
~/.aibtc/yield-hunter.pid - Deposits use Zest Protocol's function via the borrow-helper contract
supply - Transaction fees are paid in STX — ensure you have STX balance for fees
- The daemon runs in the foreground; use a process manager (e.g., ,
tmux, orscreen) to run it in the backgroundpm2 - works even when the daemon is not running (reads persisted state)
status - works when the daemon is not running (changes take effect on next
configure)start
- 状态存储在中
~/.aibtc/yield-hunter-state.json - PID跟踪使用文件
~/.aibtc/yield-hunter.pid - 存款操作通过borrow-helper合约调用Zest Protocol的函数
supply - 交易手续费以STX支付——请确保您有足够的STX余额用于支付手续费
- 守护进程在前台运行;可使用进程管理器(如、
tmux或screen)在后台运行它pm2 - 即使守护进程未运行,命令也可使用(读取持久化的状态)
status - 即使守护进程未运行,命令也可使用(更改将在下次
configure时生效)start