Agent skill

Dflow

by sendaifun in sendaifun/skills

Complete DFlow trading protocol SDK - the single source of truth for integrating DFlow on Solana.

Apache-2.0Auto-check passedBackend & APIs

Install Dflow

skills CLI
$ npx skills add sendaifun/skills --skill dflow -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sendaifun/skills dflow --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sendaifun/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dflow .claude/skills/dflow && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dflow
GitHub stars
130
Used in
1 other repo
Token cost
~5.7k tokens
SKILL.md length
1,138 words
Files
17
Skills in repo
24
Repo updated
First seen
Licence
Apache-2.0

At a glance

Complete DFlow trading protocol SDK - the single source of truth for integrating DFlow on Solana.

  • Works in 2 steps: Swap API (Trading) → Prediction Market Metadata API
  • Tasks that involve Trading and backtesting
  • SKILL.md covers What is DFlow?, API Overview, Quick Start and API Reference, plus 7 more sections
  • Runs TypeScript scripts from its folder; reaches api.prod.dflow.net and quote-api.dflow.net; needs API_KEY and DFLOW_API_KEY

What it does

Dflow is an agent skill from sendaifun/skills. Complete DFlow trading protocol SDK - the single source of truth for integrating DFlow on Solana. Covers spot trading, prediction markets, Swap API, Metadata API, WebSocket streaming, and all DFlow tools.

Its SKILL.md is about 5.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 23 other files (for example `docs/advanced-patterns.md`, `docs/troubleshooting.md` and `examples/declarative-swaps/intent-swap.ts`).

It sits in Backend & APIs, covering Trading and backtesting and Realtime and WebSockets. It works with Solana. The repository describes itself as: a public marketplace of all solana-related skills for agents to learn from! The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Trading and backtesting
  • Tasks that involve Realtime and WebSockets

Example prompts

  • “/dflow”

Requirements

  • Node.js
  • A credential in API_KEY
  • A credential in DFLOW_API_KEY

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. Swap API (Trading)
  2. Prediction Market Metadata API

What it can do on your machine

Read from SKILL.md and the folder at commit 06b36b8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (TypeScript, from the files we listed), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.prod.dflow.net
    • quote-api.dflow.net

    Also links to:

    • github.com
    • pond.dflow.net
    • discord.gg

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • API_KEY
    • DFLOW_API_KEY
    • PRIVATE_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dflow loads about 5.7k tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 1,138 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~5.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from sendaifun/skills at commit 06b36b8, republished under its Apache-2.0 licence (© sendaifun). 1,138 words, ~5,696 tokens.

