hbd1994Bitcoin
    Updated 2023-09-25
    with live as (
    SELECT
    RESP:data:bitcoin:usd as live_btc_usd_price
    from (SELECT livequery.live.udf_api(
    'https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd') as resp))


    (select
    date(BLOCK_TIMESTAMP) as "Date",
    tx_id as "Transaction ID",
    fee as "Transaction Fee",
    fee * live_btc_usd_price as "Transaction Fee (USD)",
    row_number() over (order by "Transaction Fee" desc) as "Order"
    from bitcoin.core.fact_transactions,live
    qualify "Order" between 1 and 10)
    union all
    (select
    date(BLOCK_TIMESTAMP) as "Date",
    tx_id as "Transaction ID",
    fee as "Transaction Fee",
    fee * live_btc_usd_price as "Transaction Fee (USD)",
    row_number() over (order by "Transaction Fee" desc) as "Order"
    from bitcoin.core.fact_transactions,live
    qualify "Order" between 11 and 20)
    union all
    (select
    date(BLOCK_TIMESTAMP) as "Date",
    tx_id as "Transaction ID",
    fee as "Transaction Fee",
    fee * live_btc_usd_price as "Transaction Fee (USD)",
    row_number() over (order by "Transaction Fee" desc) as "Order"
    from bitcoin.core.fact_transactions,live
    qualify "Order" between 21 and 30)
    union all
    (select
    date(BLOCK_TIMESTAMP) as "Date",
    Run a query to Download Data