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/formatter.py

View on GitHub
"""输出格式化 — table / json / markdown"""

import json
from tabulate import tabulate


def format_table(rows: list, headers: list) -> str:
    """格式化为终端表格"""
    return tabulate(rows, headers=headers, tablefmt="simple", floatfmt=".4f")


def format_markdown(rows: list, headers: list) -> str:
    """格式化为 Markdown 表格"""
    return tabulate(rows, headers=headers, tablefmt="github", floatfmt=".4f")


def format_json(rows: list, headers: list) -> str:
    """格式化为 JSON"""
    data = [dict(zip(headers, row)) for row in rows]
    return json.dumps(data, indent=2, ensure_ascii=False)


def format_output(rows: list, headers: list, fmt: str = "table") -> str:
    """统一格式化入口"""
    if not rows:
        return "No opportunities found."
    formatters = {
        "table": format_table,
        "markdown": format_markdown,
        "json": format_json,
    }
    formatter = formatters.get(fmt, format_table)
    return formatter(rows, headers)


def risk_level(apy: float, symbol: str) -> str:
    """根据年化和币种评估风险等级
    HIGH: APY > 50% 或 (非主流币 且 APY > 20%)
    MEDIUM: APY 10-50% 或 非主流币
    LOW: 主流币 且 APY < 10%
    """
    major_coins = {"BTC", "ETH", "BNB", "SOL", "XRP"}
    is_major = symbol in major_coins
    if apy > 50:
        return "HIGH"
    if not is_major and apy > 20:
        return "HIGH"
    if apy > 10 or not is_major:
        return "MEDIUM"
    return "LOW"
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