binhachonTHORChain and $vTHOR Overlap - #1
    Updated 2022-05-21
    with vthor_holders as (
    select
    address,
    sum(amount) as current_balance
    from (
    select
    from_address as address,
    -raw_amount/1e18 as amount
    from flipside_prod_db.ethereum_core.fact_token_transfers
    where contract_address = '0x815c23eca83261b6ec689b60cc4a58b54bc24d8d'
    and from_address != '0x0000000000000000000000000000000000000000'
    union all
    select
    to_address as address,
    raw_amount/1e18 as amount
    from flipside_prod_db.ethereum_core.fact_token_transfers
    where contract_address = '0x815c23eca83261b6ec689b60cc4a58b54bc24d8d'
    and to_address != '0x0000000000000000000000000000000000000000'
    )
    group by 1
    ),
    thorchain_current_lper as (
    select
    case
    when asset_address like '0x%' then asset_address
    else coalesce(from_address, asset_address)
    end as lper,
    pool_name,
    sum(case when lp_action = 'add_liquidity' then stake_units else - stake_units end) as current_lping
    from flipside_prod_db.thorchain.liquidity_actions
    group by 1, 2
    ),
    vthor_holders_with_lp as (
    select
    vthor_holders.*,
    pool_name,
    Run a query to Download Data