I've been playing around with Dune Analytics but can't seem to get this to work!
I've managed to filter a wallet to display the transactions showing the number of tokens sold and the corresponding BNB received (it was working before I started mucking around with it).
The issue that I am having is joining the corresponding BNB price on that day (I think I need to do an INNER JOIN function).
Essentially I'd like to have four columns DATE | No. Drip Tokens Sold | BNB Received | BNB Price (on that day)
I've come completely stuck on this last part!
WITH Drip_Data AS
(SELECT
"bnb_amount" / 1e18 AS BNB_Received_Raw,
"token_amount" / 1e18 AS Drip_Sold,
DATE_TRUNC('day', evt_block_time) AS day
FROM
drip."fountain_evt_onBnbPurchase"
WHERE
buyer = '\xFdD4D2e4e3b344429107590c20BCf4B88281Da33'
),
BNB_Data AS (
SELECT BNB_USD_PRICE FROM dune_user_generated."bnb_price" AS BNB),
Thank you!