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

@dotprotocol/arena

v0.3.0

Published

DOT Protocol Arena — Elo engine, blind evaluation, prediction resolution. DOT spreads like life, not like messages.

Readme

@dotprotocol/arena

Elo engine + blind prediction evaluation for DOT Protocol.

npm

Install

npm install @dotprotocol/arena

Quick start

import { resolveSession, rankLeaderboard } from '@dotprotocol/arena';

// Resolve predictions against oracle outcome
const { matches, ratings } = await resolveSession(session, resolutionDOT);

// Rank by Elo
const board = rankLeaderboard('prediction', entries);

How blind evaluation works

  1. Predictors submit DOTs with sealed answers (commitment scheme)
  2. Hash is published before the oracle resolves — no retroactive changes
  3. Oracle resolves by emitting a resolution DOT
  4. Session resolves — correct predictions win Elo, incorrect ones lose it
  5. Chain proves the sequence — oracle cannot have seen predictions before resolving
import { hashPredictionDOT, resolveSession, verifyPrediction } from '@dotprotocol/arena';

// --- Predictor ---
const predDOT    = await createDOT({ keypair, payload: myAnswer });
const commitment = hashPredictionDOT(predDOT); // publish this hash

// --- Oracle ---
const resDOT = await createDOT({ keypair: oracleKeypair, payload: trueOutcome });

// --- Resolution ---
const session = { predictions: [predDOT], commitments: [commitment], domain: 'crypto' };
const { matches, ratings } = await resolveSession(session, resDOT);

API

resolveSession(session, resolutionDOT)

Evaluate all predictions in a session against the oracle's resolution.

const { matches, ratings } = await resolveSession({
  predictions:  predictionDOTs,     // DOT[] — sealed predictions
  commitments:  commitmentHashes,   // Uint8Array[] — published hashes
  domain:       'crypto',           // string — Elo domain
  initialRatings: new Map(),        // optional — Map<pubkey, number>
}, resolutionDOT);

// matches: [{ predictor: Uint8Array, correct: boolean, eloDelta: number }]
// ratings: Map<pubkeyHex, number> — updated Elo ratings

verifyPrediction(predictionDOT, commitment)

Verify that a prediction DOT matches its published commitment.

const ok = verifyPrediction(predictionDOT, commitment); // boolean

hashPredictionDOT(dot)

Compute the commitment hash for a prediction DOT.

const hash = hashPredictionDOT(dot); // Uint8Array(32)

rankLeaderboard(domain, entries)

Sort leaderboard entries by Elo descending.

const board = rankLeaderboard('crypto', [
  { pubkey: aliceKey, elo: 1650 },
  { pubkey: bobKey,   elo: 1720 },
]);
// [{ pubkey: bobKey, elo: 1720, rank: 1 }, ...]

Elo utilities

import { updateElo, computeEloFromMatches, computeEloPercentile } from '@dotprotocol/arena';

// Single match
const { newRating, delta } = updateElo({
  rating:         1500,
  opponentRating: 1600,
  outcome:        'win',   // 'win' | 'draw' | 'loss'
  K:              32,
});

// Bulk from history
const rating = computeEloFromMatches(ELO_DEFAULT, matchHistory);

// Where does this rating fall?
const pct = computeEloPercentile(1720, allRatings); // 0.87 = top 13%

License

MIT