Afonso_DiazTop swap tokens
    Updated 6 days ago
    with

    main as (
    select
    tx_id,
    block_timestamp,
    nvl(from_amount_usd, to_amount_usd) as amount_usd,
    from_address as user,
    from_asset as symbol_in,
    to_asset as symbol_out,
    iff(symbol_in > symbol_out, symbol_in || ' - ' || symbol_out, symbol_out || ' - ' || symbol_in) as pair,
    pool_name as pairs
    from thorchain.defi.fact_swaps
    where block_timestamp::date between '{{ start_date }}' and '{{ end_date }}'
    and amount_usd <= 1e6
    and affiliate_address = 'lifi'
    )

    select
    pairs,
    count(distinct tx_id) as transactions,
    count(distinct user) as users,
    sum(amount_usd) as total_volume_usd,
    avg(amount_usd) as average_amount_usd,
    sum(amount_usd) as platform_fee_volume_usd,
    avg(amount_usd) as average_platform_fee_usd,
    transactions / count(distinct block_timestamp::date) as daily_average_transactions
    from main
    where pair is not null
    group by 1
    order by transactions desc
    limit 10
    Last run: 6 days ago
    PAIRS
    TRANSACTIONS
    USERS
    TOTAL_VOLUME_USD
    AVERAGE_AMOUNT_USD
    PLATFORM_FEE_VOLUME_USD
    AVERAGE_PLATFORM_FEE_USD
    DAILY_AVERAGE_TRANSACTIONS
    1
    ETH.ETH851165658760746.20248571817.0813469958760746.20248571817.08134699536.685345
    2
    BSC.BNB520142844510945.14351558728.0415015364510945.14351558728.04150153621.852941
    3
    BSC.USDT-0X55D398326F99059FF775485246999027B3197955264021721916144.0330074377.8631498731916144.0330074377.86314987312.165899
    4
    AVAX.AVAX188615242169758.310687071025.8904542262169758.310687071025.8904542268.025532
    5
    ETH.USDT-0XDAC17F958D2EE523A2206206994597C13D831EC77726841193954.08206792636.7755104361193954.08206792636.7755104364.595238
    6
    BTC.BTC7504722992104.927987193671.2943901682992104.927987193671.2943901688.333333
    7
    BSC.USDC-0X8AC76A51CC950D9822D68B83FE1AD97B32CD580D620568324340.442542217289.331349279324340.442542217289.3313492793.115578
    8
    AVAX.USDC-0XB97EF9EF8734C71904D8002F8B6BC66DD9C48A6E394350408322.15978426500.394803657408322.15978426500.3948036572.417178
    9
    ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48284252708050.754524531987.518486087708050.754524531987.5184860871.893333
    10
    AVAX.USDT-0X9702230A8EA53601F5CD2DC00FDBC13D4DF4A8C7154135123359.72868262145.471378163123359.72868262145.4713781631.524752
    10
    1KB
    2s