tkvresearch2024-06-27 02:21 PM
    Updated 2024-09-17
    with karak_tx_deposit as
    (select BLOCK_TIMESTAMP,
    tx_hash
    from bsc.core.fact_token_transfers
    where TO_ADDRESS = lower('0x4a2b015CcB8658998692Db9eD4522B8e846962eD')
    ),

    karak_tx_withdraw as
    (select BLOCK_TIMESTAMP,
    tx_hash
    from bsc.core.fact_token_transfers
    where FROM_ADDRESS = lower('0x4a2b015CcB8658998692Db9eD4522B8e846962eD')
    ),

    full_table as
    (select *
    from
    (select a.BLOCK_TIMESTAMP,
    'Deposit' as label,
    a.tx_hash,
    a.FROM_ADDRESS as address,
    -- a.TO_ADDRESS
    from bsc.core.fact_token_transfers a join karak_tx_deposit b
    on a.tx_hash = b.tx_hash
    union all
    select c.BLOCK_TIMESTAMP,
    'Withdraw' as label,
    c.tx_hash,
    --c.FROM_ADDRESS,
    c.TO_ADDRESS
    from bsc.core.fact_token_transfers c join karak_tx_withdraw d
    on c.tx_hash = d.tx_hash)
    where address != '0x0000000000000000000000000000000000000000')

    select *
    from
    QueryRunArchived: QueryRun has been archived