Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 539 Bytes

untitled-3.md

File metadata and controls

15 lines (12 loc) · 539 Bytes

USD value of token utilised for an event

SELECT
date_trunc('week', evt_block_time),
SUM(amount/1e18 * p.price) AS staked
FROM numerai."SimpleGriefing_evt_StakeAdded" s --Replace with relevant event
LEFT JOIN prices.usd p ON p.minute = date_trunc('minute', evt_block_time)
WHERE p.symbol = 'NMR' --Replace with relevant token
-- WHERE p.contract_address = s.token_address --In case different tokens
GROUP BY 1;