marquprimary asset deposits - kamino
Updated 2024-11-28
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
deposit_txs as (
select
fact_decoded_instructions.block_timestamp
, fact_decoded_instructions.tx_id
, fact_transfers.amount
, fact_transfers.mint
from solana.core.fact_decoded_instructions
left join solana.core.fact_transfers
using(block_timestamp, tx_id)
where fact_decoded_instructions.program_id = 'KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD'
and fact_decoded_instructions.event_type in (
'depositReserveLiquidity'
, 'depositReserveLiquidityAndObligationCollateral'
)
and (fact_decoded_instructions.decoded_instruction :accounts[4] :pubkey = fact_transfers.mint
or fact_decoded_instructions.decoded_instruction :accounts[5] :pubkey = fact_transfers.mint)
and fact_decoded_instructions.decoded_instruction :accounts[0] :pubkey = fact_transfers.tx_from
and block_timestamp ::date > current_date() - interval '30 days'
),
aggregated as (
select
date_trunc('day', block_timestamp) as date
, mint as token_address
, sum(amount) as amount_token
from deposit_txs
group by date, mint
QueryRunArchived: QueryRun has been archived