Crazy_KidTHORChain and $vTHOR Overlap
    Updated 2022-05-24
    WITH a AS (SELECT DISTINCT tx_id as tx1
    FROM ethereum.events_emitted
    WHERE contract_address = LOWER('0xa5f2211B9b8170F694421f2046281775E8468044') --THOR
    ),
    b AS (SELECT *
    FROM ethereum.events_emitted
    WHERE tx_to_address = LOWER('0x815c23eca83261b6ec689b60cc4a58b54bc24d8d') --vTHOR
    AND event_name = 'Deposit'),

    thor AS (SELECT DISTINCT tx_from_address as stakers FROM a JOIN b ON tx1 = tx_id),

    thorchain AS (SELECT DISTINCT from_address as lps FROM thorchain.liquidity_actions WHERE lp_action = 'addd_liquidity'
    AND from_address IN (SELECT * FROM thor))

    SELECT 'Thor Wallets' as wallet_type, COUNT(stakers) as no_of_wallets FROM thor
    UNION ALL
    SELECT 'Thor Wallets LPing in Thorchain' as wallet_type, COUNT(lps) as no_of_wallets FROM thorchain
    Run a query to Download Data