gokcincrosschain
Updated 2022-11-23
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
›
⌄
with algo_usdc_transfers as (
select date_trunc({{time_frame}},block_timestamp) as date,amount as usd_volume,tx_id,TX_SENDER as user from algorand.core.ez_transfer where asset_id = '31566704' and date >= current_date - {{date_range}}
and amount is not null
group by 1,2,3,4),
sol_usdc_transfers as (
select date_trunc({{time_frame}},block_timestamp) as date,amount as usd_volume,tx_id,tx_from as user from solana.core.fact_transfers
where mint='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' and date >= current_date - {{date_range}} and amount is not null
group by 1,2,3,4),
eth_usdc_transfers as (
select date_trunc({{time_frame}},block_timestamp) as date,amount*token_price as usd_volume,tx_hash,origin_from_address as user from ethereum.core.ez_token_transfers where contract_address='0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' and date >= current_date - {{date_range}}
and amount is not null and token_price is not null
group by 1,2,3,4),
near_usdc_transfers AS (
SELECT tx_hash,date_trunc({{time_frame}},block_timestamp) as date, trim(split(split(logs[0]::string, 'from')[1], 'to')[0]) AS user,
replace(split(logs[0]::string, 'from')[0], 'Transfer ', '')::bigint / power(10, 6) as usd_volume
FROM near.core.fact_receipts
WHERE receiver_id = 'a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near'
AND left(logs[0]::string, 9) = 'Transfer ' AND block_timestamp >= CURRENT_DATE - {{date_range}}
),
optimism_usdc_transfers AS (
SELECT tx_hash,date_trunc({{time_frame}},block_timestamp) as date, FROM_ADDRESS as user,
RAW_AMOUNT/power(10,6) as usd_volume
FROM optimism.core.fact_token_transfers
WHERE CONTRACT_ADDRESS = '0x7f5c764cbc14f9669b88837ca1490cca17c31607'
AND block_timestamp >= CURRENT_DATE - {{date_range}}
),
osmo_usdc_transfers AS (
SELECT tx_id,date_trunc({{time_frame}},block_timestamp) as date, SENDER as user,
amount/power(10,6) as usd_volume
FROM osmosis.core.fact_transfers
WHERE currency = 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858'
AND block_timestamp >= CURRENT_DATE - {{date_range}} and TX_STATUS ='SUCCEEDED'
),
axl_usdc_transfers AS (
SELECT tx_id,date_trunc({{time_frame}},block_timestamp) as date, SENDER as user,
Run a query to Download Data