BlazeCCTP: arbitrum
Updated 2024-09-09
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
›
⌄
-- forked from CCTP: Optimism @ https://flipsidecrypto.xyz/edit/queries/ae459d87-631a-49f6-b20a-a739f77038cb
-- forked from CCTP: Avalanche @ https://flipsidecrypto.xyz/edit/queries/6f0493fb-1029-4518-97dc-3e102ab2800b
-- forked from CCTP: ETHEREUM @ https://flipsidecrypto.xyz/edit/queries/d369d625-af74-4440-b7f0-cd29dcf1d391
with tb as(
select
block_timestamp,
case when event_name='Mint' then decoded_log:amount/power(10,6) else 0 end as mint_amount,
case when event_name='Burn' then decoded_log:amount/power(10,6) else 0 end as burn_amount,
mint_amount-burn_amount as amount,
mint_amount+burn_amount as vol,
case when event_name='DepositForBurn' then DECODED_LOG:amount/power(10,6) else 0 end as cctp_burn_amount,
case when event_name='MintAndWithdraw' then DECODED_LOG:amount/power(10,6) else 0 end as cctp_mint_amount,
cctp_mint_amount-cctp_burn_amount as cctp_amount,
cctp_mint_amount+cctp_burn_amount as cctp_vol
from arbitrum.core.ez_decoded_event_logs
where
lower(contract_address) in (lower('0xaf88d065e77c8cC2239327C5EDb3A432268e5831'),lower('0x19330d10D9Cc8751218eaf51E8885D058642E08A'))
AND
event_name in ('Mint','Burn','DepositForBurn','MintAndWithdraw')
and TX_STATUS = 'SUCCESS'
),
daily_data as (
SELECT
date_trunc('day',block_timestamp) as day,
sum(mint_amount) as daily_mint,
sum(burn_amount) as daily_burn,
sum(vol) as daily_volume,
sum(amount) as daily_supply_change,
SUM(daily_supply_change) OVER (ORDER BY day) as total_supply,
sum(cctp_mint_amount) as daily_cctp_mint_amount,
sum(cctp_burn_amount) as daily_cctp_burn_amount,
sum(cctp_vol) as daily_cctp_vol,
QueryRunArchived: QueryRun has been archived