KaskoazulOsmosis First Txs
Updated 2023-01-03
999
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 first_txs as (
select tx_from as new_address,
min(block_timestamp) as first_tx_date
from osmosis.core.fact_transactions
where tx_status = 'SUCCEEDED'
group by 1
),
first_tx_id as (
select t1.*,
txs.tx_id as first_tx_id
from first_txs t1
left join osmosis.core.fact_transactions txs
on t1.new_address = txs.tx_from and t1.first_tx_date = txs.block_timestamp
),
swaps as (
select s.trader,
s.tx_id,
s.block_timestamp,
s.from_amount / pow(10,s.from_decimal) as amount_from,
t1.project_name as token_from_name,
t1.label as token_from_label,
s.to_amount / pow(10,s.to_decimal) as amount_to,
t2.project_name as token_to_name,
t2.label as token_to_label,
'SWAP' as type
from osmosis.core.fact_swaps s
left join osmosis.core.dim_tokens t1
on s.from_currency = t1.address
left join osmosis.core.dim_tokens t2
on s.to_currency = t2.address-- or s.to_currency = t.address
where tx_succeeded = TRUE
),
airdrop as (
Run a query to Download Data