yield-dashboard

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Yield Dashboard Skill

收益仪表盘Skill

Aggregated read-only dashboard across Stacks DeFi protocols: Zest Protocol (lending), ALEX DEX (AMM LP), and Bitflow (DEX LP). Also checks native STX stacking status.
All data is fetched live from Stacks mainnet via Hiro API read-only contract calls.
这是一个整合了Stacks生态下多个DeFi协议的只读仪表盘:Zest Protocol(借贷)、ALEX DEX(AMM LP)和Bitflow(DEX LP)。同时还会检查原生STX的Stacking状态。
所有数据通过Hiro API的只读合约调用实时从Stacks主网获取。

Usage

使用方法

bun run yield-dashboard/yield-dashboard.ts <subcommand> [options]
bun run yield-dashboard/yield-dashboard.ts <subcommand> [options]

Subcommands

子命令

overview

overview

High-level portfolio summary: total value across all protocols, weighted average APY, and per-protocol breakdown.
bun run yield-dashboard/yield-dashboard.ts overview
Output:
json
{
  "totalValueSats": 500000,
  "totalValueBtc": "0.00500000",
  "weightedApyPct": 4.2,
  "protocols": {
    "zest": { "valueSats": 300000, "apyPct": 5.0 },
    "alex": { "valueSats": 150000, "apyPct": 3.5 },
    "bitflow": { "valueSats": 50000, "apyPct": 2.8 },
    "stacking": { "valueSats": 0, "apyPct": 0 }
  },
  "walletSbtcSats": 25000,
  "walletStxMicroStx": 5000000
}
投资组合概览:展示所有协议的总价值、加权平均APY,以及各协议的细分数据。
bun run yield-dashboard/yield-dashboard.ts overview
输出:
json
{
  "totalValueSats": 500000,
  "totalValueBtc": "0.00500000",
  "weightedApyPct": 4.2,
  "protocols": {
    "zest": { "valueSats": 300000, "apyPct": 5.0 },
    "alex": { "valueSats": 150000, "apyPct": 3.5 },
    "bitflow": { "valueSats": 50000, "apyPct": 2.8 },
    "stacking": { "valueSats": 0, "apyPct": 0 }
  },
  "walletSbtcSats": 25000,
  "walletStxMicroStx": 5000000
}

positions

positions

Detailed per-protocol position data.
bun run yield-dashboard/yield-dashboard.ts positions
Returns an array of positions with protocol, asset, amount, current APY, and any reward info.
展示各协议的详细持仓数据。
bun run yield-dashboard/yield-dashboard.ts positions
返回一个持仓数组,包含协议、资产、数量、当前APY以及任何奖励信息。

apy-breakdown

apy-breakdown

Current APY rates across all supported protocols (no wallet needed for this — pure market data).
bun run yield-dashboard/yield-dashboard.ts apy-breakdown
Output:
json
{
  "timestamp": "2026-03-06T03:00:00.000Z",
  "rates": [
    { "protocol": "Zest Protocol", "asset": "sBTC", "supplyApyPct": 5.0, "riskScore": 20 },
    { "protocol": "ALEX DEX", "asset": "aBTC/STX LP", "apyPct": 3.5, "riskScore": 50 },
    { "protocol": "Bitflow", "asset": "sBTC", "apyPct": 2.8, "riskScore": 35 },
    { "protocol": "STX Stacking", "asset": "STX", "apyPct": 8.0, "riskScore": 10 }
  ],
  "zestV2Ready": false
}
展示所有支持协议的当前APY费率(此功能无需钱包——仅为市场数据)。
bun run yield-dashboard/yield-dashboard.ts apy-breakdown
输出:
json
{
  "timestamp": "2026-03-06T03:00:00.000Z",
  "rates": [
    { "protocol": "Zest Protocol", "asset": "sBTC", "supplyApyPct": 5.0, "riskScore": 20 },
    { "protocol": "ALEX DEX", "asset": "aBTC/STX LP", "apyPct": 3.5, "riskScore": 50 },
    { "protocol": "Bitflow", "asset": "sBTC", "apyPct": 2.8, "riskScore": 35 },
    { "protocol": "STX Stacking", "asset": "STX", "apyPct": 8.0, "riskScore": 10 }
  ],
  "zestV2Ready": false
}

