chispascontracts dont work but wtv pyusd usdt
Updated 2023-09-20
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
›
⌄
WITH ethereum AS (
SELECT column1 AS contract_address, column2 AS token_label
FROM (VALUES
('0xdac17f958d2ee523a2206206994597c13d831ec7', 'USDT'), --usdt
('0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', 'USDC'), --usdc
('0x4fabb145d64652a948d72533023f6e7a623c7c53', 'BUSD'), --busd
('0x6b175474e89094c44da98b954eedeac495271d0f', 'DAI'), --dai
('0x853d955acef822db058eb8505911ed77f175b99e', 'FRAX'), --frax
('0x6c3ea9036406852006290770bedfcaba0e23a0e8', 'PYUSD') --pyusd
)
)
SELECT
token_label,
COUNT(DISTINCT tx_hash) AS distinct_swaps
FROM
ETHEREUM.defi.ez_dex_swaps swaps
INNER JOIN ethereum labels ON swaps.contract_address = labels.contract_address
INNER JOIN ETHEREUM.core.dim_labels ON swaps.contract_address = dim_labels.address
WHERE
EXTRACT(YEAR FROM block_timestamp::timestamp) = 2023 -- filter for the year 2023
AND swaps.contract_address IN (
SELECT contract_address
FROM ethereum
)
GROUP BY
token_label
ORDER BY
distinct_swaps DESC;