Skip to content
Dune Analytics

@Bung / Zeus - Query

SQL query results

Loading
 

SQL query

1WITH transfersERC20 AS (
2  SELECT
3    evt_tx_hash AS tx_hash,
4    contract_address AS token_address,
5    -tr.value AS amount,
6    evt_block_time
7  FROM erc20."ERC20_evt_Transfer" tr
8UNION
9  SELECT
10    evt_tx_hash AS tx_hash,
11    contract_address AS token_address,
12    tr.value AS amount,
13    evt_block_time
14  FROM erc20."ERC20_evt_Transfer" tr 
15),
16
17tokenTransferts AS (
18    SELECT
19        t.amount /10^erc."decimals" AS amount,
20        erc.symbol,
21        t.evt_block_time AS block_time
22    FROM transfersERC20 t
23    INNER JOIN erc20.tokens erc ON t.token_address = erc.contract_address
24    WHERE erc.symbol = '{{ token_symbol }}'
25)...