npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hunterweb303/bgtask

v2.0.0

Published

BitPilot — AI 自动驾驶你的加密资产

Readme

@hunterweb303/bgtask

BitPilot — AI 自动驾驶你的加密资产

基于 Bitget Agent Hub 构建的策略执行框架,提供 7 种预置策略模板、6 步安全链、守护进程管理,支持 24/7 无人值守运行。

特性

  • 7 种策略模板 — 从简单盯盘到全自动多引擎组合
  • 6 步安全链 — 危险工具拦截、dry-run、日限额、仓位比例、大额确认、持仓冲突检测
  • 3 级风控档位 — conservative / balanced / aggressive
  • 守护进程 — 后台运行、崩溃自恢复、指数退避重试
  • 实时面板 — 终端 Dashboard + Telegram/Webhook 通知
  • 三级 Provider — Core → CLI → REST 自动降级

快速开始

1. 安装

npm install -g @hunterweb303/bgtask

2. 配置 API Key

Bitget API 管理 获取密钥:

export BITGET_API_KEY="your_api_key"
export BITGET_SECRET_KEY="your_secret"
export BITGET_PASSPHRASE="your_passphrase"

3. 安装 Provider(任选一个)

# 推荐:原生 Node.js 绑定(最快)
npm install -g bitget-core

# 或:CLI 方式
npm install -g bitget-client

# 或:不装任何依赖,直接用 REST API(只需上面的环境变量)

4. 验证环境

bgtask check

5. 运行策略

# 睡觉前挂一个:BTC 跌 3% 就买 200U
bgtask run sleep-mode --symbol BTCUSDT --trigger-value 3 --amount 200 --daemon

# 资金费率套利:1000U 做 BTC delta-neutral
bgtask run sleep-yield --symbols BTCUSDT --budget 1000 --daemon

# 动量轮动:5000U 买最强的 3 个币
bgtask run alpha-rotator --budget 5000 --top-n 3 --daemon

# 全自动驾驶:2 万 U 三引擎组合
bgtask run bitpilot-pro --budget 20000 --daemon

策略模板

| 模板 | 说明 | 预期年化 | 最大回撤 | |------|------|---------|---------| | sleep-mode | 价格触发买卖,盯盘替代 | — | — | | event-mode | 事件驱动(暴跌/放量/费率异常)自动减仓 | — | — | | copy-mode | 排行榜量化筛选 + 智能跟单 | — | — | | sleep-yield | Delta-Neutral 资金费率套利 | 10-30% | <3% | | alpha-rotator | 动量因子选币 + 月度轮动 | 10-25% | 14-18% | | yield-pilot | Earn vs 套利自动路由 | 7-20% | ~0% | | bitpilot-pro | 三引擎编排 + 全局熔断 | 11-22% | 8-12% |

sleep-yield(资金费率套利)

现货买入 + 等量合约做空 = 零方向敞口,纯赚资金费率。

bgtask run sleep-yield \
  --symbols BTCUSDT,ETHUSDT \
  --budget 5000 \
  --min-funding-rate 0.001 \
  --risk-profile conservative \
  --daemon

alpha-rotator(动量轮动)

三因子评分(ROC 40% + RSI 30% + MACD 30%),ATR 波动率加权分配,恐慌指数 < 20 全仓避险。

bgtask run alpha-rotator \
  --symbols BTCUSDT,ETHUSDT,SOLUSDT,BNBUSDT,XRPUSDT,AVAXUSDT \
  --top-n 3 \
  --budget 5000 \
  --rebalance-days 30 \
  --daemon

bitpilot-pro(全自动驾驶)

60% 稳健引擎(SleepYield)+ 30% 成长引擎(AlphaRotator)+ 10% 储备金(Earn),恐慌指数 < 15 全局避险。

bgtask run bitpilot-pro \
  --budget 20000 \
  --alloc-sleep-yield 60 \
  --alloc-alpha-rotator 30 \
  --alloc-reserve 10 \
  --daemon

安全机制

每笔交易经过 6 步安全校验链:

1. 危险工具硬拦截 → 禁止提币、子账户操作
2. Dry-run 检查   → --dry-run 模式只记录不执行
3. 日交易限额     → conservative 3 笔/天, balanced 10 笔/天
4. 仓位比例检查   → 单笔不超过总资产 5%/10%/20%
5. 大额确认       → 超过阈值需二次确认(200/500/1000 USDT)
6. 持仓冲突检测   → 防止同时做多做空同一币种

守护进程

bgtask daemon start      # 启动守护进程
bgtask daemon status     # 查看状态
bgtask daemon restart    # 重启(自动恢复任务)
bgtask daemon stop       # 停止所有任务

bgtask list              # 列出所有任务
bgtask status <taskId>   # 任务详情
bgtask logs <taskId> -f  # 实时日志
bgtask stop <taskId>     # 停止单个任务

Dashboard & 通知

# 实时面板
bgtask dashboard

# 配置 Telegram 通知
bgtask notify set telegram.botToken "123456:ABCdef..."
bgtask notify set telegram.chatId "999999"
bgtask notify test

在 AI Agent 中使用

配合 bitget-task-skills 可在 Claude Code、Cursor 等 40+ AI Agent 中用自然语言操控:

"帮我用 3000U 做一个 BTC 的资金费率套利,保守风险"

"市场恐慌指数多少?低于 20 就全部转成稳定币"

"帮我做一个全自动驾驶的资产配置,2 万 U"

环境变量

| 变量 | 说明 | 必需 | |------|------|------| | BITGET_API_KEY | Bitget API Key | 是 | | BITGET_SECRET_KEY | Bitget Secret Key | 是 | | BITGET_PASSPHRASE | Bitget Passphrase | 是 | | HTTPS_PROXY | HTTPS 代理 | 否 | | HTTP_PROXY | HTTP 代理 | 否 |

License

MIT