sarathpooledvalidator1
    Updated 2022-09-21
    with whitelist_bond_actions as (
    SELECT
    block_timestamp,
    SUBSTRING(MEMO, 5+1 , 43) AS node_id,
    SUBSTRING(MEMO, 50, 43) AS bond_provider_id,
    Memo,
    tx_id
    FROM flipside_prod_db.thorchain.bond_events
    WHERE BOND_TYPE = 'bond_paid'
    and regexp_count(MEMO,':') >= 2

    -- ORDER BY rune_amount desc
    -- limit 50
    ) , bond_actions as (

    SELECT
    block_timestamp
    , asset_e8/1e8 as rune_amount
    , SUBSTRING(MEMO, 5+1 , 43) AS node_id
    , from_address
    , tx_id
    FROM flipside_prod_db.thorchain.bond_events
    WHERE
    BOND_TYPE = 'bond_paid'
    and regexp_count(MEMO,':') = 1
    and from_address in (select bond_provider_id from whitelist_bond_actions)
    -- order by block_timestamp desc
    -- limit 10
    ) , wl_bond_actions as (
    SELECT
    wba.block_timestamp as white_list_ts
    , ba.block_timestamp as bond_ts
    , rune_amount
    , ba.node_id
    , bond_provider_id
    Run a query to Download Data