DEVELOPER

Public API — v2

Free, unauthenticated REST API for market prices, candles, trades, protocol stats. No API key required. CORS enabled for browser access. pokeliquid v2 is a custodial perps engine: prices come from our TCGPlayer oracle (5-minute cycles, EWMA-smoothed with a circuit breaker) and every response below is live from the engine.

BASE URLhttps://www.pokeliquid.xyz/api/keeper
Auth
None required
Format
JSON
CORS
Enabled (all origins)
Units
USD, except /prices/all and exposure fields = micro-USD (x1e6)

Markets

128 active markets across Pokemon TCG cards and set indices (129 defined; one currently inactive). Query parameters accept the market ID from /prices/all — e.g. ?market=CHARIZARD-151, ?market=MODERN-INDEX. Unknown markets return 400 {"error":"Unknown market: ..."}.

For the full list of market IDs, call /prices/all.

Endpoints

GET/ping

Liveness probe. Returns server status and timestamp.

EXAMPLE
curl https://www.pokeliquid.xyz/api/keeper/ping
RESPONSE
{
  "ok": true,
  "timestamp": "2026-12-01T07:30:00.101Z"
}
GET/health

Comprehensive system health: oracle freshness (degraded >10 min stale, critical >30 min), liquidation watcher, funding, protocol reserves, engine mode.

EXAMPLE
curl https://www.pokeliquid.xyz/api/keeper/health
RESPONSE
{
  "status": "healthy",
  "timestamp": "2026-12-01T07:30:00.082Z",
  "oracle": { "last_update": "2026-12-01T07:29:31.000Z", "seconds_since_update": 29 },
  "liquidation": { "accounts_monitored": 1, "last_check": "2026-12-01T07:30:00.082Z" },
  "funding": { "settlements_24h": 0 },
  "protocol": { "open_positions": 1, "lp_pool": 10.88, "insurance_fund": 1.21 },
  "keeper": { "mode": "usdc-v2", "uptime_minutes": 15 }
}
GET/prices/all

All market prices at once, keyed by market ID. IMPORTANT: price and ewma here are micro-USD integers (multiply by 1e-6 to get dollars: 121210000 = $121.21). lastUpdateTime is a unix timestamp.

EXAMPLE
curl https://www.pokeliquid.xyz/api/keeper/prices/all
RESPONSE
{
  "GRENINJA": { "price": 121210000, "ewma": 121210000, "lastUpdateTime": 1796110722 },
  "GENGAR": { "price": 527340000, "ewma": 527340000, "lastUpdateTime": 1796110722 },
  ... // 128 markets
}
GET/prices

Historical oracle price data for one market: raw scraped price, EWMA-smoothed price, and deviation, oldest-first. These values are plain USD (unlike /prices/all).

QUERY PARAMETERS
ParamTypeDefaultDescription
marketstringrequiredMarket ID (e.g. CHARIZARD-151, MODERN-INDEX). See /prices/all for the full list.
limitnumber50Number of data points (max 500)
fromnumber—Unix timestamp range start (with to)
tonumber—Unix timestamp range end (with from)
EXAMPLE
curl "https://www.pokeliquid.xyz/api/keeper/prices?market=CHARIZARD-151&limit=2"
RESPONSE
[
  { "timestamp": 1796110053, "raw_price": 290.73, "ewma": 290.73, "deviation": 0 },
  { "timestamp": 1796110725, "raw_price": 290.73, "ewma": 290.73, "deviation": 0 }
]
GET/candles

OHLC candlesticks built from accepted oracle prices (plain USD, no volume). resolution=1d gives daily candles (30 days); any other value gives hourly candles (7 days).

QUERY PARAMETERS
ParamTypeDefaultDescription
marketstringrequiredMarket ID (e.g. CHARIZARD-151, MODERN-INDEX). See /prices/all for the full list.
resolutionstring1hCandle bucket: "1d" (daily) or anything else (hourly)
EXAMPLE
curl "https://www.pokeliquid.xyz/api/keeper/candles?market=CHARIZARD-151&resolution=1h"
RESPONSE
[
  { "timestamp": 1796065200, "open": 291.64, "high": 291.64, "low": 291.64, "close": 291.64 },
  { "timestamp": 1796068800, "open": 291.75, "high": 292.11, "low": 291.71, "close": 291.71 },
  ...
]
GET/trades

Trade history for one wallet, newest-first, with a total count. Rows carry the keeper shape: action (open/close), direction, entry/exit price, pnl, funding_paid, fee_paid, close_reason (close, liquidation, stop_loss, take_profit).

QUERY PARAMETERS
ParamTypeDefaultDescription
walletstringrequiredSolana wallet address
limitnumber20Number of trades (max 100)
EXAMPLE
curl "https://www.pokeliquid.xyz/api/keeper/trades?wallet=WALLET&limit=2"
RESPONSE
{
  "trades": [
    {
      "id": 12, "timestamp": 1796092271, "user_pubkey": "indexsmoke",
      "position_index": 7, "action": "close", "direction": "long",
      "collateral": 100, "notional": 500, "leverage": 5,
      "entry_price": 36621.31, "exit_price": 36621.31,
      "pnl": 0, "funding_paid": 0, "fee_paid": 5,
      "tx_signature": "", "close_reason": "close"
    },
    ...
  ],
  "total": 2
}
GET/trades/recent

Most recent trades across all users (opens, closes, liquidations). Same row shape as /trades.