Download SKILL.mdSave it as .claude/skills/dflow/SKILL.md (or your agent's skills folder). This skill also uses 16 other files; get the full folder from GitHub.
name
dflow
description
Complete DFlow trading protocol SDK - the single source of truth for integrating DFlow on Solana. Covers spot trading, prediction markets, Swap API, Metadata API, WebSocket streaming, and all DFlow tools.

DFlow - Complete Integration Guide

The definitive guide for integrating DFlow - a trading protocol that enables traders to exchange value across spot and prediction markets natively on Solana.

What is DFlow?

DFlow is a comprehensive trading infrastructure that provides:

  • Trading Applications & Wallets - Token swaps with intelligent routing and 99.9% token coverage
  • Exchanges & Aggregators - Access to billions in monthly routed volume across DEXes and Prop AMMs
  • Financial Institutions & Market Makers - Programmable execution layers with CLPs and async trades
  • Prediction Market Platforms - Discovery, pricing, routing, and settlement infrastructure
Key Capabilities
FeatureDescription
Token Coverage99.9% with millisecond detection
InfrastructureGlobally distributed, high-throughput optimization
ExecutionAdvanced algorithms with JIT routing for best-price execution
MarketsSupport for both spot and prediction market trading
MEV ProtectionEnhanced sandwich protection with Jito bundles

API Overview

DFlow provides two main API categories:

1. Swap API (Trading)

Base URL: https://quote-api.dflow.net

For executing trades:

  • Imperative Swaps - Full control over route selection at signature time
  • Declarative Swaps - Intent-based swaps with deferred route optimization
  • Trade API - Unified interface for spot and prediction market trading
  • Order API - Quote and transaction generation
2. Prediction Market Metadata API

Base URL: https://api.prod.dflow.net

For querying prediction market data:

  • Events API - Query prediction events and forecasts
  • Markets API - Get market details, orderbooks, outcome mints
  • Trades API - Historical trade data
  • Live Data API - Real-time milestones and updates
  • WebSocket - Streaming price and orderbook updates
Authentication

Most endpoints require an API key via the x-api-key header. Contact hello@dflow.net to obtain credentials.

Quick Start

Imperative Swap (3 Steps)
typescript
import { Connection, Keypair, VersionedTransaction } from "@solana/web3.js";

const API_BASE = "https://quote-api.dflow.net";
const API_KEY = process.env.DFLOW_API_KEY; // Optional but recommended

// Token addresses
const SOL = "So11111111111111111111111111111111111111112";
const USDC = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";

async function imperativeSwap(keypair: Keypair, connection: Connection) {
  // Step 1: Get Quote
  const quoteParams = new URLSearchParams({
    inputMint: SOL,
    outputMint: USDC,
    amount: "1000000000", // 1 SOL
    slippageBps: "50",    // 0.5%
  });

  const quote = await fetch(`${API_BASE}/quote?${quoteParams}`, {
    headers: API_KEY ? { "x-api-key": API_KEY } : {},
  }).then(r => r.json());

  // Step 2: Get Swap Transaction
  const swapResponse = await fetch(`${API_BASE}/swap`, {
    method: "POST",
    headers: {
      "content-type": "application/json",
      ...(API_KEY && { "x-api-key": API_KEY }),
    },
    body: JSON.stringify({
      userPublicKey: keypair.publicKey.toBase58(),
      quoteResponse: quote,
      dynamicComputeUnitLimit: true,
      prioritizationFeeLamports: 150000,
    }),
  }).then(r => r.json());

  // Step 3: Sign and Send
  const tx = VersionedTransaction.deserialize(
    Buffer.from(swapResponse.swapTransaction, "base64")
  );
  tx.sign([keypair]);

  const signature = await connection.sendTransaction(tx);
  await connection.confirmTransaction(signature);

  return signature;
}

The Trade API provides a single endpoint that handles both sync and async execution:

typescript
async function tradeTokens(keypair: Keypair, connection: Connection) {
  // Step 1: Get Order (quote + transaction in one call)
  const orderParams = new URLSearchParams({
    inputMint: SOL,
    outputMint: USDC,
    amount: "1000000000",
    slippageBps: "50",
    userPublicKey: keypair.publicKey.toBase58(),
  });

  const order = await fetch(`${API_BASE}/order?${orderParams}`, {
    headers: API_KEY ? { "x-api-key": API_KEY } : {},
  }).then(r => r.json());

  // Step 2: Sign and Send
  const tx = VersionedTransaction.deserialize(
    Buffer.from(order.transaction, "base64")
  );
  tx.sign([keypair]);
  const signature = await connection.sendTransaction(tx);

  // Step 3: Monitor (based on execution mode)
  if (order.executionMode === "async") {
    // Poll order status for async trades
    let status = "pending";
    while (status !== "closed" && status !== "failed") {
      await new Promise(r => setTimeout(r, 2000));
      const statusRes = await fetch(
        `${API_BASE}/order-status?signature=${signature}`,
        { headers: API_KEY ? { "x-api-key": API_KEY } : {} }
      ).then(r => r.json());
      status = statusRes.status;
    }
  } else {
    // Sync trades complete atomically
    await connection.confirmTransaction(signature);
  }

  return signature;
}

API Reference

Order API Endpoints
GET /order

Returns a quote and optionally a transaction for spot or prediction market trades.

ParameterRequiredDescription
inputMintYesBase58 input token mint
outputMintYesBase58 output token mint
amountYesAmount as scaled integer (1 SOL = 1000000000)
userPublicKeyNoInclude to receive signable transaction
slippageBpsNoMax slippage in basis points or "auto"
platformFeeBpsNoPlatform fee in basis points
prioritizationFeeLamportsNo"auto", "medium", "high", "veryHigh", or lamport amount

Response:

json
{
  "outAmount": "150000000",
  "minOutAmount": "149250000",
  "priceImpactPct": "0.05",
  "executionMode": "sync",
  "transaction": "base64...",
  "computeUnitLimit": 200000,
  "lastValidBlockHeight": 123456789,
  "routePlan": [...]
}
GET /order-status

Check status of async orders.

ParameterRequiredDescription
signatureYesBase58 transaction signature
lastValidBlockHeightNoBlock height for expiry check

Status Values:

  • pending - Order submitted, awaiting processing
  • open - Order opened, awaiting fill
  • pendingClose - Filled, closing transaction pending
  • closed - Order completed successfully
  • expired - Transaction expired before landing
  • failed - Order execution failed
Imperative Swap Endpoints
GET /quote

Get a quote for an imperative swap.

ParameterRequiredDescription
inputMintYesBase58 input mint
outputMintYesBase58 output mint
amountYesInput amount (scaled integer)
slippageBpsNoSlippage tolerance or "auto"
dexesNoComma-separated DEXes to include
excludeDexesNoComma-separated DEXes to exclude
onlyDirectRoutesNoSingle-leg routes only
maxRouteLengthNoMax number of route legs
forJitoBundleNoJito bundle compatible routes
platformFeeBpsNoPlatform fee in basis points
POST /swap

Generate swap transaction from quote.

Request Body:

json
{
  "userPublicKey": "Base58...",
  "quoteResponse": { /* from /quote */ },
  "dynamicComputeUnitLimit": true,
  "prioritizationFeeLamports": 150000,
  "wrapAndUnwrapSol": true
}

Response:

json
{
  "swapTransaction": "base64...",
  "computeUnitLimit": 200000,
  "lastValidBlockHeight": 123456789,
  "prioritizationFeeLamports": 150000
}
POST /swap-instructions

Returns individual instructions instead of a full transaction (for custom transaction building).

Declarative Swap Endpoints

Declarative swaps use intent-based execution with deferred route optimization.

GET /intent

Get an intent quote for a declarative swap.

ParameterRequiredDescription
inputMintYesBase58 input mint
outputMintYesBase58 output mint
amountYesInput amount (scaled integer)
slippageBpsNoSlippage tolerance
userPublicKeyYesUser's wallet address
POST /submit-intent

Submit a signed intent transaction for execution.

Request Body:

json
{
  "signedTransaction": "base64...",
  "intentResponse": { /* from /intent */ }
}
Token API Endpoints
GET /tokens

Returns list of supported token mints.

GET /tokens-with-decimals

Returns tokens with decimal information for proper amount scaling.

Venue API Endpoints
GET /venues

Returns list of supported DEX venues (Raydium, Orca, Phoenix, Lifinity, etc.).

Swap Modes Comparison

FeatureImperativeDeclarative
Route ControlFull control at sign timeOptimized at execution
LatencyHigher (two API calls)Lower (deferred calc)
SlippageFixed at quote timeMinimized at execution
Sandwich ProtectionStandardEnhanced
Use CasePrecise route requirementsBest execution priority
When to Use Imperative
  • Need to review exact route before signing
  • Building order books or specific DEX routing
  • Complex multi-step transactions
  • Need deterministic execution paths
When to Use Declarative
  • Prioritize best execution
  • Lower slippage requirements
  • Simple token swaps
  • MEV protection is important

Execution Modes

Show full SKILL.md (460 more words)Show less
Synchronous (Atomic)
  • Single transaction execution
  • All-or-nothing settlement
  • Standard confirmation flow
  • Use connection.confirmTransaction()
Asynchronous (Multi-Transaction)
  • Uses Jito bundles
  • Open → Fill → Close transaction flow
  • Poll /order-status for completion
  • Better for complex routes or prediction markets
typescript
// Async order monitoring
async function monitorAsyncOrder(signature: string) {
  const statuses = ["pending", "open", "pendingClose"];
  let currentStatus = "pending";

  while (statuses.includes(currentStatus)) {
    await new Promise(r => setTimeout(r, 2000));

    const res = await fetch(
      `${API_BASE}/order-status?signature=${signature}`,
      { headers: { "x-api-key": API_KEY } }
    ).then(r => r.json());

    currentStatus = res.status;

    if (currentStatus === "closed") {
      return { success: true, fills: res.fills };
    }
    if (currentStatus === "failed" || currentStatus === "expired") {
      return { success: false, status: currentStatus };
    }
  }
}

Prediction Markets

DFlow provides infrastructure for trading prediction market outcome tokens.

Market Structure
Series (Collection)
  └── Event (Occurrence)
        └── Market (Outcome Trade)
Market Lifecycle
  1. Initialized - Market created
  2. Active - Trading enabled
  3. Inactive - Trading paused
  4. Closed - No more trading
  5. Determined - Outcome known
  6. Finalized - Payouts available
Trading Prediction Markets
typescript
// Use the Trade API with prediction market token mints
const order = await fetch(`${API_BASE}/order?${new URLSearchParams({
  inputMint: USDC,
  outputMint: OUTCOME_TOKEN_MINT, // Prediction market token
  amount: "10000000", // 10 USDC
  slippageBps: "100",
  userPublicKey: keypair.publicKey.toBase58(),
  predictionMarketSlippageBps: "200", // Separate slippage for PM
})}`, { headers: { "x-api-key": API_KEY } }).then(r => r.json());

Common Token Mints

TokenMint Address
SOL (Wrapped)So11111111111111111111111111111111111111112
USDCEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
USDTEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
BONKDezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
JUPJUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN
WIFEKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm

Priority Fees

Configure transaction priority:

typescript
// Option 1: Auto (recommended)
prioritizationFeeLamports: "auto"

// Option 2: Priority level
prioritizationFeeLamports: {
  priorityLevel: "high" // "medium", "high", "veryHigh"
}

// Option 3: Exact amount
prioritizationFeeLamports: 150000

// Option 4: Max with auto-adjust
prioritizationFeeLamports: {
  autoMultiplier: 2,
  maxLamports: 500000
}

Error Handling

typescript
async function safeSwap(params: SwapParams) {
  try {
    const quote = await getQuote(params);

    if (!quote.routePlan?.length) {
      throw new Error("No route found");
    }

    const swap = await getSwapTransaction(quote, params.userPublicKey);
    const tx = deserializeTransaction(swap.swapTransaction);
    tx.sign([params.keypair]);

    const signature = await connection.sendTransaction(tx, {
      skipPreflight: false,
      maxRetries: 3,
    });

    return { success: true, signature };
  } catch (error) {
    if (error.message.includes("insufficient")) {
      return { success: false, error: "Insufficient balance" };
    }
    if (error.message.includes("slippage")) {
      return { success: false, error: "Slippage exceeded" };
    }
    return { success: false, error: error.message };
  }
}

Platform Fees

Collect platform fees on swaps:

typescript
const quote = await fetch(`${API_BASE}/quote?${new URLSearchParams({
  inputMint: SOL,
  outputMint: USDC,
  amount: "1000000000",
  platformFeeBps: "50", // 0.5% fee
  platformFeeMode: "outputMint", // Collect in output token
})}`, { headers: { "x-api-key": API_KEY } }).then(r => r.json());

// In swap request, specify fee account
const swap = await fetch(`${API_BASE}/swap`, {
  method: "POST",
  headers: { "content-type": "application/json", "x-api-key": API_KEY },
  body: JSON.stringify({
    userPublicKey: user.toBase58(),
    quoteResponse: quote,
    feeAccount: platformFeeAccount.toBase58(), // Your fee recipient
  }),
}).then(r => r.json());

Jito Integration

For MEV protection and bundle submission:

typescript
// Request Jito-compatible routes
const quote = await fetch(`${API_BASE}/quote?${new URLSearchParams({
  inputMint: SOL,
  outputMint: USDC,
  amount: "1000000000",
  forJitoBundle: "true",
})}`, { headers: { "x-api-key": API_KEY } }).then(r => r.json());

// Include Jito sandwich mitigation
const swap = await fetch(`${API_BASE}/swap`, {
  method: "POST",
  body: JSON.stringify({
    userPublicKey: user.toBase58(),
    quoteResponse: quote,
    includeJitoSandwichMitigationAccount: true,
  }),
}).then(r => r.json());

DFlow Swap Orchestrator

The DFlow Swap Orchestrator contract manages declarative swap execution:

Program ID: DF1ow3DqMj3HvTj8i8J9yM2hE9hCrLLXpdbaKZu4ZPnz

Prediction Market Metadata API

The Prediction Market Metadata API provides comprehensive access to prediction market information.

Base URL: https://api.prod.dflow.net

Market Structure
Series (Collection)
  └── Event (Occurrence)
        └── Market (Outcome Trade)
              ├── Yes Token (outcome mint)
              └── No Token (outcome mint)
Events API
GET /api/v1/event/{ticker}

Returns a single event by its ticker with optional nested markets.

typescript
const METADATA_API = "https://api.prod.dflow.net";

// Get event details
const event = await fetch(`${METADATA_API}/api/v1/event/TRUMP-2024`, {
  headers: { "x-api-key": API_KEY }
}).then(r => r.json());

// Response includes: ticker, title, status, markets, close_time, etc.
GET /api/v1/events

Returns a paginated list of all events.

typescript
const events = await fetch(`${METADATA_API}/api/v1/events?limit=50&offset=0`, {
  headers: { "x-api-key": API_KEY }
}).then(r => r.json());
GET /api/v1/event/{ticker}/forecast

Returns historical forecast percentile data.

GET /api/v1/event/{ticker}/candlesticks

Returns candlestick data from Kalshi.

Markets API
GET /api/v1/market/{ticker}

Returns a single market by ticker.

typescript
const market = await fetch(`${METADATA_API}/api/v1/market/TRUMP-2024-WIN`, {
  headers: { "x-api-key": API_KEY }
}).then(r => r.json());

// Response: ticker, yes_mint, no_mint, status, last_price, volume, etc.
GET /api/v1/market/by-mint/{mint_address}

Lookup market by any mint (ledger or outcome mints).

typescript
const market = await fetch(
  `${METADATA_API}/api/v1/market/by-mint/${outcomeMint}`,
  { headers: { "x-api-key": API_KEY } }
).then(r => r.json());
POST /api/v1/markets/batch

Batch retrieve multiple markets (max 100).

typescript
const markets = await fetch(`${METADATA_API}/api/v1/markets/batch`, {
  method: "POST",
  headers: { "content-type": "application/json", "x-api-key": API_KEY },
  body: JSON.stringify({
    tickers: ["MARKET-1", "MARKET-2"],
    mints: ["mint1...", "mint2..."]
  })
}).then(r => r.json());
GET /api/v1/outcome_mints

Returns all yes_mint and no_mint pubkeys from all supported markets.

typescript
// Get all outcome mints, optionally filter by close time
const mints = await fetch(
  `${METADATA_API}/api/v1/outcome_mints?min_close_timestamp=${Date.now()}`,
  { headers: { "x-api-key": API_KEY } }
).then(r => r.json());
POST /api/v1/filter_outcome_mints

Check if addresses are outcome mints (max 200).

typescript
const filtered = await fetch(`${METADATA_API}/api/v1/filter_outcome_mints`, {
  method: "POST",
  headers: { "content-type": "application/json", "x-api-key": API_KEY },
  body: JSON.stringify({ addresses: ["mint1...", "mint2..."] })
}).then(r => r.json());
Orderbook API
GET /api/v1/orderbook/{ticker}

Get orderbook by market ticker.

typescript
const orderbook = await fetch(
  `${METADATA_API}/api/v1/orderbook/TRUMP-2024-WIN`,
  { headers: { "x-api-key": API_KEY } }
).then(r => r.json());

// Response: bids: [{price, quantity}], asks: [{price, quantity}]
GET /api/v1/orderbook/by-mint/{mint_address}

Get orderbook using mint address lookup.

Trades API
GET /api/v1/trades

Returns paginated trade history with filtering.

typescript
const trades = await fetch(
  `${METADATA_API}/api/v1/trades?ticker=TRUMP-2024-WIN&limit=100`,
  { headers: { "x-api-key": API_KEY } }
).then(r => r.json());
GET /api/v1/trades/by-mint/{mint_address}

Get trades using mint address lookup.

Live Data API
GET /api/v1/milestones/{ticker}

Real-time milestone data from Kalshi.

typescript
const milestones = await fetch(
  `${METADATA_API}/api/v1/milestones/TRUMP-2024`,
  { headers: { "x-api-key": API_KEY } }
).then(r => r.json());
Series & Categories
GET /api/v1/series

Returns series templates for recurring events.

GET /api/v1/categories

Returns category tags for filtering.

WebSocket Streaming

Connect for real-time updates:

typescript
const ws = new WebSocket("wss://api.prod.dflow.net/ws");

ws.onopen = () => {
  // Subscribe to market updates
  ws.send(JSON.stringify({
    action: "subscribe",
    channel: "market",
    ticker: "TRUMP-2024-WIN"
  }));
};

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  // Handle: price_update, orderbook_update, trade, etc.
  console.log("Update:", data);
};
Market Lifecycle
StatusDescription
initializedMarket created
activeTrading enabled
inactiveTrading paused
closedNo more trading
determinedOutcome known
finalizedPayouts available

GitHub Tools & SDKs

DFlow provides several open-source tools on GitHub:

solana-agent-kit

Repository: DFlowProtocol/solana-agent-kit

Toolkit enabling AI agents to connect to Solana protocols:

typescript
// Use with AI agents for automated trading
import { SolanaAgentKit } from "@dflow/solana-agent-kit";

const agent = new SolanaAgentKit({
  rpcUrl: process.env.RPC_URL,
  privateKey: process.env.PRIVATE_KEY,
});

// Agent can execute DFlow swaps, query markets, etc.
clearpools

Repository: DFlowProtocol/clearpools

Orca Whirlpools with support for flow segmentation:

typescript
// Extends Orca protocol with DFlow routing
import { ClearPools } from "@dflow/clearpools";

const pools = new ClearPools(connection);
await pools.initializePool(/* params */);
dflow-amm-interface

Repository: DFlowProtocol/dflow-amm-interface

Rust trait definitions for DFlow's AMM implementation. Use when building custom AMMs that integrate with DFlow routing.


Skill Structure

dflow/
├── SKILL.md                           # This file - complete integration guide
├── resources/
│   ├── api-reference.md               # Swap API reference
│   ├── prediction-market-api.md       # Prediction Market Metadata API reference
│   ├── github-sdks.md                 # GitHub tools & SDKs documentation
│   ├── token-mints.md                 # Common token addresses
│   └── error-codes.md                 # Error handling guide
├── examples/
│   ├── imperative-swaps/              # Imperative swap examples
│   ├── declarative-swaps/             # Declarative swap examples
│   ├── trade-api/                     # Unified Trade API examples
│   └── prediction-markets/            # Prediction market examples
│       ├── query-markets.ts           # Query events, markets, orderbook
│       ├── trade-outcomes.ts          # Trade outcome tokens
│       └── websocket-client.ts        # Real-time data streaming
├── templates/
│   ├── swap-client.ts                 # Swap client starter
│   └── prediction-market-client.ts    # Prediction market client starter
└── docs/
    ├── advanced-patterns.md           # Complex integrations
    └── troubleshooting.md             # Common issues

Guidelines

  1. Use Trade API for most cases - Unified endpoint handles both sync/async
  2. Always handle async orders - Check executionMode and poll status
  3. Set appropriate slippage - "auto" for convenience, custom for control
  4. Include priority fees - Essential for reliable execution
  5. Handle errors gracefully - Network issues, slippage, insufficient balance
  6. Monitor rate limits - Use API key for production
  7. Test on devnet first - DFlow supports Solana devnet

Resources

© sendaifun, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 16 other files in skills/dflow of sendaifun/skills.

  • SKILL.md
  • docs/advanced-patterns.md
  • docs/troubleshooting.md
  • examples/declarative-swaps/intent-swap.ts
  • examples/imperative-swaps/basic-swap.ts
  • examples/prediction-markets/query-markets.ts
  • examples/prediction-markets/trade-outcomes.ts
  • examples/prediction-markets/websocket-client.ts
  • examples/trade-api/unified-trade.ts
  • resources/api-reference.md
  • resources/error-codes.md
  • resources/github-sdks.md
  • resources/prediction-market-api.md
  • resources/token-mints.md
  • … and 3 more

Open the folder on GitHubat commit 06b36b8

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in sendaifun/skills, which our catalogue first saw on October 9, 2026.

Compare with similar skills

Dflow next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dflow compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dflow this skillsendaifun/skills1301 repos~5.7kAutomated safety check: PassApache-2.0
Web3 PolymarketPolymarket/agent-skills1911 repos~2kAutomated safety check: PassNone
Cryptofeed2025Emma/vibe-coding-cn23k1 repos~1.6kAutomated safety check: PassMIT
Tiger Brokers C++ OpenAPI SDKqusong0627/QuantMind1.7k—~942Automated safety check: PassApache-2.0
Polymarket2025Emma/vibe-coding-cn23k1 repos~1.6kAutomated safety check: PassMIT
Openalgo Chart Terminalmarketcalls/openalgo-charts144—~3.8kAutomated safety check: NotesApache-2.0

Similar skills

  • Web3 Polymarket

    Polymarket/agent-skills

    Polymarket integration for prediction market trading on Polygon.

    191 GitHub starsUsed in 1 repo~2k tokens
    Backend & APIsAuto-check passed
  • Cryptofeed

    2025Emma/vibe-coding-cn

    Cryptofeed - Real-time cryptocurrency market data feeds from 40+ exchanges.

    23k GitHub starsUsed in 1 repo~1.6k tokens
    Backend & APIsAuto-check passed
  • Tiger Brokers C++ OpenAPI SDK

    qusong0627/QuantMind

    Guides an agent through the Tiger Brokers OpenAPI C++ SDK for build setup, market data, orders and real-time push, defaulting to paper trading.

    1.7k GitHub stars~942 tokensUpdated today
    Backend & APIsAuto-check passed
  • Polymarket

    2025Emma/vibe-coding-cn

    Comprehensive Polymarket skill covering prediction markets, API, trading, market data, and real-time WebSocket data streaming.

    23k GitHub starsUsed in 1 repo~1.6k tokens
    Backend & APIsAuto-check passed
  • Openalgo Chart Terminal

    marketcalls/openalgo-charts

    Build a full trading terminal on openalgo-charts - symbol search, interval switcher, chart-type picker, indicator menu, drawing rail with clipboard, live OpenAlgo REST plus WebSocket data behind a…

    144 GitHub stars~3.8k tokensUpdated 8 days ago
    Backend & APIsAuto-check: notes
  • Switchboard Oracle SDK

    internet-court/internet-court-skill

    Covers integrating Switchboard oracles on Solana: pull feeds, oracle quotes, VRF randomness and Surge WebSocket streaming, from both the TypeScript SDK and Rust.

    6.5k GitHub starsUsed in 2 repos~2.9k tokens
    Backend & APIsAuto-check passed

More from sendaifun/skills

All 24 skills in this repo
  • Breaks a shared video or GIF down frame by frame to recreate its motion as working code instead of guessing the timing by eye.

    130 GitHub stars~2.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Builds and debugs Arcium encrypted computation apps on Solana: Arcis circuits, Anchor orchestration, encrypted inputs and the init, queue and callback flow.

    130 GitHub stars~2.8k tokensUpdated 2 mo ago
    Auto-check passed
  • Coingecko

    sendaifun/skills

    Complete CoinGecko Solana API integration for token prices, DEX pool data, OHLCV charts, trades, and market analytics.

    130 GitHub starsUsed in 1 repo~4.8k tokens
    Auto-check: notes
  • Phantom Connect SDK

    sendaifun/skills

    Integrates Phantom wallet connection, social login, and transaction signing into React, React Native, or vanilla JS apps on Solana.

    130 GitHub stars~1.3k tokensUpdated 2 mo ago
    Auto-check passed
  • Integrating Jupiter

    sendaifun/skills

    Comprehensive guidance for integrating Jupiter APIs (Ultra Swap, Lend, Perps, Trigger, Recurring, Tokens, Price, Portfolio, Prediction Markets, Send, Studio, Lock, Routing).

    130 GitHub starsUsed in 1 repo~5.1k tokens
    Auto-check passed
  • Pinocchio Development

    sendaifun/skills

    Comprehensive guide for building high-performance Solana programs using Pinocchio - the zero-dependency, zero-copy framework.

    130 GitHub starsUsed in 1 repo~4.1k tokens
    Auto-check passed

