winnie-pro-internalbase query
Updated 2024-11-26
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
›
⌄
-- forked from Ario / Kamino - Deposit/Withtdraw @ https://flipsidecrypto.xyz/Ario/q/ZerFavHKzn1q/kamino---deposit-withtdraw
with Deposit as (
select
tx_id,
block_timestamp,
signers [0] as Depositor,
DECODED_INSTRUCTION:accounts [3] :pubkey :: string as lendingMarketAuthority
from
solana.core.fact_decoded_instructions
where
program_id = 'KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD'
and event_type = 'depositReserveLiquidityAndObligationCollateral'
and block_timestamp >= current_timestamp - interval '90 days'
group by
1,
2,
3,
4
),
prices as (
select
date_trunc(day, hour) as date,
TOKEN_ADDRESS,
SYMBOL,
avg(price) as price
from
solana.price.ez_prices_hourly
where
date >= current_timestamp - interval '90 days'
group by
1,
2,
3
),
Deposit_Volume as (
QueryRunArchived: QueryRun has been archived