crayfish-grid-hunter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Crayfish Grid Hunter Skill

Crayfish Grid Hunter Skill

Crayfish Grid Hunter is a specialized AI assistant that helps users find the best cryptocurrencies for grid trading on Binance. It combines technical analysis with Smart Money intelligence and security auditing to deliver safe, data-driven grid trading recommendations.
Crayfish Grid Hunter 是一款专用AI助手,可帮助用户找到适合在Binance进行网格交易的最佳加密货币。它将技术分析与Smart Money情报、安全审计相结合,提供安全、基于数据的网格交易建议。

Prerequisites

前置条件

Before using this skill, the following official Binance skills must be installed. Since the current OpenClaw ecosystem does not support automatic dependency resolution, users need to install them manually.
Required dependencies (Crayfish Grid Hunter cannot function without these):
Dependency SkillSourcePurpose
spot
binance/spot
Kline data, ticker prices, order book
crypto-market-rank
binance-web3/crypto-market-rank
Market rankings, volume leaders
Optional dependencies (enhance Crayfish Grid Hunter with extra capabilities):
Dependency SkillSourcePurpose
trading-signal
binance-web3/trading-signal
Smart Money signal validation
query-token-audit
binance-web3/query-token-audit
Token security audit before recommendation
assets
binance/assets
Balance check, BNB fee discount (Requires API Key)
One-command install (all 5 skills):
bash
npx skills add https://github.com/binance/binance-skills-hub \
  --skill spot \
  --skill crypto-market-rank \
  --skill trading-signal \
  --skill query-token-audit \
  --skill assets \
  -a openclaw -y
使用该Skill前,必须安装以下官方Binance Skill。由于当前OpenClaw生态系统不支持自动依赖解析,用户需要手动安装这些Skill。
必需依赖项(无这些依赖项,Crayfish Grid Hunter将无法运行):
依赖Skill来源用途
spot
binance/spot
K线数据、行情报价、订单簿
crypto-market-rank
binance-web3/crypto-market-rank
市场排名、交易量领先标的
可选依赖项(为Crayfish Grid Hunter增强额外功能):
依赖Skill来源用途
trading-signal
binance-web3/trading-signal
Smart Money信号验证
query-token-audit
binance-web3/query-token-audit
推荐前的代币安全审计
assets
binance/assets
余额查询、BNB手续费折扣(需要API密钥)
一键安装(全部5个Skill):
bash
npx skills add https://github.com/binance/binance-skills-hub \
  --skill spot \
  --skill crypto-market-rank \
  --skill trading-signal \
  --skill query-token-audit \
  --skill assets \
  -a openclaw -y

Workflow

工作流程

When a user asks "Which coins are good for grid trading?" or "Analyze the grid range for $XXX", the agent should follow these steps in order:
当用户询问“哪些币种适合网格交易?”或“分析$XXX的网格区间”时,Agent应按以下步骤执行:

Step 1: Market Scan (Intelligent Screening)

步骤1:市场扫描(智能筛选)

Scan the market to identify high-volume tokens with grid-friendly characteristics.
  1. Fetch Market Rankings: Use the
    crypto-market-rank
    skill to get top-traded tokens.
    • Skill:
      crypto-market-rank
    • API:
      Unified Token Rank
    • Method:
      POST
    • URL:
      https://web3.binance.com/bapi/defi/v1/public/wallet-direct/buw/wallet/market/token/pulse/unified/rank/list
    • Request Body:
      json
      {
          "rankType": 10,
          "period": 50,
          "sortBy": 70,
          "orderAsc": false,
          "page": 1,
          "size": 200
      }
  2. Filter for Grid Candidates: For each token, fetch 30-day daily Kline data.
    • Skill:
      spot
    • API:
      /api/v3/klines
    • Base URL:
      https://api.binance.com
      (primary) or
      https://data-api.binance.vision
      (fallback)
    • Parameters:
      symbol=<symbol>
      ,
      interval=1d
      ,
      limit=30
    • Why 30? RSI uses the Wilder Smoothing method with a 14-period window. This requires at least 15 price deltas for a valid calculation. Fetching 30 candles provides 29 deltas — 14 for the initial average and 15 rolling updates — ensuring the RSI reflects real market momentum rather than defaulting to a neutral value.
  3. AI Evaluation: Process the data to identify coins with high volatility but a stable (sideways) trend.
    • Volatility Check: Calculate price range over 30 days. Higher range = higher volatility.
    • Trend Check: Calculate price trend slope over 30 days. Slope close to zero = sideways market.
    • RSI Check: Calculate RSI using the Wilder smoothing method over 14 days. Value oscillating between 30-70 is ideal.
    • Screening Criteria: Volatility > 3%, |Trend Slope| < 2.0%, RSI between 25-75.
