MCPcopy Index your code
hub / github.com/cryptoquantumwave/khunquant

github.com/cryptoquantumwave/khunquant @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
4,544 symbols 20,415 edges 570 files 1,344 documented · 30%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

KhunQuant

EN | TH

Open-source agentic framework for quantitative portfolio management — built for the Thai community.

KhunQuant bridges Thai equity markets (SET) and global digital assets through a single AI-powered orchestrator. It runs locally on your machine, keeping your API keys and strategy parameters under your full control.

Built on PicoClaw — an ultra-lightweight Go AI assistant.


Features

  • Unified execution — Trade on Bitkub and Binance while monitoring SET via Settrade from a single agent
  • Thai market native — Built-in support for Thai brokerages: Streaming (Settrade), InnovestX, Dime
  • Privacy-first — All logic runs locally; no strategy data leaves your machine
  • LLM-powered — Natural language commands like "Rebalance my crypto into Thai high-dividend stocks if BTC RSI hits 30"
  • TradingView integration — Webhook receiver maps alerts directly to trade execution
  • Multi-provider LLM — Anthropic Claude, OpenAI, Azure, Ollama, local models

Quick Start

Requirements: Go 1.25+, make

git clone https://github.com/khunquant/khunquant.git
cd khunquant
make deps
make install       # installs to ~/.local/bin/khunquant
khunquant onboard  # interactive setup wizard

Web Console

cd web
make dev           # starts frontend (localhost:5173) + backend (localhost:18800)

Architecture

Channels (Telegram, Discord, Web, …)
          │
          ▼
    Agent Orchestrator  ◄──  LLM Provider (Claude, GPT, …)
          │
          ▼
      Tools Layer
    ┌─────┴──────────────────────────┐
    │  Exchange Adapters             │
    │  ┌──────────┐  ┌───────────┐  │
    │  │  Bitkub  │  │  Binance  │  │
    │  └──────────┘  └───────────┘  │
    │  ┌──────────┐  ┌───────────┐  │
    │  │ Settrade │  │InnovestX  │  │
    │  └──────────┘  └───────────┘  │
    └────────────────────────────────┘
  • pkg/providers/ — LLM provider abstraction
  • pkg/channels/ — Chat platform adapters
  • pkg/tools/ — Agent tools (filesystem, shell, search, exchange adapters)
  • pkg/agent/ — Core agent loop and context management
  • cmd/khunquant/ — CLI entry point (onboard, agent, gateway, status, …)

Roadmap

Phase Focus Status
1 Exchange adapter layer (Bitkub, Binance, Settrade, InnovestX, Dime) 🔨 In progress
2 LLM orchestration — natural language trading commands 📋 Planned
3 Open-source adapter SDK for community contributions 📋 Planned

Contributing

See CONTRIBUTING.md.


License

MIT — see LICENSE. KhunQuant is a fork of PicoClaw.


KhunQuant (ภาษาไทย)

เฟรมเวิร์ก open-source สำหรับการบริหารพอร์ตเชิงปริมาณ — สร้างสำหรับชุมชนคนไทย

KhunQuant เชื่อมตลาดหุ้นไทย (SET) กับสินทรัพย์ดิจิทัลทั่วโลกผ่าน AI agent ตัวเดียว ทำงานบนเครื่องของคุณเอง — API key และกลยุทธ์การลงทุนอยู่ในมือคุณตลอดเวลา


คุณสมบัติหลัก

  • ครบในที่เดียว — เทรด Bitkub และ Binance พร้อมติดตาม SET ผ่าน Settrade จาก agent เดียว
  • รองรับตลาดไทย — รองรับโบรกเกอร์ไทยโดยตรง: Streaming (Settrade), InnovestX, Dime
  • ความเป็นส่วนตัว — ระบบทำงานในเครื่องของคุณ ไม่มีข้อมูลกลยุทธ์ส่งออกไปภายนอก
  • สั่งงานด้วยภาษาธรรมชาติ — เช่น "ปรับพอร์ตคริปโตไปหุ้นปันผลสูงไทย ถ้า RSI ของ BTC ถึง 30"
  • รองรับ TradingView — รับ webhook alert แล้วส่งคำสั่งเทรดต่อทันที

