Skip to content

Commit

Permalink
fix: move temp_rekt_vaults up to registry and use ypm commit that han…
Browse files Browse the repository at this point in the history
…dles pricing of ERN vaults more gracefully.
  • Loading branch information
crebsy committed Oct 18, 2023
1 parent 982d678 commit 54d7cc8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ eth_retry>=0.1.18
eth-hash[pysha3]
ez-a-sync==0.7.4
python-telegram-bot==13.15
git+https://www.github.com/BobTheBuidler/ypricemagic@f10e8d594480242139ce17271484dd79a39cea43
git+https://www.github.com/BobTheBuidler/ypricemagic@897eb800a4dcabf188a0ecbaa7aec80d81c6f1f0
git+https://www.github.com/BobTheBuidler/eth-portfolio@594b4eddf979739e23efa427e3dc508bf90594dc
git+https://www.github.com/BobTheBuidler/toolcache@e37b53cec64556d2b35df66767fca4c8f366a2fa
memray
13 changes: 0 additions & 13 deletions scripts/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,8 @@ async def _main():
data = []
total = len(vaults)

# populate rekt vaults here
temp_rekt = {
Network.Optimism: [
"0xa7B550B3A80361d8e47E07616dC42f04c655881b", # stERN-ERN
"0x9E724b3f65b509326A4F5Ec90D4689BeE6b6C78e", # ERN-USDC
"0x50032bE2b2c7e8A6a6bc241e3aEbef21497A3cF0", # ERN-DOLA
"0x7bDEA31F968089f93A548ddec8BB74036E8ac6e0" # ERN-LUSD
]
}
for i, vault in enumerate(vaults):
pos = i + 1
# TEMP disable all ERN vaults on optimism because there's some pricing issue with them
if chain.id in temp_rekt and str(vault.vault) in temp_rekt[chain.id]:
logger.warn(f"skipping rekt vault [{pos}/{total}]: {vault.name} {str(vault.vault)}")
continue
logger.info(f"wrapping vault [{pos}/{total}]: {vault.name} {str(vault.vault)}")
data.append(await wrap_vault(vault, samples, aliases, icon_url, assets_metadata))
logger.info(f"done wrapping vault [{pos}/{total}]: {vault.name} {str(vault.vault)}")
Expand Down
15 changes: 15 additions & 0 deletions yearn/v2/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
]
}

# populate rekt vaults here
TEMP_REKT_VAULTS = {
Network.Optimism: [
"0x9E724b3f65b509326A4F5Ec90D4689BeE6b6C78e", # ERN-USDC, issue with pricing
]
}

class Registry(metaclass=Singleton):
def __init__(self, watch_events_forever=True, include_experimental=True):
self.releases = {} # api_version => template
Expand Down Expand Up @@ -141,7 +148,15 @@ def watch_events(self):
raise NodeNotSynced(f"No new blocks in the past {sleep_time/60} minutes.")

def process_events(self, events):
temp_rekt_vaults = []
if chain.id in TEMP_REKT_VAULTS:
temp_rekt_vaults = TEMP_REKT_VAULTS[chain.id]

for event in events:
if "vault" in event and event["vault"] in temp_rekt_vaults:
logger.warn(f"skipping temp rekt vault {event['vault']}")
continue

# hack to make camels to snakes
event._ordered = [OrderedDict({inflection.underscore(k): v for k, v in od.items()}) for od in event._ordered]
logger.debug("starting to process %s for %s: %s", event.name, event.address, dict(event))
Expand Down

0 comments on commit 54d7cc8

Please sign in to comment.