This endpoint is only available to Growth and Enterprise plans.
Endpoint Details
- URL:
wss://api.mobula.io
- Event Type:
fast-trade
Subscription Formats
Thefast-trade
endpoint supports subscribing to trades for multiple pools and tokens with real-time updates.
Multiple Items Subscription (Recommended)
Subscribe to multiple pools and tokens using theitems
array format with assetMode
:
Token Mode Subscription
For token-specific trades (whenassetMode
is true
):
Parameters
Core Parameters
assetMode
(required): Boolean indicating subscription modefalse
: Subscribe to pools (default)true
: Subscribe to tokens
items
(required): Array of subscription items, each containing:blockchain
(required): Blockchain identifier (e.g.,"evm:1"
,"solana"
)address
(required): Pool or token address
subscriptionId
(optional): Unique identifier for your WebSocket connection. Auto-generated if not providedsubscriptionTracking
(optional, default:false
): Include subscription details in response logs for debugging
Important Notes
This endpoint is specifically for subscribing to trades only. For enriched market data with each trade, use the
market-details
or token-details
endpoints instead.The assetMode
parameter determines how the addresses are interpreted:false
(default): Addresses are treated as pool addressestrue
: Addresses are treated as token addresses
Real-Time Updates
After the initial subscription response, you’ll receive real-time updates whenever new trades occur involving the subscribed pools/tokens.Real-Time Trade Updates
When trades happen involving subscribed items, you’ll receive updates with trade information. The response format depends on theassetMode
used in your subscription:
Pool Mode Response (assetMode: false
)
Token Mode Response (assetMode: true
)
Response Fields
pair
: Pool address where the trade occurred (only in pool mode:assetMode = false
)token
: Base token address involved in the trade (only in token mode:assetMode = true
)date
: Timestamp of the trade (Unix milliseconds)tokenPrice
: Price of the traded tokentokenPriceVs
: Price of the quote tokentokenAmount
: Amount of tokens traded (base token)tokenAmountVs
: Amount of quote tokens tradedtokenAmountUsd
: USD value of the tradetype
: Trade type (“buy” or “sell”)operation
: Operation type (“regular”, “arbitrage”, etc.)blockchain
: Blockchain namehash
: Transaction hashsender
: Transaction sender addresstokenAmountRaw
: Raw token amount (base token)tokenAmountRawVs
: Raw token amount (quote token)subscriptionId
: Your subscription identifiertimestamp
: Server timestamp when the update was sent
Unsubscribing from the Stream
Unsubscribe from All Trade Streams
Unsubscribe from Specific Subscription
Unsubscribe from Specific Subscription with Type
Unsubscribe from Specific Items (Partial Unsubscription)
You can unsubscribe from specific pools/tokens while keeping others active in the same subscription:Unsubscribe from Multiple Specific Items
Unsubscribe from Specific Items in a Specific Subscription
If you didn’t provide a
subscriptionId
when subscribing, one is auto-generated. To retrieve it, set "subscriptionTracking": true
in the subscription payload.For partial unsubscriptions without subscriptionId
, the system will automatically find and modify subscriptions that contain the specified items, leaving other items in those subscriptions active.