扫描市场以识别具有网格交易友好特征的高交易量代币。
  1. 获取市场排名:使用
    crypto-market-rank
    Skill获取交易量领先的代币。
    • Skill
      crypto-market-rank
    • API
      Unified Token Rank
    • 请求方法
      POST
    • URL
      https://web3.binance.com/bapi/defi/v1/public/wallet-direct/buw/wallet/market/token/pulse/unified/rank/list
    • 请求体:
      json
      {
          "rankType": 10,
          "period": 50,
          "sortBy": 70,
          "orderAsc": false,
          "page": 1,
          "size": 200
      }
  2. 筛选网格交易标的:为每个代币获取30天日K线数据。
    • Skill
      spot
    • API
      /api/v3/klines
    • 基础URL
      https://api.binance.com
      (主用)或
      https://data-api.binance.vision
      (备用)
    • 参数
      symbol=<symbol>
      ,
      interval=1d
      ,
      limit=30
    • 为什么选30天? RSI指标采用14周期的Wilder平滑法,这至少需要15个价格差值才能进行有效计算。获取30根K线可得到29个差值——14个用于初始平均值计算,15个用于滚动更新——确保RSI能反映真实的市场动量,而非默认的中性值。
  3. AI评估:处理数据以识别**高波动性但趋势稳定(横盘)**的币种。
    • 波动性检查:计算30天内的价格区间,区间越大波动性越高。
    • 趋势检查:计算30天内的价格趋势斜率,斜率接近0代表横盘市场。
    • RSI检查:使用Wilder平滑法计算14天RSI值,数值在30-70区间内为理想状态。
    • 筛选标准:波动性>3%,|趋势斜率|<2.0%,RSI在25-75之间。

Step 2: Dynamic Range Generation

步骤2:动态区间生成

For each promising candidate, generate a dynamic grid range.
  1. Fetch Detailed Data: Get 72-hour hourly Kline data.
    • Skill:
      spot
    • API:
      /api/v3/klines
    • Parameters:
      symbol=<symbol>
      ,
      interval=1h
      ,
      limit=72
  2. Calculate Bollinger Bands: Compute standard 20-period Bollinger Bands using only the most recent 20 closing prices from the 72-hour dataset.
    • Middle Band: SMA of the last 20 closing prices
    • Upper Band: Middle Band + (standard deviation of last 20 closes × 2)
    • Lower Band: Middle Band − (standard deviation of last 20 closes × 2)
    • Why last 20? Using all 72 candles would produce an overly wide band that reflects historical extremes rather than current price behavior. The 20-period window is the industry standard and captures the most relevant recent volatility.
  3. Identify Support/Resistance: Use recent highs and lows from the 72-hour data.
  4. Generate Range: Combine Bollinger Bands and support/resistance levels. The grid range lower bound is
    max(Bollinger Lower, 72h Support)
    and upper bound is
    min(Bollinger Upper, 72h Resistance)
    .
  5. Calculate Grid Density: Based on volatility — 20 grids for low volatility, up to 50 grids for high volatility.
  6. Set Stop Loss: 2% below the lower range boundary.
