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

@polyedge/client

v0.1.0

Published

Compute prediction-market edges locally: PolyEdge fair values plus your own venue order book, on your machine.

Readme

@polyedge/client

Compute prediction-market edges on your own machine.

PolyEdge publishes the fair value: an outcome probability de-vigged from sportsbook consensus. You hold the other half, an order book from your own venue account. This package does the subtraction.

npm i @polyedge/client @polyedge/resolver
import { PolyEdge } from '@polyedge/client';

const pe = new PolyEdge({ apiKey: process.env.POLYEDGE_KEY });

const fairValues = await pe.fairValues({ league: 'nba' });   // ours, over HTTP
const settlementRules = await pe.settlementRules();          // ours
const books = await yourKalshiClient.books();                // yours, never sent to us

const edges = pe.computeEdges({ fairValues, books, settlementRules, sizeUsd: 1000 });

A worked end-to-end board is in examples/kalshi-board.

Why it runs locally

PolyEdge holds no data agreement with Polymarket or Kalshi, and both prohibit us from collecting their prices or redistributing them, derived forms included. You are permitted to read your own account: Kalshi's Developer Agreement allows a member to use the API for their own trading.

So the edge is computed where the permission is. Your credentials, positions and order flow never reach us. The only outbound call to PolyEdge is a GET for fair values.

This is not a reduced version of a hosted product. buildEdge here is the same function the hosted board ran, and a snapshot built from published inputs plus your own book is byte-identical to one the server produced, down to provenance.inputsHash.

What it refuses to do

The refusal rules matter more than the happy path, because this runs against real money.

  • A fair value PolyEdge refused to publish produces no edge. It never falls back to the venue's own mid, which would be circular and would read as an edge of zero.
  • An unknown fee leaves net null, never zero. Zero is a claim that trading is free.
  • A market whose venue settles a tie differently from a book is blocked, not adjusted with a fudge factor. There is no defensible comparison between a two-way book price and a contract that settles on a different event.
  • A book with no matching fair value is skipped, not priced against nothing.
  • The market price is the executable ask, never the mid. You cannot buy at a midpoint, and a wide book makes a mid-based edge fiction.

Fees

feeModelFor(book) builds the model from what the venue reported. Kalshi's taker fee is roundUpToCent(0.07 x C x P x (1-P)), rounded on the total rather than per contract. Polymarket's comes from that market's own feesEnabled and takerBaseFee; fees on with an unreadable rate returns null, because unknown is not free.

Verify against a live order ticket before trading real size.

MIT. Part of PolyEdge.