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.
Each market has outcome mints (YES and NO, the SPL tokens users hold to take a side) and a ledger mint (the market’s onchain accounting account). Given any of them, the recipe returns the market and the mint’s role.
Resolve a market by mint
Look up a market and detect side
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 DFLOW_SETTLEMENT_MINT = process . env . DFLOW_SETTLEMENT_MINT ?? "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" ; // USDC
const headers : HeadersInit = {};
if ( DFLOW_API_KEY ) headers [ "x-api-key" ] = DFLOW_API_KEY ;
const mintAddress = "OUTCOME_OR_LEDGER_MINT_ADDRESS" ;
const market = await fetch (
` ${ DFLOW_METADATA_API_URL } /api/v1/market/by-mint/ ${ mintAddress } ` ,
{ headers }
). then (( r ) => r . json ());
if ( ! market . accounts ) {
throw new Error ( `No market found for mint " ${ mintAddress } ". Replace with a real outcome or ledger mint. Response: ${ JSON . stringify ( market ) } ` );
}
const accounts = market . accounts [ DFLOW_SETTLEMENT_MINT ];
const role =
mintAddress === accounts . yesMint ? "YES outcome token"
: mintAddress === accounts . noMint ? "NO outcome token"
: mintAddress === accounts . marketLedger ? "market ledger"
: "unknown" ;
console . log ( market . ticker , role );
console . log ( " title:" , market . title );
console . log ( " status:" , market . status );
console . log ( " result:" , market . result || "<undetermined>" );
console . log ( " redemptionStatus:" , accounts . redemptionStatus ?? "<not open>" );
market.accounts is keyed by settlement mint. If you support multiple, iterate Object.entries(market.accounts) instead.
Forecast history from the same mint
Fetch historical forecast percentiles
const now = Math . floor ( Date . now () / 1000 );
const dayAgo = now - 24 * 60 * 60 ;
const params = new URLSearchParams ({
percentiles: "2500,5000,7500" ,
startTs: dayAgo . toString (),
endTs: now . toString (),
periodInterval: "60" ,
});
const history = await fetch (
` ${ DFLOW_METADATA_API_URL } /api/v1/event/by-mint/ ${ mintAddress } /forecast_percentile_history? ${ params } ` ,
{ headers }
). then (( r ) => r . json ());
console . log ( JSON . stringify ( history , null , 2 ));
Response is relayed verbatim from Kalshi.
Find Markets Discover markets by category, tag, status, or series.
Bulk Fetch Markets Hydrate multiple markets and outcome mints in one call.
Monitor Market Lifecycle Track status changes and know when redemption opens.
Prediction Market Data Model Events, markets, outcomes, mints, and how they relate.
API Routes