Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apy murder review #573

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
10 changes: 9 additions & 1 deletion scripts/debug_apy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import os
import sys
import time
import logging
import os
import traceback
Expand All @@ -8,12 +11,14 @@

def main(address):
from yearn.apy.common import get_samples
start = time.perf_counter()
from yearn.v2.registry import Registry
from yearn.v2.vaults import Vault
registry = Registry()
vault = Vault.from_address(address)
vault.registry = registry
print(await_awaitable(vault.apy(get_samples())))
logger.info(f'apy {str(await_awaitable(vault.apy(get_samples())))}')
logger.info(f' ⏱️ {time.perf_counter() - start} seconds')

def with_exception_handling():
address = os.getenv("DEBUG_ADDRESS", None)
Expand All @@ -31,3 +36,6 @@ def with_exception_handling():
logger.info("*** Available variables for debugging ***")
available_variables = [ k for k in locals().keys() if '__' not in k and 'pdb' not in k and 'self' != k and 'sys' != k ]
logger.info(available_variables)

if __name__ == '__main__':
globals()[sys.argv[1]]()
1 change: 1 addition & 0 deletions yearn/apy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from yearn.apy import v1, v2, velo
from yearn.apy.balancer import simple as balancer
from yearn.apy.common import (Apy, ApyBlocks, ApyError, ApyFees, ApyPoints,
ApySamples, get_samples)
from yearn.apy.curve import simple as curve
Loading
Loading