เริ่มต้นใช้งาน

git clone https://github.com/khunquant/khunquant.git
cd khunquant
make deps
make install
khunquant onboard

เว็บคอนโซล

cd web
make dev   # เปิด frontend ที่ localhost:5173 และ backend ที่ localhost:18800

โรดแมป

เฟส เป้าหมาย สถานะ
1 ชั้น adapter สำหรับ exchange ต่าง ๆ (Bitkub, Binance, Settrade, InnovestX, Dime) 🔨 กำลังพัฒนา
2 LLM orchestration — สั่งงานด้วยภาษาธรรมชาติ 📋 วางแผน
3 Open-source adapter SDK สำหรับชุมชน 📋 วางแผน

การมีส่วนร่วม

ดู CONTRIBUTING.md


สัญญาอนุญาต

MIT — ดู LICENSE KhunQuant พัฒนาต่อจาก PicoClaw

Extension points exported contracts — how you extend this code

Tool (Interface)
Tool is the interface that all tools must implement. [30 implementers]
pkg/tools/base.go
TypingCapable (Interface)
TypingCapable — channels that can show a typing/thinking indicator. StartTyping begins the indicator and returns a stop [7 …
pkg/channels/interfaces.go
LLMProvider (Interface)
(no doc) [16 implementers]
pkg/providers/types.go
Exchange (Interface)
Exchange is the interface that all exchange adapters must implement. [4 implementers]
pkg/exchanges/exchange.go
SessionStore (Interface)
SessionStore defines the persistence operations used by the agent loop. Both SessionManager (legacy JSON backend) and JS [2 …
pkg/session/session_store.go
SkillRegistry (Interface)
SkillRegistry is the interface that all skill registries must implement. Each registry represents a different source of [2 …
pkg/skills/registry.go
Classifier (Interface)
Classifier evaluates a feature set and returns a complexity score in [0, 1]. A higher score indicates a more complex tas [2 …
pkg/routing/classifier.go
MediaStore (Interface)
MediaStore manages the lifecycle of media files associated with processing scopes. [1 implementers]
pkg/media/store.go

Core symbols most depended-on inside this repo

Errorf
called by 2063
pkg/logger/logger_3rd_party.go
Fatalf
called by 1343
pkg/logger/logger_3rd_party.go
Error
called by 996
pkg/providers/types.go
Run
called by 221
pkg/agent/loop.go
Close
called by 174
pkg/memory/store.go
ErrorResult
called by 153
pkg/tools/result.go
WriteFile
called by 150
pkg/tools/filesystem.go
ErrorCF
called by 135
pkg/logger/logger.go

Shape

Function 2,631
Method 1,217
Struct 518
Interface 151
FuncType 15
TypeAlias 12

Languages

Go88%
TypeScript12%

Modules by API surface

pkg/config/config.go99 symbols
pkg/migrate/sources/openclaw/openclaw_config.go85 symbols
pkg/agent/loop_test.go55 symbols
pkg/providers/claude_cli_provider_test.go54 symbols
pkg/channels/matrix/matrix.go50 symbols
pkg/channels/manager_test.go49 symbols
pkg/agent/loop.go49 symbols
pkg/tools/filesystem.go47 symbols
pkg/tools/web.go39 symbols
pkg/providers/common/common_test.go38 symbols
pkg/channels/wecom/aibot.go36 symbols
pkg/routing/router_test.go35 symbols

Datastores touched

dbnameDatabase · 1 repos
dbDatabase · 1 repos

For agents

$ claude mcp add khunquant \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact