Introduction

Unified TypeScript SDK for DFlow on Solana - prediction markets and trading.

DFlow SDK

dflow-sdk is a unified TypeScript SDK for building trading applications on DFlow, the intelligent trade execution layer for Solana.

DFlow powers institution-grade trading experiences across spot and prediction markets natively on Solana with smart order routing, best-price execution, and near-complete token coverage.

Features

  • Prediction Markets API — Events, Markets, Orderbook, Trades, Live Data, Series, Tags, Sports, Search
  • Trade API — Orders, Swaps, Intents, Market Initialization, Tokens, Venues
  • Real-time WebSocket — Subscribe to price updates, trades, and orderbook changes
  • Solana Helpers — Transaction signing, position tracking, redemption utilities

Quick Installation

pnpm add dflow-sdk
# or
npm install dflow-sdk

Quick Example

import { DFlowClient } from 'dflow-sdk';
 
const dflow = new DFlowClient();
 
// Discover active markets
const events = await dflow.events.getEvents({ status: 'active' });
 
// Get a specific market
const market = await dflow.markets.getMarket('BTCD-25DEC0313-T92749.99');
 
// Get a quote
const quote = await dflow.swap.getQuote({
  inputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC
  outputMint: market.accounts.usdc.yesMint,
  amount: 1000000, // 1 USDC
});

Explore the SDK

Who Uses DFlow?

  • Trading Applications & Wallets — Offer "trade any token" with smart order routing
  • Exchanges & Aggregators — Access deep liquidity across every major DEX
  • Financial Institutions — Programmable execution with CLPs and async trades
  • Prediction Market Platforms — Discovery, pricing, routing, and settlement infrastructure

Resources

On this page