USD value of token utilised for an event

1
SELECT
2
date_trunc('week', evt_block_time),
3
SUM(amount/1e18 * p.price) AS staked
4
FROM numerai."SimpleGriefing_evt_StakeAdded" s --Replace with relevant event
5
LEFT JOIN prices.usd p ON p.minute = date_trunc('minute', evt_block_time)
6
WHERE p.symbol = 'NMR' --Replace with relevant token
7
-- WHERE p.contract_address = s.token_address --In case different tokens
8
GROUP BY 1;
Copied!
Last modified 5mo ago
Copy link