jupiter-prediction-market

Complete Node.js client for Jupiter Prediction Market API. Use when building AI agents for prediction market trading, portfolio management, or automated trading bots on Solana. Covers: (1) Querying events, markets, orders, positions, payouts, history, and social features, (2) Creating/managing trading positions, (3) Claiming payouts after market settlement, (4) Building autonomous agent workflows for market scanning, opportunity finding, portfolio monitoring, and risk management.

23 stars

Best use case

jupiter-prediction-market is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Complete Node.js client for Jupiter Prediction Market API. Use when building AI agents for prediction market trading, portfolio management, or automated trading bots on Solana. Covers: (1) Querying events, markets, orders, positions, payouts, history, and social features, (2) Creating/managing trading positions, (3) Claiming payouts after market settlement, (4) Building autonomous agent workflows for market scanning, opportunity finding, portfolio monitoring, and risk management.

Teams using jupiter-prediction-market should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/jupiter-prediction-market/SKILL.md --create-dirs "https://raw.githubusercontent.com/jiayaoqijia/cryptoskill/main/skills/defi/jupiter-prediction-market/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/jupiter-prediction-market/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How jupiter-prediction-market Compares

Feature / Agentjupiter-prediction-marketStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Complete Node.js client for Jupiter Prediction Market API. Use when building AI agents for prediction market trading, portfolio management, or automated trading bots on Solana. Covers: (1) Querying events, markets, orders, positions, payouts, history, and social features, (2) Creating/managing trading positions, (3) Claiming payouts after market settlement, (4) Building autonomous agent workflows for market scanning, opportunity finding, portfolio monitoring, and risk management.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Jupiter Prediction Skill v1.0

## Purpose
Enable AI agents to interact with Jupiter Prediction Market API for autonomous trading and portfolio management.

## When to Use
- Build autonomous trading bots or agents
- Query market data, events, and user positions
- Create automated market scanning and opportunity detection
- Monitor portfolio health and risk
- Claim payouts after market settlement

