Loading...
Loading...
Compare original and translation side by side
bun run hodlmm-bin-guardian/hodlmm-bin-guardian.ts doctorbun run hodlmm-bin-guardian/hodlmm-bin-guardian.ts doctorbun run hodlmm-bin-guardian/hodlmm-bin-guardian.ts install-packsbun run hodlmm-bin-guardian/hodlmm-bin-guardian.ts install-packs--walletundefined--walletundefinedundefinedundefined{
"status": "ok",
"checks": [
{ "name": "Bitflow HODLMM API", "ok": true, "detail": "8 pools found, dlmm_1 active bin: 504" },
{ "name": "Bitflow Bins API (dlmm_1)", "ok": true, "detail": "active_bin_id=504, 1001 bins" },
{ "name": "Bitflow App Pools API", "ok": true, "detail": "dlmm_1 TVL: $77,142.99, vol_24h: $126,045, APR: 17.72%" },
{ "name": "Hiro Stacks API (fees)", "ok": true, "detail": "2 µSTX/byte" }
],
"message": "All data sources reachable. Ready to run."
}{
"status": "ok",
"checks": [
{ "name": "Bitflow HODLMM API", "ok": true, "detail": "8 pools found, dlmm_1 active bin: 504" },
{ "name": "Bitflow Bins API (dlmm_1)", "ok": true, "detail": "active_bin_id=504, 1001 bins" },
{ "name": "Bitflow App Pools API", "ok": true, "detail": "dlmm_1 TVL: $77,142.99, vol_24h: $126,045, APR: 17.72%" },
{ "name": "Hiro Stacks API (fees)", "ok": true, "detail": "2 µSTX/byte" }
],
"message": "All data sources reachable. Ready to run."
}{
"status": "success",
"action": "HOLD — position out of range but rebalance blocked: price slippage 1.86% > 0.5% cap.",
"data": {
"in_range": false,
"active_bin": 504,
"user_bin_range": null,
"can_rebalance": false,
"refusal_reasons": [ "price slippage 1.86% > 0.5% cap" ],
"slippage_ok": false,
"slippage_pct": 1.8595,
"bin_price_raw": 66459654464,
"pool_price_usd": 66459.65,
"market_price_usd": 65246.37,
"slippage_source": "bitflow-app-price-vs-hodlmm-active-bin",
"gas_ok": true,
"gas_estimated_stx": 0.0144,
"cooldown_ok": true,
"cooldown_remaining_h": 0,
"last_rebalance_at": null,
"volume_ok": true,
"volume_24h_usd": 126045,
"liquidity_usd": 77143,
"apr_24h_pct": 17.72,
"pool_id": "dlmm_1",
"pool_name": "sBTC-USDCx-LP",
"fee_bps": 30,
"position_note": "No position found for SP219TWC8G12CSX5AB093127NC82KYQWEH8ADD1AY in pool dlmm_1."
},
"error": null
}{
"status": "success",
"action": "HOLD — position out of range but rebalance blocked: price slippage 1.86% > 0.5% cap.",
"data": {
"in_range": false,
"active_bin": 504,
"user_bin_range": null,
"can_rebalance": false,
"refusal_reasons": [ "price slippage 1.86% > 0.5% cap" ],
"slippage_ok": false,
"slippage_pct": 1.8595,
"bin_price_raw": 66459654464,
"pool_price_usd": 66459.65,
"market_price_usd": 65246.37,
"slippage_source": "bitflow-app-price-vs-hodlmm-active-bin",
"gas_ok": true,
"gas_estimated_stx": 0.0144,
"cooldown_ok": true,
"cooldown_remaining_h": 0,
"last_rebalance_at": null,
"volume_ok": true,
"volume_24h_usd": 126045,
"liquidity_usd": 77143,
"apr_24h_pct": 17.72,
"pool_id": "dlmm_1",
"pool_name": "sBTC-USDCx-LP",
"fee_bps": 30,
"position_note": "No position found for SP219TWC8G12CSX5AB093127NC82KYQWEH8ADD1AY in pool dlmm_1."
},
"error": null
}{
"status": "success",
"action": "HOLD — position in range at active bin 504. APR (24h): 17.72%.",
"data": {
"in_range": true,
"active_bin": 504,
"user_bin_range": { "min": 500, "max": 508, "count": 3, "bins": [500, 504, 508] },
"can_rebalance": true,
"refusal_reasons": null,
"slippage_ok": true,
"slippage_pct": 0.04,
"bin_price_raw": 66459654464,
"pool_price_usd": 66459.65,
"market_price_usd": 66433.0,
"slippage_source": "bitflow-app-price-vs-hodlmm-active-bin",
"gas_ok": true,
"gas_estimated_stx": 0.0144,
"cooldown_ok": true,
"cooldown_remaining_h": 0,
"last_rebalance_at": null,
"volume_ok": true,
"volume_24h_usd": 126045,
"liquidity_usd": 77143,
"apr_24h_pct": 17.72,
"pool_id": "dlmm_1",
"pool_name": "sBTC-USDCx-LP",
"fee_bps": 30
},
"error": null
}{
"status": "success",
"action": "HOLD — position in range at active bin 504. APR (24h): 17.72%.",
"data": {
"in_range": true,
"active_bin": 504,
"user_bin_range": { "min": 500, "max": 508, "count": 3, "bins": [500, 504, 508] },
"can_rebalance": true,
"refusal_reasons": null,
"slippage_ok": true,
"slippage_pct": 0.04,
"bin_price_raw": 66459654464,
"pool_price_usd": 66459.65,
"market_price_usd": 66433.0,
"slippage_source": "bitflow-app-price-vs-hodlmm-active-bin",
"gas_ok": true,
"gas_estimated_stx": 0.0144,
"cooldown_ok": true,
"cooldown_remaining_h": 0,
"last_rebalance_at": null,
"volume_ok": true,
"volume_24h_usd": 126045,
"liquidity_usd": 77143,
"apr_24h_pct": 17.72,
"pool_id": "dlmm_1",
"pool_name": "sBTC-USDCx-LP",
"fee_bps": 30
},
"error": null
}| Field | Type | Description |
|---|---|---|
| | Overall result |
| | |
| | |
| | Pool's current active bin ID |
| | User's liquidity bin range |
| | Whether all safety gates pass |
| | Why REBALANCE is blocked |
| | Whether price deviation is within cap |
| | |
| | Raw active bin price from Bitflow bins API |
| | HODLMM derived USD price: |
| | Bitflow app reported token price in USD |
| | Price source identifier |
| | Whether estimated gas is within limit |
| | Estimated STX for 2-txn rebalance |
| | Whether cooldown has elapsed |
| | Hours until next rebalance allowed |
| | ISO timestamp of last recorded rebalance |
| | Whether 24h volume meets minimum |
| | 24h pool volume in USD |
| | Pool TVL in USD |
| | 24h fee APR from Bitflow app API |
| | Pool identifier |
| | Human-readable pool name |
| | Pool fee in basis points |
| | Present when position state needs explanation |
| 字段 | 类型 | 描述 |
|---|---|---|
| | 整体结果状态 |
| | |
| | 未提供钱包时为 |
| | 资金池当前活跃仓位ID |
| | 用户的流动性仓位区间 |
| | 是否通过所有安全限制条件 |
| | 拒绝调仓的原因 |
| | 价格偏差是否在限制范围内 |
| | |
| | 来自Bitflow bins API的原始活跃仓位价格 |
| | HODLMM推导的USD价格: |
| | Bitflow应用报告的代币USD价格 |
| | 价格来源标识 |
| | 预估Gas是否在限制范围内 |
| | 两次调仓交易的预估STX消耗 |
| | 冷却时间是否已结束 |
| | 距离下次允许调仓的剩余小时数 |
| | 上次记录调仓的ISO时间戳 |
| | 24小时交易量是否满足最低要求 |
| | 资金池24小时USD交易量 |
| | 资金池TVL(USD) |
| | 来自Bitflow应用API的24小时手续费年化收益率 |
| | 资金池标识 |
| | 易读的资金池名称 |
| | 资金池手续费(基点) |
| | 当持仓状态需要说明时显示 |
| Source | Data | Endpoint |
|---|---|---|
| Bitflow HODLMM API | Pool list, active bin | |
| Bitflow Bins API | Per-bin prices (raw, for slippage) | |
| Bitflow App Pools API | TVL, 24h volume, APR, token prices, decimals | |
| Bitflow Position API | User's position bins | |
| Hiro Stacks API | STX fee estimate | |
| 来源 | 数据内容 | 接口地址 |
|---|---|---|
| Bitflow HODLMM API | 资金池列表、活跃仓位 | |
| Bitflow Bins API | 单仓位价格(原始数据,用于滑点计算) | |
| Bitflow App Pools API | TVL、24小时交易量、APR、代币价格、小数位数 | |
| Bitflow Position API | 用户持仓仓位 | |
| Hiro Stacks API | STX手续费预估 | |
inRange = isFinite(pool.active_bin) && pool.active_bin > 0trueGET /api/app/v1/users/{address}/positions/{poolId}/binsuser_liquidity > 0active_bin_idinRange = isFinite(pool.active_bin) && pool.active_bin > 0trueGET /api/app/v1/users/{address}/positions/{poolId}/binsuser_liquidity > 0active_bin_id(bin_price_raw / 1e8) × 10^(xDec − yDec)(bin_price_raw / 1e8) × 10^(xDec − yDec)gas_estimated_stx: 0.006Hiro /v2/fees/transfer × 500 bytes × 2 txns × 3× contract multiplier × 1.2 safety buffergas_estimated_stx: 0.006Hiro /v2/fees/transfer × 500字节 × 2笔交易 × 3倍合约乘数 × 1.2安全缓冲~/.hodlmm-guardian-state.jsoncooldown_remaining_h~/.hodlmm-guardian-state.jsoncooldown_remaining_hrequires: [bitflow]requires: ""requires: [bitflow]requires: ""