基於 @polymarket/clob-client 的自動交易系統。
clob-client-Test/
├── trading/ # 📈 交易系統
│ ├── bots/ # 交易機器人
│ │ ├── btc-trading-bot.ts
│ │ └── btc-trading-bot-v2.ts
│ ├── search/ # 市場搜索工具
│ ├── strategy/ # 交易策略
│ │ └── tests/ # 策略測試
│ ├── lib/ # 本地輔助模組
│ │ ├── config.ts # 合約配置
│ │ ├── logger.ts # 日誌工具
│ │ └── abi/ # 合約 ABI
│ └── docs/ # 策略文檔
│
├── infra/ # 🐳 基礎設施
│ ├── docker-compose.yml # ELK Stack
│ ├── filebeat.yml # 日誌收集
│ └── start-filebeat.ps1
│
├── data/ # 📊 市場數據
├── tests-custom/ # 🧪 自訂測試
├── logs/ # 📝 執行日誌 (gitignore)
└── node_modules/ # npm 依賴
npm install複製範例檔案並填入你的金鑰:
cp .env.example .env在 .env 填入:
PRIVATE_KEY=your_private_key
CLOB_API_KEY=your_api_key
CLOB_SECRET=your_api_secret
CLOB_PASS_PHRASE=your_pass_phrase# BTC 5分鐘預測市場機器人 (推薦)
npx tsx trading/bots/btc-trading-bot-v2.ts
# 舊版機器人
npx tsx trading/bots/btc-trading-bot.ts# 搜索市場
npx tsx trading/search/search-btc-5min.ts
npx tsx trading/search/search-clob-markets.ts
# 即時交易策略
npx tsx trading/strategy/btc-trading-live.ts
# 模擬交易 (不實際下單)
npx tsx trading/strategy/btc-trading-simulator.tscd infra
docker-compose up -d
.\start-filebeat.ps1- @polymarket/clob-client: 官方 npm 套件(
npm update自動更新) - trading/lib/: 本地輔助模組(config, logger, abi)