QUERY PARAMETERS
ParamTypeDefaultDescription
limitnumber50Number of trades (max 200)
EXAMPLE
curl "https://www.pokeliquid.xyz/api/keeper/trades/recent?limit=2"
RESPONSE
{
  "trades": [
    {
      "id": 13, "timestamp": 1796100648, "user_pubkey": "uidesign",
      "position_index": 8, "action": "open", "direction": "long",
      "collateral": 100, "notional": 200, "leverage": 2,
      "entry_price": 20846.209600000006, "exit_price": null,
      "pnl": null, "funding_paid": null, "fee_paid": 1,
      "tx_signature": "", "close_reason": null
    },
    ...
  ]
}
GET/events/recent

Recent engine events (position closes including liquidations). The data field is a JSON string.

QUERY PARAMETERS
ParamTypeDefaultDescription
limitnumber10Number of events (max 50)
EXAMPLE
curl "https://www.pokeliquid.xyz/api/keeper/events/recent?limit=2"
RESPONSE
{
  "events": [
    {
      "id": 5, "timestamp": 1796092271, "market_id": "MODERN-INDEX",
      "kind": "close",
      "data": "{\"pos\":7,\"user\":\"indexsmoke\",\"mark\":36621.31,\"pnl\":0}"
    }
  ]
}
GET/stats

Protocol-wide statistics for the last 24 hours and 7 days. All values are USD.

EXAMPLE
curl https://www.pokeliquid.xyz/api/keeper/stats
RESPONSE
{
  "total_volume_24h": 1200,
  "total_volume_7d": 1200,
  "total_trades_24h": 3,
  "total_liquidations_24h": 0,
  "total_fees_24h": 7,
  "unique_traders_24h": 2
}
GET/leaderboard

Top 50 traders ranked by lifetime realized PnL (closed positions only).

EXAMPLE
curl https://www.pokeliquid.xyz/api/keeper/leaderboard
RESPONSE
{
  "leaderboard": [
    { "user": "indexsmoke", "pnl": 0, "trades": 1 },
    ...
  ]
}
GET/protocol

Protocol reserves (lp_pool, insurance, platform_fees — plain USD) plus engine constants. fee_bps, base_funding_rate_per_hour and skew_factor are basis points; maintenance_ratio is the liquidation threshold (margin ratio < 2%); total_long_exposure, total_short_exposure and total_oi are micro-USD (x1e6, divide by 1e6 for dollars).

EXAMPLE
curl https://www.pokeliquid.xyz/api/keeper/protocol
RESPONSE
{
  "lp_pool": 11.16,
  "insurance": 1.24,
  "platform_fees": 17.5,
  "fee_bps": 100,
  "min_position_size": 1000000,
  "max_leverage": 5,
  "profit_cap_bps": 30000,
  "base_funding_rate_per_hour": 0,
  "skew_factor": 0,
  "maintenance_ratio": 0.02,
  "total_long_exposure": 200000000,
  "total_short_exposure": 0,
  "total_oi": 200000000
}
GET/oi

Open interest for one market, micro-USD (x1e6). max_long_oi / max_short_oi are that market's per-side caps (0 = uncapped). Unknown markets return zeros.

QUERY PARAMETERS
ParamTypeDefaultDescription
marketstringrequiredMarket ID (e.g. CHARIZARD-151, MODERN-INDEX)
EXAMPLE
curl "https://www.pokeliquid.xyz/api/keeper/oi?market=CHARIZARD-151"
RESPONSE
{
  "long_oi": 0,
  "short_oi": 0,
  "max_long_oi": 19708000000,
  "max_short_oi": 19708000000
}

Code Examples

JavaScript / TypeScript
const BASE = "https://www.pokeliquid.xyz/api/keeper";

// Latest Charizard 151 price (/prices/all is micro-USD — divide by 1e6)
const all = await fetch(BASE + "/prices/all").then(r => r.json());
console.log("CHARIZARD-151: $" + (all["CHARIZARD-151"].price / 1e6).toFixed(2));

// Get hourly candles (plain USD)
const candles = await fetch(BASE + "/candles?market=CHARIZARD-151&resolution=1h").then(r => r.json());
console.log(candles.length + " candles, latest close: $" + candles.at(-1).close);

// Get protocol stats (USD floats)
const stats = await fetch(BASE + "/stats").then(r => r.json());
console.log("24h volume: $" + stats.total_volume_24h + ", traders: " + stats.unique_traders_24h);
Python
import requests

BASE = "https://www.pokeliquid.xyz/api/keeper"

# Latest prices for all markets (micro-USD -> divide by 1e6)
all = requests.get(f"{BASE}/prices/all").json()
for market in ["CHARIZARD-151", "GRENINJA", "PIKACHU"]:
    if market in all:
        print(market + ": $" + format(all[market]["price"] / 1e6, ".2f"))

# Get recent trades
trades = requests.get(f"{BASE}/trades/recent", params={"limit": 50}).json()
for t in trades["trades"]:
    print(t["action"], t["direction"], t["close_reason"])

Trading model

Trading uses real USDC, with wallet-signed orders that fill at the next oracle price. Maximum leverage is 5x, the fee is 1% of collateral, there is no funding, profit is capped at 3x collateral, and a position is liquidated below a 2% margin ratio. Positions are backed by the LP pool, or by the house when the pool cannot cover them; house winnings may be owed with no deadline.