Decentralised Pub/Sub Network
  • What is Pub/Sub
  • DPSN + Virtual Protocol: Empowering 17,000+ AI Agents with Real-Time Data
  • DPSN + GOAT SDK: Real-Time Data Streams Now Live
  • How to Publish Real-Time Data Streams on DPSN: A Guide for Developers
  • How to Subscribe to DPSN Data Streams: A Guide for Developers
  • Real-Time Market Intelligence for AI Agents: The DPSN Approach
  • MCP vs. Bridging Agents: Which One Powers AI Agents Best?
  • How DPSN Unlocks 99% of the Data
  • AI Agent Builders+DPSN: Unlocking Real-Time, Scalable Intelligence
  • DPSN+MCP: Bridging Real-Time Data for AI Agents
  • Improving AI Agent Decision-Making with Workflow Tags and JSON
  • Exploring DPSN SDK: Transforming Pub/Sub Networks in a Decentralised World
  • DPSN: Secure and Scalable Real-Time Messaging for a Decentralized Future
  • Understanding Price Feed Oracles and Why DPSN Is Essential for Decentralized Infrastructure
  • How DPSN supports Fully Homomorphic Encryption to Secure Data
  • Revolutionizing Data Feeds: How DPSN is Democratizing Web3 Connectivity
  • Enhancing Machine-to-Machine Communication in DePIN: How DPSN Powers Data Transfer
  • How DPSN Powers High-Throughput, Low-Latency Applications
  • DPSN for DeFi: Powering High-Speed Oracles and Financial Innovation
  • Harnessing DPSN for IoT: A Game-Changer for Smart Cities and Beyond
  • Building Resilient dApps: How DPSN Drives Scalability and Security
  • DPSN vs. Centralized Systems: A Case for Decentralization
  • Topic Ownership and Privacy in DPSN: Why It Matters for Developers
  • ChainPulse & DPSN: Revolutionizing Decentralized Communication for Web3
  • Boosting High-Performance Applications with DPSN's Advanced Clusters
  • The Evolution of Decentralized Messaging: From Bitcoin to DPSN
  • Optimizing Smart City Infrastructure with DPSN’s IoT Data Handling
  • Building Censorship-Resistant Applications with DPSN
  • 5 Key Features That Make DPSN Stand Out in Blockchain Networks
  • 7 Ways DPSN Enhances Data Privacy and Security
  • 6 Innovations in DPSN That Are Shaping the Blockchain Ecosystem
  • How DPSN is Transforming Data Security in Financial Applications
  • How DPSN Powers Secure Data Sharing in the Era of IoT Expansion
  • Exploring DPSN’s Role in Blockchain Interoperability
  • How DPSN Enhances Decentralized Messaging for Web3 Innovation
  • Why DPSN's Pub-Sub Model is Perfect for Web3
  • DPSN as the Backbone of Real-Time Messaging for Blockchain
  • How to Set Up Topic-Based Messaging in DPSN
  • 5 Common Challenges in Blockchain Communication and How to Solve Them
  • AI Agents Need Real-Time Data, DPSN Delivers
  • DPSN Dynamic Streams: The Future of Real-Time, Decentralized Data Feeds
  • Why Real-Time Data is the Next Frontier for Web3
Powered by GitBook
On this page
  • What is DPSN?
  • Why Developers Should Use DPSN
  • Quick Guide: Subscribing to DPSN Topics
  • Best Practices for Integration
  • 50+ Available Data Streams
  • Need Custom Streams?

How to Subscribe to DPSN Data Streams: A Guide for Developers

PreviousHow to Publish Real-Time Data Streams on DPSN: A Guide for DevelopersNextReal-Time Market Intelligence for AI Agents: The DPSN Approach

Last updated 1 month ago

What is DPSN?

The Decentralized Pub-Sub Network (DPSN) is revolutionizing data delivery for AI agents and autonomous systems. As an open-source decentralized network, DPSN solves the critical challenge of reliable, efficient message delivery across global networks with built-in economic incentives for operators.

Unlike traditional centralized systems, DPSN distributes message delivery across independent nodes, dramatically improving reliability and reducing latency—essential requirements for modern AI agents and data-driven applications.

Why Developers Should Use DPSN

DPSN's data streams deliver unprecedented advantages for AI agents and autonomous systems:

  • Single Integration Point: Eliminate the complexity of multiple data provider SDKs

  • Focus on Core AI Logic: Let DPSN handle your data requirements while you focus on building intelligence

  • Real-time Data Processing: Get instant updates with minimal latency for time-sensitive AI decision making

  • Streamlined Development: Reduce the complexity of managing data subscriptions

Quick Guide: Subscribing to DPSN Topics

npm install dpsn-client

# or

yarn add dpsn-client

2. Import and Initialize the Client

import DpsnClient from 'dpsn-client';

To initialize and authenticate with DPSN services, you'll need an EVM wallet private key:

  • Use an EVM wallet: Create or use an existing Ethereum-based wallet, preferably on testnet for security

  • Get your private key: Export it from your wallet's security settings

  • Configure the client:

typescript
  const dpsnService = new DpsnClient(
     "betanet.dpsn.org",     // DPSN network endpoint
     "<YOUR_EVM_WALLET_PRIVATE_KEY>",  // Your EVM wallet private key (for authentication only)
     {
        wallet_chain_type: 'ethereum',
        network: 'testnet'
     }
  );

Security note: Your private key is used only for authentication. DPSN won't execute transactions or access funds.

3. Choose Your Data Stream

Each stream has a unique topic identifier. For example, to subscribe to BTC/USDT price updates:

const TOPIC = "0xe14768a6d8798e4390ec4cb8a4c991202c2115a5cd7a6c0a7ababcaf93b4d2d4/BTCUSDT/ticker";

4. Create the Subscription

await dpsnService.subscribe(TOPIC, (topic, message, packetDetails) => {// Handle incoming messages
         console.log('💰 Received Binance Price Update:', message);
     });
     console.log('Successfully subscribed to BTC/USDT price feed');

Best Practices for Integration

To maximize the performance, note the following:

  • Error Handling: Implement robust error handling for uninterrupted agent operation

  • Data Validation: Always validate incoming data before using it in agent decision processes

  • Reconnection Logic: Build automatic reconnection if the connection drops

  • Rate Awareness: Optimize your agent's processing to handle the stream's update frequency

50+ Available Data Streams

DPSN offers various data streams perfect for AI and autonomous systems:

  • Cryptocurrency market data (OHLC prices, volumes data from 10+ chains)

  • Github repository data

  • Crypto News and social media feed data from Farcaster

and more data streams.

Need Custom Streams?

1. Install the using npm or yarn:

Visit the to explore all available data streams.

For enterprise systems requiring custom streams, lower latency options, or specialized data feeds, please reach out to us directly on our official telegram channel - . We offer tailored solutions for developers building high-frequency trading systems, autonomous decision-making platforms, and other data-intensive applications.

DPSN Client SDK
DPSN Streams Store
https://t.me/dpsn_dev