AMLBotUSDT CEX -> DepositAddr -> CEX
    Updated 2024-12-17
    with cex_addresses as(
    select
    address,
    label
    from ethereum.core.dim_labels
    where label_type='cex' and label_subtype = 'hot_wallet'
    ),
    raw_tx as(
    select
    block_timestamp,
    tx_hash,
    from_address,
    --label from_cex_label,
    to_address,
    amount
    from ethereum.core.ez_token_transfers transfers
    where
    block_timestamp::date >= current_date - {{days_back}}
    and
    contract_address = '0xdac17f958d2ee523a2206206994597c13d831ec7'
    and amount > 0
    ),
    cex_deposit_collecting_address as(
    select
    distinct tx.from_address as address,
    cex_addresses.label as receiving_cex_name
    from raw_tx tx
    inner join cex_addresses on (tx.to_address = cex_addresses.address)
    where
    cex_addresses.address is not null
    and tx.from_address not in (select address from cex_addresses)
    ),
    cex_withdrawal_to_deposit_address_leg as (
    select
    --tx.block_number,
    tx.block_timestamp,
    QueryRunArchived: QueryRun has been archived