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

@b402ai/trader

v0.2.1

Published

Turn one wallet into an agent fleet. Spawn capitalized AI trading agents with private treasuries on Hyperliquid.

Readme

b402-trader

Turn one wallet into a self-improving trading desk on Hyperliquid. Private. Gasless. Autonomous.

USDC flows through a Railgun ZK privacy pool, emerges in untraceable wallets, bridges to Arbitrum, and deposits to Hyperliquid through gasless permits. Each agent gets its own anonymous identity. Nobody can link them to you.

Zero gas. Zero setup. Zero trace. Wallet auto-generated on first run. All gas paid by protocol infrastructure.

Install

claude mcp add b402-trader -- npx @b402ai/trader

On first run, a wallet is auto-generated at ~/.b402/wallet.json (chmod 600). No private keys to manage. If you already have a ~/.b402/wallet.json from the b402-sdk, it uses the same wallet.

Optional env vars (create ~/.b402/.env):

OPENROUTER_API_KEY=sk-...  # For LLM-confirmed entries (recommended)
BASE_RPC_URL=https://...   # Custom Base RPC (default: public)

Quick Start

"check balance"                     → shows your fund address + privacy pool
"shield 50 USDC"                    → move USDC into privacy pool
"spawn 5 agents with different strategies"
"fund each agent with 10 USDC"      → ZK unshield → bridge → HL deposit
"start all agents live"             → agents trading independently
"status"                            → live P&L, positions, equity
"analytics phantom"                 → Sharpe, win rate, profit factor, per-asset P&L
"darwinian"                         → fleet rankings, who gets more capital

Strategies

Each agent has its own config at ~/.b402/agents/{name}.json. Five presets:

| Preset | Style | Positions | Leverage | LLM | Risk | |--------|-------|-----------|----------|-----|------| | momentum | ride directional moves | 2 max | 3x | confirms | SL -0.5% TP 1.5% | | scalping | fast in/out, tight stops | 3 max | 5x | confirms | SL -0.4% TP 0.8% | | trend | patient, wide stops | 1 max | 3x | confirms | SL -0.8% TP 2.0% | | mean_reversion | fade extremes | 2 max | 3x | confirms | SL -0.5% TP 0.8% | | breakout | volume spikes | 2 max | 4x | off | SL -0.6% TP 1.5% |

All params editable in the JSON. Changes take effect on next start_agent.

Self-Improving Agents

Agents evolve autonomously — no human intervention needed.

Every 5 trades (when no positions open):

  1. Measures Sharpe ratio before and after last config change
  2. If improved → KEEP. If degraded → REVERT to previous config.
  3. Proposes next change based on trade analytics (LLM analyzes full history)
  4. Applies change, tests for 5 more trades

Prompt evolution — agents rewrite their own strategy description based on which assets and patterns work for them. Example: spectre evolved from "aggressive" to "focus on BTC, TAO, HYPE. avoid XPL, LIT, ENA, DOGE."

Fleet intelligence:

  • Contrarian block: if 2+ agents already entered the same trade, others are blocked
  • Cross-agent learning: discoveries propagate (one agent learns → all benefit)
  • Market regime detection: trending, ranging, volatile, low volume
  • Darwinian weights: top performers get amplified, bottom get decayed

How It Works

Auto-generated Wallet (Base)
  → shield USDC into Railgun privacy pool (ZK proof, gasless)
  → unshield to anonymous smart wallet (zero on-chain link)
  → Across bridge to Arbitrum (~2s fill)
  → permit deposit to Hyperliquid (gasless, hosted relayer)
  → agent trades on HL order book through anonymous identity

Trading Pipeline

SCAN → TA + ML → LLM CONFIRM → EXECUTE → MANAGE → EVOLVE
  1. SCAN — RSI, MACD, BB, OBV, ATR across top 20 assets by volume
  2. ML — logistic regression (3 bucketed models: majors, liquid_alts, high_beta) predicts 15-min direction
  3. LLM — sees TA score, ML score, RSI, price action, portfolio, session P&L. Knows when TA+ML agree or disagree.
  4. EXECUTE — market order, position sized at 30% of available equity
  5. MANAGE — mechanical exits every 15s: stop loss, take profit, trailing stop, TA flip, stagnation
  6. EVOLVE — every 5 trades: measure Sharpe, propose change, test, keep or revert

Dashboard

npx tsx src/dashboard-server.ts
# → http://localhost:3502

Three-panel live view: agent list (left), detail panel (center), self-improvement timeline (right). P&L leaderboard, live ticker, streaming logs.

MCP Tools

| Tool | Description | |------|-------------| | check_balance | Fund address, privacy pool, agent wallets | | shield | Move USDC into Railgun privacy pool | | spawn_agent | Create anonymous wallet + strategy config | | fund_agent | Privacy pool → bridge → HL deposit (gasless) | | start_agent | Start trading (paper or live, pick strategy) | | stop_agent | Stop + close positions + show P&L | | list_agents | All agents with status | | status | Positions, equity, trades for any/all agents | | market_data | Price, order book, funding for any asset | | analytics | Sharpe, win rate, profit factor, per-asset P&L, exit reasons | | improve | Propose a self-improvement change for an agent | | darwinian | Fleet rankings with Darwinian weights |