Updated 2025-02-21
    WITH pools_information AS (
    SELECT
    t.block_timestamp,
    t.tx_id,
    MAX(CASE WHEN acc.value:name = 'amm' THEN acc.value:pubkey END) AS pool_address,
    MAX(CASE WHEN acc.value:name = 'poolCoinTokenAccount' THEN acc.value:pubkey END) AS poolsol_token_account,
    MAX(
    CASE
    WHEN acc.value:pubkey = 'So11111111111111111111111111111111111111112'
    AND acc.value:name IN ('pcMint', 'coinMint')
    THEN COALESCE(t.decoded_instruction:args:initPcAmount, t.decoded_instruction:args:initCoinAmount)
    END
    ) / 1e9 AS sol_amount
    FROM solana.core.ez_events_decoded t,
    LATERAL FLATTEN(INPUT => t.decoded_instruction:accounts) acc
    WHERE t.signers[0] IN (
    '39azUYFWPz3VHgKCf3VChUwbpURdCHRxjWVowf5jUJjg',
    '5PXxuZkvftsg5CAGjv5LL5tEtvBRskdx1AAjxw8hK2Qx',
    '7ihN8QaTfNoDTRTQGULCzbUT3PHwPDTu5Brcu4iT2paP',
    'DCpJReAfonSrgohiQbTmKKbjbqVofspFRHz9yQikzooP'
    )
    AND t.event_type = 'initialize2'
    AND t.block_id >= 243310797
    GROUP BY t.block_timestamp, t.tx_id
    ),

    daily_tx_excluding_pump_fun AS (
    SELECT
    DATE_TRUNC('day', block_timestamp) AS tx_date,
    liquidity_pool_address,
    SUM(CASE WHEN action = 'deposit' THEN amount ELSE -amount END) AS net_amount
    FROM solana.defi.fact_liquidity_pool_actions
    WHERE mint = 'So11111111111111111111111111111111111111112'
    AND action IN ('deposit', 'withdraw', 'burn')
    AND liquidity_pool_address IN (SELECT pool_address FROM pools_information)
    AND tx_id NOT IN (SELECT tx_id FROM pools_information)
    Last run: 2 months ago
    DATE
    CUMULATIVE_SOL_STUCK
    1
    2024-01-22 00:00:00.000113.045742373
    2
    2024-01-23 00:00:00.000104.758251843
    3
    2024-01-24 00:00:00.000106.819875843
    4
    2024-01-25 00:00:00.000103.454506482
    5
    2024-01-26 00:00:00.000101.561577169
    6
    2024-01-27 00:00:00.000101.467637126
    7
    2024-01-28 00:00:00.000101.798155382
    8
    2024-01-29 00:00:00.000105.275600818
    9
    2024-01-30 00:00:00.000107.99064361
    10
    2024-01-31 00:00:00.000108.72468344
    11
    2024-02-01 00:00:00.000110.697638956
    12
    2024-02-02 00:00:00.000114.037077
    13
    2024-02-03 00:00:00.000117.480479518
    14
    2024-02-04 00:00:00.000133.782371413
    15
    2024-02-05 00:00:00.0000
    16
    2024-02-06 00:00:00.0000
    17
    2024-02-07 00:00:00.000225.211731701
    18
    2024-02-08 00:00:00.000200.078273695
    19
    2024-02-09 00:00:00.000194.834582057
    20
    2024-02-10 00:00:00.000198.695086493
    ...
    397
    17KB
    591s