Abolfazl_771025Daily binance smart chain
    Updated 2023-02-24
    with main as (select
    DISTINCT a.tx_hash,
    a.block_timestamp,
    a.origin_from_address as sender,
    'Binance smart chain' as from_chain,
    try_hex_decode_string(substr(data,451,16)) as to_chain,
    avg(a.RAW_AMOUNT/power(10, 6)) as volume
    from bsc.core.fact_token_transfers a join bsc.core.fact_event_logs b on a.tx_hash=b.tx_hash
    where to_address LIKE lower('0xce16f69375520ab01377ce7b88f5ba8c48f8d666')
    and a.contract_address LIKE lower('0x4268B8F0B87b6Eae5d897996E6b845ddbD99Adf3')
    and topics[0] = '0x999d431b58761213cf53af96262b67a069cbd963499fd8effd1e21556217b841'
    group by 1,2,3,4,5
    )
    select
    a.block_timestamp::date as date,
    from_chain,
    to_chain,
    count(a.tx_hash) as tx_count,
    count(DISTINCT sender) as user_count,
    sum(volume) as volume,
    sum(tx_fee) as tot_fee,
    tot_fee/tx_count fee_per_tx
    FROM main a join bsc.core.fact_transactions b on a.tx_hash=b.tx_hash
    where to_chain is not null
    group by 1,2,3
    Run a query to Download Data