0xbiStable_flow_analytics_usdc
    Updated 2023-10-30
    with stable_token_dim as
    (
    select '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' as contract_address,'usdt' as symbol
    ),


    all_contract_address as (SELECT CONTRACT_ADDRESS from ethereum.core.fact_event_logs CONTRACT_ADDRESS),

    pool_address_dim AS ( SELECT POOL_ADDRESS FROM ethereum.core.dim_dex_liquidity_pools GROUP BY 1 ),

    cex_agg_address as (
    SELECT '0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be' AS address, 'Binance' AS cex_name, 'Binance 1' AS distinct_name UNION ALL SELECT '0xd551234ae421e3bcba99a0da6d736074f22192ff' AS address, 'Binance' AS cex_name, 'Binance 2' AS distinct_name UNION ALL SELECT '0x564286362092d8e7936f0549571a803b203aaced' AS address, 'Binance' AS cex_name, 'Binance 3' AS distinct_name UNION ALL SELECT '0x0681d8db095565fe8a346fa0277bffde9c0edbbf' AS address, 'Binance' AS cex_name, 'Binance 4' AS distinct_name UNION ALL SELECT '0xfe9e8709d3215310075d67e3ed32a380ccf451c8' AS address, 'Binance' AS cex_name, 'Binance 5' AS distinct_name UNION ALL SELECT '0x4e9ce36e442e55ecd9025b9a6e0d88485d628a67' AS address, 'Binance' AS cex_name, 'Binance 6' AS distinct_name UNION ALL SELECT '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8' AS address, 'Binance' AS cex_name, 'Binance 7' AS distinct_name UNION ALL SELECT '0xf977814e90da44bfa03b6295a0616a897441acec' AS address, 'Binance' AS cex_name, 'Binance 8' AS distinct_name UNION ALL SELECT '0x001866ae5b3de6caa5a51543fd9fb64f524f5478' AS address, 'Binance' AS cex_name, 'Binance 9' AS distinct_name UNION ALL SELECT '0x85b931a32a0725be14285b66f1a22178c672d69b' AS address, 'Binance' AS cex_name, 'Binance 10' AS distinct_name UNION ALL SELECT '0x708396f17127c42383e3b9014072679b2f60b82f' AS address, 'Binance' AS cex_name, 'Binance 11' AS distinct_name UNION ALL SELECT '0xe0f0cfde7ee664943906f17f7f14342e76a5cec7' AS address, 'Binance' AS cex_name, 'Binance 12' AS distinct_name UNION ALL SELECT '0x8f22f2063d253846b53609231ed80fa571bc0c8f' AS address, 'Binance' AS cex_name, 'Binance 13' AS distinct_name UNION ALL SELECT '0x28c6c06298d514db089934071355e5743bf21d60' AS address, 'Binance' AS cex_name, 'Binance 14' AS distinct_name UNION ALL SELECT '0x21a31ee1afc51d94c2efccaa2092ad1028285549' AS address, 'Binance' AS cex_name, 'Binance 15' AS distinct_name UNION ALL SELECT '0xdfd5293d8e347dfe59e90efd55b2956a1343963d' AS address, 'Binance' AS cex_name, 'Binance 16' AS distinct_name UNION ALL SELECT '0x56eddb7aa87536c09ccc2793473599fd21a8b17f' AS address, 'Binance' AS cex_name, 'Binance 17' AS distinct_name UNION ALL SELECT '0x9696f59e4d72e237be84ffd425dcad154bf96976' AS address, 'Binance' AS cex_name, 'Binance 18' AS distinct_name UNI
    ),

    special_dim AS
    (
    select '0x075e72a5edf65f0a5f44699c7654c1a76941ddc8' as address,'defi' as LABEL_TYPE ,'dex' as LABEL_SUBTYPE union all
    select '0x0162cd2ba40e23378bf0fd41f919e1be075f025f' as address,'multisig' as LABEL_TYPE ,'safe multisig' as LABEL_SUBTYPE union all
    select '0x0162cd2ba40e23378bf0fd41f919e1be075f025f' as address,'bridge' as LABEL_TYPE ,'l2' as LABEL_SUBTYPE union all
    select '0x1715a3e4a142d8b698131108995174f37aeba10d' as address,'bridge' as LABEL_TYPE ,'normal' as LABEL_SUBTYPE union all
    select '0xe80623a9d41f2f05780d9cd9cea0f797fd53062a' as address,'cex' as LABEL_TYPE ,'bitget' as LABEL_SUBTYPE union all
    select '0x0000000000000000000000000000000000000007' as address,'blackhole' as LABEL_TYPE ,'blackhole' as LABEL_SUBTYPE union all
    select '0x0000000000000000000000000000000000000000' as address,'blackhole' as LABEL_TYPE ,'blackhole' as LABEL_SUBTYPE union all
    select '0x0000000000000000000000000000000000000008' as address,'blackhole' as LABEL_TYPE ,'blackhole' as LABEL_SUBTYPE union all
    select '0x0000000000000000000000000000000000000009' as address,'blackhole' as LABEL_TYPE ,'blackhole' as LABEL_SUBTYPE union all
    select '0x2222222222222222222222222222222222222222' as address,'blackhole' as LABEL_TYPE ,'blackhole' as LABEL_SUBTYPE union all
    select '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' as address,'blackhole' as LABEL_TYPE ,'blackhole' as LABEL_SUBTYPE union all
    select '0x3333333333333333333333333333333333333333' as address,'blackhole' as LABEL_TYPE ,'blackhole' as LABEL_SUBTYPE union all
    select '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' as address,'blackhole' as LABEL_TYPE ,'blackhole' as LABEL_SUBTYPE union all
    select '0x6666666666666666666666666666666666666666' as address,'blackhole' as LABEL_TYPE ,'blackhole' as LABEL_SUBTYPE union all
    select '0x6666666666666666666666666666666666666666' as address,'blackhole' as LABEL_TYPE ,'black hole' as LABEL_SUBTYPE union all
    select '0x00000000219ab540356cbb839cbe05303d7705fa' as address,'sys' as LABEL_TYPE ,'beacon deposit contract' as LABEL_SUBTYPE union all
    select '0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359' as address,'Ethereum Team' as LABEL_TYPE ,'FoundationTipJar' as LABEL_SUBTYPE union all
    select '0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae' as address,'Ethereum Team' as LABEL_TYPE ,'EthDev' as LABEL_SUBTYPE union all
    select address,'cex'as LABEL_TYPE,cex_name as LABEL_SUBTYPE from cex_agg_address group by 1,2,3 union all
    select '0x0000000000000000000000000000000000000000' as address,'blackhole' as level_1_type,'blackhole' as level_2_type union all
    Run a query to Download Data