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

@shepherd-terminal/chopper

v0.2.0

Published

CLI tool for cryptocurrency trade analysis - best trades, oracle bounds, and drawdown analysis

Readme

@shepherd-terminal/chopper

Cryptocurrency trade analysis CLI and library.

Installation

npm install -g @shepherd-terminal/chopper

Or use with npx:

npx @shepherd-terminal/chopper best BTC/USDT --from 2024-01-01 --to 2024-06-01

CLI Commands

chopper best <symbol>

Find the best single long trade (buy then sell) in a time window.

chopper best BTC/USDT --from 2024-01-01 --to 2024-06-01

Constrain to trades within a time window using --max-candles:

# Best trade within any 24h window (using 1m candles for accuracy)
chopper best BTC/USDT -t 1m --from 2024-01-01 --to 2024-01-07 --max-candles 1440

# Best trade within any 7-day window
chopper best ETH/USDT -t 1h --from 2024-01-01 --to 2024-03-01 --max-candles 168

chopper bound <symbol>

Calculate the oracle upper bound - the theoretical maximum return achievable with perfect foresight and unlimited trades.

chopper bound BTC/USDT --tf 1d --from 2020-01-01 --to 2024-01-01 --json

chopper dd <symbol>

Calculate max drawdown over a time window.

chopper dd BTC/USDT --tf 4h --from 2023-01-01 --to 2023-12-31

Common Options

| Option | Description | Default | |--------|-------------|---------| | -e, --exchange <name> | Exchange to use | binance | | -t, --tf <timeframe> | Candle timeframe | 1h | | -f, --from <iso> | Start date (ISO format) | required | | -T, --to <iso> | End date (ISO format) | required | | -j, --json | Output as JSON | false |

Best Command Options

| Option | Description | |--------|-------------| | -n, --max-candles <n> | Max candles between entry and exit (constrains trade duration) |

Library Usage

import {
  bestSingleTrade,
  oracleBound,
  maxDrawdown,
  fetchCandles,
  type Candle,
} from "@shepherd-terminal/chopper";

// Fetch candles
const candles = await fetchCandles(
  "binance",
  "BTC/USDT",
  "1h",
  Date.parse("2024-01-01"),
  Date.parse("2024-06-01")
);

// Analyze
const best = bestSingleTrade(candles);
const bestConstrained = bestSingleTrade(candles, { maxCandles: 24 }); // within 24 candles
const bound = oracleBound(candles);
const dd = maxDrawdown(candles);

console.log(best);  // { entryTs, exitTs, entryPrice, exitPrice, pctReturn, candlesBetween }
console.log(bound); // { oracleBound, buyAndHold, totalCandles, positiveMovesCount }
console.log(dd);    // { pct, peakTs, troughTs, peakPrice, troughPrice }

Development

# Install dependencies
bun install

# Run in development
bun run dev best BTC/USDT --from 2024-01-01 --to 2024-02-01

# Build
bun run build

# Release (creates tag, publishes to npm)
bun run release

License

MIT