Works with

Questions about Dflow

What does Dflow do?

Complete DFlow trading protocol SDK - the single source of truth for integrating DFlow on Solana. Dflow is an agent skill from sendaifun/skills. Complete DFlow trading protocol SDK - the single source of truth for integrating DFlow on Solana.

When should I use Dflow?

Dflow fits situations like: tasks that involve Trading and backtesting; tasks that involve Realtime and WebSockets.

How do I install Dflow in Claude Code?

Run `npx skills add sendaifun/skills --skill dflow -a claude-code`. Or copy the skill folder (skills/dflow in sendaifun/skills) into .claude/skills/dflow in your project. Claude Code loads it when a task matches its description.

How do I install Dflow in Codex?

Run `npx skills add sendaifun/skills --skill dflow -a codex`. Or copy the skill folder (skills/dflow in sendaifun/skills) into .agents/skills/dflow in your project. Codex loads it when a task matches its description.

Can I use Dflow in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sendaifun/skills --skill dflow -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dflow, .gemini/skills/dflow, .github/skills/dflow and .opencode/skills/dflow in your project.

What does Dflow need to run?

Going by SKILL.md and its folder, Dflow needs TypeScript for the scripts in its folder and credentials named API_KEY, DFLOW_API_KEY and PRIVATE_KEY. Our summary lists: Node.js; A credential in API_KEY; A credential in DFLOW_API_KEY.

Does Dflow access the network?

SKILL.md names 5 domains. In commands or code: api.prod.dflow.net and quote-api.dflow.net; the agent is likely to contact these when it follows the instructions. As links in the text: github.com, pond.dflow.net and discord.gg. This is read from the text; nothing was executed.

Is Dflow safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Dflow use?

Dflow is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dflow use?

About 5.7k tokens (SKILL.md is roughly 23k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dflow?

Skills that share tags, products or a category with Dflow: Web3 Polymarket (Polymarket/agent-skills, 191 stars), Cryptofeed (2025Emma/vibe-coding-cn, 23k stars), Tiger Brokers C++ OpenAPI SDK (qusong0627/QuantMind, 1.7k stars) and Polymarket (2025Emma/vibe-coding-cn, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dflow?

sendaifun (a GitHub organization) maintains it in sendaifun/skills, which has 130 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on July 31, 2026.

Source: sendaifun/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.