pnp-markets-solana
What it does
This skill covers creating and running prediction markets on Solana with any token as collateral. It is for developers and agent builders who want to launch or trade binary outcome markets.
When to use it
- ✓When you want to create a prediction market on Solana.
- ✓When you need to trade YES or NO outcome tokens or settle a market as an oracle.
- ✓When you want a social media market, such as one based on Twitter or YouTube data.
Skill link
https://github.com/internet-court/internet-court-skill/blob/main/vendored/pnp/pnp-solana/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you help me create a Solana prediction market on whether a token will reach a price target by next month?”
5 new skills a week. 1 minute to read.
How it works
The agent works through the market type you pick, such as AMM, peer-to-peer, or custom oracle, and sets up the question, collateral, and resolution rules. It then helps with trading, settlement, and redeeming winning positions.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
PNP Markets (Solana)
Create and manage prediction markets on Solana with any SPL token collateral. Supports V2 AMM markets, P2P direct bets, custom oracle resolution for AI agents, and social media markets (Twitter, YouTube, DeFiLlama).
When to Use This Skill
Use when the user wants to:
- Create prediction markets on Solana (V2 AMM, P2P, or custom oracle)
- Trade on markets (buy/sell YES/NO outcome tokens)
- Settle markets as an oracle after the trading period ends
- Redeem winning positions after settlement
- Create social media markets (Twitter engagement, YouTube views, DeFiLlama metrics)
- Use custom tokens as prediction market collateral (any SPL token including Token-2022)
- Build autonomous AI agents that create, trade, and resolve markets
- Build info finance infrastructure using market prices as probability signals
Triggers: prediction market, betting, oracle, settlement, forecast, YES/NO, outcome token, market resolution, P2P bet, custom oracle, social media market, autonomous market, info finance, market creation, prediction, wager, binary outcome
Do not use when:
- The task is generic Solana wallet operations (use solana-dev-skill instead)
- The task is token swaps/DEX trading without prediction markets (use jupiter-skill)
- The task is NFT-related (use metaplex-foundation/skill)
- The task is about other prediction market protocols (use their specific skill)
Program IDs & Core Constants
| Item | Address | Notes |
|---|---|---|
| PNP Program (Mainnet) | 8PyE2dizL52ga7ytqLtqRyjwWp4yXEx8M5Z4BAHgHuTb |
Main prediction market program |
| PNP Program (Devnet) | pnpkv2qnh4bfpGvTugGDSEhvZC7DP4pVxTuDykV3BGz |
Devnet testing program |
| USDC Mint | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v |
Common collateral (6 decimals) |
| USDT Mint | Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB |
Alternative stable (6 decimals) |
| WSOL Mint | So11111111111111111111111111111111111111112 |
Wrapped SOL (9 decimals) |
Precision Reference
| Token Type | Decimals | Example |
|---|---|---|
| USDC / USDT | 6 | 1 USDC = 1_000_000n |
| SOL (wrapped) | 9 | 1 SOL = 1_000_000_000n |
| Decision tokens (YES/NO) | 6 | Minted per-market by the program |
// Conversion helpers
const usdcToRaw = (amount: number) => BigInt(Math.floor(amount * 1_000_000));
const daysFromNow = (days: number) => BigInt(Math.floor(Date.now() / 1000) + days * 86400);
// Example
const liquidity = usdcToRaw(100); // 100 USDC -> 100_000_000n
const endTime = daysFromNow(7); // 7 days from now -> Unix timestamp as bigint
[!IMPORTANT] Collateral can be any SPL token or Token-2022 token. Pass the token's mint address as
baseMintorcollateralTokenMint. Make sure to use the correct decimals for the chosen token (e.g., USDC/USDT = 6, SOL = 9). Common mints are listed in the table above for reference.
Prerequisites
- Solana Wallet: Base58-encoded private key with SOL for fees (~0.05 SOL minimum)
- Collateral Tokens: Any SPL token (including Token-2022) for market liquidity — USDC, USDT, SOL, or any custom token
- RPC Endpoint: Mainnet RPC URL (public or dedicated like Helius/QuickNode)
# Install dependencies
cd scripts && npm install
# Set environment variables
export PRIVATE_KEY=<base58_private_key>
export RPC_URL=https://api.mainnet-beta.solana.com # or dedicated RPC
Quick Start
import { PNPClient } from 'pnp-sdk';
import { PublicKey } from '@solana/web3.js';
const client = new PNPClient(
process.env.RPC_URL || 'https://api.mainnet-beta.solana.com',
process.env.PRIVATE_KEY! // Base58 string or Uint8Array
);
// Collateral can be any SPL token (including Token-2022) — use the mint address of your chosen token
const USDC = new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');
// Create a prediction market
const result = await client.market.createMarket({
question: 'Will Bitcoin reach $100K by end of 2025?',
initialLiquidity: 1_000_000n, // 1 USDC (6 decimals) — adjust decimals for your collateral token
endTime: BigInt(Math.floor(Date.now() / 1000) + 30 * 24 * 60 * 60),
baseMint: USDC, // Any SPL or Token-2022 mint
});
console.log('Market created:', result.market.toBase58());
// Returns: { signature: string, market: PublicKey }
[!TIP] Use `PNPClient.parseSecretKey(process.env.PRIV
FAQ
What kinds of markets does it cover?
The skill covers V2 AMM markets, peer-to-peer bets, and custom oracle markets.
Can I use any token as collateral?
Yes. The skill says any SPL token, including Token-2022, can be used.
Is this for generic token swaps?
No. The skill says token swaps without prediction markets belong to a different skill.
Details
Original description by the author
Create, trade, and settle permissionless prediction markets on Solana. Use when building prediction market infrastructure, creating social media markets (Twitter/YouTube/DeFiLlama), setting up custom oracle resolution, P2P betting, or autonomous agent-driven forecasting. Supports V2 AMM, P2P (V3), and custom oracle markets with any SPL token collateral (including Token-2022).
Popularity
- GitHub stars
- 7.0k
- Ranking position
- #13672
- License
- —
- Updated
- 10/26/2026
Comments
- …
More skills from this repository
internet-court
7.0kHelps your agent pay, hire, or deal safely with another AI agent or paid service, and points it to the right specialized guide.
genlayer-erc7710-connector
7.0kHelps your agent connect an AI review result to a permission system, so a bad review can limit or cancel an agent's permissions.
genlayer-intelligent-contracts
7.0kHelps your agent define the rules, evidence and outputs of an AI judge that checks whether another agent followed its mandate.
x402-erc7710
7.0kHelps your agent pay for web services one request at a time, and set up ongoing spending that stays within a permission budget.
Similar skills
blucli
394kHelps your agent find, play, pause, group, and adjust the volume of Bluesound and NAD speakers through the blu command.
camsnap
394kHelps your agent grab snapshots, short clips, or motion events from network cameras and local webcams that you have set up.
eightctl
394kHelps your agent check and control an Eight Sleep pod, including its temperature, alarms, and sleep schedules.