Sniperok-tomato
    Updated 2024-10-05
    -- with tbl as ( select block_timestamp,
    -- tx_signer as user,
    -- tx_hash
    -- from near.core.fact_transactions
    -- where TX_SUCCEEDED = 'true'
    -- and block_timestamp::date::Date >= '2023-01-01'
    -- UNION
    -- select block_timestamp,
    -- tx_receiver as user,
    -- tx_hash
    -- from near.core.fact_transactions
    -- where TX_SUCCEEDED = 'true'
    -- and block_timestamp::date::Date >= '2023-01-01'
    -- )
    -- ,
    with new_wallet as (
    select
    date_trunc('quarter', first_tx) as date,
    count(DISTINCT tx_signer) as n_new_user
    from (
    select
    tx_signer,
    min(block_timestamp) as first_tx
    from near.core.fact_transactions
    group by 1
    )
    group by 1
    )
    -- ,
    -- affiliate_volume as (
    -- select
    -- date_trunc('quarter', block_timestamp) as date,
    -- sum(coalesce(from_amount_usd, to_amount_usd)) as affiliate_volume
    -- from thorchain.defi.fact_swaps
    -- where affiliate_address is not null
    -- group by 1
    QueryRunArchived: QueryRun has been archived