You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// We use last_slot_ to calculate slots_since_last_successful_aggregate. This is because last_slot_ is updated after the aggregate price is updated successfully.
// Check if the program upgrade has happened in the current slot and aggregate price has been updated, if so, use the old logic to update twap/twac/price_cumulative.
157
157
// This is to ensure that twap/twac/price_cumulative are calculated correctly during the migration.
158
158
// We check if prev_twap_.denom_ is == 0 because when the program upgrade has happened, denom_ is initialized to 0 and it can only stay the same or increase while numer_ can be negative if prices are negative.
159
-
// And we check if slots_since_last_update == 0 to check if the aggregate price has been updated in the current slot.
159
+
// And we check if slots_since_last_successful_aggregate == 0 to check if the aggregate price has been updated in the current slot.
0 commit comments