diff --git a/yearn/apy/balancer/simple.py b/yearn/apy/balancer/simple.py index b1c14c581..77a05b1ca 100644 --- a/yearn/apy/balancer/simple.py +++ b/yearn/apy/balancer/simple.py @@ -225,8 +225,12 @@ def get_bonus_rewards_apr(rewards, rewards_tvl, block=None): result = 0 for index in range(rewards.extraRewardsLength(block_identifier=block)): extra_rewards = contract(rewards.extraRewards(index)) - extra_rewards_per_year = (extra_rewards.rewardRate(block_identifier=block) / 10**extra_rewards.decimals()) * SECONDS_PER_YEAR - extra_rewards_per_year_usd = extra_rewards_per_year * magic.get_price(extra_rewards, block=block) + reward_token = extra_rewards + if hasattr(extra_rewards, 'rewardToken'): + reward_token = contract(extra_rewards.rewardToken()) + + extra_rewards_per_year = (extra_rewards.rewardRate(block_identifier=block) / 10**reward_token.decimals()) * SECONDS_PER_YEAR + extra_rewards_per_year_usd = extra_rewards_per_year * magic.get_price(reward_token, block=block) result += extra_rewards_per_year_usd / rewards_tvl return result