Moesqsq4 BSC path
    Updated 2023-02-14

    SELECT
    'BSC' as source,
    date(BLOCK_TIMESTAMP) as date ,
    try_hex_decode_string(substr(data, 3 + (64*7), 16)) as destination,
    --sum(AMOUNT_USD) as USD_AMOUNT,
    --sum(DECODED_LOG:amount / 1e6) as usd_amount,
    count (distinct tx_hash) as txns,
    concat (source,'->',destination) as direction
    FROM BSC.core.fact_event_logs
    WHERE tx_hash in (
    SELECT tx_hash
    FROM BSC.core.fact_token_transfers
    WHERE to_address ILIKE ('0xce16f69375520ab01377ce7b88f5ba8c48f8d666')
    )
    and topics[0] = '0x999d431b58761213cf53af96262b67a069cbd963499fd8effd1e21556217b841'
    and destination is not null and BLOCK_TIMESTAMP >= CURRENT_DATE - 10
    group by 2,3,direction

    Run a query to Download Data