Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.getelyra.xyz/llms.txt

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

DFlow is a Solana-native prediction market platform that tokenizes Kalshi markets on-chain. Elyra integrates DFlow alongside Polymarket so you can query Solana-native orderbooks, inspect taker flow, and compare odds across platforms — all without an API key. Responses are cached for 60 seconds on the server to keep latency low under repeated queries.

Natural language usage

You can query DFlow markets through Elyra’s assistant using plain language.
"Show me DFlow prediction markets"
"Find arbitrage opportunities on DFlow"
"What's the taker flow on [market]?"

What DFlow provides through Elyra

Solana-native orderbooks — Direct access to DFlow’s on-chain order matching. Every market has a live YES and NO price derived from the current book state, not a delayed feed. Taker flow analysis — Identifies whether large orders are hitting bids or lifting asks. This asymmetry is a leading indicator for directional conviction before it shows up in price. Cross-book line shopping — Compares DFlow odds against Polymarket for the same underlying event. When the two platforms disagree on probability, Elyra surfaces the divergence. Structural arbitrage detection — Surfaces correlated markets with divergent pricing across the DFlow universe so you can act before the spread closes.

API endpoint

The DFlow prediction market endpoint is a Next.js route handler at /api/prediction-market. It accepts a single GET request and returns either a list of active markets or a single market by ticker.
GET /api/prediction-market

Query parameters

ticker
string
Market ticker to look up. When provided, the endpoint returns a single DFlowMarket object for that ticker. The value is normalised to uppercase before the lookup. If the exact ticker is not found, the endpoint attempts a search fallback and then a fuzzy match against active markets before returning an error object.When omitted, the endpoint returns a list of the most active markets.
limit
integer
Maximum number of markets to return when ticker is not provided. Defaults to 8. The value is clamped server-side to a maximum of 25.

Response — list mode

When ticker is not provided, the response has type: "list" and data is an array of DFlowMarket objects.
{
  "type": "list",
  "data": [
    {
      "id": "KXBTCD-25DEC31-T95000",
      "ticker": "KXBTCD-25DEC31-T95000",
      "title": "Will BTC close above $95,000 on Dec 31, 2025?",
      "description": "Resolves YES if BTC/USD closes above $95,000...",
      "yes_price": "0.61",
      "no_price": "0.39",
      "yes_probability": "61%",
      "volume": "$4.20M",
      "category": "crypto",
      "end_date": "2025-12-31T00:00:00Z",
      "success": true
    }
  ]
}
type
string
Always "list" in this mode.
data
array
Array of DFlowMarket objects. See the field definitions below. If DFlow returns no active markets, the array contains a single error object with success: false.

Response — single market mode

When ticker is provided, the response has type: "single" and data is a single DFlowMarket object.
{
  "type": "single",
  "data": {
    "id": "KXBTCD-25DEC31-T95000",
    "ticker": "KXBTCD-25DEC31-T95000",
    "title": "Will BTC close above $95,000 on Dec 31, 2025?",
    "yes_price": "0.61",
    "no_price": "0.39",
    "yes_probability": "61%",
    "volume": "$4.20M",
    "success": true
  }
}
type
string
Always "single" in this mode.
data
object
A single DFlowMarket object. When the ticker cannot be found after all fallbacks are exhausted, success is false and error contains a human-readable explanation.

DFlowMarket fields

id
string
Market identifier. Falls back to ticker when an explicit ID is not present in the DFlow response.
ticker
string
Normalised market ticker, for example KXBTCD-25DEC31-T95000.
title
string
Human-readable market title. Falls back to eventTitle when title is absent in the upstream response.
description
string
Optional longer description of the market’s resolution criteria.
yes_price
string
Current YES price as a decimal string rounded to two places, for example "0.61".
no_price
string
Current NO price as a decimal string rounded to two places, for example "0.39". Derived from 1 − yes_price when the upstream field is absent.
yes_probability
string
YES probability expressed as a rounded percentage string, for example "61%".
volume
string
Total traded volume formatted as a dollar amount in millions, for example "$4.20M".
category
string
Market category string when available, such as "crypto" or "politics". Falls back to the first tag in the tags array if category is absent.
end_date
string
ISO 8601 expiration date string when available. Maps from the upstream expirationDate or endDate field.
success
boolean
true when the market was fetched and normalised successfully. false when the upstream API returned an error or the ticker could not be resolved after all fallbacks.
error
string
Present only when success is false. Contains the upstream error message and, for ticker lookups, a hint to use "Show active prediction markets" to retrieve valid tickers.

Ticker lookup fallbacks

When you query a specific ticker, the endpoint attempts three resolution strategies in order before returning an error:
  1. Direct lookupGET /api/v1/market/{ticker} against the DFlow API.
  2. Search endpointGET /api/v1/markets?search={ticker}&limit=50. Returns an exact match if the normalised ticker matches, or the closest result otherwise.
  3. Active market fuzzy match — Fetches up to 50 active markets and checks for exact ticker equality, substring containment, or title match against the requested ticker.
DFlow is currently in development. The API connects to a development environment, and tickers available in the current dataset may not yet reflect the full production catalogue. If a specific ticker is unavailable, ask Elyra to “show active prediction markets” to retrieve the current list of valid tickers.