Deebs-DeFi-j9fRbzRUNE Who is Buying Custom Other Month
Updated 2023-11-12
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 RUNE Who is Buying Custom @ https://flipsidecrypto.xyz/edit/queries/6c53d3f0-f8ce-4c8d-9e98-df6d5b5e605a
-- forked from KUJIRA Who is Buying Custom @ https://flipsidecrypto.xyz/edit/queries/0741a838-1e6e-4047-bf69-aa337bdaaec8
-- forked from KUJIRA Who is Buying @ https://flipsidecrypto.xyz/edit/queries/64d47120-94e6-429c-83a9-d8323a713142
-- forked from KUJI Weekly WHALEs @ https://flipsidecrypto.xyz/edit/queries/f2b08602-84e0-4d45-a6e7-01bcae8d5def
WITH swaps AS (
SELECT
sum(TO_AMOUNT_USD) AS Swapped_Value_USD,
To_asset,
Blockchain
from thorchain.defi.fact_swaps
WHERE BLOCK_TIMESTAMP BETWEEN {{start_date}} AND {{end_date}}
AND TO_asset='THOR.RUNE'
GROUP BY 2,3
)
SELECT
blockchain,
Swapped_Value_USD
FROM swaps
UNION ALL
SELECT
BLOCKchain,
sum(AMOUNT_OUT_USD) as Swapped_Value_USD
FROM crosschain.defi.ez_dex_swaps
WHERE TOKEN_OUT=lower('0x3155BA85D5F96b2d030a4966AF206230e46849cb')
AND BLOCK_TIMESTAMP BETWEEN {{start_date}} AND {{end_date}}
GROUP BY 1
ORDER BY Swapped_VALUE_USD DESC
Run a query to Download Data