Skip to main content

Documentation Index

Fetch the complete documentation index at: https://pond.dflow.net/llms.txt

Use this file to discover all available pages before exploring further.

During development, you can use the developer endpoints without an API key. For production use, request an API key for higher rate limits.
Use this instead of looping GET /market/{ticker}.

Mixed ticker + mint lookup

Unknown IDs are dropped silently; the response only contains markets that resolved.
import "dotenv/config";

const DFLOW_METADATA_API_URL = process.env.DFLOW_METADATA_API_URL ?? "https://dev-prediction-markets-api.dflow.net";
const DFLOW_API_KEY = process.env.DFLOW_API_KEY; // optional; not needed for dev endpoints

const headers: HeadersInit = { "Content-Type": "application/json" };
if (DFLOW_API_KEY) headers["x-api-key"] = DFLOW_API_KEY;

const res = await fetch(`${DFLOW_METADATA_API_URL}/api/v1/markets/batch`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    tickers: ["MARKET_TICKER_1_HERE", "MARKET_TICKER_2_HERE"],
    mints: ["OUTCOME_OR_LEDGER_MINT_1_HERE", "OUTCOME_OR_LEDGER_MINT_2_HERE"],
  }),
});

const { markets, cursor } = await res.json();

console.log(`Resolved ${markets.length} of the requested IDs`);
for (const m of markets) {
  console.log(`  ${m.ticker}  status=${m.status}  yesBid=${m.yesBid ?? "n/a"}`);
}
Combined cap is 100. Chunk client-side for larger lists.

Build a positions dashboard

Feed filter_outcome_mints results straight into markets/batch:
// `tokenMints` is the list of SPL token mint addresses found in a wallet
// (the `mint` field on each entry from connection.getParsedTokenAccountsByOwner).
// These are NOT wallet addresses; they're token mint addresses.
// See the Track Positions recipe for how to fetch them from a wallet.
const tokenMints: string[] = [
  "SPL_TOKEN_MINT_1_HERE",
  "SPL_TOKEN_MINT_2_HERE",
];

// Step 1: filter down to just the outcome token mints
const filterRes = await fetch(`${DFLOW_METADATA_API_URL}/api/v1/filter_outcome_mints`, {
  method: "POST",
  headers,
  body: JSON.stringify({ addresses: tokenMints }),
}).then((r) => r.json());

const outcomeMints: string[] = filterRes.outcomeMints ?? [];

if (outcomeMints.length > 0) {
  // Step 2: fetch the full market object for each in one call
  const batchRes = await fetch(`${DFLOW_METADATA_API_URL}/api/v1/markets/batch`, {
    method: "POST",
    headers,
    body: JSON.stringify({ mints: outcomeMints.slice(0, 100) }),
  }).then((r) => r.json());

  for (const market of batchRes.markets) {
    console.log(market.ticker, market.title, market.status);
  }
}

Find Markets

Discover markets by category, tag, status, or series.

Identify a Market From a Mint

Reverse-lookup a market and side from any ledger or outcome mint.

Track User Positions

Full portfolio view with balances and market metadata.

API Routes