为每个潜力标的生成动态网格区间。
  1. 获取详细数据:获取72小时小时级K线数据。
    • Skill
      spot
    • API
      /api/v3/klines
    • 参数
      symbol=<symbol>
      ,
      interval=1h
      ,
      limit=72
  2. 计算布林带:使用72小时数据中最近20个收盘价计算标准20周期布林带
    • 中轨:最近20个收盘价的简单移动平均线(SMA)
    • 上轨:中轨 +(最近20个收盘价的标准差 × 2)
    • 下轨:中轨 −(最近20个收盘价的标准差 × 2)
    • 为什么选最近20个? 使用全部72根K线会生成过宽的区间,反映的是历史极端情况而非当前价格行为。20周期窗口是行业标准,能捕捉最相关的近期波动性。
  3. 识别支撑/阻力位:使用72小时数据中的近期高点和低点。
  4. 生成区间:结合布林带与支撑/阻力位。网格区间下限为
    max(布林带下轨, 72小时支撑位)
    ,上限为
    min(布林带上轨, 72小时阻力位)
  5. 计算网格密度:基于波动性——低波动性设置20个网格,高波动性最多设置50个网格。
  6. 设置止损:低于区间下限2%的位置。

Step 3: Smart Money Validation (Optional Enhancement)

步骤3:Smart Money验证(可选增强)

If the
trading-signal
skill is installed, validate candidates against Smart Money activity.
  1. Fetch Smart Money Signals: For each candidate token, query the trading signal API.
    • Skill:
      trading-signal
    • API:
      Smart Money Signal
    • Method:
      POST
    • URL:
      https://web3.binance.com/bapi/defi/v1/public/wallet-direct/buw/wallet/web/signal/smart-money
    • Request Headers:
      User-Agent: binance-web3/1.0 (Skill)
    • Request Body:
      json
      {
          "page": 1,
          "pageSize": 100,
          "chainId": "CT_501"
      }
  2. Cross-Reference: Check if any candidate token appears in the Smart Money signal list.
    • If a BUY signal exists for a candidate: Add +15 bonus to the grid score and mark as "Smart Money Backed".
    • If a SELL signal exists: Add a warning note but do not auto-exclude.
如果已安装
trading-signal
Skill,可通过Smart Money活动验证标的。
  1. 获取Smart Money信号:为每个候选代币查询交易信号API。
    • Skill
      trading-signal
    • API
      Smart Money Signal
    • 请求方法
      POST
    • URL
      https://web3.binance.com/bapi/defi/v1/public/wallet-direct/buw/wallet/web/signal/smart-money
    • 请求头
      User-Agent: binance-web3/1.0 (Skill)
    • 请求体:
      json
      {
          "page": 1,
          "pageSize": 100,
          "chainId": "CT_501"
      }
  2. 交叉验证:检查候选代币是否出现在Smart Money信号列表中。
    • 如果候选代币存在BUY信号:为网格评分增加15分,并标记为“Smart Money支持”。
    • 如果存在SELL信号:添加警告提示,但不自动排除该标的。

Step 4: Security Audit (Optional Enhancement)

步骤4:安全审计(可选增强)

If the
query-token-audit
skill is installed, perform a security audit on each candidate.
  1. Audit Token Contract: For each candidate, query the token audit API.
    • Skill:
      query-token-audit
    • API:
      Token Security Audit
    • Method:
      POST
    • URL:
      https://web3.binance.com/bapi/defi/v1/public/wallet-direct/security/token/audit
    • Request Headers:
      User-Agent: binance-web3/1.4 (Skill)
    • Request Body:
      json
      {
          "binanceChainId": "56",
          "contractAddress": "<contract_address>",
          "requestId": "<uuid-v4>"
      }
    • Note: This audit applies to BSC (BEP-20) tokens. For major CEX spot pairs (BTC, ETH, etc.) that lack an on-chain contract address, this step is skipped and no security penalty is applied.
  2. Risk Assessment: Evaluate the audit results:
    • Contract Risk: Is the contract verified? Is it a proxy contract?
    • Trading Risk: Are there abnormal buy/sell taxes (>5%)?
    • Scam Risk: Is it flagged as a honeypot?
  3. Decision Logic:
    • SAFE: Proceed with recommendation, display "Security: PASSED", add +5 bonus to score.
    • WARNING: Proceed but add a prominent risk warning.
    • DANGEROUS: Auto-exclude from recommendations.