## Scope
- Read/write access to Jupiter Prediction API
- Requires API key from [Jupiter Portal](https://portal.jup.ag)
- All transactions require user signature via Solana wallet
- Beta API - subject to breaking changes

## Quick Start

```javascript
const { JupiterPrediction, parseEventsResponse, formatUsd } = require('./src');

const client = new JupiterPrediction();

const events = await client.list({ category: 'crypto', filter: 'trending', limit: 5 });
const parsed = parseEventsResponse(events);
console.log('Events:', parsed.data.map(e => e.title));
```

## Configuration

```bash
export JUPITER_API_KEY=your-api-key
```

Or use config file `config/api-key.json`.

## Supported Capabilities

### Client Endpoints

| Category | Methods |
|----------|---------|
| Events | `list`, `search`, `getEvent`, `suggested` |
| Markets | `getMarket`, `orderbook` |
| Orders | `create`, `listOrders`, `status`, `cancelOrder` |
| Positions | `listPositions`, `getPosition`, `closePosition`, `closeAllPositions`, `claim` |
| History | `listHistory`, `getHistoryByPosition` |
| Social | `profile`, `pnlHistory`, `trades`, `leaderboards`, `follow/unfollow` |

### Utility Functions

| Function | Description |
|----------|-------------|
| `microUsdToUsd(microUsd)` | Convert micro USD to USD |
| `formatUsd(microUsd, decimals)` | Format as currency string |
| `calculateProbability(yesPrice)` | Implied probability (%) |
| `parseEventsResponse(response)` | Parse event data |
| `parseMarketResponse(market)` | Parse market data |
| `parsePositionsResponse(response)` | Parse position data |
| `filterClaimable(positions)` | Filter claimable positions |
| `filterOpen(positions)` | Filter open positions |
| `aggregatePnL(positions)` | Calculate total P&L |

## Bundled Scripts

Run from project root:

```bash
# Scan markets by criteria
node scripts/scan-markets.js --crypto --limit=10 --min-volume=10000

# Find mispriced opportunities
node scripts/find-opportunities.js --threshold=20 --min-volume=50000

# Monitor portfolio
node scripts/monitor-portfolio.js <wallet-address>

# Auto-claim winnings
node scripts/auto-claim.js <wallet-address> [--dry-run] [--min=1]

# Portfolio health check
node scripts/portfolio-health.js <wallet-address>
```

## Bundled Workflows

The bundled scripts provide complete autonomous agent workflows:

1. **Market Scanner** - Find markets by volume, probability, category
2. **Opportunity Finder** - Detect mispriced markets
3. **Portfolio Monitor** - Track positions, P&L, claimable
4. **Auto-Claim** - Batch claim winnings
5. **Portfolio Health** - Risk checks (position limits, diversification)
6. **Trading Cycle** - Complete discovery → evaluation → execution

## Code Examples

See `src/` for available endpoints and utilities:
- `src/client.js` - Main API client class
- `src/index.js` - Exports and utility functions
- `src/endpoints/` - Individual endpoint modules
- `src/utils/` - Helper functions (parser, prices, errors)

## API Reference

Client methods are documented in code comments. Main classes:
- `JupiterPrediction` - Main client (src/client.js)
- Utility functions in src/index.js

## Verification

Verify syntax:
```bash
node --check src/index.js
node --check src/client.js
```

Run a script (requires JUPITER_API_KEY):
```bash
export JUPITER_API_KEY=your-key
node scripts/scan-markets.js --crypto --limit=5
```

## Version
- v1.0.0

## License
MIT

Related Skills

okx-cex-market

23
from jiayaoqijia/cryptoskill

This skill should be used when the user asks for 'price of BTC', 'ETH ticker', 'show me the orderbook', 'market depth', 'BTC candles', 'OHLCV chart data', 'funding rate', 'open interest', 'mark price', 'index price', 'recent trades', 'price limit', 'list instruments', 'what instruments are available', or any request to query public market data on OKX CEX. All commands are read-only and do NOT require API credentials. Do NOT use for account balance/positions (use okx-cex-portfolio), placing/cancelling orders (use okx-cex-trade), or grid/DCA bots (use okx-cex-bot).

okx-dex-market

23
from jiayaoqijia/cryptoskill

This skill should be used when the user asks about live on-chain market data: token prices, price charts (K-line, OHLC), trade history, or swap activity. Also covers on-chain signals — smart money, whale, and KOL wallet activity, large trades, and signal-supported chains. For meme tokens: scanning new launches (扫链/trenches,golden dog, alpha, pump fun), checking dev wallets, developer reputation, rug pull detection, tokens by same creator, bundle/sniper detection, bonding curves, and meme token safety checks. For token search, market cap, liquidity, trending tokens, or holder distribution, use okx-dex-token instead.

recipe-morning-market-brief

23
from jiayaoqijia/cryptoskill

Generate a morning market summary with prices, volume, and portfolio state.

kraken-market-intel

23
from jiayaoqijia/cryptoskill

Read market state with low-noise data pulls and streaming updates.

gate-info-marketoverview

23
from jiayaoqijia/cryptoskill

Market overview. Use this skill whenever the user asks about overall market. Trigger phrases include: how is the market, market overview, what is happening in crypto. MCP tools: info_marketsnapshot_get_market_overview, info_coin_get_coin_rankings, info_platformmetrics_get_defi_overview, news_events_get_latest_events, info_macro_get_macro_summary.

gate-exchange-marketanalysis

23
from jiayaoqijia/cryptoskill

The market analysis function of Gate Exchange, such as liquidity, momentum, liquidation, funding arbitrage, basis, manipulation risk, order book explainer, slippage simulation. Use when the user asks about liquidity, depth, slippage, buy/sell pressure, liquidation, funding rate arbitrage, basis/premium, manipulation risk, order book explanation, or slippage simulation (e.g. market buy $X slippage). Trigger phrases: liquidity, depth, slippage, momentum, buy/sell pressure, liquidation, squeeze, funding rate, arbitrage, basis, premium, manipulation, order book, spread, slippage simulation.

gate-dex-market

23
from jiayaoqijia/cryptoskill

Gate DEX market data skill. Uses AK/SK authentication to call Gate DEX OpenAPI, providing token and market quote read-only queries. Use when users mention quotes, prices, token information, rankings, security audits.

market-intel

23
from jiayaoqijia/cryptoskill

On-chain and institutional market intelligence — the structural layer beneath price. Use this skill whenever the user asks about: whale activity, exchange flows, token unlocks, ETF inflows/outflows, institutional buying or selling, DeFi TVL, yield opportunities, DEX trending tokens, meme coins, new token launches, market cycle indicators, AHR999, Pi Cycle, rainbow chart, accumulation zone, BTC market cycle, is now a good time to DCA, Coinbase premium, stablecoin supply, on-chain health, ETH gas, BTC fees, mempool, market cap rankings, or anything about what large holders and institutions are doing with their coins.

crypto-market-rank

23
from jiayaoqijia/cryptoskill

Crypto market rankings and leaderboards. Query trending tokens, top searched tokens, Binance Alpha tokens, tokenized stocks, social hype sentiment ranks, smart money inflow token rankings, top meme token rankings from Pulse launchpad, and top trader PnL leaderboards. Use this skill when users ask about token rankings, market trends, social buzz, meme rankings, breakout meme tokens, or top traders.

jupiter-solana-swap

23
from jiayaoqijia/cryptoskill

Execute optimal token swaps on Solana through Jupiter's aggregator with best-route selection across all Solana DEXs.

jupiter-mcp-server

23
from jiayaoqijia/cryptoskill

MCP server for Jupiter DEX aggregator on Solana enabling optimal swap routing for AI agents.

jupiter-agent

23
from jiayaoqijia/cryptoskill

Execute swaps and get quotes on Jupiter, the leading Solana DEX aggregator with best route finding.