MLDZMNctoken3-swaps
Updated 2022-08-04
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
›
⌄
with tb1 as (select
distinct SIGNERS[0] as wallets,
tx_id,
INNER_INSTRUCTIONS[0]:instructions[1]:parsed:info:mint as ctokens,
INNER_INSTRUCTIONS[0]:instructions[1]:parsed:info:amount/1e6 as amount
--PRE_TOKEN_BALANCES[1]:uiTokenAmount:uiAmount as amount
from solana.fact_transactions
where INSTRUCTIONS[0]:programId='So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo'
and INNER_INSTRUCTIONS[0]:instructions[1]:parsed:info:mintAuthority='DdZR6zRFiUt4S5mg7AV1uKB2z1f1WzcNYCaTEEWPAuby'
and INNER_INSTRUCTIONS[0]:instructions[1]:parsed:type='mintTo'
and BLOCK_TIMESTAMP>=CURRENT_DATE-3 having amount is not null
)
select
date_trunc('week',BLOCK_TIMESTAMP) as week,
ADDRESS_NAME as tokens,
count(tx_id) as swapfrom
from solana.core.fact_swaps x join solana.core.dim_labels y on x.SWAP_FROM_MINT=y.ADDRESS
where SWAP_FROM_MINT in (select ctokens from tb1)
and BLOCK_TIMESTAMP>='2022-01-01'
group by 1,2
union all
select
date_trunc('week',BLOCK_TIMESTAMP) as week,
ADDRESS_NAME as tokens,
count(tx_id) as swapfrom
from solana.core.fact_swaps x join solana.core.dim_labels y on x.SWAP_TO_MINT=y.ADDRESS
where SWAP_FROM_MINT in (select ctokens from tb1)
and BLOCK_TIMESTAMP>='2022-01-01'
group by 1,2
Run a query to Download Data