bachitinyman - swap vol
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
›
⌄
⌄
with tinymanpool as (
select
asset_id,
asset_name
from algorand.account_asset
where (asset_name like '%Tinyman%') --and asset_name like '%-ALGO%')
),
swapfrom as (
select date(block_timestamp) as day, sum(swap_from_amount) as total_volume, avg(swap_from_amount) as average_volume
from algorand.swaps x inner join tinymanpool l on x.swap_from_asset_id = l.asset_id
where block_timestamp >= dateadd(month, -3, getdate()) group by day
),
swapto as (
select date(block_timestamp) as day, sum(swap_to_amount) as total_volume, avg(swap_to_amount) as average_volume
from algorand.swaps y inner join tinymanpool m on y.swap_to_asset_id = m.asset_id
where block_timestamp >= dateadd(month, -3, getdate())
group by day
)
select * from swapfrom p inner join swapto q on p.day = q.day --group by p.day
/*select date(block_timestamp) as "Date", count(distinct tx_id) as "Transaction Count" from algorand.transactions a
inner join tinymanpool t on a.asset_id = t.asset_id where block_timestamp >= dateadd(month, -3, getdate())
group by 1 order by 1 desc*/
Run a query to Download Data