readme

chstrategy.xyz

Personal platform that manages investment strategy, holdings and crypto trading in one place: a homepage with three buttons leads to three independent sections, Strategy, Assets and Trading.

Long-term direction

The goal is a single chatbot that opens and closes positions on any of the most used platforms: centralized and decentralized exchanges, DeFi protocols and aggregators such as 1inch and NEAR Intents, each integrated with its official tools kept at the latest version. The main difficulty of the plan is keeping growth in order: every new platform brings its own symbols, quotes, credentials and rules, and without a common shape the codebase degrades into special cases.

Principles

  • Put everything in the right place and stay minimal. Classify each individual call to a platform, not the platform as a whole: a call that neither signs nor mutates real state is the data layer; one that does is the execution layer, venue or DeFi compartment. If an integration does not answer these two questions cleanly, decide the new shape first and write the code after. Details in docs/architecture.md.
  • The model never decides to execute. Every action goes through deterministic validation, produces a preview and requires final consent; consent routes a signed single-use token. The full rules are in SECURITY.md.
  • Official SDKs only where they save real work, typically order signing; reads stay direct fetches.
  • Updating stays a manual step, never automatic on code that signs real orders.

Why the project exists and how decisions are made: soul.md.

Status

Open work is in tasks/todo.md.

Stack and map

The site: TypeScript, React, Next.js, Tailwind, Convex for backend and data, Clerk for authentication, Vercel, Bun. The Trading engine: Python 3.11+, the official Hyperliquid SDK and ccxt.

Section What it does
Strategy Ideal capital allocation per portfolio, compared with the real holdings and plotted against its target path
Assets Where the money is today and the realized track record across Hyperliquid, OKX and Lighter
Trading (admins) Multi-venue trading in natural language on Hyperliquid, OKX, KuCoin and Lighter, with preview and consent
/trading/tools-docs, /api-status (admins) Tool docs catalog and integration status
/info This README, rendered at build
  • src/app/, src/components/, src/lib/: the Next.js app; venue adapters in src/lib/execution/venues, DeFi modules in src/lib/execution/defi, the chatbot in src/lib/tradingAgent
  • convex/: schema, functions, crons and market data providers
  • engine/: the standalone Python trading engine
  • archive/: parked code, never built or imported (archive/README.md)
  • docs/: deep documentation

Run

bun install
cp .env.example .env.local   # fill in OPENROUTER_API_KEY, ENGINE_DIR, ENGINE_PYTHON, the Clerk keys and NEXT_PUBLIC_ADMIN_EMAIL
bun run dev                  # Next.js frontend
bunx --bun convex dev        # Convex backend, local development only
bun run build
bun run lint
bun test src/lib

Trading engine, from engine/: python -m venv .venv && source .venv/bin/activate, pip install -r requirements.txt, pytest, python -m src.main --plan plans/spcx_short.example.yaml --offline.

Deploy: every push to main starts a Vercel production deploy, which publishes the Convex backend first.

Links