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

pnpfucius

v2.0.1

Published

PNPFUCIUS - The PNP Exchange SDK & CLI for Solana prediction markets

Readme

PNPFUCIUS

The PNP Exchange CLI & SDK for Solana prediction markets.

npm version License: MIT

"The wise trader predicts with patience"

Features

  • Full PNP Exchange Integration - Create, trade, and settle prediction markets on Solana
  • PNP Oracle Settlement - Built-in LLM oracle for market resolution criteria
  • AMM & P2P Markets - Support for both V2 (AMM) and V3 (P2P) market types
  • Custom Odds - Create markets with custom starting odds
  • Market Discovery - Browse all markets on PNP Exchange
  • Trading Tools - Buy/sell YES/NO tokens with USDC
  • Redemption - Redeem winning positions and claim refunds
  • Interactive CLI - Purple-themed terminal interface with slash commands
  • Helius RPC Integration - Reliable Solana access via Helius
  • No External AI Required - Uses PNP's built-in LLM oracle

Installation

# Install from npm
npm install pnpfucius

# Or clone and install locally
git clone https://github.com/pnp-protocol/pnpfucius.git
cd pnpfucius
npm install

Quick Start

# Run the interactive CLI
npm run pnpfucius

# Run the demo (no wallet required)
npm run demo

Configuration

Create a .env file:

# Required for trading/creating markets
WALLET_KEY=your_base58_private_key

# Helius API key (recommended)
HELIUS_API_KEY=your_helius_api_key

# Network (devnet or mainnet)
NETWORK=devnet

# Optional defaults
DEFAULT_LIQUIDITY=1000000
DEFAULT_DURATION_DAYS=30

Get a free Helius API key at helius.dev

CLI Commands

| Command | Description | |---------|-------------| | /discover | Browse ALL PNP markets | | /create [question] | Create AMM market | | /p2p [question] | Create P2P market | | /odds <percent> <question> | Market with custom odds | | /info <address> | Get market details | | /buy <address> <yes\|no> <usdc> | Buy YES/NO tokens | | /sell <address> <yes\|no> <amount> | Sell tokens | | /prices <address> | Get market prices | | /balance <address> | Check your balances | | /oracle <address> | Get LLM settlement criteria | | /settle <address> <yes\|no> | Settle a market | | /redeem <address> | Redeem winning position | | /refund <address> | Claim refund | | /config | Show configuration | | /tools | List all available tools | | /help | Show help | | /exit | Exit PNPFUCIUS |

SDK Usage

import { createAgent, executeTool } from 'pnpfucius';

// Create an agent
const agent = await createAgent({ verbose: true });

// Create a market
const result = await agent.createMarket({
    question: 'Will BTC reach $150k by March 2026?',
    durationDays: 90,
    liquidity: 1000000n
});
console.log('Market created:', result.market);

// Discover all markets
const markets = await agent.discoverMarkets();
console.log('Found markets:', markets.total);

// Get settlement criteria from PNP Oracle
const criteria = await agent.fetchSettlementCriteria(marketAddress);
console.log('Settlement criteria:', criteria);

// Buy tokens
const trade = await agent.buyTokens({
    marketAddress: '7xKXw9...',
    side: 'yes',
    amountUsdc: 50
});

// Use tools directly
await executeTool('discover_all_markets', {});
await executeTool('get_settlement_criteria', { market_address: '...' });
await executeTool('buy_tokens', { market_address: '...', side: 'yes', amount_usdc: 10 });

Available Tools

Market Creation

  • create_market - Create AMM market
  • create_p2p_market_simple - Create simple P2P market
  • create_amm_market_with_odds - AMM with custom odds
  • create_p2p_market_with_odds - P2P with custom odds
  • create_market_with_oracle - Market with custom oracle

Market Discovery

  • discover_all_markets - Find all PNP markets
  • list_markets - List your markets
  • get_market_info - Market details
  • get_v2_market_info - V2 (AMM) details
  • get_p2p_market_info - P2P details
  • get_market_metadata - Market metadata

Trading

  • buy_tokens - Buy YES/NO tokens
  • sell_tokens - Sell tokens
  • buy_v3_tokens - Buy V3 tokens
  • get_market_prices - Current prices
  • get_balances - Your balances

Settlement (PNP Oracle)

  • get_settlement_criteria - LLM-generated criteria
  • get_settlement_data - Resolution result
  • wait_for_settlement - Wait for criteria
  • settle_market - Settle with outcome

Redemption

  • redeem_position - Redeem winnings
  • redeem_v3_position - Redeem V3
  • redeem_p2p_position - Redeem P2P
  • claim_refund - Claim refund
  • claim_p2p_refund - Claim P2P refund

How It Works

  1. Market Creation: Create prediction markets with YES/NO outcomes on Solana via PNP Exchange protocol

  2. PNP Oracle: Markets use PNP's built-in LLM oracle for settlement criteria and resolution

  3. Trading: Buy/sell outcome tokens using USDC through bonding curves (AMM) or direct P2P

  4. Settlement: Oracle evaluates market conditions and provides resolution

  5. Redemption: Winners redeem tokens for USDC

Testing

npm test

Links

License

MIT