Query editor
WITHMintStarted AS(SELECTuser,evt_tx_hash,contract_address,evt_index,evt_block_time,evt_block_number,gMintpower,tRank,CAST(json_extract_scalar(userMintInfo, '$.mintPower')AS UINT256) AS mintPower,CAST(json_extract_scalar(userMintInfo, '$.numOfDays')AS UINT256) AS numOfDays,CAST(json_extract_scalar(userMintInfo, '$.mintableTitan')AS DOUBLE)/power(10,18) AS mintableTitan,from_unixtime(CAST(json_extract_scalar(userMintInfo, '$.mintStartTs') AS DECIMAL)) AS mintStartTs,from_unixtime(CAST(json_extract_scalar(userMintInfo, '$.maturityTs') AS DECIMAL)) AS maturityTs,CAST(json_extract_scalar(userMintInfo, '$.mintPowerBonus')AS UINT256) AS mintPowerBonus,CAST(json_extract_scalar(userMintInfo, '$.EAABonus')AS DOUBLE)/100000 AS EAABonusPCT,CAST(json_extract_scalar(userMintInfo, '$.mintedTitan')AS DOUBLE)/power(10,18) AS mintedTitan,CAST(json_extract_scalar(userMintInfo, '$.mintCost')AS DOUBLE)/power(10,18) AS mintCost,CAST(json_extract_scalar(userMintInfo, '$.status')AS UINT256) AS statusFROM titanx_v2_ethereum.TITANX_evt_MintStarted--WHERE evt_tx_hash=0x4480646a56e0fadc56e77b4c83e3b075fdbf86bc16def65a2fbf552323a8e1fa),USDPrice AS (SELECT CAST(minute AS DATE) AS AsOfDate, AVG(price) AS priceFROM prices.usdWHERE symbol='ETH'AND contract_address IS NULLGROUP BY 1),ProtocolFee AS(select contract_address, evt_tx_hash, evt_block_time,CAST(amount AS DOUBLE)/power(10,18) AS amountETH -- batch total amount fee, day, userfrom titanx_v2_ethereum.TITANX_evt_ProtocolFeeRecevied--where user =0xa01f1df835f9f95f2c5d3c404c8b8ce237f223a8GROUP BY contract_address, evt_tx_hash, evt_block_time, CAST(amount AS DOUBLE)/power(10,18), day, user), MintClaim AS(SELECT user, COUNT(1) AS MintClaimCT, SUM(rewardMinted/power(10,18)) AS MintClaimAMTFrom titanx_v2_ethereum.TITANX_evt_MintClaimed--WHERE user =0x577475a62391cbe7c075dd70b587852822a95ee1GROUP BY user)SELECTms.user AS Wallet,ms.evt_tx_hash,ms.contract_address,ms.evt_index