jgvf2024-02-23 01:05 PM
    Updated 2024-02-23
    -- forked from d3b72d1d-b2b4-4c2d-b7be-f587be074356

    with multi_snd as (
    select
    tx_hash,
    logs,
    block_timestamp,
    split_part(value,'Sending ',2) a,
    try_to_numeric(split_part(a,' yNEAR',1))/1e24 as amount,
    split_part(a,'@',2)::string as receiver
    from near.core.fact_receipts, lateral flatten(input => logs) b
    where RECEIVER_ID = 'multisender.app.near'
    and STATUS_VALUE ilike '%SuccessValue%'
    and logs[0] is not NULL
    )
    , multi_send as (
    SELECT
    a.tx_hash,
    block_timestamp,
    tx_signer as sender,
    receiver,
    amount
    FROM multi_snd a join near.core.fact_transactions b USING(tx_hash)
    )
    ,multi_receive as (
    select
    tx_hash,
    block_timestamp,
    split_part(value,'Sending ',2) a,
    split_part(a,'@',2) as receiver,
    try_to_numeric(split_part(a,' yNEAR',1))/1e24 as amount
    from near.core.fact_receipts, lateral flatten(input => logs) b
    where RECEIVER_ID = 'multisender.app.near'
    and STATUS_VALUE ilike '%SuccessValue%'
    and logs[0] is not NULL
    QueryRunArchived: QueryRun has been archived