synthquestSynthetix - Inflation Distribution
    Updated 2025-02-15
    -- forked from Inflation table @ https://flipsidecrypto.xyz/edit/queries/b7b66cfe-02be-4e36-b6f1-61e0407ec6ee

    with supply_mint as (
    select
    to_timestamp(decoded_log:lastMintEvent) as last_time
    , decoded_log:supplyMinted/1e18 as total_supplyMinted
    , to_timestamp(decoded_log:timestamp) as start_time
    , coalesce(lead(to_timestamp(decoded_log:timestamp)) over (order by to_timestamp(decoded_log:timestamp)),
    current_timestamp()) as stop_time
    , *
    from ethereum.core.ez_decoded_event_logs
    where
    contract_address = lower('0x8d203C458d536Fe0F97e9f741bC231EaC8cd91cf')
    and topics[0] = lower('0x601e517d4811033fed8290c79b7823ce1ab70258da45400fe2391a3c7432edab')
    and tx_status = 'SUCCESS'
    )


    select amount, amount_usd, token_price, block_timestamp
    , case when t1.to_address = lower('0x39Ea01a0298C315d149a490E34B59Dbf2EC7e48F') then 'ethereum'
    when t1.to_address = lower('0xAc86855865CbF31c8f9FBB68C749AD5Bd72802e3') then 'optimism'
    else 'OTHER' end as layer
    , t1.tx_hash


    , (date_trunc('week', block_timestamp) + INTERVAL '3 DAY')::date as week
    from ethereum.core.ez_token_transfers t1
    RIGHT join (select tx_hash from supply_mint) t2 on t1.tx_hash = t2.tx_hash
    where contract_address = lower('0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F')
    AND
    to_address in (lower('0x39Ea01a0298C315d149a490E34B59Dbf2EC7e48F'), lower('0xAc86855865CbF31c8f9FBB68C749AD5Bd72802e3'))
    -- select
    -- block_number,
    -- block_timestamp,
    -- tx_hash,
    Last run: about 2 months agoAuto-refreshes every 24 hours
    AMOUNT
    AMOUNT_USD
    TOKEN_PRICE
    BLOCK_TIMESTAMP
    LAYER
    TX_HASH
    WEEK
    1
    912997.32042317145.196051222.5379539942022-05-19 00:00:13.000ethereum0x6b8c46320eddf789865ef7b8fc7960c9c8e1f91cff7abba7e12bcd10a0d23b802022-05-19 00:00:00.000
    2
    195167382650.8681611851.9606330382023-06-22 00:00:11.000optimism0xb7d613fb4289185df42de1b6323c4ebff26affd02c27ee0b050bb8ee3d533be72023-06-22 00:00:00.000
    3
    130178255231.2876433351.9606330382023-06-22 00:00:11.000ethereum0xb7d613fb4289185df42de1b6323c4ebff26affd02c27ee0b050bb8ee3d533be72023-06-22 00:00:00.000
    4
    281014692113.4036764052.4629143162022-09-29 00:00:23.000ethereum0xa3b77794f69549dbee75d037dc73c8d9b816bafd7644d98d343b32c6506b403c2022-09-29 00:00:00.000
    5
    182667384312.1726882522.1038949162023-06-08 00:00:11.000optimism0xf87e785af98979a7994403b5c980419cb7174a681b3c7da17e8aaea453af1cc02023-06-08 00:00:00.000
    6
    130178273880.8324229952.1038949162023-06-08 00:00:11.000ethereum0xf87e785af98979a7994403b5c980419cb7174a681b3c7da17e8aaea453af1cc02023-06-08 00:00:00.000
    7
    130178391361.6001670133.006357452023-11-16 00:00:23.000ethereum0x337cec6a9d77e977737b594e076944d8308af83ac490389274678f81b0f6b3d12023-11-16 00:00:00.000
    8
    195167586741.7645054873.006357452023-11-16 00:00:23.000optimism0x337cec6a9d77e977737b594e076944d8308af83ac490389274678f81b0f6b3d12023-11-16 00:00:00.000
    9
    706459.921092892025.750013744.0936869362022-08-11 00:00:19.000ethereum0x93a1ddc8a29c520d8c93c7e68c4e3584c6ea825d051a3e5fb7670ab094f3cc862022-08-11 00:00:00.000
    10
    240593383195.3358093711.5927119072023-01-05 00:00:23.000ethereum0x789c0ac33fb1236fbd86f402d651fac0a6b4cdbcebdbdbd3a3d9f49d177dd9462023-01-05 00:00:00.000
    11
    348290554725.6300434581.5927119072023-01-05 00:00:23.000optimism0x789c0ac33fb1236fbd86f402d651fac0a6b4cdbcebdbdbd3a3d9f49d177dd9462023-01-05 00:00:00.000
    12
    195167410644.8826813172.1040692472023-07-06 00:00:11.000optimism0x3e2a669473382ae182730c9a465627fa0ba491246d63192c6b9b67540f14e9dc2023-07-06 00:00:00.000
    13
    130178273903.5264039952.1040692472023-07-06 00:00:11.000ethereum0x3e2a669473382ae182730c9a465627fa0ba491246d63192c6b9b67540f14e9dc2023-07-06 00:00:00.000
    14
    130178278559.9001959272.139838532023-08-24 00:00:11.000ethereum0xef02c9b64712842c2542d35eec69a2d7c4211e47df9f08b18d121a87da9c0f332023-08-24 00:00:00.000
    15
    195167417625.8664408612.139838532023-08-24 00:00:11.000optimism0xef02c9b64712842c2542d35eec69a2d7c4211e47df9f08b18d121a87da9c0f332023-08-24 00:00:00.000
    16
    362656616831.0121845571.7008708312022-11-10 00:00:11.000ethereum0xfef7c7dd01ea0b0090e80a89333f46ab17cf8849f2d6597ff78c22da2897cb192022-11-10 00:00:00.000
    17
    535383910617.3282570941.7008708312022-11-10 00:00:11.000optimism0xfef7c7dd01ea0b0090e80a89333f46ab17cf8849f2d6597ff78c22da2897cb192022-11-10 00:00:00.000
    18
    912997.32042398699.83213232.6272802542022-07-07 00:00:23.000ethereum0x23bd13ac9aeebb9c445a08447be9187b66b7f165e85413958ce1b816b0e1cb212022-07-07 00:00:00.000
    19
    195167504559.7973832682.5852720872023-08-10 00:00:11.000optimism0x5f53c98773c1e311a737a4bead1fbbdf8229fc89d29c80a27ef219e3245591852023-08-10 00:00:00.000
    20
    130178336545.5497279722.5852720872023-08-10 00:00:11.000ethereum0x5f53c98773c1e311a737a4bead1fbbdf8229fc89d29c80a27ef219e3245591852023-08-10 00:00:00.000
    ...
    143
    24KB
    86s