rebalance

rebalance

Suggests rebalancing moves based on current positions vs optimal allocation given risk-adjusted APY.
bun run yield-dashboard/yield-dashboard.ts rebalance [--risk-tolerance low|medium|high]
Options:
  • --risk-tolerance
    (optional, default:
    medium
    ) — Risk preference for allocation suggestions
Output:
json
{
  "currentAllocation": { "zest": 60, "alex": 30, "bitflow": 10, "stacking": 0 },
  "suggestedAllocation": { "zest": 50, "alex": 20, "bitflow": 10, "stacking": 20 },
  "suggestions": [
    "Consider moving 10% from Zest to STX stacking for diversification",
    "ALEX LP has higher IL risk — reduce if STX/BTC volatility is high"
  ]
}
根据当前持仓与基于风险调整后APY的最优配置,给出再平衡建议。
bun run yield-dashboard/yield-dashboard.ts rebalance [--risk-tolerance low|medium|high]
选项:
  • --risk-tolerance
    (可选,默认值:
    medium
    )——配置建议的风险偏好
输出:
json
{
  "currentAllocation": { "zest": 60, "alex": 30, "bitflow": 10, "stacking": 0 },
  "suggestedAllocation": { "zest": 50, "alex": 20, "bitflow": 10, "stacking": 20 },
  "suggestions": [
    "考虑将10%的Zest持仓转移至STX Stacking以分散风险",
    "ALEX LP的无常损失风险较高——若STX/BTC波动较大,建议减少持仓"
  ]
}

Known Limitations

已知限制

  • ALEX LP positions: User LP token balance reading is not yet implemented —
    valueSats
    will show 0 even if you hold LP tokens. APY is read correctly.
  • Bitflow LP positions: Same as ALEX — LP balance reading is a TODO. APY falls back to a 2.8% estimate if the Bitflow API is unavailable (output includes
    apySource: "fallback estimate"
    ).
  • ALEX asset: The ALEX pool uses aBTC (ALEX wrapped BTC), not native sBTC. Different trust assumptions — labeled as "aBTC/STX LP" in output.
  • Stacking value: STX stacking is denominated in microSTX, not sats. The
    overview
    command separates these:
    totalValueSats
    (BTC-denominated) vs
    totalValueStx
    (STX stacking).
  • Bitflow API: Uses
    https://app.bitflow.finance/api
    — undocumented endpoint, may change without notice.
  • ALEX LP持仓:尚未实现用户LP代币余额读取功能——即使你持有LP代币,
    valueSats
    仍会显示为0。APY数据读取正常。
  • Bitflow LP持仓:与ALEX相同——LP余额读取功能待开发。若Bitflow API不可用,APY将 fallback 到2.8%的估算值(输出中会包含
    apySource: "fallback estimate"
    )。
  • ALEX资产:ALEX资金池使用的是aBTC(ALEX封装的BTC),而非原生sBTC。两者的信任假设不同——在输出中标记为"aBTC/STX LP"。
  • Stacking价值:STX Stacking以microSTX为单位,而非sats。
    overview
    命令会将其分开展示:
    totalValueSats
    (以BTC计价)与
    totalValueStx
    (STX Stacking)。
  • Bitflow API:使用
    https://app.bitflow.finance/api
    ——该端点未公开文档,可能会无预警变更。

Notes

说明

  • All reads are free (no gas needed) — uses read-only contract calls
  • Wallet must be unlocked so the skill knows which address to query
  • APY figures are point-in-time estimates from on-chain state
  • Bitflow data uses the Bitflow public API (no key required)
  • Zest V2 availability is probed automatically; falls back to V1 pool data
  • 所有读取操作均免费(无需Gas费)——使用只读合约调用
  • 钱包必须解锁,以便该Skill知晓要查询的地址
  • APY数值是基于链上状态的时点估算值
  • Bitflow数据使用Bitflow公开API(无需密钥)
  • 会自动探测Zest V2的可用性;若不可用则 fallback 到V1资金池数据