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

depthsignal

v1.0.0

Published

Official TypeScript SDK for the DepthSignal API — institutional-grade orderbook microstructure intelligence

Downloads

100

Readme

DepthSignal TypeScript SDK

v1.0.0 — Stable release

Official TypeScript/JavaScript client for the DepthSignal API — institutional-grade orderbook microstructure intelligence for crypto markets.

Target API: DepthSignal REST API v1

Requirements

  • Node.js 18+ (uses native fetch)
  • Zero production dependencies

Installation

npm install depthsignal

Quick Start

import { DepthSignal } from "depthsignal";

const ds = new DepthSignal({ apiKey: "your-api-key" });

// Orderbook features (Basic+ tier)
const features = await ds.getOrderbookFeatures("BTCUSDT");
console.log(features.features["binance"]?.["vpin"]);

// Composite signals (Pro+ tier)
const composites = await ds.getCompositeSignals("BTCUSDT");
if (composites.directional_pressure > 0.7) {
  console.log("Strong bullish pressure");
}

// Support/resistance zones (Pro+ tier)
const sr = await ds.getSupportResistance("BTCUSDT");
for (const zone of sr.zones) {
  console.log(`${zone.type}: $${zone.price} (strength: ${zone.strength})`);
}

Configuration

const ds = new DepthSignal({
  apiKey: "your-api-key",
  baseUrl: "https://api.depthsignal.io", // default
  timeout: 10_000,                        // ms, default 10000
  maxRetries: 2,                          // retries on 429/503/network, default 2
});

The client enforces HTTPS in production. HTTP is only allowed for localhost and 127.0.0.1 during development.

Endpoints

Orderbook (Basic+ tier)

const features = await ds.getOrderbookFeatures("BTCUSDT");
const composites = await ds.getCompositeSignals("BTCUSDT");  // Pro+
const sr = await ds.getSupportResistance("BTCUSDT");         // Pro+

Flow Intelligence

const overview = await ds.getFlowOverview();                  // Enterprise
const asset = await ds.getFlowAsset("BTCUSDT");              // Enterprise
const liqs = await ds.getLiquidations("BTCUSDT");            // Pro+
const whales = await ds.getLargeTrades("BTCUSDT");           // Pro+
const cvd = await ds.getCVD("BTCUSDT");                     // Pro+
const sentiment = await ds.getSentiment("BTCUSDT");          // Pro+
const sf = await ds.getSpotFutures("BTCUSDT");              // Enterprise
const derivs = await ds.getDerivatives("BTCUSDT");          // Enterprise
const pos = await ds.getPositioning("BTCUSDT");             // Enterprise

Aggregated Timeframes (Pro+)

const aggFeatures = await ds.getAggregatedFeatures("BTCUSDT", {
  timeframe: "4h",
  exchange: "binance",
});

const aggComposites = await ds.getAggregatedComposites("BTCUSDT", {
  timeframe: "1h",
});

Venue Analytics

const venue = await ds.getVenueSelection("BTCUSDT");         // Pro+
const depth = await ds.getDepthResilience("BTCUSDT");        // Starter+
const events = await ds.getSpreadEvents("BTCUSDT", {         // Starter+
  threshold: 3,
});
const cost = await ds.getExecutionCost("BTCUSDT", {          // Enterprise
  tradeSizeUsd: 50000,
});
const corr = await ds.getCorrelation("BTCUSDT", "ETHUSDT");  // Pro+
const whale = await ds.getWhaleFlow("BTCUSDT");              // Enterprise

Historical (Pro+ tier)

const hist = await ds.getHistoricalFeatures("BTCUSDT", {
  exchange: "binance",
  hours: 24,
  limit: 500,
});

const histComp = await ds.getHistoricalComposites("BTCUSDT", { hours: 12 });

Discovery & Health (Public)

const symbols = await ds.getSymbols();
const tiers = await ds.getTiers();
const health = await ds.getHealth();

Real-Time Streaming (Enterprise)

const sub = ds.stream("BTCUSDT", {
  onData: (event) => console.log("Received:", event),
  onError: (err) => console.error("Stream error:", err),
  onClose: () => console.log("Stream closed"),
  reconnect: true,          // default
  maxReconnectDelay: 30_000, // default 30s
});

// Close after 60 seconds
setTimeout(() => sub.close(), 60_000);

Error Handling

import {
  DepthSignalError,
  AuthenticationError,
  TierAccessError,
  RateLimitError,
  NotFoundError,
  ServerError,
  ConnectionError,
} from "depthsignal";

try {
  const features = await ds.getOrderbookFeatures("BTCUSDT");
} catch (err) {
  if (err instanceof AuthenticationError) {
    console.error("Invalid API key");
  } else if (err instanceof TierAccessError) {
    console.error("Upgrade your tier for this endpoint");
  } else if (err instanceof RateLimitError) {
    console.error(`Rate limited — retry after ${err.retryAfter}s`);
  } else if (err instanceof NotFoundError) {
    console.error("Symbol not found");
  } else if (err instanceof ConnectionError) {
    console.error("Could not reach the API");
  } else if (err instanceof DepthSignalError) {
    console.error(`API error ${err.statusCode}: ${err.detail}`);
  }
}

Version Sync

Both the TypeScript and Python SDKs follow the same semantic versioning and target the same DepthSignal API version (v1). Breaking API changes are released as major version bumps in both SDKs simultaneously.

License

MIT — Ravenna OÜ