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

@sudobility/heavymath_contracts

v0.1.60

Published

Multi-chain prediction market system with UUPS upgradeable contracts, dual-boundary market splits, and a unified TypeScript client for EVM chains and Solana.

Downloads

3,299

Readme

@sudobility/heavymath_contracts

Multi-chain prediction market smart contracts and TypeScript SDK for EVM chains. Features a percentage-based prediction mechanism with dual-boundary market split settlement.

Installation

bun add @sudobility/heavymath_contracts

Usage

import { PredictionClient } from '@sudobility/heavymath_contracts';
import { EVMPredictionClient } from '@sudobility/heavymath_contracts/evm';

const client = new EVMPredictionClient({
  predictionMarket: '0x...',
  stakeToken: '0x...', // USDC address (optional, resolved on-chain)
});

// Place a prediction (auto-approves ERC20)
await client.placePrediction(walletContext, marketId, 60, 1_000_000n);

// Create a market (requires Dealer NFT)
await client.createMarket(walletContext, {
  tokenId: 1n,
  category: 1n,
  subCategory: 2n,
  deadline: BigInt(Math.floor(Date.now() / 1000) + 86400),
  description: 'Team A wins',
});

// Read market state
const market = await client.getMarket(publicClient, marketId);

Smart Contracts

Three UUPS-upgradeable Solidity 0.8.24 contracts:

  • PredictionMarket -- core market lifecycle (create, predict, resolve, claim)
  • DealerNFT -- ERC721 licensing with category/subcategory permissions
  • OracleResolver -- oracle registration and data feeds

How It Works

  1. Dealers create markets with a deadline
  2. Users place predictions at a percentage (0-100) with USDC
  3. At deadline, the market split is calculated across the percentage spectrum
  4. Winners on the resolved side of the split share the losing side's effective stakes proportionally
  5. Fees: winner fee (default 1%, max 10%) split between dealer and platform (default 50/50)

Development

bun run compile:evm    # Compile Solidity
bun run test:evm       # Run Hardhat tests
bun run build          # Build all (evm + unified + react-native TS)
bun run lint           # ESLint check
bun run typecheck      # TypeScript check
bun run deploy:evm:sepolia  # Deploy to Sepolia

SDK Entry Points

| Import | Description | | ------------------------------------- | -------------------------- | | @sudobility/heavymath_contracts | Unified PredictionClient | | @sudobility/heavymath_contracts/evm | EVMPredictionClient (viem) |

Related Packages

  • @sudobility/heavymath_types -- shared type definitions
  • @sudobility/heavymath_indexer_client -- indexer API client
  • @sudobility/heavymath_lib -- business logic hooks
  • heavymath_app -- frontend web application

License

BUSL-1.1