MetEngine Data Agent API – Complete Skill File
This is the authoritative skill manifest for Claude Code agents working with MetEngine's real-time smart money analytics API.
Core Service Details
MetEngine Data Agent provides 63 endpoints spanning three platforms:
- Polymarket (27 endpoints): prediction market analytics
- Hyperliquid (18 endpoints): perpetual futures trader intelligence
- Meteora (18 endpoints): Solana LP/AMM pool analytics
Base URL: https://agent.metengine.xyz
Payment: x402 protocol on Solana Mainnet (USDC). No API keys required—payment IS authentication.
Quick Start: Session Memory System
Before making any API call, check for ~/.claude/agents/metengine-memory.md. This persistent file eliminates repetitive setup and saves ~80% of setup tokens by storing:
- Wallet keypair path and public address (never the private key)
- Confirmed installed packages (
@x402/core,@x402/svm,@solana/kit) - Working bootstrap code snippet (copy-paste ready)
- Endpoint performance history (timeouts, fallbacks, costs)
- Quirks and known issues
Update rules:
- After first successful setup -> record wallet, packages, bootstrap code
- After every API call -> append to Endpoint History (keep last 10 rows)
- When using a fallback -> record in Fallbacks Learned section
- At session end -> update Last Updated timestamp
New agents: Create the memory file after initial onboarding. Returning agents: Read memory first, skip setup if installed: true.
Payment Flow (x402 on Solana Mainnet)
All paid endpoints follow a two-step handshake:
Step 1 (Agent -> API): Send initial request
- Returns:
402 Payment Requiredwith encoded price
Step 2 (Agent -> Solana -> API): Sign and re-send
- Agent signs payment locally using
@x402/core - Sends second request with
PAYMENT-SIGNATUREheader - API verifies on-chain, executes query, settles payment
- Returns:
200with data + settlement proof (tx hash)
Key rule: Payment only settles on successful 2xx responses. Timeouts and errors incur no charge.
Client Bootstrap (TypeScript/Bun)
import { x402Client, x402HTTPClient } from "@x402/core/client";
import { registerExactSvmScheme } from "@x402/svm/exact/client";
import { toClientSvmSigner } from "@x402/svm";
import { getBase58Encoder, createKeyPairSignerFromBytes } from "@solana/kit";
const bytes = getBase58Encoder().encode(process.env.SOLANA_PRIVATE_KEY!);
const signer = await createKeyPairSignerFromBytes(bytes);
const client = new x402Client();
registerExactSvmScheme(client, { signer: toClientSvmSigner(signer) });
const httpClient = new x402HTTPClient(client);
const BASE_URL = "https://agent.metengine.xyz";
async function paidFetch(path, options = {}) {
const url = `${BASE_URL}${path}`;
const initial = await fetch(url, options);
if (initial.status !== 402) throw new Error(`Expected 402, got ${initial.status}`);
const paymentRequired = httpClient.getPaymentRequiredResponse(
(name) => initial.headers.get(name), await initial.json()
);
const price = Number(paymentRequired.accepts[0].amount);
const paymentPayload = await httpClient.createPaymentPayload(paymentRequired);
const paymentHeaders = httpClient.encodePaymentSignatureHeader(paymentPayload);
const paid = await fetch(url, { ...options, headers: { ...paymentHeaders } });
if (paid.status !== 200) throw new Error(`Payment failed: ${paid.status}`);
const settlement = httpClient.getPaymentSettleResponse((name) => paid.headers.get(name));
return { data: (await paid.json()).data, settlement, price };
}
Install dependencies: bun add @x402/core @x402/svm @solana/kit
Pricing Structure
All prices in USDC on Solana Mainnet. Pricing endpoint (free, no payment):
GET https://agent.metengine.xyz/api/v1/pricing
Tier base costs:
- Light: $0.01
- Medium: $0.02
- Heavy: $0.05
- Whale: $0.08
Multipliers applied:
- Timeframe: 0.5x (1h) to 5.0x (365d/all)
- Limit scaling:
max(1, requested_limit / default_limit) - Category filter: 0.7x discount
- Condition_id / pool_address filter: 0.5x discount
- Smart_money_only: 0.7x discount
Hard caps: Floor $0.01 per request, ceiling $0.20 per request.
Special endpoints: /markets/opportunities capped at $0.15; /wallets/copy-traders capped at $0.12.
Health & Monitoring
GET https://agent.metengine.xyz/health
Free endpoint. Returns component status (ClickHouse, Postgres, Redis), active request count, semaphore limits, and error stats.
Display Rule: Full Addresses Always
Never truncate or trim wallet/contract addresses. Always show full addresses (e.g. 0x61276aba49117fd9299707d5d573652949d5c977, not 0x6127...c977). This applies to all hex addresses (Polymarket, Hyperliquid), base58 pubkeys (Meteora), condition_ids, token_ids, and tx hashes.
Polymarket (27 Endpoints)
| # | Tier | Path | Purpose |
|---|---|---|---|
| 1 | M | GET /api/v1/markets/trending | Volume spikes, timeframe filter |
| 2 | L | GET /api/v1/markets/search | Keyword/category/status, accepts Polymarket URLs |
| 3 | L | GET /api/v1/markets/categories | List categories with activity stats |
| 4 | L | GET /api/v1/platform/stats | Platform aggregates (volume, trades, wallets) |
| 5 | H | POST /api/v1/markets/intelligence | Smart money consensus, top wallets, signal analysis |
| 6 | L | GET /api/v1/markets/price-history | OHLCV time series per outcome |
| 7 | M | POST /api/v1/markets/sentiment | Sentiment time series with smart money overlay |
| 8 | M | POST /api/v1/markets/participants | Participant distribution by tier |
| 9 | H | POST /api/v1/markets/insiders | 7-signal behavioral insider detection |
| 10 | L | GET /api/v1/markets/trades | Chronological trade feed, side/min_usdc filter |
| 11 | W | GET /api/v1/markets/similar | Related markets by wallet overlap |
| 12 | W | GET /api/v1/markets/opportunities | Smart money vs price disagreement |
| 13 | H | GET /api/v1/markets/high-conviction | High-conviction bets (fallback for #12) |
| 14 | M | GET /api/v1/markets/capital-flow | Sector rotation, smart_money_only filter |
| 15 | M | GET /api/v1/trades/whales | Large trades, condition_id/category filter |
| 16 | M | GET /api/v1/markets/volume-heatmap | Volume by category/hour/day |
| 17 | H | POST /api/v1/wallets/profile | Full dossier: score, positions, trades |
| 18 | M | POST /api/v1/wallets/activity | Recent activity by timeframe |
| 19 | M | POST /api/v1/wallets/pnl-breakdown | Per-market PnL with best/worst trades |
| 20 | W | POST /api/v1/wallets/compare | 2-5 wallets side-by-side |
| 21 | W | POST /api/v1/wallets/copy-traders | Detect lag, detect overlap (max $0.12) |
| 22 | H | GET /api/v1/wallets/top-performers | Leaderboard (2x penalty without category) |
| 23 | H | GET /api/v1/wallets/niche-experts | Category specialists |
| 24 | L | GET /api/v1/markets/resolutions | Resolved markets + smart money accuracy |
| 25 | H | GET /api/v1/wallets/alpha-callers | Early traders on trending markets |
| 26 | M | GET /api/v1/markets/dumb-money | Low-score positions (contrarian) |
| 27 | H | GET /api/v1/wallets/insiders | Global insider candidates |
Key quirks:
- Wallet addresses MUST be lowercase.
/trades/whalesreturns REDEEM trades (resolved payouts) withprice=1.00, side=REDEEM. Filter byside=BUY|SELLto exclude./markets/opportunities(504) -> fallback to/markets/high-conviction.- Price = implied probability (0 to 1).
Hyperliquid (18 Endpoints)
| # | Tier | Path | Purpose |
|---|---|---|---|
| 28 | L | GET /api/v1/hl/platform/stats | Platform aggregates |
| 29 | M | GET /api/v1/hl/coins/trending | Trending by activity (use 7d if 24h empty) |
| 30 | L | GET /api/v1/hl/coins/list | All coins with 7d stats |
| 31 | M | GET /api/v1/hl/coins/volume-heatmap | Volume by coin/hour |
| 32 | H | GET /api/v1/hl/traders/leaderboard | Ranked by PnL/ROI/Sharpe/win_rate |
| 3 |