SandeshCopy of near cheddar nearcon users
    Updated 2022-08-03
    with astro_in as
    (
    select
    c.tx_hash,
    c.block_id,
    c.block_timestamp,
    c.method_name,
    c.deposit/10e24 as amount,
    t.tx_receiver,
    t.tx_signer,
    t.transaction_fee,
    'in' as direction

    from near.core.fact_actions_events_function_call c inner join near.core.fact_transactions t
    on c.tx_hash=t.tx_hash
    inner join near.core.fact_receipts r
    on c.tx_hash=r.tx_hash
    where t.tx_receiver='farm-nearcon.cheddar.near'
    ),
    astro_out as
    (
    select
    c.tx_hash,
    c.block_id,
    c.block_timestamp,
    c.method_name,
    coalesce((((REGEXP_SUBSTR(r.logs[0], '[0-9]+'))::int)/10e24),0) as amount,
    t.tx_receiver,
    t.tx_signer,
    t.transaction_fee,
    -- coalesce((((REGEXP_SUBSTR(r.logs[0], '[0-9]+'))::int)/10e23),0) as amount,
    'out' as direction


    from near.core.fact_actions_events_function_call c inner join near.core.fact_transactions t
    on c.tx_hash=t.tx_hash
    Run a query to Download Data