如果已安装
query-token-audit
Skill,可为每个候选代币执行安全审计。
  1. 审计代币合约:为每个候选代币查询代币审计API。
    • Skill
      query-token-audit
    • API
      Token Security Audit
    • 请求方法
      POST
    • URL
      https://web3.binance.com/bapi/defi/v1/public/wallet-direct/security/token/audit
    • 请求头
      User-Agent: binance-web3/1.4 (Skill)
    • 请求体:
      json
      {
          "binanceChainId": "56",
          "contractAddress": "<contract_address>",
          "requestId": "<uuid-v4>"
      }
    • 注意:该审计适用于BSC(BEP-20)代币。对于没有链上合约地址的主流CEX现货对(如BTC、ETH等),将跳过此步骤且不施加安全惩罚。
  2. 风险评估:评估审计结果:
    • 合约风险:合约是否已验证?是否为代理合约?
    • 交易风险:是否存在异常买卖手续费(>5%)?
    • 诈骗风险:是否被标记为蜜罐?
  3. 决策逻辑:
    • 安全:继续推荐,显示“安全状态:通过”,为评分增加5分。
    • 警告:继续推荐,但添加显眼的风险提示。
    • 危险自动排除出推荐列表。

Step 5: Fee Optimization (Optional Enhancement)

步骤5:手续费优化(可选增强)

If the
assets
skill is installed AND the user has provided a
BINANCE_API_KEY
, optimize trading fees.
  1. Check BNB Burn Status: Query the BNB burn setting.
    • Skill:
      assets
    • API:
      /sapi/v1/bnbBurn
    • Method:
      GET
    • Authentication: Required (API Key + HMAC-SHA256 signature)
  2. Recommend Activation: If
    spotBNBBurn
    is
    false
    , recommend the user to enable it.
  3. Check Account Balance: Query the user's spot account balance via
    assets
    skill.
如果已安装
assets
Skill 用户已提供
BINANCE_API_KEY
,可优化交易手续费。
  1. 检查BNB抵扣状态:查询BNB抵扣设置。
    • Skill
      assets
    • API
      /sapi/v1/bnbBurn
    • 请求方法
      GET
    • 身份验证:需要(API密钥 + HMAC-SHA256签名)
  2. 推荐激活:如果
    spotBNBBurn
    false
    ,推荐用户启用该功能。
  3. 查询账户余额:通过
    assets
    Skill查询用户的现货账户余额。

Step 6: Output Generation

步骤6:输出生成

Present the findings to the user in a structured format. The agent's response MUST include:
  • Recommended Coin:
    [Coin Name/USDT]
  • Reason: (e.g., "High volatility with a stable sideways trend. Smart Money BUY signal detected.")
  • Suggested Range:
    [Lower Price] - [Upper Price]
  • Grid Density:
    20-50
    grids.
  • Risk Warning: Stop-loss point (2% below lower range).
  • Security Status: "PASSED" / "WARNING" (if audit skill is available)
  • Smart Money Signal: "BUY signal at $X" (if signal skill is available)
  • Grid Score: A composite score (0-115).
以结构化格式向用户展示结果。Agent的回复必须包含:
  • 推荐币种
    [币种名称/USDT]
  • 推荐理由:(例如:“高波动性且趋势稳定横盘。检测到Smart Money BUY信号。”)
  • 建议区间
    [下限价格] - [上限价格]
  • 网格密度
    20-50
    个网格。
  • 风险提示:止损点位(低于区间下限2%)。
  • 安全状态:“通过”/“警告”(若审计Skill可用)
  • Smart Money信号:“$X价位的BUY信号”(若信号Skill可用)
  • 网格评分:综合评分(0-115分)。

Step 7: Breakout Alert (Continuous Monitoring)

步骤7:突破预警(持续监控)

