Skip to content

LeoYeAI/agent-master-skills / skills/arbiscan-skill

arbiscan

Verified

Comprehensive crypto market scanner across Binance, OKX, Bybit, and Bitget. 12 scan types covering arbitrage (funding rate, basis, spot spread, futures spread), market monitoring (open interest, price movers, volume anomaly, stablecoin depeg, funding extreme), and trading signals (funding trend, long/short ratio, new listing detection). Read-only — no trading, no API keys needed.

scripts/long_short_ratio.py

View on GitHub
"""多空比扫描 — 散户情绪一边倒时的反向信号"""

from config import TOP_SYMBOLS
from fetcher import fetch_long_short_ratio
from formatter import format_output


def scan_long_short_ratio(symbols: list = None, min_ratio_pct: float = 60) -> tuple:
    """扫描多空比极端值"""
    if symbols is None:
        symbols = TOP_SYMBOLS[:30]  # 多空比查询较慢,默认 Top 30

    headers = ["Symbol", "Exchange", "Long%", "Short%", "Ratio", "Signal"]
    rows = []

    print(f"[Long/Short Ratio] 扫描 {len(symbols)} 个交易对...")
    for symbol in symbols:
        # Binance 和 Bybit 有公开多空比端点
        for exchange in ["binance", "bybit"]:
            data = fetch_long_short_ratio(exchange, symbol)
            if data is None:
                continue

            long_pct = data["long_pct"]
            short_pct = data["short_pct"]

            # 只标记极端情况
            if max(long_pct, short_pct) < min_ratio_pct:
                continue

            ratio = long_pct / short_pct if short_pct > 0 else float('inf')

            if long_pct > 75:
                signal = "EXTREME LONG - reversal risk"
            elif long_pct > 65:
                signal = "LONG HEAVY"
            elif short_pct > 75:
                signal = "EXTREME SHORT - squeeze risk"
            elif short_pct > 65:
                signal = "SHORT HEAVY"
            else:
                signal = "MODERATE"

            from config import EXCHANGES
            rows.append([
                f"{symbol}USDT",
                EXCHANGES[exchange]["name"],
                f"{long_pct:.1f}%",
                f"{short_pct:.1f}%",
                f"{ratio:.2f}",
                signal,
            ])

    rows.sort(key=lambda r: max(float(r[2].rstrip('%')), float(r[3].rstrip('%'))), reverse=True)
    return rows, headers


def main():
    import argparse
    parser = argparse.ArgumentParser(description="Long/Short Ratio Scanner")
    parser.add_argument("--format", choices=["table", "markdown", "json"], default="table")
    args = parser.parse_args()

    rows, headers = scan_long_short_ratio()
    print(f"\n{'='*80}")
    print("  Long/Short Ratio")
    print(f"{'='*80}")
    print(format_output(rows, headers, args.format))
    print(f"\nFound {len(rows)} extreme ratios")


if __name__ == "__main__":
    main()
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall