Skip to main content

Swap

Swap data stream.

Connect

websocat wss://api.datamaxiplus.com/ws/v1/dex/swap -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 is chain@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 while exchange and pool is optional param.

{
"method": "SUBSCRIBE",
"params": [
string
],
"id": int32
}

Response

  • chain represents chain of swap event
  • exchange represents exchange of swap event
  • pool represents pool address of swap event
  • timestamp represents timestamp of swap event
  • logIndex represents log index of swap event
  • blockNumber represents block number of swap event
  • txHash represents tx hash of swap event
  • symbol represents symbol of swap event
  • maker represents maker address of swap event
  • type represents type of swap event
  • baseQtySubUnit represents the base quantity in sub unit
  • quoteQtySubUnit represents the quote quantity in sub unit
  • baseQtyBaseUnit represents the base quantity in base unit
  • quoteQtyBaseUnit represents the quote quantity in base unit
  • basePrice represents the quote price of swap event
{
"chain": string,
"exchange": string,
"pool": string,
"timestamp": int,
"logIndex": int,
"blockNumber": int,
"txHash": string,
"symbol": string,
"maker": string,
"type": string,
"baseQtySubUnit": string,
"quoteQtySubUnit": string,
"baseQtyBaseUnit": float,
"quoteQtyBaseUnit": float,
"basePrice": float
}