SocioCryptoBridge
Updated 2023-04-13Copy Reference Fork
9
1
2
3
4
5
6
7
8
9
›
⌄
SELECT date_trunc('{{interval}}',block_timestamp) as date,
sum (CASE WHEN transfer_type = 'IBC_TRANSFER_IN' then amount ELSE 0 end)/pow(10,6) as amnt_in,
sum (CASE WHEN transfer_type = 'IBC_TRANSFER_OUT' then -1*amount ELSE 0 end)/pow(10,6) as amnt_out,
amnt_in+amnt_out as net_amnt,
sum(net_amnt)over(ORDER BY date) as cum_amnt
FROM cosmos.core.fact_transfers
WHERE currency = 'uatom'
AND tx_succeeded = 'TRUE'
GROUP by date
Run a query to Download Data