Liquidity
Liquidity data stream.
Connect
- websocat
- wscat
websocat wss://api.datamaxiplus.com/ws/v1/dex/liquidity -H 'X-DTMX-APIKEY: $YOUR_API_KEY'
wscat -c wss://api.datamaxiplus.com/ws/v1/dex/liquidity -H 'X-DTMX-APIKEY: $YOUR_API_KEY'
Subscribe
-
method
specifies the type of request. -
params
list represents of symbols on exchanges that user wants to subscribe. The format of parameter ischain@exchange@pool
(e.g."kaia_mainnet@klayswap@0x12"
). You can request the list of supported chains with /api/v1/dex/chains exchanges with /api/v1/dex/exchanges endpoint, and pools with /api/v1/dex/pools -
The
id
uniquely identifies the subscription request. -
chain
is mandatory whileexchange
andpool
is optional param.
- schema
- example
{
"method": "SUBSCRIBE",
"params": [
string
],
"id": int32
}
Subscribe to all pools in kaia_mainnet
chain
// subscribe for all pools in certain chain
{
"method": "SUBSCRIBE",
"params": [
"kaia_mainnet"
],
"id": 1
}
Subscribe to all pools within klayswap
exchange in kaia_mainnet
chain
{
"method": "SUBSCRIBE",
"params": [
"kaia_mainnet@klayswap"
],
"id": 1
}
Subscribe to 0xB9a1b7A04B6bbF4C319B46583c41f84eDc6c9932
pool from klayswap
exchange in kaia_mainnet
chain
{
"method": "SUBSCRIBE",
"params": [
"kaia_mainnet@klayswap@0xB9a1b7A04B6bbF4C319B46583c41f84eDc6c9932"
],
"id": 1
}
Response
chain
represents chain of swap eventexchange
represents exchange of swap eventpool
represents pool address of swap eventtimestamp
represents timestamp of swap eventlogIndex
represents log index of swap eventblockNumber
represents block number of swap eventtxHash
represents tx hash of swap eventmaker
represents maker address of swap eventtype
represents type of swap eventsymbol
represents symbol of swap eventassets
represents the assets of liquidity eventsymbol
represents the asset symbolqtySubUnit
represents quantity in sub unitqtyBaseUnit
represents quantity in base unit
- schema
- example
{
"chain": string,
"exchange": string,
"pool": string,
"timestamp": int,
"logIndex": int,
"blockNumber": int,
"txHash": string,
"maker": string,
"type": string,
"symbol": string,
"assets": [{
"symbol": string,
"qtySubUnit": string,
"qtyBaseUnit": float
}]
}
{
"chain": "bsc_mainnet",
"exchange": "pancakeswap",
"pool": "0x36696169c63e42cd08ce11f5deebbcebae652050",
"timestamp": 1730516847,
"logIndex": 55,
"blockNumber": 43645624,
"txHash": "0x37653f5bac944bc8b1e754d6f69254fe5a0caf3f617e49773f24542dba1f1327",
"maker": "0x46a15b0b27311cedf172ab29e4f4766fbe7f4364",
"type": "add",
"symbol": "USDT-WBNB",
"assets": [
{
"symbol": "USDT",
"qtySubUnit": "76231293417894035866",
"qtyBaseUnit": 76.23129341789404
},
{
"symbol": "WBNB",
"qtySubUnit": "674145206321343258",
"qtyBaseUnit": 0.6741452063213432
}
]
}