DEX Swaps in Tokenview Transaction Tracking API
DEX Swaps in Tokenview Transaction Tracking API
Overview
DEX Swaps refer to decentralized exchanges where users can trade cryptocurrencies directly with one another without relying on a central authority or intermediary. Here are some key points about DEX Swaps:
- Decentralization: DEXs operate on blockchain networks and allow users to trade digital assets in a peer-to-peer manner. DEXs do not hold users' funds.
- User-Controlled Wallets: Users connect their digital wallets to the DEX platform. They retain full control over their private keys and funds.
- Liquidity Pools: DEXs rely on liquidity pools created by users who provide liquidity by depositing their assets. These pools facilitate trading by ensuring there are enough tokens available for swaps.
DEXs do not facilitate swaps between cryptocurrencies and fiat currencies, they focus solely on crypto-to-crypto trading, including WETH vs. USDT, WBNB vs. USDC, OP or WETH vs. DAI, MATIC vs. USDT etc on Ethereum, BNB Smart Chain, Polygon, Arbitrum and more. Now, let's learn how to track DEX swaps with the pool contract address and swap event.
Uniswap v3 Swaps
To track Uniswap v3 Swaps, we will need to target two parameters:
- The contract address which is coded to raise Uniswap v3 swap event - Let's say 0x: Exchange Proxy.
- The Swap event's Keccak-256 hash - In the case of the v3, you can find it from event documentation from Uniswap. To get the Keccak-256 hash, you can open 0x: Exchange Proxy from blockchain explorer, and click any of the transaction from its transaction list, for instance, this one. And then check its "Event Logs(11)" tab, Ctrl+F to search "Swap", Topics[0] is the event requested, "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67"
With the above parameters, build a HTTP request:
curl --location 'https://services.tokenview.io/vipapi/txmonitor/addTrackingItem?apikey={apikey}' \
--header 'Content-Type: application/json' \
--data '{
"currency": "ETH",
"trackType": "event",
"contract": "0xdef1c0ded9bec7f1a1670819833240f027b25eff",
"topic": "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67"
}'
PancakeSwap V3 Swaps(BSC)
To track PancakeSwap v3 Swaps, we will need to target two parameters:
- The contract address which is coded to raise PancakeSwap v3 swap event - Let's say AggregationRouterV5.
- The Swap event's Keccak-256 hash - In the case of the v3, you can find it from event documentation from PancakeSwap. To get the Keccak-256 hash, you can open AggregationRouterV5 from blockchain explorer, and click any of the transaction from its transaction list, for instance, this one. And then check its "Event Logs(11)" tab, Ctrl+F to search "Swap", Topics[0] is the event requested, "0x19b47279256b2a23a1665c810c8d55a1758940ee09377d4f8d26497a3577dc83"
With the above parameters, build a HTTP request:
curl --location 'https://services.tokenview.io/vipapi/txmonitor/addTrackingItem?apikey={apikey}' \
--header 'Content-Type: application/json' \
--data '{
"currency": "BSC",
"trackType": "event",
"contract": "0x1111111254eeb25477b68fb85ed929f73a960582",
"topic": "0x19b47279256b2a23a1665c810c8d55a1758940ee09377d4f8d26497a3577dc83"
}'
By leveraging Tokenview Transaction Tracking, it is very easy to track the DEX Swaps which will happend on blockchains, it's helpful for traders, programers, investors to get the real-time market activities and bring profitable trading experiences.