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

@toomanycooks/sdk

v0.5.0

Published

TypeScript SDK for the Too Many Cooks funding rates API. Shared between the MCP server, CLI, and any third-party integration.

Downloads

858

Readme

@toomanycooks/sdk

TypeScript SDK for the Too Many Cooks funding rates API.

Used internally by @toomanycooks/mcp-server and @toomanycooks/cli. Also stable as a public SDK for any third-party integration.

The dashboard lives at toomanycooks.app; the API itself is hosted at api.antoine-legrand.dev. The SDK targets the API host by default — override with TMC_API_BASE_URL if you need to point elsewhere.

Install

npm install @toomanycooks/sdk

Quick start

import { TmcApiClient } from "@toomanycooks/sdk";

// Reads TMC_API_KEY from env automatically.
const client = new TmcApiClient();

const exchanges = await client.listExchanges();
const strategies = await client.findStrategies({ count: 10, periodDays: 7 });

console.log(strategies);

Error handling

import { TmcApiClient, TmcAuthError, TmcQuotaError } from "@toomanycooks/sdk";

try {
	await client.findStrategies({ count: 50 });
} catch (err) {
	if (err instanceof TmcAuthError) {
		// 401 — bad/revoked key
	} else if (err instanceof TmcQuotaError) {
		console.log(`Quota hit, resets at ${new Date(err.resetAt! * 1000)}`);
	}
}

API

| Method | What it returns | |---|---| | whoami() | Current key tier + quota | | getPlans() | Public plan catalog (quotas, prices, limits) | | listExchanges() | All supported DEX exchanges | | getMarkets(exchange) | Latest funding rates for one exchange | | getMarket(exchange, ticker) | Latest funding rate for one ticker on one exchange | | getExchangeStatus(exchange) | Data-freshness signal for an exchange | | getHistory(exchange, tickers, periodDays) | Historical funding-rate series | | getAllMarkets(params) | Aggregated snapshot across exchanges (single call) | | getMarketExtremes(params) | Top-N highest/lowest funding rates | | listTickers(params) | Which tickers exist and on which exchanges | | getTickerMarkets(ticker, params?) | Cross-exchange snapshot for one ticker + suggested arb | | getTickersMarkets(tickers, params?) | Batch cross-exchange snapshot for many tickers (one call) | | findStrategies(params) | Top delta-neutral arb opportunities | | findStrategyForTicker(ticker, params?) | Best long/short pair for one ticker | | simulateStrategy(params) | Project PnL for a delta-neutral pair | | findSpotStrategies(params) | Spot-arbitrage (perp/spot) strategies | | simulateSpotStrategy(params) | Project PnL for a spot/perp pair | | getExecutionCostHistory(params) | Historical execution cost for one exchange/ticker (DB-backed) | | getStrategyExecutionCostHistory(params) | Round-trip execution-cost history for a pair (DB-backed) | | getFundingSpikes(params) | Cross-exchange z-score outliers | | getStats() | Platform-level summary metrics | | compareTickerAcrossExchanges(ticker, opts?) | Same ticker across exchanges, sorted by APR (1 call) |

See TypeScript types for the full schema.

Options

const client = new TmcApiClient({
	apiKey: "...",                 // or TMC_API_KEY env
	baseUrl: "https://...",        // or TMC_API_BASE_URL env (https-only off-localhost)
	timeoutMs: 30_000,             // per-request timeout, 0 disables
	userAgent: "my-app/1.0",       // appended to "toomanycooks-sdk/<version>"
});

// All methods accept an optional final `RequestOptions` with an AbortSignal.
const ac = new AbortController();
setTimeout(() => ac.abort(), 5_000);
await client.findStrategies({ count: 10 }, { signal: ac.signal });

compareTickerAcrossExchanges is a single server call (quota cost: 1) — it delegates to the getTickerMarkets endpoint and filters client-side. An optional exchanges list narrows the result:

await client.compareTickerAcrossExchanges("BTC", {
	exchanges: ["hyperliquid", "lighter"],
});

To compare several tickers at once, use the batch endpoint (also one call):

const rows = await client.getTickersMarkets(["BTC", "ETH", "SOL"]);

License

MIT.