Skip to main content
Mobula provides real-time WebSocket streams for accessing live blockchain data with minimal latency. Whether you need market updates, trade feeds, or position tracking, our streaming API delivers data as it happens. The easiest way to consume WebSocket streams is through our official SDK, which handles connection management, reconnection, and provides full type safety:
npm install @mobula_labs/sdk
import { MobulaClient } from '@mobula_labs/sdk';

const client = new MobulaClient({
  apiKey: 'your-api-key', // Get one at https://admin.mobula.io
});

// Subscribe to market data
client.streams.subscribe('market', { asset: 'bitcoin' }, (data) => {
  console.log('Market update:', data);
});

// Subscribe to trades
client.streams.subscribe('trade', {
  asset: 'bitcoin',
  blockchain: 'ethereum',
  pair: 'WETH/USDC',
}, (data) => {
  console.log('Trade:', data);
});

// Subscribe to OHLCV candles
client.streams.subscribe('ohlcv', {
  asset: 'bitcoin',
  interval: '1h',
}, (data) => {
  console.log('OHLCV update:', data);
});

// Subscribe to Pulse V2
client.streams.subscribe('pulse-v2', {
  model: 'default',
  chainId: ['solana:solana'],
}, (data) => {
  console.log('Pulse update:', data);
});

Available Stream Types

Stream TypeDescription
marketMarket data updates
market-detailsDetailed market information
token-detailsToken information updates
trade / fast-tradeTrade updates
ohlcvOHLCV candle updates
holdersToken holder updates
pulse-v2Pulse V2 data stream
positionPosition updates
fundingFunding rate updates
stream-evmEVM blockchain stream
stream-svmSolana blockchain stream

SDK Features

  • Automatic reconnection: Connection drops are handled automatically
  • Heartbeat management: Keep connections alive without manual intervention
  • Connection pooling: Efficient management of multiple subscriptions
  • Full type safety: TypeScript types for all stream payloads
  • Easy unsubscription: Clean up resources with returned unsubscribe functions
// Unsubscribe when done
const unsubscribe = client.streams.subscribe('market', { asset: 'bitcoin' }, callback);

// Later...
unsubscribe();

Direct WebSocket Connection

If you prefer to connect directly without the SDK, you can use the WebSocket endpoint: URL: wss://api.mobula.io Example subscription message:
{
  "type": "market-details",
  "authorization": "YOUR-API-KEY",
  "payload": {
    "pools": [
      {
        "blockchain": "evm:1",
        "address": "0x1234567890abcdef1234567890abcdef12345678"
      }
    ]
  }
}
The SDK handles authentication, message formatting, and connection management automatically. We recommend using it for production applications.

Stream Categories