Hi, I am really strugling trying to create an aggregation to get data for a graph. I have a times seties collection named wallet_balances. Here is the list of fields that all the document contains:
wallet_name: str
wallet_address: str
coin_symbol: str
coin_unit: str
coin_amount: int
coin_decimals: int
fiat_symbol: str
fiat_unit: str
coin_price_in_fiat: float
timestamp: date (timeField)
The collection contains balances from different wallets (identified by wallet_name). I want to get each wallet balance ((coin_amount / 10 ^ coin_decimals) * coin_price_in_fiat) for each unique wallet on intervals of 5 minutes and then sum them to have a total. I am specially struggling to work around the fact that maybe in an interval I do not have a reported wallet balance and that in that case I need to use the previous coin_amount before the interval.