h4wkPolygon deUSDC Pool Activity
    Updated 2024-02-14
    -- forked from Polygon deUSDC Pool Activity @ https://flipsidecrypto.xyz/edit/queries/b0915419-d81f-45c8-96ce-a16e9d9caae7

    -- forked from Arbitrum deUSDC Pool Activity @ https://flipsidecrypto.xyz/edit/queries/725db840-091c-4132-89b4-063b07e5a828

    -- forked from arb stable pool @ https://flipsidecrypto.xyz/edit/queries/353c1e89-db1d-443d-9635-0e6f0dc08b93
    with base_raw as (
    select block_timestamp,
    case when from_address = '0x0000000000000000000000000000000000000000' then 'Deposit'
    else 'Withdrawal' end as type,
    raw_amount_precise::float/1e18 as token_amount,
    origin_from_address,
    tx_hash
    -- count(distinct tx_hash) as tx_count,
    -- count(distinct origin_from_address) as user_count,
    -- sum(case when from_address = '0x0000000000000000000000000000000000000000' then raw_amount_precise::float/1e18 else 0 end) as deposit_vol,
    -- sum(case when to_address = '0x0000000000000000000000000000000000000000' then -raw_amount_precise::float/1e18 else 0 end) as withdrawal_vol,
    -- deposit_vol + withdrawal_vol as net_vol,
    -- sum(net_vol) over (order by date) as TVL
    from polygon.core.fact_token_transfers
    where 1 = 1
    -- and tx_hash = '0xc3869010f5f9a85ccd3d252c7640f8c937fb5f787118c893687386245dd7d383'
    and contract_address = lower('0xDa43Bfd7Ecc6835AA6f1761ced30b986A574c0d2')
    and (from_address = '0x0000000000000000000000000000000000000000'
    or to_address = '0x0000000000000000000000000000000000000000')
    -- group by 1,2
    -- order by date desc
    )
    , base as (
    select block_timestamp,
    type as action,
    -- token,
    token_amount,
    origin_from_address as user,
    tx_hash
    from base_raw
    -- where user = '0xfbfa52ee3a8c3ca813e9eeb6ab86af17cc1e0118'
    Last run: about 1 year ago
    USER
    POOL
    LIQUIDITY_PROVIDED
    1
    0xa5b42880846634a466dd9a56edfc489fbe435efepolygon_deUSDC116176265.198803
    2
    0x510a7cd4ba40f7b6643f566a5d45ea55f5cd8d0epolygon_deUSDC65330483.1661701
    3
    0xbf09fd742bbe3a7e1b2fb6a443f9aa0e8ef42b0bpolygon_deUSDC9788858.50785618
    4
    0xdc4d0d92ae598ae497a7fa824bff7f9492df691bpolygon_deUSDC4107334.3188139
    5
    0x7490a38095d5424c101217b08b51edaaba950f82polygon_deUSDC3948755.47849172
    6
    0x0d82ebc0e779aa73a0eb899252f9d83167872903polygon_deUSDC3387001.40210343
    7
    0x481362ad5b1194072e197afd3666e398c4bfa02cpolygon_deUSDC2539560.58780086
    8
    0x739adc03a7d8cea2f0a64d9622a5c346cb0ca1ebpolygon_deUSDC2108455.14788737
    9
    0xcf2b7c6bc98bfe0d6138a25a3b6162b51f75e05dpolygon_deUSDC1374933.64753251
    10
    0x2b9d8f558e02753ed7d4d97dedfad662c02af3cbpolygon_deUSDC1294417.30367423
    11
    0x1f224d73419f2d63022545c127b3a65c31a2cc39polygon_deUSDC803552.113677622
    12
    0xb779daead6031ef189cad4ac438c991efe7635a7polygon_deUSDC706911.592693365
    13
    0x92a0b2c089733bef43ac367d2ce7783526aea590polygon_deUSDC507850.97071095
    14
    0x6c31eb825b69185dddbe101a241d2f771329a440polygon_deUSDC473486.742855255
    15
    0xe24f1714203518c0972f9e81286e273b445980b5polygon_deUSDC405890.264453973
    16
    0x571b90ff189c2b9b5fd01baa88bed41073f388a6polygon_deUSDC405197.92210059
    17
    0xcc3529c09dbeec382804ef0e8ecd18797665eed1polygon_deUSDC398634.140050105
    18
    0x9fc34d7aafa38c58689cca6060c4e178eda4940bpolygon_deUSDC364268.879352625
    19
    0x1918e53476bfb2ac2b696b0a1c3f2df506596531polygon_deUSDC356016.707427321
    20
    0x6f5473bf6f4518037784206000f4d5347c48e98bpolygon_deUSDC281455.953464376
    ...
    290
    22KB
    3s