Ario$AXL Token Recap - holding period in last month
    Updated 2022-12-02
    with axl_price as (
    select
    date_trunc('day', recorded_at) as DATE,
    avg(price) as price
    from osmosis.core.dim_prices
    where symbol = 'AXL'
    group by 1
    ),
    buyers as (
    select
    block_timestamp,
    TRADER as buyer,
    --to_amount/pow(10,to_decimal) as Amount_in_AXL,
    (to_amount*price)/pow(10,to_decimal) as Amount_in_USD
    from osmosis.core.fact_swaps a join axl_price b on a.block_timestamp::date = b.date
    where 1=1
    and
    tx_status = 'SUCCEEDED'
    and
    to_currency = 'ibc/903A61A498756EA560B85A85132D3AEE21B5DEDD41213725D22ABF276EA6945E'
    and
    block_timestamp >= CURRENT_DATE - 30
    )
    , Traders as (
    select
    c.block_timestamp as Buying_date,
    a.block_timestamp as trading_date,
    a.trader
    ,a.from_amount/pow(10,from_decimal) as Amount_in_AXL,
    (a.from_amount*price)/pow(10,a.from_decimal) as Amount_in_USD
    from
    osmosis.core.fact_swaps a join axl_price b
    on a.block_timestamp::date = b.date
    join buyers c
    on a.trader = c.buyer
    and a.block_timestamp > c.block_timestamp
    Run a query to Download Data