MLDZMNmgf4
Updated 2023-03-14
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
›
⌄
with t1 as (select
RECORDED_HOUR::date as day,
avg(close) as price_token
from solana.core.fact_token_prices_hourly where SYMBOL='SOL'
group by 1),
t2 as (select
block_timestamp,
tx_id,
signers[0] as sol_borrower,
inner_instruction:instructions[0]:parsed:info:amount/1e9 as amount,
amount*price_token as USD_Volume
from solana.core.fact_events a left join t1 b on a.block_timestamp::date=b.day
where program_id = 'MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA'
and block_timestamp >= '2022-02-08'
and inner_instruction:instructions[0]:parsed:info:authority = 'DD3AeAssFvjqTvRTrRAtpfjkBF8FpVKnFuwnMLN9haXD'
),
t3 as (select
block_timestamp,
tx_id,
tx_to as USDC_borrower,
amount
from solana.core.fact_transfers
where mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
and block_timestamp >= '2022-02-08'
and tx_from = '3uxNepDbmkDNq6JhRja5Z8QwbTrfmkKP8AKZV5chYDGG'
)
select
block_timestamp::date as date,
'SOL' as mint,
count(distinct tx_id) as no_txn,
count(distinct sol_borrower) as no_sender,
sum(USD_Volume) as volume_usd,
Run a query to Download Data