FanchicWallet balance all chains
    Updated 2024-04-08
    with

    -- Arbitrum
    arb_vente as(
    select
    date(BLOCK_TIMESTAMP) as date,
    'Arbitrum' as chain,
    tx_hash as tx_hash,
    NULL as amount_recu,
    - sum(amount_usd) as amount_send
    from arbitrum.core.ez_native_transfers
    where FROM_ADDRESS = lower ('{{Adresse}}')
    group by 1,2,3
    ),

    arb_achat as(
    select
    date(BLOCK_TIMESTAMP) as date,
    'Arbitrum' as chain,
    tx_hash,
    sum(amount_usd) as amount_recu,
    NULL as amount_send
    from arbitrum.core.ez_native_transfers
    where TO_ADDRESS = lower ('{{Adresse}}')
    group by 1,2,3
    ),


    -- Optimism
    op_vente as(
    select
    date(BLOCK_TIMESTAMP) as date,
    'Optimism' as chain,
    tx_hash as tx_hash,
    NULL as amount_recu,
    - sum(amount_usd) as amount_send
    QueryRunArchived: QueryRun has been archived