Skip to content

Commit

Permalink
hotfix(twap): Hotfix twap (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
akhercha authored Sep 4, 2024
1 parent 99e4dcf commit 46db6fe
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pragma-sdk/pragma_sdk/onchain/mixins/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ async def calculate_volatility(

return tuple(response)

async def calculate_twap(
self, volatility_feed_params: TwapFeedParams
) -> Tuple[int, int]:
async def calculate_twap(self, twap_feed_params: TwapFeedParams) -> Tuple[int, int]:
"""
Calculates the TWAP for a given data feeds.
see https://docs.pragma.build/Resources/Cairo%201/computational-feeds/TWAP for more info
Expand All @@ -72,8 +70,8 @@ async def calculate_twap(
:return: Tuple[int, int] (twap, decimals)
"""

(response,) = await self.summary_stats.functions["calculate_volatility"].call(
*volatility_feed_params.to_list()
(response,) = await self.summary_stats.functions["calculate_twap"].call(
*twap_feed_params.to_list()
)

return tuple(response)

0 comments on commit 46db6fe

Please sign in to comment.