dflow

Integrate DFlow spot swaps and prediction market trading on Solana via REST and WebSocket APIs.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/IagoPrandi/ai-dealer --skill dflow-iagoprandi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dflow
Source: https://github.com/IagoPrandi/ai-dealer/tree/main/.claude/skills/solana-dev/ext/sendai/skills/dflow
Command: npx skills add https://github.com/IagoPrandi/ai-dealer --skill dflow-iagoprandi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Integrating token swaps and prediction market trading on Solana requires stitching together routing, quoting, transaction building, MEV protection, and market data feeds. This Skill consolidates the complete DFlow protocol surface—Swap API, Trade API, Prediction Market Metadata API, and WebSocket streaming—into one reference so you can implement trading flows without hunting through scattered docs. ## Core Features & Use Cases - Spot Token Swaps: Execute imperative swaps (quote + swap transaction) or declarative intent-based swaps with deferred route optimization, slippage control, priority fees, and Jito bundle MEV protection. - Prediction Market Trading: Query events, markets, orderbooks, and trade history via the Metadata API, then buy or sell YES/NO outcome tokens through the unified Trade API with sync/async execution monitoring. - Production Patterns: Platform fee collection, gasless sponsored swaps, custom destination accounts, retry logic with exponential backoff, and rate-limit handling. - Use Case: Build a Solana app where users swap SOL for USDC with best-price routing, or create a prediction market interface that streams live orderbook updates and lets users trade outcome tokens with a single order call. ## Quick Start Ask the AI to write TypeScript code that gets a DFlow quote and executes a swap of 1 SOL to USDC using the Trade API with an API key.

Frequently Asked Questions about dflow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I swap tokens on Solana using the DFlow API?▼

Call GET /order on quote-api.dflow.net with inputMint, outputMint, amount, and userPublicKey to receive a quote plus a base64 transaction. Deserialize it as a VersionedTransaction, sign with your keypair, and send it via your Solana connection.

What is the difference between DFlow imperative and declarative swaps?▼

Imperative swaps give full route control at signature time using separate /quote and /swap calls. Declarative swaps use intent-based execution via /intent and /submit-intent, deferring route optimization to execution time for lower slippage and enhanced sandwich protection.

How do I trade prediction market outcome tokens with DFlow?▼

Look up the market via the Metadata API to get its yes_mint and no_mint addresses, then call the Trade API's /order endpoint with USDC as inputMint and the outcome mint as outputMint. Set predictionMarketSlippageBps separately for prediction market legs.

Does the DFlow API require an API key?▼

Most endpoints accept requests without a key but limit you to roughly 10 requests per minute. Obtain a key by contacting hello@dflow.net and pass it in the x-api-key header for higher rate limits in production.

Why is my DFlow async order stuck in pending status?▼

Async orders move through pending, open, and pendingClose states before closing, so poll GET /order-status with the transaction signature every few seconds. If it returns expired or failed, retry with a higher prioritization fee or fresh blockhash.

How do I get real-time prediction market prices from DFlow?▼

Connect to wss://api.prod.dflow.net/ws and send a subscribe message with channel set to market, orderbook, or trades plus the market ticker. The socket streams price_update, orderbook_update, and trade messages as JSON.