jackguySquid Launch Analysis 3
Updated 2024-03-19Copy Reference Fork
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
›
⌄
with tab1 as (
SELECT tx_hash
FROM ethereum.core.fact_token_transfers
LEFT OUTER JOIN ethereum.core.dim_contracts
on address = contract_address
WHERE to_address LIKE lower('0xce16f69375520ab01377ce7b88f5ba8c48f8d666')
AND SYMBOL LIKE 'USDC'
--LIMIT 100
)
SELECT
-- date_trunc('day', block_timestamp) as day,
to_chain,
sum(USDC_AMOUNT) as volume,
avg(USDC_AMOUNT) as avg_swap_size,
count(*) as transactions,
COUNT(DISTINCT sender) as users
FROM (
SELECT
block_timestamp,
DECODED_LOG:amount / power(10, 6) as usdc_amount,
DECODED_LOG:destinationChain AS to_chain,
'Ethereum' as from_chain,
DECODED_LOG:refundAddress as sender
FROM ethereum.core.fact_decoded_event_logs
WHERE EVENT_NAME LIKE 'NativeGasPaidForContractCallWithToken'
AND tx_hash in (SELECT * FROM tab1)
)
GROUP BY 1
QueryRunArchived: QueryRun has been archived