This endpoint is only available to Growth and Enterprise plans.
Endpoint details
- URL: wss://api.mobula.io
- Message (string):
Subscription Tracking
You can optionally track your WebSocket subscription using the following fields:
-
subscriptionId (optional):
A unique ID for your WebSocket connection. If not provided, it is automatically generated by the server.
-
subscriptionTracking (optional, default: false):
Set this to true to include the subscriptionId and additional connection details in the response logs. Helpful for debugging and managing multiple active streams.
{
"type": "market",
"authorization": "YOUR-API-KEY",
"payload": {
"assets": [
{ "name": "Bitcoin" },
{
"address": "0x059fd118aa8988f5e97b66fcd489765111e069c9",
"blockchain": "1"
}
],
"interval": 15,
"subscriptionTracking": "true"
}
}
This websocket sends at the end of each block on every chain we track, an update of multichain weighted average prices & weights for the assets tracked in the Oracle Feed program.
Any asset that has onchain contracts can be tracked this way, on demand.
Data model
Data reponses includes:
[
{
"timestamp": 1721296005026,
"price": 1.0909899899659965,
"marketDepthUSDUp": 924925.3576342536,
"marketDepthUSDDown": 688612.6710491518,
"volume24h": 1056032.4915289644,
"baseSymbol": "EURA",
"quoteSymbol": "USD"
},
{
"timestamp": 1721296005026,
"price": 0.9982620844534368,
"marketDepthUSDUp": 3027549.9580928273,
"marketDepthUSDDown": 2280808.1570687457,
"volume24h": 1052302.1653788893,
"baseSymbol": "LUSD",
"quoteSymbol": "USD"
},
{
"timestamp": 1721296005026,
"price": 0.9962086808597617,
"marketDepthUSDUp": 16386.051460857914,
"marketDepthUSDDown": 10762.452628963154,
"volume24h": 90085.31844922765,
"baseSymbol": "MIM",
"quoteSymbol": "USD"
},
{
"timestamp": 1721296005026,
"price": 0.9961086545945838,
"marketDepthUSDUp": 6000961.186934919,
"marketDepthUSDDown": 21330193.86604397,
"volume24h": 6903342.049632488,
"baseSymbol": "CRVUSD",
"quoteSymbol": "USD"
},
{
"timestamp": 1721296005026,
"price": 1.172859348009492,
"marketDepthUSDUp": 58893031.62029558,
"marketDepthUSDDown": 119975288.5409638,
"volume24h": 95642516.18313012,
"baseSymbol": "WSTETH",
"quoteSymbol": "ETH"
}
]
Unsubscribing from the stream
You can unsubscribe from the stream by sending an unsubscribe message:
- Unsubscribe from all active streams:
Send an empty payload as shown above.
This will terminate all active subscriptions associated with the current WebSocket connection.
{
"type": "unsubscribe",
"authorization": "API-KEY",
"payload": {},
};
- Unsubscribe from a specific subscriptionId:
Include the relevant subscriptionId in the payload:
{
"type": "unsubscribe",
"authorization": "API-KEY",
"payload": {
"subscriptionId": "your-subscription-id"
}
};
If you did not provide a subscriptionId when subscribing, one is generated automatically. To retrieve it, set “subscriptionTracking”: “true” in the subscription payload. Otherwise, it will not be returned in the response.
- Unsubscribe from a specific stream type:
To unsubscribe all streams of a given type (e.g., all “pair”, “market” streams):
{
"type": "unsubscribe",
"authorization": "API-KEY",
"payload": {
"type": "market"
}
}
Also, Mobula keeps an audit trail of all the pairs used in the computation, accessible via this endpoint:
Endpoint: https://general-api-preprod-fgpupeioaa-uc.a.run.app/blockchain/query (POST)
{
"sql": "SELECT * from \"PriceFeedDetails\" order by timestamp desc limit 100"
}
Can’t find what you’re looking for? Reach out to us, response times < 1h.