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.
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 Skill | Source | Purpose |
|---|
| | Kline data, ticker prices, order book |
| binance-web3/crypto-market-rank
| Market rankings, volume leaders |
Optional dependencies (enhance Crayfish Grid Hunter with extra capabilities):
| Dependency Skill | Source | Purpose |
|---|
| binance-web3/trading-signal
| Smart Money signal validation |
| binance-web3/query-token-audit
| Token security audit before recommendation |
| | 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
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:
Step 1: Market Scan (Intelligent Screening)
Scan the market to identify high-volume tokens with grid-friendly characteristics.
-
Fetch Market Rankings: Use the
skill to get top-traded tokens.
- Skill:
- API:
- Method:
- 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
}
-
Filter for Grid Candidates: For each token, fetch 30-day daily Kline data.
- Skill:
- API:
- Base URL: (primary) or
https://data-api.binance.vision
(fallback)
- Parameters: , ,
- 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.
-
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.
Step 2: Dynamic Range Generation
For each promising candidate, generate a dynamic grid range.
-
Fetch Detailed Data: Get 72-hour hourly Kline data.
- Skill:
- API:
- Parameters: , ,
-
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.
-
Identify Support/Resistance: Use recent highs and lows from the 72-hour data.
-
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)
.
-
Calculate Grid Density: Based on volatility — 20 grids for low volatility, up to 50 grids for high volatility.
-
Set Stop Loss: 2% below the lower range boundary.
Step 3: Smart Money Validation (Optional Enhancement)
If the
skill is installed, validate candidates against Smart Money activity.
-
Fetch Smart Money Signals: For each candidate token, query the trading signal API.
- Skill:
- API:
- Method:
- 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"
}
-
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.
Step 4: Security Audit (Optional Enhancement)
If the
skill is installed, perform a security audit on each candidate.
-
Audit Token Contract: For each candidate, query the token audit API.
- Skill:
- API:
- Method:
- 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.
-
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?
-
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.
Step 5: Fee Optimization (Optional Enhancement)
If the
skill is installed
AND the user has provided a
, optimize trading fees.
-
Check BNB Burn Status: Query the BNB burn setting.
- Skill:
- API:
- Method:
- Authentication: Required (API Key + HMAC-SHA256 signature)
-
Recommend Activation: If
is
, recommend the user to enable it.
-
Check Account Balance: Query the user's spot account balance via
skill.
Step 6: Output Generation
Present the findings to the user in a structured format. The agent's response MUST include:
- Recommended Coin:
- Reason: (e.g., "High volatility with a stable sideways trend. Smart Money BUY signal detected.")
- Suggested Range:
[Lower Price] - [Upper Price]
- Grid Density: 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).
Step 7: Breakout Alert (Continuous Monitoring)
After a grid recommendation is active, the agent should monitor for breakout conditions:
- Monitor Price: Periodically check if the current price approaches the grid range boundaries (within 10% of upper or lower bound).
- 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.
- 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.
Step 8: Performance Monitoring & Alerting
Once a grid is running, activate the
(defined in
) to provide continuous, multi-dimensional health tracking. The monitor runs four independent check groups on every cycle:
8.1 Grid Performance
Track PnL and fill rate to detect underperforming grids early.
| Condition | Alert Level | Action |
|---|
| PnL ≤ −5% of invested capital | CRITICAL | Recommend stopping the grid immediately |
| PnL ≤ −3% of invested capital | HIGH | Prompt user to review grid settings |
| Fill rate ≤ 5% (grid stalled) | HIGH | Suggest range adjustment or market exit |
| Fill rate ≤ 20% (low activity) | MEDIUM | Advisory: market may be trending |
| PnL ≥ +5% milestone reached | INFO | Positive status update to user |
8.2 Market Condition
Detect price boundary proximity, volume spikes, and trend drift in real time.
| Condition | Alert Level | Action |
|---|
| Price within 3% of grid boundary | CRITICAL | Warn of imminent breakout |
| Price within 8% of grid boundary | HIGH | Advisory: monitor closely |
| Price exits grid range entirely | CRITICAL | Notify grid is now inactive |
| Volume ≥ 2.5× 24h average | CRITICAL | Breakout signal — review position |
| Price drifted >2% from entry | MEDIUM | Suggest re-centering the grid |
8.3 Risk Management
Enforce stop-loss discipline and track drawdown from price peak.
| Condition | Alert Level | Action |
|---|
| Price within 2% of stop-loss | CRITICAL | Immediate stop-loss warning |
| Price within 5% of stop-loss | HIGH | Prepare for potential stop-loss execution |
| Drawdown from peak ≥ 8% | CRITICAL | Recommend emergency exit |
| Drawdown from peak ≥ 5% | HIGH | Review risk tolerance |
8.4 API Health
Monitor the health of all Binance Skill API calls to ensure data reliability.
| Condition | Alert Level | Action |
|---|
| Average latency ≥ 3000ms | HIGH | Warn of degraded data freshness |
| Average latency ≥ 1000ms | MEDIUM | Advisory: API is slow |
| Error rate ≥ 20% | HIGH | Warn of unreliable data |
| Error rate ≥ 5% | MEDIUM | Advisory: intermittent errors |
| Fallback endpoint active | MEDIUM | Notify primary API is unreachable |
8.5 Integration Example
The monitor is imported and used within the agent loop as follows:
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,
)
# 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,
))
# In the agent loop: update state and run checks
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
# Generate a full status report
print(monitor.format_report())
8.6 Alert Cooldown
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.
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"
User-Agent Header
When making API calls, include the
header:
crayfish-grid-hunter/4.4.0 (Skill)
.