0xHaM-dThorchain vs CEX NetFlow
    Updated 2024-06-23
    -- forked from CEX netflow @ https://flipsidecrypto.xyz/edit/queries/7838b7a1-6cf6-4e1f-b18e-6a8c42001aba

    -- forked from Sandesh / CEX netflow @ https://flipsidecrypto.xyz/Sandesh/q/UOXSoeHRCPXT/cex-netflow

    -- forked from CEX base @ https://flipsidecrypto.xyz/edit/queries/2a5114a1-1f9b-4c49-a62a-9ec5eb8871d9
    -- SELECT
    -- BLOCKCHAIN,
    -- POOL_NAME,
    -- FROM_ASSET,
    -- TO_ASSET,
    -- count(*)
    -- FROM thorchain.defi.fact_swaps
    -- WHERE ( POOL_NAME ilike '%BTC%'
    -- OR BLOCKCHAIN ilike '%BTC%'
    -- OR TO_ASSET ilike '%BTC%')
    -- GROUP by all
    -- /*
    with outt AS
    (
    with outflow AS
    (
    select
    ft.block_timestamp,
    ft.block_number,
    ft.PUBKEY_SCRIPT_ADDRESS,
    ft.value,
    dl.label_type,
    dl.label_subtype,
    dl.address_name,
    dl.label
    from bitcoin.core.fact_inputs ft
    inner join bitcoin.core.dim_labels dl
    on ft.PUBKEY_SCRIPT_ADDRESS = dl.address
    where 1=1
    -- and ft.tx_id=('f8f3656083429056ccdba05815b424dc7da796d8c77bc4bc4503eb9cf3f55b7c')
    -- and ft.block_timestamp >= '2024-01-01'
    QueryRunArchived: QueryRun has been archived