khunquant

module
v0.4.1-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: MIT

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 khunquant — 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/cryptoquantumwave/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, …)

Contributing

See CONTRIBUTING.md.


License

MIT — see LICENSE. This project is based on sipeed/picoclaw (MIT License). Modifications and additional code by KhunQuant (MIT License). KhunQuant — github.com/cryptoquantumwave/khunquant.


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/cryptoquantumwave/khunquant.git
cd khunquant
make deps
make install
khunquant onboard
เว็บคอนโซล
cd web
make dev   # เปิด frontend ที่ localhost:5173 และ backend ที่ localhost:18800

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

ดู CONTRIBUTING.md


สัญญาอนุญาต

MIT — ดู LICENSE โครงการนี้มีพื้นฐานมาจาก sipeed/picoclaw (ใบอนุญาต MIT) การแก้ไขและโค้ดเพิ่มเติมโดย KhunQuant (ใบอนุญาต MIT). KhunQuant — github.com/cryptoquantumwave/khunquant

Directories

Path Synopsis
cmd
khunquant command
membench command
pkg
brand
Package brand holds the canonical KHUNQUANT ASCII art banner.
Package brand holds the canonical KHUNQUANT ASCII art banner.
bus
constants
Package constants provides shared constants across the codebase.
Package constants provides shared constants across the codebase.
credential
Package credential resolves API credential values for model_list entries.
Package credential resolves API credential values for model_list entries.
dca
exchanges/mt5
Package mt5 provides a broker adapter stub for MetaTrader 5 (MT5) Forex/CFD trading.
Package mt5 provides a broker adapter stub for MetaTrader 5 (MT5) Forex/CFD trading.
exchanges/settrade
Package settrade provides a broker adapter for the SETTRADE Open API (SDK v2).
Package settrade provides a broker adapter for the SETTRADE Open API (SDK v2).
fileutil
Package fileutil provides file manipulation utilities.
Package fileutil provides file manipulation utilities.
identity
Package identity provides unified user identity utilities for KhunQuant.
Package identity provides unified user identity utilities for KhunQuant.
mcp
pid
providers/broker
Package broker defines the unified provider hierarchy for all asset classes.
Package broker defines the unified provider hierarchy for all asset classes.
providers/common
Package common provides shared utilities used by multiple LLM provider implementations (openai_compat, azure, etc.).
Package common provides shared utilities used by multiple LLM provider implementations (openai_compat, azure, etc.).
ta
Package ta provides pure-Go technical analysis indicators.
Package ta provides pure-Go technical analysis indicators.
updater
Package updater checks for new releases on GitHub and returns update info.
Package updater checks for new releases on GitHub and returns update info.
utils
Package utils provides shared, reusable algorithms.
Package utils provides shared, reusable algorithms.
web
backend command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL