npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tonquant

v0.1.0

Published

AI-native quant research CLI for the TON blockchain — data, factors, backtesting, and automated research loops

Downloads

94

Readme

TonQuant

TON DeFi market research and trading CLI — built for AI Agents.

TON AI Agent Hackathon · Track 1: Agent Infrastructure

What is TonQuant?

A command-line tool that lets AI Agents (like OpenClaw) and developers perform quantitative research, backtest strategies, and inspect DeFi markets on the TON blockchain.

Key features:

  • Agent-driven research loop: autoresearch run chains data→factor→backtest→report automatically
  • Full quant pipeline: OHLCV data, RSI/MACD/volatility factors, momentum backtesting
  • --json output for AI agent consumption
  • Human-readable colored terminal output for developers
  • STON.fi DEX integration (prices, pools, swap simulation)
  • TonAPI integration (wallet balance, transaction history)
  • Encrypted mnemonic storage (AES-256-GCM)

Quick Start

# Install Bun (if not already installed)
curl -fsSL https://bun.sh/install | bash

# Clone and install
git clone <repo-url> && cd tonquant
bun install
bun link

# Try it out
tonquant trending --limit 5
tonquant price TON
tonquant pools USDT/TON
tonquant research NOT --json

Commands

Quant Research (Phase 1)

| Command | Description | |---------|-------------| | tonquant autoresearch run --asset TON/USDT | Full research loop: data→factor→backtest→report | | tonquant data fetch TON/USDT | Fetch OHLCV market data | | tonquant data list | List cached datasets | | tonquant factor compute --factors rsi,macd,volatility | Compute technical factors | | tonquant factor list | List available factors | | tonquant backtest run --strategy momentum | Run strategy backtest | | tonquant preset list | List strategy presets | | tonquant preset show momentum-ton | Show preset details |

Market Inspection (Phase 0)

| Command | Description | |---------|-------------| | tonquant price <symbol> | Token price and details | | tonquant pools <A>/<B> | Pool liquidity and fees | | tonquant trending | Top tokens by liquidity | | tonquant research <symbol> | Market research summary | | tonquant init --mnemonic '...' | Configure wallet | | tonquant balance [--all] | Wallet balance with USD | | tonquant swap <from> <to> <amount> | Simulate DEX swap | | tonquant history | Transaction history |

Add --json to any command for structured JSON output.

See skill/SKILL.md for full command reference, JSON schemas, and Agent workflows.

Architecture

CLI Layer (commander)
  Phase 0: price | pools | trending | init | balance | swap | research | history
  Phase 1: data | factor | backtest | preset | autoresearch
    ↓
Quant API Layer (src/quant/api/)              Query Layer (queries.ts)
  runDataFetch | runFactorCompute |            fetchPriceData | fetchPoolData | ...
  runBacktest | runPresetShow                    ↓
    ↓                                         Service Layer
Quant Runner (src/quant/runner/)               stonfi.ts | tonapi.ts | wallet.ts
  subprocess spawn → JSON stdio                 ↓
    ↓                                         Cache Layer (cache.ts)
Quant Backend (quant-backend/)                   ↓
  data | factor | backtest | preset           External APIs
    ↓                                           STON.fi v1 | TonAPI v2
Orchestrator (src/quant/orchestrator.ts)
  preset → data → factor → backtest → report

Tech Stack

| Component | Technology | |-----------|-----------| | Runtime | Bun | | Language | TypeScript (strict) | | CLI | Commander | | Validation | Zod | | TON SDK | @ton/ton, @ton/crypto, @ton/core | | DEX | STON.fi HTTP API v1 | | Wallet API | TonAPI v2 | | Terminal UI | chalk, cli-table3 | | Linting | Biome | | Testing | bun:test (135 tests, 80%+ coverage) |

For AI Agents

TonQuant is designed as an OpenClaw skill. The skill/SKILL.md file teaches any MCP-compatible Agent how to:

  1. Discover tokens (trending)
  2. Research before trading (research, price, pools)
  3. Simulate trades (swap)
  4. Monitor portfolio (balance --all)

All commands support --json for structured parsing.

Development

bun test              # Run tests
bun test --coverage   # With coverage report
bun run typecheck     # TypeScript check
bun run lint          # Biome linting
bun run dev           # Run CLI in dev mode

License

MIT