0x_spadeCourse 3, Assignment 2
Updated 2024-09-07
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
30
31
32
33
34
35
36
›
⌄
-- forked from Course 3, Assignment 1 @ https://flipsidecrypto.xyz/studio/queries/bf93e004-b718-460e-bb99-fe5ce668f39f
--token transfers: Compare the number of times stablecoins are sent -- usdc, usdt, dai in may 2024
with usdt as
(
SELECT
count(distinct tx_hash) as n_transactions
FROM ethereum.core.ez_token_transfers
WHERE from_address = lower('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045')
AND contract_address = lower('0xdAC17F958D2ee523a2206206994597C13D831ec7')
AND block_timestamp BETWEEN '2024-05-01' AND '2024-05-31'
),
dai as
(
SELECT
count(distinct tx_hash) as n_transactions
FROM ethereum.core.ez_token_transfers
WHERE from_address = lower('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045')
AND contract_address = lower('0x6B175474E89094C44Da98b954EedeAC495271d0F')
AND block_timestamp BETWEEN '2024-05-01' AND '2024-05-31'
),
usdc AS
(
SELECT
count(distinct tx_hash) as n_transactions
FROM ethereum.core.ez_token_transfers
WHERE from_address = lower('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045')
AND contract_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48')
AND block_timestamp BETWEEN '2024-05-01' AND '2024-05-31'
)
SELECT
(SELECT n_transactions FROM usdt) AS usdt_transactions,
QueryRunArchived: QueryRun has been archived