WebSocket
Websocket Pair Feed
WebSocket
Websocket Pair Feed
Get WSS streams for pairs stats & onchain trades in real time.
This endpoint is only available to Growth and Enterprise plans.
Endpoint details
- URL: wss://api.mobula.io
- Message (string):
{
"type": "pair",
"authorization": "YOUR-API-KEY",
"payload": {
"address": "0x059fd118aa8988f5e97b66fcd489765111e069c9",
"blockchain": "1"
}
}
Parameters:
address
: the address of the pairblockchain
: the blockchain of the pair (blockchain ID or name)asset
: you can also query via the asset pattern (asset name or contract) instead of the address - it will use the largest trading pair of the asset (by volume & liquidity)
Data model
Data reponses includes:
{
"pair": "0xd7efdee04e508502bdc666f67f3d9b006c20318d",
"date": 1742777351000,
"token_price": 0.022998242791244194,
"token_price_vs": 623.3316960282402,
"token_amount": 3467.7781520526946,
"token_amount_vs": 0.1280676197032033,
"token_amount_usd": 79.6432911989217,
"type": "buy",
"operation": "regular",
"blockchain": "BNB Smart Chain (BEP20)",
"hash": "0xa06d71d5d46544e74f870147120ac2706d5c70ff893c993e689c5e713434ca54",
"sender": "0x74bf7407dd5fa033e51120f87246ace3b75b32d0",
"token_amount_raw": "3467778152052694767214",
"token_amount_raw_vs": "128067619703203291",
"pairData": {
"token0": {
"address": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
"price": 624.6568794710992,
"priceToken": 27140.717120413887,
"priceTokenString": "27140.71712041388673242181539535522461",
"approximateReserveUSD": 446918.91533437266,
"approximateReserveTokenRaw": "715463048630444359680",
"approximateReserveToken": 715.4630486304444,
"symbol": "BNB",
"name": "BNB",
"id": 100001566,
"decimals": 18,
"totalSupply": 145887575.79,
"circulatingSupply": 146085867,
"logo": "https://coin-images.coingecko.com/coins/images/825/large/bnb-icon2_2x.png?1696501970",
"chainId": "evm:56"
},
"token1": {
"address": "0xcaae2a2f939f51d97cdfa9a86e79e3f085b799f3",
"price": 0.023019431518665583,
"priceToken": 0.00003684501023179856,
"priceTokenString": "0.00003684501023179855976356564251",
"approximateReserveUSD": 446995.46962998016,
"approximateReserveTokenRaw": "19418180212987818403692544",
"approximateReserveToken": 19418180.212987818,
"symbol": "TUT",
"name": "Tutorial",
"logo": "https://mobulastorage.blob.core.windows.net/mobula-assets/assets/logos/a7c7ace09385c833f553c4c488cd86c47368d27d5d31b79b5ae319bb9779f371.png",
"id": 102503533,
"decimals": 18,
"totalSupply": 949999985.5435216,
"circulatingSupply": 954616549,
"chainId": "evm:56"
},
"volume24h": 1728384.3736568224,
"liquidity": 893914.3849643528,
"blockchain": "BNB Smart Chain (BEP20)",
"address": "0xd7efdee04e508502bdc666f67f3d9b006c20318d",
"createdAt": "2025-02-10T00:28:09.000Z",
"type": "uniswap-v2",
"baseToken": "token1",
"exchange": {
"name": "Unknown",
"logo": "https://unknown.png"
},
"factory": "0xca143ce32fe78f1f7019d7d551a6402fc5350c73",
"quoteToken": "token0",
"price": 0.023019431518665583,
"priceToken": 0.00003684501023179856,
"priceTokenString": "0.00003684501023179855976356564251",
"trades_1min": 8,
"buys_1min": 3,
"sells_1min": 5,
"volume_1min": 2619.8813929843805,
"buy_volume_1min": 150.36904615686325,
"sell_volume_1min": 2469.512346827517,
"sellers_1min": 5,
"buyers_1min": 2,
"traders_1min": 7,
"trades_5min": 53,
"buys_5min": 28,
"sells_5min": 25,
"volume_5min": 29378.288306102957,
"buy_volume_5min": 14069.32399601281,
"sell_volume_5min": 15308.96431009015,
"sellers_5min": 19,
"buyers_5min": 23,
"traders_5min": 40,
"trades_15min": 108,
"buys_15min": 63,
"sells_15min": 45,
"volume_15min": 45378.73180595561,
"buy_volume_15min": 23127.93650312149,
"sell_volume_15min": 22250.79530283417,
"traders_15min": 59,
"buyers_15min": 35,
"sellers_15min": 31,
"trades_1h": 384,
"buys_1h": 205,
"sells_1h": 179,
"buyers_1h": 87,
"sellers_1h": 91,
"traders_1h": 154,
"volume_1h": 143670.0329625482,
"buy_volume_1h": 66490.87256288968,
"sell_volume_1h": 77179.16039965858,
"trades_4h": 1098,
"buys_4h": 552,
"sells_4h": 546,
"buyers_4h": 221,
"sellers_4h": 214,
"traders_4h": 349,
"volume_4h": 426118.2646660652,
"buy_volume_4h": 205326.35989735243,
"sell_volume_4h": 220791.90476871288,
"volume_12h": 1877912.2929574074,
"buy_volume_12h": 942733.4245817509,
"sell_volume_12h": 935178.8683756567,
"traders_12h": 1110,
"buyers_12h": 767,
"sellers_12h": 670,
"trades_12h": 4045,
"buys_12h": 2058,
"sells_12h": 1983,
"trades_24h": 8093,
"buys_24h": 4112,
"sells_24h": 3975,
"volume_24h": 4020063.8406410096,
"buy_volume_24h": 2004959.2103884632,
"sell_volume_24h": 2015104.6302525462,
"traders_24h": 1901,
"buyers_24h": 1259,
"sellers_24h": 1226,
"pool_addr": 1.2327823090843993e+48,
"price_change_1min": 0.2828894379890179,
"price_change_5min": 0.3531336244666691,
"price_change_1h": -3.4947089305239842,
"price_change_4h": -7.046475968298424,
"price_change_12h": 4.617155205058722,
"price_change_24h": -4.426061897594044,
"largestPool": {
"chainId": "evm:56",
"address": "0xd7efdee04e508502bdc666f67f3d9b006c20318d",
"marketDepth": {
"token0Up": 3.5507070221341768,
"token1Up": 96849.37991601102,
"token0Down": 3.60437066379286,
"token1Down": 97334.84959259078
},
"type": "uniswap-v2",
"factory": "0xca143ce32fe78f1f7019d7d551a6402fc5350c73",
"token0": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
"token1": "0xcaae2a2f939f51d97cdfa9a86e79e3f085b799f3",
"reserve0": "715463048630444434378",
"reserve1": "19418180212987816026732272",
"price": 27140.717120413887,
"volume24hUSD": 1728384.3736568224,
"totalVolumeUSD": 30728416.145732835,
"createdAt": 1739147289000,
"extra": {
"isStable": false
}
},
"lastStatsFetchTime": 1742777351721
}
}
Unsubscribing from the stream
You can unsubscribe from the stream by sending an unsubscribe message:
{
type: "unsubscribe",
payload: {},
};