roketo26
Updated 2023-01-03
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
›
⌄
--credit : https://app.flipsidecrypto.com/velocity/queries/157c645d-939e-4896-8733-6d0d08f2ee14
with pricet as (
select recorded_at::date as day,
address,
symbol,
avg (price) as USDPrice
from osmosis.core.dim_prices t1 join osmosis.core.dim_labels t2 on t1.symbol = t2.project_name
group by 1,2,3),
maintable as (
select block_timestamp,
tx_id,
tx_from,
row_number () over (partition by tx_from order by block_timestamp) as rn
from osmosis.core.fact_transactions),
firsttwo as (
select * from maintable
where rn in ('1','2')),
table1 as (
select block_timestamp as swap_date,
tx_id,
trader,
to_currency,
to_amount,
to_decimal
from osmosis.core.fact_swaps
where tx_id in (select tx_id from firsttwo where rn = '1')),
table2 as (
select block_timestamp as transfer_date,
t1.tx_id,
sender,
currency,
amount,
Run a query to Download Data