After a grid recommendation is active, the agent should monitor for breakout conditions:
  1. Monitor Price: Periodically check if the current price approaches the grid range boundaries (within 10% of upper or lower bound).
  2. Volume Spike Detection: If trading volume increases by more than 200% compared to the 24-hour average while price is near the range edge, trigger an alert.
  3. Alert Levels:
    • CRITICAL: Price near boundary AND volume spike simultaneously.
    • HIGH: Either price near boundary OR volume spike alone.
    • WARNING: Price within 10% of boundary, no volume spike.
网格推荐生效后,Agent应监控突破情况:
  1. 价格监控:定期检查当前价格是否接近网格区间边界(距离上/下限10%以内)。
  2. 成交量异动检测:当价格接近区间边界时,若交易量较24小时平均值增长超过200%,则触发预警。
  3. 预警级别:
    • 严重:价格接近边界 成交量异动同时发生。
    • :仅价格接近边界 仅成交量异动。
    • 警告:价格在边界10%以内,无成交量异动。

Step 8: Performance Monitoring & Alerting

步骤8:性能监控与预警

Once a grid is running, activate the
GridPerformanceMonitor
(defined in
monitor.py
) to provide continuous, multi-dimensional health tracking. The monitor runs four independent check groups on every cycle:
网格运行后,激活
GridPerformanceMonitor
(定义于
monitor.py
)以提供持续的多维度健康跟踪。监控器在每个周期运行4组独立检查:

8.1 Grid Performance

8.1 网格性能

Track PnL and fill rate to detect underperforming grids early.
ConditionAlert LevelAction
PnL ≤ −5% of invested capitalCRITICALRecommend stopping the grid immediately
PnL ≤ −3% of invested capitalHIGHPrompt user to review grid settings
Fill rate ≤ 5% (grid stalled)HIGHSuggest range adjustment or market exit
Fill rate ≤ 20% (low activity)MEDIUMAdvisory: market may be trending
PnL ≥ +5% milestone reachedINFOPositive status update to user
跟踪盈亏(PnL)和成交率,尽早发现表现不佳的网格。
条件预警级别操作
PnL ≤ 投资资金的−5%严重建议立即停止网格
PnL ≤ 投资资金的−3%提示用户检查网格设置
成交率 ≤ 5%(网格停滞)建议调整区间或退出市场
成交率 ≤ 20%(活跃度低)提示:市场可能处于趋势行情
PnL ≥ +5%里程碑达成信息向用户发送正面状态更新

8.2 Market Condition

8.2 市场状况

Detect price boundary proximity, volume spikes, and trend drift in real time.
ConditionAlert LevelAction
Price within 3% of grid boundaryCRITICALWarn of imminent breakout
Price within 8% of grid boundaryHIGHAdvisory: monitor closely
Price exits grid range entirelyCRITICALNotify grid is now inactive
Volume ≥ 2.5× 24h averageCRITICALBreakout signal — review position
Price drifted >2% from entryMEDIUMSuggest re-centering the grid
实时检测价格接近边界、成交量异动和趋势漂移情况。
条件预警级别操作
价格距离网格边界3%以内严重警告即将突破
价格距离网格边界8%以内提示:密切监控
价格完全脱离网格区间严重通知用户网格已失效
成交量 ≥ 24小时平均值的2.5倍严重突破信号——检查持仓
价格较入场价漂移>2%建议重新校准网格

8.3 Risk Management

8.3 风险管理

Enforce stop-loss discipline and track drawdown from price peak.
ConditionAlert LevelAction
Price within 2% of stop-lossCRITICALImmediate stop-loss warning
Price within 5% of stop-lossHIGHPrepare for potential stop-loss execution
Drawdown from peak ≥ 8%CRITICALRecommend emergency exit
Drawdown from peak ≥ 5%HIGHReview risk tolerance
执行止损纪律,跟踪价格峰值后的回撤情况。
条件预警级别操作
价格距离止损位2%以内严重立即发出止损警告
价格距离止损位5%以内提示准备执行止损
峰值回撤 ≥ 8%严重建议紧急退出
峰值回撤 ≥ 5%提示重新评估风险承受能力

8.4 API Health

8.4 API健康状况

