HosseinUntitled Query
    Updated 2022-09-19
    with lists1 as (
    select
    tx_receiver as wallet_address,
    (deposit / pow(10, 24)) as amount
    from near.core.fact_list3
    where amount <= 0.05
    and status = 1
    and (
    tx_signer like '%sweat_oracle_%' or
    tx_signer = 'sweat_welcome.near'
    )
    ),

    list2 as (
    select
    block_timestamp::date as date, status_value, tx_hash,
    replace(value, 'EVENT_JSON:') as json,
    try_parse_json(json):standard as standard,
    try_parse_json(json):event as event,
    regexp_substr(status_value, 'Success') as status,
    try_parse_json(json):data as data
    from near.core.fact_list2,
    table(flatten(input => logs))
    where receiver_id = 'token.sweat'
    and status != ''
    ),

    list3 as (
    select block_timestamp::date as date, tx_hash, standard, event,
    value:amount / pow(10, 18) as amount,
    value:owner_id as owner_id,
    value:new_owner_id as new_owner_id,
    iff(value:new_owner_id is null, owner_id, new_owner_id) as to_address
    from list2, table(flatten(input => data))
    having amount > 0
    )
    Run a query to Download Data