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

@moxie-markets/sdk

v0.1.0

Published

TypeScript SDK for Moxie Markets Prediction Perp DEX

Downloads

12

Readme

Prediction Perp DEX SDK

The TypeScript SDK for interacting with the Moxie Markets Prediction Perp DEX on Solana. This SDK provides a comprehensive interface for traders, keepers, and protocol administrators.

Features

  • Protocol Management: Initialize protocol, add markets, update global state
  • User Operations: Deposit/withdraw collateral, place orders (limit/market), manage positions
  • Polymarket Integration: Fetch real-world prediction markets and prices
  • Keeper Services: Automated price updates, liquidations, funding rate updates, and order matching

Installation

npm install @moxie-markets/sdk

Prerequisites

Before running any tests or scripts, ensure you have a local Solana validator running and the program deployed.

  1. Start Local Validator:

    solana-test-validator
  2. Deploy Program: In the root of the project (parent directory):

    anchor build
    anchor deploy

Testing Guide

We provide several scripts to test different parts of the system.

🚀 End-to-End Test (Recommended)

The best way to see the system in action. This script fetches live data from Polymarket, creates a corresponding market on Solana, and performs a full lifecycle test (deposit, trade, settle).

npm run test:e2e
# or
npx ts-node test-e2e-polymarket.ts

🤖 Keeper Service Test

Tests the automated keeper functionality including price updates, liquidations, and order filling.

npm run test:keeper
# or
npx ts-node test-keeper.ts

🔮 Polymarket Data Test

Fetches popular markets from Polymarket to verify API connectivity and data format.

npm run test:polymarket
# or
npx ts-node test-polymarket.ts

🛠️ Basic SDK Integration

Simple test for basic protocol initialization and user operations (deposit/withdraw) without external dependencies.

npm run test:integration
# or
npx ts-node test-sdk.ts

Usage Example

import { Connection, Keypair } from "@solana/web3.js";
import { PredictionClient, IWallet } from "@pred-perp-dex/sdk";

// 1. Setup connection
const connection = new Connection("http://127.0.0.1:8899", "confirmed");

// 2. Initialize Client
const client = new PredictionClient({
  connection,
  wallet: myWallet, // IWallet interface
});

// 3. User Operations
await client.initializeUser();
await client.deposit(solToLamports(1));

// 4. Place Order
await client.placeOrder({
  marketIndex: 0,
  direction: PositionDirection.Long,
  orderType: OrderType.Limit,
  baseAssetAmount: new BN(10_000_000), // 0.1 units
  price: new BN(500_000), // $0.50
  reduceOnly: false,
  postOnly: false,
});

Protocol Initialization

To initialize the protocol on a new network (localnet or devnet):

# For localnet
npm run init:localnet

# For devnet
npm run init:devnet

Extensive Docs/Guide

Coming soon...