0xHaM-dSwap From Stablecoin
Updated 2022-11-27Copy Reference Fork
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
›
⌄
select
block_timestamp::date as date,
'Trader Joe' as platform,
count (distinct tx_hash) as Swaps_Count,
count (distinct origin_from_address) as Swappers_Count,
sum(CASE
WHEN CONTRACT_ADDRESS in ('0xdc42728b0ea910349ed3c6e1c9dc06b5fb591f98', '0x130966628846bfd36ff31a822705796e8cb8c18d',
'0xba7deebbfc5fa1100fb055a87773e1e99cd3507a', '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70')
THEN event_inputs:value/1e18 ELSE event_inputs:value/1e6 END) as volume,
sum(Swaps_Count) over (order by date) as cum_Swaps_Count,
sum(volume) over (order by date) as cum_volume
from avalanche.core.fact_event_logs
where origin_to_address = lower('0x60aE616a2155Ee3d9A68541Ba4544862310933d4')
and event_name = 'Transfer'
and tx_status = 'SUCCESS'
and block_timestamp >= CURRENT_DATE - 30
and block_timestamp <= CURRENT_DATE - 1
and event_inputs:from = origin_from_address
and contract_address in ('0xdc42728b0ea910349ed3c6e1c9dc06b5fb591f98', -- frax 18
'0x130966628846bfd36ff31a822705796e8cb8c18d', -- MIM 18
'0xba7deebbfc5fa1100fb055a87773e1e99cd3507a', -- DAI 18
'0xd586E7F844cEa2F87f50152665BCbc2C279D8d70', -- DAI.e 18
'0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e', -- USDC 6
'0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664', -- USDC.e 6
'0xde3a24028580884448a5397872046a019649b084', -- USDT 6
'0xc7198437980c041c805a1edcba50c1ce5db95118', -- USDT.e 6
'0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7') -- USDt 6
group by 1,2
union ALL
select
block_timestamp::date as date,
'Pangolin' as platform,
count (distinct tx_hash) as Swaps_Count,
count (distinct origin_from_address) as Swappers_Count,
Run a query to Download Data