Monitor the health of all Binance Skill API calls to ensure data reliability.
ConditionAlert LevelAction
Average latency ≥ 3000msHIGHWarn of degraded data freshness
Average latency ≥ 1000msMEDIUMAdvisory: API is slow
Error rate ≥ 20%HIGHWarn of unreliable data
Error rate ≥ 5%MEDIUMAdvisory: intermittent errors
Fallback endpoint activeMEDIUMNotify primary API is unreachable
监控所有Binance Skill API调用的健康状况,确保数据可靠性。
条件预警级别操作
平均延迟 ≥ 3000ms警告数据新鲜度下降
平均延迟 ≥ 1000ms提示:API响应缓慢
错误率 ≥ 20%警告数据不可靠
错误率 ≥ 5%提示:存在间歇性错误
备用端点已激活通知主API不可用

8.5 Integration Example

8.5 集成示例

The monitor is imported and used within the agent loop as follows:
python
from skills.crayfish_grid_hunter.monitor import create_monitor, GridPosition
监控器在Agent循环中的导入和使用方式如下:
python
from skills.crayfish_grid_hunter.monitor import create_monitor, GridPosition

Initialize monitor with custom thresholds

使用自定义阈值初始化监控器

monitor = create_monitor( pnl_loss_critical_pct=-5.0, boundary_proximity_critical_pct=3.0, stop_loss_proximity_critical_pct=2.0, volume_spike_multiplier=2.5, )
monitor = create_monitor( pnl_loss_critical_pct=-5.0, boundary_proximity_critical_pct=3.0, stop_loss_proximity_critical_pct=2.0, volume_spike_multiplier=2.5, )

Register an active grid position

注册一个活跃的网格头寸

monitor.register_position(GridPosition( symbol="BTCUSDT", grid_lower=68000.0, grid_upper=74000.0, grid_count=30, entry_price=71000.0, current_price=71500.0, stop_loss=66640.0, invested_usdt=1000.0, ))
monitor.register_position(GridPosition( symbol="BTCUSDT", grid_lower=68000.0, grid_upper=74000.0, grid_count=30, entry_price=71000.0, current_price=71500.0, stop_loss=66640.0, invested_usdt=1000.0, ))

In the agent loop: update state and run checks

在Agent循环中:更新状态并执行检查

monitor.update_position("BTCUSDT", current_price=73800.0, current_volume=28000.0, avg_volume_24h=10000.0) alerts = monitor.run_checks() for alert in alerts: agent.notify(alert.level.value, alert.message) # Surface to user
monitor.update_position("BTCUSDT", current_price=73800.0, current_volume=28000.0, avg_volume_24h=10000.0) alerts = monitor.run_checks() for alert in alerts: agent.notify(alert.level.value, alert.message) # 向用户展示预警

Generate a full status report

生成完整状态报告

print(monitor.format_report())
undefined
print(monitor.format_report())
undefined

8.6 Alert Cooldown

8.6 预警冷却

To prevent alert fatigue, each unique alert condition has a 15-minute cooldown window. The same condition will not re-trigger an alert until the cooldown expires, ensuring users receive actionable notifications rather than repeated noise.
为避免预警疲劳,每个独特的预警条件都有15分钟冷却窗口。同一条件在冷却期结束前不会重复触发预警,确保用户收到的是可操作的通知而非重复噪音。

Authentication

身份验证

This skill does not require a Binance API key for its core market scanning and analysis functions. However, an API key is required for account-specific features like balance checks and fee optimization.
If you wish to use these features, set the following environment variables:
bash
export BINANCE_API_KEY="your_api_key"
export BINANCE_API_SECRET="your_secret_key"
该Skill的核心市场扫描与分析功能不需要Binance API密钥。但如果要使用账户专属功能(如余额查询、手续费优化),则需要API密钥。
如果您希望使用这些功能,请设置以下环境变量:
bash
export BINANCE_API_KEY="your_api_key"
export BINANCE_API_SECRET="your_secret_key"

User-Agent Header

User-Agent 请求头

When making API calls, include the
User-Agent
header:
crayfish-grid-hunter/4.4.0 (Skill)
.
发起API请求时,请包含User-Agent请求头:
crayfish-grid-hunter/4.4.0 (Skill)