WebSocket Setup

Quick Start

For quick integration, follow these steps:

  1. Connect to wss://ws.noodles.fi/ws/coin-update

  2. Send periodic pings every 30 seconds to keep connection alive

  3. Subscribe using the room-based format (recommended)

  4. Handle messages by checking the type field

  5. Implement reconnection: On disconnect, automatically reconnect and resubscribe to your channels

Endpoints

wss://ws.noodles.fi/ws/coin-update

CORS Validation

  • Web browser connections must pass CORS validation based on the Origin header.

  • Contact @hiephhoarrow-up-right on Telegram for whitelisting your domain.

  • If CORS validation fails, the server will send 403 Forbidden status code and close the connection.

Available Rooms

The WebSocket service supports four main data rooms:

  1. TRADES - Real-time trading transaction data

  2. COIN_UPDATES - Real-time coin updates for coins (price, price change, volume, maker, etc.)

  3. OHLC - Candlestick/OHLC data for various time intervals

Coin ID Format

All coin identifiers follow the format: {package}::{module}::{type}

Examples:

  • SUI: 0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI

  • USDC: 0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC

Message Protocol

Message Types

Type
Direction
Purpose

ping

Client → Server

Keep connection alive

pong

Server → Client

Ping response

subscribe

Client → Server

Subscribe to a channel

unsubscribe

Client → Server

Unsubscribe from a channel

data

Server → Client

Real-time data or acknowledgments

error

Server → Client

Error messages

Client Message Format

Examples:

Subscribe to trades for a single coin:

Subscribe to coin statistic updates for multiple coins:

Subscribe to OHLC data:

Server Message Format

Subscription Confirmation

When you subscribe or unsubscribe, the server sends a confirmation message:

Error Handling

Common Error Messages

Error
Description
Resolution

"Invalid channel format"

Channel name doesn't follow expected format

Check channel naming convention

"Invalid coin"

Coin ID is not valid

Verify coin ID format

"Invalid room"

Unsupported room type

Use TRADES, COIN_UPDATES, OHLC, or ALERTS

"Invalid bucket"

Unsupported time bucket for OHLC

Use supported time intervals (1, 5, 15, 30, 60, 240, 1440, 10080, 43200)

"Invalid coins format"

Coins array format is incorrect

Ensure coins is an array of valid coin IDs

"Invalid wallet"

Wallet address is not valid

Verify wallet address format

"Invalid message format"

Message JSON is malformed

Check JSON syntax

"Unsupported message type"

Unknown message type

Use ping, subscribe, or unsubscribe

Connection Errors

  • Rate Limit Exceeded: Temporary IP blocking due to too many connection attempts (http status 429)

  • Origin Not Allowed: CORS validation failure (http status 403)

  • Connection Timeout: Network connectivity issues

Rate Limits

  • Maximum Connections per IP: 20

  • Maximum Connection Attempts per Minute: 30

  • Blocking Duration: 10 minutes for IPs exceeding limits

Integration Examples

JavaScript/Web Browser

For more detailed examples including TypeScript integrations, see the individual room documentation pages.

Last updated