Skip to content

Commit

Permalink
fix: exclude aleth price exception
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Aug 1, 2023
1 parent 831bae7 commit 7de5877
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion yearn/v2/vaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ async def get_price_return_exceptions(token, block=None):
except Exception as e:
return e

BORKED = {
Network.Mainnet: [
# borked in the vyper exploit of july 2023
"0x718AbE90777F5B778B52D553a5aBaa148DD0dc5D",
]
}.get(chain.id, [])

def _unpack_results(vault: Address, is_experiment: bool, _views: List[str], results: List[Any], scale: int, price_or_exception: Union[float, BaseException], strategies: List[str], strategy_descs: List[Dict]) -> Dict[str,Any]:
try:
info = dict(zip(_views, results))
Expand All @@ -75,7 +82,7 @@ def _unpack_results(vault: Address, is_experiment: bool, _views: List[str], resu
# Sometimes we fail to fetch price during blocks prior to the first deposit to a vault.
# In this case (totalSupply == 0), missing price data is totally fine and we can set price = 0.
# In all other cases, missing price data indicates an issue. We must raise and debug the Exception.
if info["totalSupply"] > 0:
if info["totalSupply"] > 0 and vault not in BORKED:
logger.error(f"The exception below is for vault: {vault}")
raise price_or_exception
price_or_exception = 0
Expand Down

0 comments on commit 7de5877

Please sign in to comment.