StangFAST003 - base [ fact_transactions ]
    Updated 2023-12-05

    --- Liquidity Pool
    --- withdraw
    --- UpdateFeesAndRewards , CollectFees , DecreaseLiquidity
    --- deposit
    --- IncreaseLiquidity , OpenPositionWithMetadata
    --- Swap
    --- Swap

    with

    --- price
    tab1 AS
    (
    SELECT
    date_trunc( 'day' , a.recorded_hour ) AS date
    , avg( a.close ) AS price
    , a.token_name AS token
    FROM
    solana.price.ez_token_prices_hourly a
    WHERE
    a.token_address = '5MAYDfq5yxtudAhtfyuMBuHZjgAbaS9tbEyEQYAhDS5y'
    GROUP BY 1 , 3
    ORDER BY 1 DESC
    )

    SELECT
    a.block_timestamp::date AS dt
    , a.signers[0] AS sg
    , a.tx_id AS tx
    , c.amount * d.price AS am
    , trim( split( b.value, ':' ) [2] ) AS ac
    , c.tx_from AS tf
    , c.tx_to AS tt
    FROM
    solana.core.fact_transactions a
    Run a query to Download Data