omer93Torneig R2 1
    Updated 2022-11-22
    WITH
    algo as (
    select
    sum(asset_amount/pow(10,decimals)) as total_amount,
    count(distinct tx_id) as transactions,
    count(distinct tx_sender) as wallets,
    total_amount/transactions as average_amount_per_transfer,
    total_amount/wallets as average_amount_per_wallet
    from algorand.core.ez_transaction_asset_transfer
    where block_timestamp::date >= current_date - INTERVAL '{{Number}} {{Period}}'
    and asset_id = 31566704
    ),
    axl as (
    select
    sum(amount/pow(10,decimal)) as total_amount,
    count(distinct tx_id) as transactions,
    count(distinct sender) as wallets,
    total_amount/transactions as average_amount_per_transfer,
    total_amount/wallets as average_amount_per_wallet
    from axelar.core.fact_transfers
    where currency = 'uusdc' and TX_SUCCEEDED = 'TRUE'
    and block_timestamp::date >= current_date - INTERVAL '{{Number}} {{Period}}'
    ),
    flow as (
    select
    sum(amount) as total_amount,
    count(distinct tx_id) as transactions,
    count(distinct FLOW_WALLET_ADDRESS) as wallets,
    total_amount/transactions as average_amount_per_transfer,
    total_amount/wallets as average_amount_per_wallet
    from flow.core.ez_bridge_transactions
    where token_contract = 'A.b19436aae4d94622.FiatToken'
    and block_timestamp::date >= current_date - INTERVAL '{{Number}} {{Period}}'
    ),
    near as (
    select
    Run a query to Download Data