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

Wallets and treasury update #182

Merged
merged 123 commits into from
Jan 31, 2022

Conversation

BobTheBuidler
Copy link
Collaborator

No description provided.

@BobTheBuidler BobTheBuidler force-pushed the wallets-and-treasury-testing-rebase branch 2 times, most recently from 6ce0392 to dd9cfc2 Compare December 15, 2021 17:46
@BobTheBuidler BobTheBuidler marked this pull request as ready for review December 15, 2021 17:48
@mariuspod mariuspod self-requested a review December 15, 2021 19:28
yearn/outputs/describers/registry.py Outdated Show resolved Hide resolved
yearn/constants.py Outdated Show resolved Hide resolved
yearn/constants.py Outdated Show resolved Hide resolved
yearn/outputs/postgres/utils.py Outdated Show resolved Hide resolved
yearn/outputs/postgres/utils.py Outdated Show resolved Hide resolved

def unit_debt(self, block=None) -> dict:
# NOTE: This only works for YFI based debt, must extend before using for other collaterals
Copy link
Member

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

Copy link
Collaborator Author

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?

yearn/treasury/treasury.py Outdated Show resolved Hide resolved
yearn/yearn.py Outdated Show resolved Hide resolved
yearn/yearn.py Outdated Show resolved Hide resolved
yearn/yearn.py Outdated Show resolved Hide resolved
yearn/entities.py Outdated Show resolved Hide resolved
yearn/entities.py Outdated Show resolved Hide resolved
yearn/outputs/victoria.py Outdated Show resolved Hide resolved
yearn/outputs/describers/vault.py Outdated Show resolved Hide resolved
services/dashboard/docker-compose.yml Outdated Show resolved Hide resolved
services/dashboard/docker-compose.yml Outdated Show resolved Hide resolved
scripts/transactions_exporter.py Outdated Show resolved Hide resolved
scripts/transactions_exporter.py Outdated Show resolved Hide resolved
scripts/transactions_exporter.py Outdated Show resolved Hide resolved
yearn/outputs/postgres/utils.py Outdated Show resolved Hide resolved
@BobTheBuidler
Copy link
Collaborator Author

one last thing to fix: stablecoin buckets for MIM, UST, RSV

@mariuspod mariuspod added the do not merge This issue or pull request is in a holding pattern label Dec 16, 2021
@BobTheBuidler BobTheBuidler changed the base branch from feat/fantom to master December 16, 2021 22:59
@mariuspod mariuspod force-pushed the wallets-and-treasury-testing-rebase branch from 4a09b17 to 905c566 Compare December 17, 2021 15:04
@BobTheBuidler
Copy link
Collaborator Author

@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
Data can be found at staging.yfistats.com

@BobTheBuidler BobTheBuidler force-pushed the wallets-and-treasury-testing-rebase branch from e47d8ae to 26e7ed8 Compare December 24, 2021 22:36
@BobTheBuidler BobTheBuidler force-pushed the wallets-and-treasury-testing-rebase branch from e408b0f to 28e9102 Compare January 17, 2022 23:14
@mariuspod
Copy link
Contributor

blocked by #186

@BobTheBuidler BobTheBuidler force-pushed the wallets-and-treasury-testing-rebase branch 2 times, most recently from 1c6d8cb to 14a39f0 Compare January 19, 2022 16:19
@mariuspod mariuspod force-pushed the wallets-and-treasury-testing-rebase branch 3 times, most recently from adf3c9c to ba925c7 Compare January 27, 2022 15:53
@mariuspod mariuspod added good to merge and removed do not merge This issue or pull request is in a holding pattern testing labels Jan 31, 2022
yearn/entities.py Outdated Show resolved Hide resolved

def _get_price(token_address, block=None):
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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)
Copy link
Member

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


@ttl_cache(maxsize=None, ttl=600)
def get_price(self, asset, block=None):
base_block = next(iter(assets[chain.id][asset]))
Copy link
Member

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

networks = [ Network.Mainnet, Network.Fantom, Network.Arbitrum ]
assets = {
Network.Mainnet: {
"0x03403154afc09Ce8e44C3B185C82C6aD5f86b9ab": 12429262,
Copy link
Member

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

@banteg banteg merged commit 21ee091 into yearn:master Jan 31, 2022
@BobTheBuidler BobTheBuidler deleted the wallets-and-treasury-testing-rebase branch January 31, 2022 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants