Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
37-tool crypto derivatives data suite: funding rates, open interest, liquidations, Hyperliquid whale tracking, and ETF flows.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
tools/other_etfs.py
1#!/usr/bin/env python32"""3Coinglass ETF Module (Non-Bitcoin)45Provides ETF data for Ethereum, Solana, XRP, and HK listings.6"""78import sys9import json10import argparse11from typing import Dict, Any, Optional, List1213from ._api import cg_request141516def get_eth_etf_flows() -> Optional[List[Dict[str, Any]]]:17"""Get Ethereum ETF flow history (inflows/outflows)."""18return cg_request("api/etf/ethereum/flow-history")192021def get_eth_etf_list() -> Optional[List[Dict[str, Any]]]:22"""Get list of all Ethereum ETFs with details."""23return cg_request("api/etf/ethereum/list")242526def get_eth_etf_premium_discount() -> Optional[List[Dict[str, Any]]]:27"""Get Ethereum ETF premium/discount history."""28return cg_request("api/etf/ethereum/premium-discount/history")293031def get_sol_etf_flows() -> Optional[List[Dict[str, Any]]]:32"""Get Solana ETF flow history."""33return cg_request("api/etf/solana/flow-history")343536def get_sol_etf_list() -> Optional[List[Dict[str, Any]]]:37"""Get list of all Solana ETFs."""38return cg_request("api/etf/solana/list")394041def get_xrp_etf_flows() -> Optional[List[Dict[str, Any]]]:42"""Get XRP ETF flow history."""43return cg_request("api/etf/xrp/flow-history")444546def get_xrp_etf_list() -> Optional[List[Dict[str, Any]]]:47"""Get list of all XRP ETFs."""48return cg_request("api/etf/xrp/list")495051def get_hk_eth_etf_flows() -> Optional[List[Dict[str, Any]]]:52"""Get Hong Kong Ethereum ETF flows."""53return cg_request("api/hk-etf/ethereum/flow-history")545556def main():57"""CLI entry point."""58parser = argparse.ArgumentParser(description="Coinglass ETF Tools")59parser.add_argument("action", choices=[60"eth-flows", "eth-list", "sol-flows", "xrp-flows"61])62parser.add_argument("--json", "-j", action="store_true")63args = parser.parse_args()6465actions = {66"eth-flows": get_eth_etf_flows,67"eth-list": get_eth_etf_list,68"sol-flows": get_sol_etf_flows,69"xrp-flows": get_xrp_etf_flows,70}7172try:73result = actions[args.action]()74print(json.dumps(result, indent=2))75except Exception as e:76print(f"Error: {e}", file=sys.stderr)77sys.exit(1)787980if __name__ == "__main__":81main()82