dflow

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

6|20|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/andresdefi/cryptoskills --skill dflow-andresdefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dflow
Source: https://github.com/andresdefi/cryptoskills/tree/main/skills/dflow
Command: npx skills add https://github.com/andresdefi/cryptoskills --skill dflow-andresdefi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @solana/web3.js, @solana/spl-token, ws, bs58, and includes references (resource) components.

What problem does it solve? AI agents and developers lack accurate, up-to-date knowledge of DFlow's trading APIs on Solana, leading to incorrect endpoints, wrong parameters, and failed swap or prediction market integrations. ## Core Features & Use Cases - Swap API Integration: Execute imperative and declarative token swaps via the Order, Quote, and Swap endpoints with slippage, priority fee, and MEV protection controls. - Prediction Market Trading: Query events, markets, orderbooks, and trades through the Metadata API, and trade outcome tokens using the unified Trade API. - Real-Time Streaming: Subscribe to price, orderbook, and trade updates over WebSocket for live market monitoring. - Use Case: Build a trading bot that swaps SOL for USDC with Jito bundle protection, then monitors a prediction market's orderbook via WebSocket and buys YES outcome tokens when prices cross a threshold. ## Quick Start Use the dflow skill to write TypeScript code that gets a quote and executes a swap of 1 SOL to USDC through the DFlow Order API.

Frequently Asked Questions about dflow

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

FAQPage Schema
How do I execute a token swap with the DFlow API on Solana?

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

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

Imperative swaps give full route control at signing time using /quote and /swap endpoints. Declarative swaps use intent-based execution via /intent and /submit-intent, deferring route optimization to execution time for better pricing and MEV protection.

Does DFlow support prediction market trading on Solana?

Yes, DFlow provides a Prediction Market Metadata API at api.prod.dflow.net for querying events, markets, orderbooks, and trades. Outcome tokens (yes_mint, no_mint) are traded through the same Trade API used for spot swaps.

How do I handle async orders in DFlow?

Check the executionMode field in the order response. For async orders, poll GET /order-status with the transaction signature until the status becomes closed, failed, or expired, since async orders settle across multiple transactions.

Why does my DFlow swap fail with slippage or rate limit errors?

Slippage failures occur when prices move beyond your slippageBps tolerance; use "auto" or increase the value. Rate limit (429) errors happen without an API key, which allows only about 10 requests per minute; get a key at pond.dflow.net/build/api-key.