Query editor
-- Widget: Counter | Title: "TVL" (prefix: "$", SI abbreviations)---- TVL USD = iTRY total supply × latest TRY/USD from TryUsdRelayer---- TryUsdRelayer on MegaETH: 0x3Ee3494f5f55c8ab00aaDc7fcba0ABEaf4c1cB15-- Event: PriceUpdated(uint256 price, uint256 timestamp) -- both non-indexed-- topic0 = keccak256("PriceUpdated(uint256,uint256)")-- = 0x945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd696838-- data[0:32] = price (× 1e8)-- data[32:64] = timestamp---- Relayer is updated daily by a cron. If the latest update is stale (>25h)-- the counter will still show the last known price.WITHitry_supply AS (SELECTCAST(SUM(CASE WHEN "from" = 0x0000000000000000000000000000000000000000 THEN value ELSE 0 END)- SUM(CASE WHEN "to" = 0x0000000000000000000000000000000000000000 THEN value ELSE 0 END)AS DOUBLE) / 1e18 AS supplyFROM erc20_ethereum.evt_TransferWHERE contract_address = 0xb492B4aFD9658093694CF9452D5C272e8230F3B0),latest_price AS (SELECTCAST(bytearray_to_uint256(bytearray_substring(data, 1, 32)) AS DOUBLE) / 1e8 AS try_usd,block_time AS updated_atFROM megaeth.logsWHERE contract_address = 0x3Ee3494f5f55c8ab00aaDc7fcba0ABEaf4c1cB15AND topic0 = 0x945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd696838ORDER BY block_time DESCLIMIT 1)SELECT(SELECT supply FROM itry_supply) * (SELECT try_usd FROM latest_price) AS tvl_usd