pinehearstSweat Economy - 0. Active Walkers, SWEAT Minted
    Updated 2023-02-24
    with sweat_wallets AS (
    SELECT
    tx_signer,
    tx_receiver as sweat_wallets,
    deposit,
    (deposit::numeric/pow(10,24)) as near
    FROM near.core.fact_Transfers
    WHERE status = TRUE
    AND (tx_signer LIKE '%sweat_oracle_%'
    OR tx_signer = 'sweat_welcome.near')
    AND tx_receiver NOT IN ('sweat_welcome.near')
    AND NEAR < 0.06 -- new wallets are funded with 0.05 NEAR
    ),
    logs AS (
    SELECT
    block_timestamp,
    tx_hash,
    status_value,
    replace(value, 'EVENT_JSON:') as json,
    regexp_substr(status_value, 'Success') as reg_success,
    try_parse_json(json):standard as standard,
    try_parse_json(json):event as event,
    try_parse_json(json):data as data_logs
    FROM near.core.fact_receipts,
    table(flatten(input => logs))
    WHERE 1=1
    AND block_timestamp > '2022-09-12'
    AND receiver_id = 'token.sweat'
    AND reg_success is not null
    ),
    sweat_transfer AS (
    SELECT
    block_timestamp,
    tx_hash,
    -- json,
    standard,
    Run a query to Download Data