binhachonUntitled Query
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
›
⌄
with tx_group_id as (
select
distinct
sender as sender_0,
tx_group_id as tx_group_id_0
from algorand.payment_transaction
where receiver = 'XNFT36FUCFRR6CK675FW4BEBCCCOJ4HOSMGCN6J2W6ZMB34KM2ENTNQCP4'
and amount > 0
),
stats as (
select
block_timestamp,
tx_group_id,
sum(amount) as price
from algorand.payment_transaction
inner join tx_group_id on (tx_group_id = tx_group_id_0)
group by 1, 2
),
ALGO_swaps as (
select
block_timestamp,
swap_from_amount as algo_amount,
swap_to_amount as usdc_amount
from algorand.swaps
where swap_from_asset_id = 0
and swap_to_asset_id in (31566704, 312769)
and swap_from_amount > 0
and swap_to_amount > 0
union all
select
block_timestamp,
swap_to_amount as algo_amount,
swap_from_amount as usdc_amount
from algorand.swaps
where swap_from_asset_id in (31566704, 312769)
and swap_to_asset_id = 0
Run a query to Download Data