vendetta5 - In - depth analysis of type Bridge coins copy
Updated 2023-02-24
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 961118a7-9667-4207-a8d6-9223bdf20a72
with meta_address AS
(
SELECT
TRADER AS unique_trader
, min(BLOCK_TIMESTAMP)::date as min_date
FROM
osmosis.core.fact_swaps
WHERE
BLOCK_TIMESTAMP::date >= '2022-12-01'
GROUP BY
unique_trader
)
SELECT
min_date
, sum( os_price.price ) AS total_price
, CASE
when os_tokens.project_name = 'AVAX' then 'AVAX'
when os_tokens.project_name = 'BNB' then 'BNB'
when os_tokens.project_name = 'BUSD' then 'BUSD'
END
AS coin
, count( DISTINCT os_swap.trader ) AS total_trader
, sum( total_trader ) over ( PARTITION BY coin ORDER BY min_date ASC) as cumulative_trader
, count( DISTINCT os_swap.tx_id ) AS total_swap
, sum( total_swap ) over ( PARTITION BY coin ORDER BY min_date ASC) as cumulative_swap
FROM
osmosis.core.fact_swaps AS os_swap
INNER JOIN
Run a query to Download Data