KARTODAURY Total Locked
    Updated 2022-07-17
    With Flexible_Pool_info as
    (
    select
    stat_date
    ,round(staking_balance,0) as staking_balance
    from
    (
    SELECT
    DATE(BLOCK_TIMESTAMP) as stat_date,
    row_number() over(partition by DATE(BLOCK_TIMESTAMP) order by BLOCK_TIMESTAMP desc ) as num_rank,
    TX_ID,
    case
    when post_token_balances[1]:owner = 'FysGks3izhgVhrUkub9QQWCTEVAdhkZKYSNK2F25maGD' then post_token_balances[1]:uiTokenAmount:uiAmount
    when post_token_balances[2]:owner = 'FysGks3izhgVhrUkub9QQWCTEVAdhkZKYSNK2F25maGD' then post_token_balances[2]:uiTokenAmount:uiAmount
    else -9999
    end as staking_balance,
    signers as wallet_address
    FROM solana.core.fact_transactions
    WHERE SUCCEEDED = TRUE
    and (pre_token_balances[1]:owner = 'FysGks3izhgVhrUkub9QQWCTEVAdhkZKYSNK2F25maGD' or pre_token_balances[2]:owner = 'FysGks3izhgVhrUkub9QQWCTEVAdhkZKYSNK2F25maGD')
    and BLOCK_TIMESTAMP >'2022-01-01'
    ) a
    where num_rank = 1
    order by
    stat_date
    ),


    Locked_Pool_info as
    (
    select
    stat_date
    ,round(staking_balance,0) as staking_balance
    from
    (
    SELECT
    Run a query to Download Data