{"id":37063509,"url":"https://github.com/quantbai/phandas","last_synced_at":"2026-01-14T07:14:53.458Z","repository":{"id":309306845,"uuid":"1035816874","full_name":"quantbai/phandas","owner":"quantbai","description":"A multi-factor quantitative trading framework for cryptocurrency markets.","archived":false,"fork":false,"pushed_at":"2026-01-11T21:52:07.000Z","size":1446,"stargazers_count":94,"open_issues_count":0,"forks_count":15,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-12T01:23:49.868Z","etag":null,"topics":["cryptocurrency","quantitative-trading","trading-framework"],"latest_commit_sha":null,"homepage":"https://phandas.streamlit.app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quantbai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-11T06:17:09.000Z","updated_at":"2026-01-10T14:02:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"c468c9df-842a-4fb6-9457-ae9a954d8ea3","html_url":"https://github.com/quantbai/phandas","commit_stats":null,"previous_names":["quantbai/phandas"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/quantbai/phandas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantbai%2Fphandas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantbai%2Fphandas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantbai%2Fphandas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantbai%2Fphandas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quantbai","download_url":"https://codeload.github.com/quantbai/phandas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quantbai%2Fphandas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptocurrency","quantitative-trading","trading-framework"],"created_at":"2026-01-14T07:14:52.919Z","updated_at":"2026-01-14T07:14:53.453Z","avatar_url":"https://github.com/quantbai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/quantbai/phandas/main/assets/PHANDAS2.png\" alt=\"Phandas\" width=\"500\"\u003e\n\n[![en](https://img.shields.io/badge/lang-en-yellow.svg)](#english) \u0026nbsp; [![zh-TW](https://img.shields.io/badge/lang-繁體中文-green.svg)](#繁體中文)\n\n\u003c/div\u003e\n\n## English\n\nA multi-factor quantitative trading framework for cryptocurrency markets.\n\n### Overview\n\nPhandas is a streamlined toolkit for alpha factor research and backtesting in cryptocurrency markets. Design factors with 60+ operators, test with dollar-neutral backtesting, and analyze with professional metrics.\n\n### Try it now\n\n[**Web Demo**](https://phandas.streamlit.app/) - Experience Phandas directly in your browser. No installation required.\n\n### Key Features\n\n- **Data Fetching**: Multi-source OHLCV data (Binance, OKX)\n- **Factor Engine**: 60+ time-series and cross-sectional operators\n- **Neutralization**: Vector projection \u0026 regression-based orthogonalization\n- **Backtesting**: Dollar-neutral strategies with full/partial rebalancing\n- **Performance Metrics**: Sharpe, Sortino, Calmar, Max Drawdown, VaR, PSR\n- **Factor Analysis**: IC, IR, correlation, coverage, turnover\n- **MCP Integration**: AI agents (Claude) can directly access Phandas\n\n### Installation\n\n```bash\npip install phandas\n```\n\n### Quick Start\n\n```python\nfrom phandas import *\n\n# Fetch market data\npanel = fetch_data(\n    symbols=['ETH', 'SOL', 'ARB', 'OP', 'POL', 'SUI'],\n    timeframe='1d',\n    start_date='2023-01-01',\n    sources=['binance'],\n)\n\n# Extract factors\nclose = panel['close']\nvolume = panel['volume']\nopen = panel['open']\n\n# Construct momentum factor\nmomentum_20 = (close / close.ts_delay(20)) - 1\n\n# Neutralize against volume\nfactor = vector_neut(rank(momentum_20), rank(-volume))\n\n# Backtest strategy\nresult = backtest(\n    entry_price_factor=open, \n    strategy_factor=factor,\n    transaction_cost=(0.0003, 0.0003)\n)\n\nresult.plot_equity()\n```\n\n### AI Integration via MCP\n\nUse Phandas with AI IDEs (Cursor, Claude Desktop) directly—no coding required.\n\n**Setup for Cursor (Recommended)**\n\n1. `pip install phandas`\n2. Open Cursor → Settings → Tools \u0026 MCP → **New MCP Server**\n3. Paste the JSON config below, save and restart\n\n```json\n{\n  \"mcpServers\": {\n    \"phandas\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"phandas.mcp_server\"]\n    }\n  }\n}\n```\n\n**Available Tools (4 Functions)**\n\n- `fetch_market_data`: Get OHLCV data for symbols\n- `list_operators`: Browse all 50+ factor operators\n- `read_source`: View source code of any function\n- `execute_factor_backtest`: Backtest custom factor expressions\n\n---\n\n## 繁體中文\n\n一個專為加密貨幣市場設計的多因子量化交易框架。\n\n### 概述\n\nPhandas 是一個精簡的加密貨幣因子研究與回測工具。提供 60+ 運算子設計因子、美元中性回測、專業績效指標分析。\n\n### 立即體驗\n\n[**網頁演示**](https://phandas.streamlit.app/) - 直接在瀏覽器中體驗 Phandas，無需安裝。\n\n### 核心功能\n\n- **資料獲取**：多源 OHLCV 資料（Binance、OKX）\n- **因子引擎**：60+ 時間序列與橫截面運算子\n- **因子中性化**：向量投影與迴歸正交化\n- **回測引擎**：美元中性策略、全/部分調倉\n- **績效指標**：夏普比、Sortino、Calmar、最大回撤、VaR、PSR\n- **因子分析**：IC、IR、相關性、覆蓋率、換手率\n- **MCP 集成**：AI 代理（Claude）可直接調用 Phandas\n\n### 安裝\n\n```bash\npip install phandas\n```\n\n### 快速開始\n\n```python\nfrom phandas import *\n\n# 獲取市場資料\npanel = fetch_data(\n    symbols=['ETH', 'SOL', 'ARB', 'OP', 'POL', 'SUI'],\n    timeframe='1d',\n    start_date='2023-01-01',\n    sources=['binance'],\n)\n\n# 提取因子\nclose = panel['close']\nvolume = panel['volume']\nopen = panel['open']\n\n# 構建動量因子\nmomentum_20 = (close / close.ts_delay(20)) - 1\n\n# 對成交量進行中性化\nfactor = vector_neut(rank(momentum_20), rank(-volume))\n\n# 回測策略\nresult = backtest(\n    entry_price_factor=open, \n    strategy_factor=factor,\n    transaction_cost=(0.0003, 0.0003)\n)\n\nresult.plot_equity()\n```\n\n### AI 集成（MCP 支援）\n\n在 AI IDE（Cursor、Claude Desktop）中直接使用 Phandas—無需編碼。\n\n**Cursor 設定（推薦）**\n\n1. `pip install phandas`\n2. 開啟 Cursor → Settings → Tools \u0026 MCP → **New MCP Server**\n3. 貼上下方 JSON 配置，儲存並重啟\n\n```json\n{\n  \"mcpServers\": {\n    \"phandas\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"phandas.mcp_server\"]\n    }\n  }\n}\n```\n\n**可用工具（4 個函數）**\n\n- `fetch_market_data`: 獲取代幣 OHLCV 資料\n- `list_operators`: 瀏覽 50+ 因子運算子\n- `read_source`: 查看任何函數的源代碼\n- `execute_factor_backtest`: 回測自訂因子表達式\n\n---\n\n## Documentation | 文檔\n\n- [Full Docs](https://phandas.readthedocs.io/) - Complete API reference\n- [Operators Guide](https://phandas.readthedocs.io/guide/operators_guide.html) - 50+ operators\n- [MCP Setup](https://phandas.readthedocs.io/mcp_setup.html) - AI IDE integration\n\n---\n\n## Community \u0026 Support | 社群與支持\n\n- **Discord**: [Join us - Phantom Management](https://discord.gg/TcPHTSGMdH)\n- **GitHub Issues**: [Report bugs or request features](https://github.com/quantbai/phandas/issues)\n\n## License\n\nThis project is licensed under the BSD 3-Clause License - see [LICENSE](LICENSE) file for details.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantbai%2Fphandas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantbai%2Fphandas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantbai%2Fphandas/lists"}