-
Notifications
You must be signed in to change notification settings - Fork 143
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
Wallets and treasury update #182
Wallets and treasury update #182
Conversation
6ce0392
to
dd9cfc2
Compare
|
||
def unit_debt(self, block=None) -> dict: | ||
# NOTE: This only works for YFI based debt, must extend before using for other collaterals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this should be an assertion so a developer knows some part is not implemented when this occurs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I'm not sure what we could assert there, since you don't pass a particular collateral type as an arg. Maybe better to change the method name for clarity?
one last thing to fix: stablecoin buckets for MIM, UST, RSV |
4a09b17
to
905c566
Compare
@mariuspod after the most recent changes, I've nuked my VM db on my staging server and am repulling from scratch to confirm nothing broke in our 185 commit rebase |
e47d8ae
to
26e7ed8
Compare
e408b0f
to
28e9102
Compare
blocked by #186 |
1c6d8cb
to
14a39f0
Compare
adf3c9c
to
ba925c7
Compare
…so it doesn't raise IntegrityException.
…d less ORM surprises.
|
||
def _get_price(token_address, block=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't like this function, it looks super messy.
@@ -13,14 +13,38 @@ | |||
Network.Fantom: '0x56E2898E0ceFF0D1222827759B56B28Ad812f92F' | |||
} | |||
|
|||
supported_assets = { | |||
# https://docs.fantom.foundation/tutorials/band-protocol-standard-dataset#supported-tokens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good addition. if they add a registry in the future, it would be preferred to hardcoding addresses.
from yearn.prices.magic import get_price, logger as logger_price_magic | ||
from yearn.exceptions import PriceError | ||
from yearn.prices.magic import get_price | ||
from yearn.prices.magic import logger as logger_price_magic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not import magic and ref logger as magic.logger
? seems clearer.
from yearn.utils import contract | ||
|
||
from yearn.constants import TREASURY_WALLETS, ERC20_TRANSFER_EVENT_HASH, ERC677_TRANSFER_EVENT_HASH | ||
|
||
logger = logging.getLogger(__name__) | ||
logger_price_magic.setLevel(logging.CRITICAL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think it's appropriate to change log level of another module from outside a script or a debug session
yearn/prices/pps.py
Outdated
|
||
@ttl_cache(maxsize=None, ttl=600) | ||
def get_price(self, asset, block=None): | ||
base_block = next(iter(assets[chain.id][asset])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can throw KeyError and StopIteration on empty list
yearn/prices/pps.py
Outdated
networks = [ Network.Mainnet, Network.Fantom, Network.Arbitrum ] | ||
assets = { | ||
Network.Mainnet: { | ||
"0x03403154afc09Ce8e44C3B185C82C6aD5f86b9ab": 12429262, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete the whole module, we shouldn't manually fix accounting errors, exporter should surface data as is
here is a period of nulls for this address:
- 12430455 first none
- 12430661 last none
No description provided.