/bingx-ai-skills:bingx-sentiment-dashboardfrom bingx-ai-skills
Fetches and visualizes crypto market sentiment data including Fear & Greed Index, funding rates, open interest anomalies, and AHR999 from BingX and alternative.me APIs.
Ships in bingx-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Base URLs: https://open-api.bingx.com, https://api.alternative.me | Auth: No authentication required. No HMAC SHA256 signing is required. BingX market requests should include X-SOURCE-KEY: BX-AI-SKILL; alternative.me requires no custom headers.
| Endpoint | Method | Description |
|---|---|---|
| https://api.alternative.me/fng/ | GET | Fear & Greed Index with replaceable limit |
| /openApi/swap/v2/quote/premiumIndex | GET | Funding rates for all symbols |
| /openApi/swap/v2/quote/openInterest | GET | Open interest for a symbol |
| /openApi/swap/v3/quote/klines | GET | BTC daily klines for local AHR999 calculation |
const BINGX_BASE_URL = "https://open-api.bingx.com";
const FEAR_GREED_BASE_URL = "https://api.alternative.me";
const BASE_URLS = [BINGX_BASE_URL];
function isNetworkOrTimeout(error: unknown): boolean {
if (!(error instanceof Error)) return false;
return /fetch failed|network|timeout|aborted|ECONNRESET|ETIMEDOUT|ENOTFOUND/i.test(error.message);
}
async function fetchJson(url: string, init: RequestInit = {}): Promise<any> {
const headers = new Headers(init.headers || {});
if (url.startsWith(BINGX_BASE_URL)) {
headers.set("X-SOURCE-KEY", "BX-AI-SKILL");
}
let lastError: unknown;
for (const baseUrl of BASE_URLS) {
try {
const targetUrl = url.startsWith(BINGX_BASE_URL) ? url.replace(BINGX_BASE_URL, baseUrl) : url;
const res = await fetch(targetUrl, { ...init, headers, signal: AbortSignal.timeout(10_000) });
const data = await res.json();
if (!res.ok) throw new Error(`BingX error HTTP ${res.status}: ${JSON.stringify(data)}`);
if (data.code !== undefined && data.code !== 0) throw new Error(`BingX error ${data.code}: ${data.msg ?? JSON.stringify(data)}`);
return data;
} catch (error) {
lastError = error;
if (!isNetworkOrTimeout(error)) throw error;
}
}
throw lastError instanceof Error ? new Error(`BingX error network: ${lastError.message}`) : new Error("BingX error network");
}
async function fetchFearGreed(limit = 10) {
return fetchJson(`${FEAR_GREED_BASE_URL}/fng/?limit=${limit}`);
}
Get funding rates for the market:
const funding = await fetchJson(`${BINGX_BASE_URL}/openApi/swap/v2/quote/premiumIndex`);
Get open interest for a symbol:
const oi = await fetchJson(`${BINGX_BASE_URL}/openApi/swap/v2/quote/openInterest?symbol=BTC-USDT`);
Get BTC daily klines for local AHR999 calculation:
const klines = await fetchJson(
`${BINGX_BASE_URL}/openApi/swap/v3/quote/klines?symbol=BTC-USDT&interval=1d&limit=200`
);
Get Fear & Greed Index:
const fearGreed = await fetchFearGreed(10);
// limit is replaceable. Example response: { name, data: [{ value, value_classification, timestamp }], metadata }
| Mode | Trigger examples | Description |
|---|---|---|
| full | "market sentiment", "overall market mood" | Full sentiment dashboard with available dimensions |
| fear_greed | "fear and greed index", "is the market panicking" | Fear & Greed only |
| funding | "funding rate heatmap", "which coins have high funding" | Funding rate overview |
| oi | "OI anomaly", "open interest changes" | OI anomaly detection |
| ahr999 | "AHR999", "good time to DCA into BTC" | AHR999 index |
Determine mode from the trigger table. Default to full.
| Dimension | Source | Status |
|---|---|---|
| Fear & Greed Index | https://api.alternative.me/fng/?limit={limit} | Available |
| Funding Rate Heatmap | BingX /openApi/swap/v2/quote/premiumIndex | Available |
| OI Anomaly Detection | BingX /openApi/swap/v2/quote/openInterest plus ticker price changes | Available with available symbols |
| AHR999 | Local calculation from BTC daily klines via bingx-swap-market | Available |
For Fear & Greed, use limit=10 by default. Replace limit when the user asks for a different history length.
python3 scripts/fear_greed.py --limit 10
Pass the result JSON as --fear-greed.
import { execFileSync } from "node:child_process";
import { homedir } from "node:os";
import { join } from "node:path";
// Use serialized JSON strings from the preceding data steps as individual arguments.
// Run from this skill directory; this child receives no API credentials.
const output = execFileSync("python3", [
"scripts/ahr999.py",
"--btc-kline",
btc_daily_kline_json
], { shell: false, encoding: "utf8", maxBuffer: 16 * 1024 * 1024,
env: { PATH: process.env.PATH, HOME: homedir(), LANG: "en_US.UTF-8" } });
Pass the result JSON as --ahr999-result.
import { execFileSync } from "node:child_process";
import { homedir } from "node:os";
import { join } from "node:path";
// Use serialized JSON strings from the preceding data steps as individual arguments.
// Run from this skill directory; this child receives no API credentials.
const output = execFileSync("python3", [
"scripts/sentiment.py",
"--mode",
String(mode),
"--fear-greed",
fear_greed_json_or_empty,
"--funding",
funding_json,
"--oi",
oi_json,
"--tickers",
tickers_json,
"--ahr999-result",
ahr999_result_json
], { shell: false, encoding: "utf8", maxBuffer: 16 * 1024 * 1024,
env: { PATH: process.env.PATH, HOME: homedir(), LANG: "en_US.UTF-8" } });
import { execFileSync } from "node:child_process";
import { homedir } from "node:os";
import { join } from "node:path";
// Use serialized JSON strings from the preceding data steps as individual arguments.
// Run from this skill directory; this child receives no API credentials.
const output = execFileSync("python3", [
"scripts/heatmap.py",
"--funding",
funding_json,
"--output",
join(homedir(), ".bingx-skills/sentiment/funding_heatmap.png")
], { shell: false, encoding: "utf8", maxBuffer: 16 * 1024 * 1024,
env: { PATH: process.env.PATH, HOME: homedir(), LANG: "en_US.UTF-8" } });
If rendering fails, output the top funding rates as text.
import { execFileSync } from "node:child_process";
import { homedir } from "node:os";
import { join } from "node:path";
// Use serialized JSON strings from the preceding data steps as individual arguments.
// Run from this skill directory; this child receives no API credentials.
const output = execFileSync("python3", [
"scripts/oi_alert.py",
"--oi",
oi_json,
"--tickers",
tickers_json
], { shell: false, encoding: "utf8", maxBuffer: 16 * 1024 * 1024,
env: { PATH: process.env.PATH, HOME: homedir(), LANG: "en_US.UTF-8" } });
Report each available dimension independently, then provide the composite score from available dimensions only.
Market Sentiment Dashboard
Composite Sentiment: {score}/100 ({label})
Fear & Greed {fg_score_or_na} {fg_detail}
Funding Rate {fr_score} {funding_detail}
OI Change {oi_score} {oi_detail}
AHR999 {ahr_score} {ahr999_detail}
Top 5 Funding Rates
{top5 extreme funding rate symbols}
OI Anomalies
{anomaly list, or "No significant OI anomalies detected from available data"}
Data Notes
{unavailable dimensions, if any}
https://api.alternative.me/fng/?limit={limit} for Fear & Greed Index. Default limit is 10.bingx-swap-market; do not require a backend AHR999 lab code.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub bingx-api/api-ai-skills --plugin bingx-ai-skills29 skills in this plugin
/bingx-agentBingX Agent (affiliate/broker) management — query invited users, daily commission details, agent user information, API transaction commission, and partner information. Use when the user asks about BingX agent invited users, affiliate commissions, referral relationships, partner data, or broker commission reports./bingx-announcementQuery BingX official announcements by module type — latest announcements, promotions, product updates, maintenance notices, listing/delisting, funding rate, crypto scout. Use when the user asks about BingX announcements, notices, activities, or the announcement API./bingx-dynamic-sl-tpUse when the user asks to set, adjust, or optimize stop-loss and take-profit for BingX perpetual futures, including dynamic stop-loss, trailing take-profit, partial take-profit, ATR stop-loss, volatility stop-loss, break-even stop, and trailing stop. It calculates SL/TP based on ATR, volatility, and support/resistance through bingx-swap-market and bingx-swap-trade./bingx-maker-entryUse when the user wants to open a BingX perpetual futures position with limit orders, maker entry, split entry, iceberg-style entry, or fee-saving execution instead of market orders. It scans order book depth, places multi-level limit orders near best price, and adjusts orders as price moves through bingx-swap-market, bingx-swap-trade, and bingx-swap-account./bingx-rsi-bottom-hunterUse when the user asks for RSI bottom fishing, oversold buying, RSI strategy, bottom hunter, or buying when RSI is low. It monitors RSI, confirms signals with bingx-technical-analysis, and supports entry, stop-loss, and take-profit planning through bingx-swap-market, bingx-swap-trade, and bingx-swap-account./bingx-technical-analysisUse when the user asks for BingX perpetual futures technical analysis, indicator values, candlestick pattern recognition, multi-timeframe scoring, support/resistance levels, divergence detection, or trend analysis. Depends on bingx-swap-market for K-line data and computes 78 indicators plus 62 candlestick patterns locally via pandas-ta-classic.Other plugins' skills for the same job