From 46db6fe780f4e486e07dfaecef84efcad12d42bc Mon Sep 17 00:00:00 2001 From: adel Date: Wed, 4 Sep 2024 10:49:20 +0200 Subject: [PATCH] hotfix(twap): Hotfix twap (#204) --- pragma-sdk/pragma_sdk/onchain/mixins/summary.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pragma-sdk/pragma_sdk/onchain/mixins/summary.py b/pragma-sdk/pragma_sdk/onchain/mixins/summary.py index 74514fb0..5c072a0e 100644 --- a/pragma-sdk/pragma_sdk/onchain/mixins/summary.py +++ b/pragma-sdk/pragma_sdk/onchain/mixins/summary.py @@ -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 @@ -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)