Skip to content

internet-court/internet-court-skill / vendored/pnp/pnp-solana

pnp-markets-solana

Flagged

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).

scripts/market-data.ts

View on GitHub
import { PNPClient } from 'pnp-sdk';
import { PublicKey } from '@solana/web3.js';

// Configuration
const RPC_URL = 'https://api.mainnet-beta.solana.com';
const MARKET_ADDRESS = 'F1g31z3KhACaJDLUFEBQwLiSxm6BdcSHCXDYK2jVNAPU';

async function getComprehensiveMarketInfo(marketId: string) {
    // Initialize a read-only client (no private key needed)
    const client = new PNPClient(RPC_URL);
    const results: any = { marketInfo: null, settlementCriteria: null, settlementData: null };

    try {
        console.log(`Fetching comprehensive information for market: ${marketId}`);

        // 1. Get on-chain market data
        try {
            const marketPK = new PublicKey(marketId);
            const marketStatus = await client.fetchMarket(marketPK);

            results.marketInfo = {
                market: marketStatus.publicKey.toString(),
                question: marketStatus.account.question,
                creator: new PublicKey(marketStatus.account.creator).toString(),
                resolvable: marketStatus.account.resolvable,
                resolved: marketStatus.account.resolved,
                endTime: new Date(Number(marketStatus.account.end_time) * 1000),
                creationTime: marketStatus.account.creation_time
                    ? new Date(Number(marketStatus.account.creation_time) * 1000)
                    : undefined,
                winningToken: marketStatus.account.winning_token_id || null,
            };

            console.log('\nMarket Information:');
            console.log(results.marketInfo);
        } catch (err) {
            console.error(`Error fetching market data: ${err.message}`);
        }

        // 2. Get settlement criteria from proxy
        try {
            results.settlementCriteria = await client.fetchSettlementCriteria(marketId);
            console.log('\nSettlement Criteria:');
            console.log(results.settlementCriteria);
        } catch (err) {
            console.error(`Error fetching settlement criteria: ${err.message}`);
        }

        // 3. Get settlement data from proxy
        try {
            results.settlementData = await client.fetchSettlementData(marketId);
            console.log('\nSettlement Data:');
            console.log({
                answer: results.settlementData.answer || 'Not provided',
                reasoning: results.settlementData.reasoning || 'Not provided'
            });
        } catch (err) {
            console.error(`Error fetching settlement data: ${err.message}`);
        }

        // 4. Determine market state
        let marketState = 'Unknown';
        if (results.marketInfo) {
            if (results.marketInfo.resolved) {
                marketState = 'RESOLVED';
            } else if (!results.marketInfo.resolvable) {
                marketState = 'NOT RESOLVABLE';
            } else {
                const endTime = results.marketInfo.endTime.getTime();
                if (Date.now() > endTime) {
                    marketState = 'ENDED (pending resolution)';
                } else {
                    marketState = 'ACTIVE';
                }
            }
        }

        console.log('\nMarket State Summary:');
        console.log(`State: ${marketState}`);
        if (results.settlementData?.answer) {
            console.log(`Resolution: ${results.settlementData.answer}`);
        }

        return results;
    } catch (err) {
        console.error(`Error getting market info: ${err.message}`);
        throw err;
    }
}

getComprehensiveMarketInfo(MARKET_ADDRESS).catch(console.error);
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 323kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall