Use this file to discover all available pages before exploring further.
General
Spot Trading
Prediction Markets
Proof
Which wallets are supported when using DFlow?
Any Solana wallet that supports standard transaction signing is compatible.
What slippage and fees should I expect when building a swap/trade UI?
Slippage depends on market liquidity and trade size, while fees include network fees plus any DEX, priority, or platform fees applied at execution.
Can users trade without KYC when using my app built on DFlow?
Yes, trades are non-custodial and do not require KYC, unless your application adds its own requirements.
How do sync vs async trades work, and why are prediction market trades always async?
Sync trades settle atomically in one transaction, while async trades span multiple transactions; prediction markets are async because market interactions cannot be completed atomically.
Does DFlow custody user funds at any point?
No, user funds remain in the userâs wallet throughout the entire trade lifecycle.
Why does a market order trigger a âcreate accountâ cost onchain?
Because when a market is uninitialized, the /order endpoint performs on-demand market tokenization (creating the YES/NO outcome tokens) before executing the swap, which incurs a small onchain account creation fee. See the full explanation here.
Should I set platformFeeBps if I'm not collecting a platform fee?
No. Only specify a nonzero platformFeeBps if you will actually collect the fee at execution time. The API factors the declared fee into slippage tolerance calculations, so declaring a fee you donât collect wastes slippage budget and results in suboptimal pricing for your users. See Platform Fees for details.
Can I call the /order endpoint directly from the browser?
No. The Trading API does not set CORS headers, so browser requests will be blocked. You must proxy /order calls through your own backend. Most builders use a lightweight edge function (Cloudflare Workers, Vercel Edge Functions, etc.) to keep the added latency minimal.
Does DFlow take positive slippage?
No.
What is the difference between imperative and declarative trades?
Imperative trades give the app full control over routes and execution, while declarative trades let DFlow handle routing based on constraints you specify.
Will DFlow support limit orders in the future?
This is currently on our roadmap, but we do not have a timeline for when it will be supported.
How does JIT routing differ from traditional DEX aggregation?
JIT routing re-optimizes routes onchain at execution time instead of relying on a fixed route decided upfront.
How are priority fees handled?
Priority fees are added to transactions to improve inclusion and execution speed during network congestion.
Does DFlow support Pump.fun tokens?
Yes. DFlow supports Pump.fun tokens both while they are still on the bonding curve and after they have graduated to PumpSwap (Pump.funâs native AMM).
What is the difference between price impact and slippage?
Slippage is receiving a worse price than expected between when a quote is generated and when the trade executes. Price impact is the difference between the market price and the effective price you get during routing, caused by the size of your trade relative to available liquidity.
What is the maximum price impact allowed on a trade?
The server determines the threshold, and trades that exceed it are rejected with a price_impact_too_high error. To set your own threshold, pass priceImpactTolerancePct.
How do I trade with native SOL?
Use the WSOL mint (So11111111111111111111111111111111111111112) in inputMint or outputMint and set wrapAndUnwrapSol=true. The API will auto-wrap or auto-unwrap SOL for the user.
In `POST /swap`, what should `destinationTokenAccount.address` be for native SOL output?
Use the destination wallet address, not the walletâs WSOL associated token account address.
Why is my trade failing with "exceeded CUs meter at BPF instruction"?
The transaction hit its compute unit (CU) limit.Fix this by passing dynamicComputeUnitLimit=true in your /order request, which instructs the API to determine the appropriate CU limit dynamically.
Why do intermediate token accounts sometimes remain after a swap, and why is there sometimes small residual dust?
In multi-leg routes, intermediate token accounts can be created to pass value from one leg to the next. Two outcomes can occur:
Full consumption (zero residual): If the full intermediate amount is consumed by subsequent legs, we can close intermediate accounts.
Partial consumption (small residual dust): If a nonzero residual remains, we do not close intermediate accounts. This can happen when venue constraints prevent exact full consumption of the produced amount.
How do I get access to the Prediction Markets API?
You can access the API via our developer endpoints now, for production use, youâll need an API key to avoid rate limits.
Are platform fees supported for prediction markets?
We support two settlement mints at the moment, USDC and CASH. The market will settle in whichever settlement mint the outcome token mint belongs to. See this recipe for more details.
How do I fetch market images from Kalshi?
We donât currently have images on markets (just events). Adding images for markets is being worked on currently, but for now you can fetch these from Kalshi directly.
How much does it cost to initialize a not-yet-tokenized market?
Initialization is about 0.02 SOL and is paid in SOL (not USDC). This fee applies only when a market is not yet tokenized.
Who is responsible for market pre-initialization and related costs?
Any platform developer can pre-initialize a market before users start trading it. Otherwise, the first userâs trade initializes the market and incurs the initialization cost unless the trade is sponsored. DFlow pre-initializes some popular markets.
What is the difference between sponsor and predictionMarketInitPayer?
Both parameters can cover the market initialization cost, but they differ in scope:
sponsor: covers both the userâs gas fees and market initialization. Use this when you want to fully abstract onchain costs from the user.
predictionMarketInitPayer: covers only the market initialization cost. The user still pays their own gas fees.
Does the input mint affect trade latency?
Yes. Using the settlement mint (USDC or CASH) as the input is the fastest path. If you input a different token (e.g., SOL), the system adds a swap leg to convert to the settlement mint first, which adds roughly 50ms of latency. For the lowest latency prediction market trades, use the settlement mint directly.
What is the minimum USDC amount per order?
The minimum is 0.01 USDC, but some markets require more because the smallest purchasable unit is one contract and the minimum depends on the contract price.
Can users buy a fractional contract?
No.
What exactly are the "tokens" I get when trading Kalshi markets via DFlow?
They are outcome tokens that represent positions in a prediction market.
How do I handle prediction market resolution and settlement in my app?
After resolution, users redeem outcome tokens for value according to the market result. This creates a second phase of UX that does not exist in spot trading: redemption flows, position closeout UX, and history and receipts UX.
How are fees structured for the Prediction Markets API?
Prediction market fees are calculated based on trading volume and are subject to a fee tier system.
When should I use forecast history vs candlesticks?
Forecast history is only supported for numerical events and is separated by percentiles. Itâs best suited for research or analysis rather than UI/UX. Use candlesticks for charting and user-facing price history.
Why am I getting a 400 error when fetching candlesticks?
There is a maximum of 5,000 candlesticks per request. If your startTs, endTs, and periodInterval parameters would produce more than 5,000 candlesticks, the request will fail. Either narrow the time range or increase the period interval.
How does the tokenization of markets work and where does the liquidity come from?
Prediction market tokens are tokens that represent positions in a prediction market. They are minted when a user enters a position and burned when a user redeems a position. The liquidity for prediction market tokens comes from the Concurrent Liquidity Programs (CLPs).
What is the market lifecycle/status flow, and how do I poll for updates (e.g., active â determined â redeemable)?
Prediction market lifecycle is a fixed sequence from creation to final settlement. A marketâs status defines what actions users and builders can take at each stage.
Can users place prediction market orders at any time?
No. Kalshiâs clearinghouse has a weekly maintenance window on Thursdays from 3:00 AM to 5:00 AM ET. Orders submitted during this window will not be cleared. The order will be reverted. Your application should prevent users from submitting orders during this window.
Do the DFlow WebSockets show all Kalshi trades or only onchain trades?
The DFlow WebSockets currently show all Kalshi trades (both onchain and offchain).
Do onchain trades through DFlow show up on Kalshi's offchain trade websocket?
Yes. Onchain trades through DFlow hit Kalshiâs offchain order books, so they appear on Kalshiâs trade websocket the same way offchain trades do.
Do you have a WebSocket channel for open interest?
We donât. DFlow market tickers map directly to Kalshi tickers, so use Kalshiâs Market Ticker websocket for streaming open interest and Get Market for per-market snapshots.
Does DFlow support all Kalshi markets (entertainment, culture, celebrity, etc.)?
Yes, DFlow supports all of Kalshiâs markets (including entertainment, culture, and celebrity) except for combos.
When a user buys a position via /submit-intent, is USDC pulled from their wallet immediately?
No. The /submit-intent endpoint builds the order and returns a transaction, but you still need to sign and submit the transaction via an RPC to execute it. USDC is only pulled from the wallet when the transaction lands onchain.
How do I show order quotes to unverified users?
Omit userPublicKey from the /order request. The API returns the quote without requiring Proof verification, so unverified users can preview pricing before completing KYC.
Can I look up a specific Kalshi market by ticker instead of paginating through all markets?
Yes. Kalshi market tickers map directly to the DFlow API. You can fetch a specific market by its ticker using the Get Market endpoint, or look up all markets under an event using the Get Event endpoint.
How can I estimate the fill price before placing an order?
Use the Get Orderbook endpoint to fetch the current best bid and best ask for a market. This lets you estimate how many contracts a user will receive at a given price before submitting an order. For real-time updates, you can also stream orderbook changes via the Orderbook WebSocket channel.
What are Milestones, and how do primary_event_tickers and related_event_tickers differ?
A Milestone groups a real-world occurrence (e.g. a game or match) by bundling related event tickers together for convenience. It is not part of the Series â Event â Market hierarchy â it is a separate grouping layer.related_event_tickers is a superset of primary_event_tickers. Primary event tickers are generally limited to moneyline, spread, and total markets for a sporting event.The relationship is typically one Milestone to many event tickers, but can be many-to-many, a single event ticker can appear in multiple Milestones, so there is no strict parent/child hierarchy.
Why are some active markets missing from my API results?
If you are passing isInitialized=true on the Events, Markets, or Series endpoints, the response will only include markets that have already been tokenized through a DFlow trade. Markets that are live on Kalshi but havenât been traded through DFlow yet will be filtered out. This is especially common with short-duration markets (e.g., 15-minute crypto price markets like KXBTC15M) where a new market starts every interval. Remove the isInitialized filter to see all active markets. See Market Initialization Behavior for details.
If we use Proof to KYC prediction market users, do we still need to geoblock?
Yes. KYC verifies user identity, but geoblocking is still required because
prediction markets are not permitted in all jurisdictions. Use geoblocking
to restrict access where local regulations do not allow prediction markets.
Is Proof required when buying outcome tokens on dev endpoints too?
Yes. Proof verification is required when buying outcome tokens on both developer and production endpoints. Selling does not require verification. See Understanding KYC for Prediction Markets for details.
Why isn't my Proof redirect firing after verification?
Proof only redirects to https:, moz-extension://, and chrome-extension: URLs. If your redirect_uri uses a custom scheme (e.g. myapp://callback), the redirect will silently fail. Native mobile apps should use universal links (iOS) or app links (Android), which use https: URLs that deep link into your app. See the redirect_uri parameter docs for details.
How do I show order quotes to users who haven't completed Proof verification?
Omit userPublicKey from the /order request to get a quote without verification.
Does Proof KYC work with embedded wallet providers like Privy?
Yes. Proof works with embedded wallet providers. Your app directs the user to https://dflow.net/proof to complete KYC, and you can provide a redirect URL to send the user back to your app after verification.