-
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
[WEB-1247-199] Refactor price magic and set TVL of ib to 0 after 2022-01-22 #199
Conversation
WEB-1247 [WEB-1247-199] Refactor price magic and set TVL of ib to 0 after 2022-01-22
Compared TVLs for ETH and FTM at e1c2867, they matched exactly to the numbers before the refactoring at a specific block:
With the ironbank tvl change 7c4a75b this might be harder to verify, I can also move the ib fix into a separate PR if that's preferred. |
yearn/ironbank.py
Outdated
if block_ts > snapshot_ts: | ||
tvl = 0 | ||
else: | ||
tvl = (res["getCash"] + res["totalBorrows"] - res["totalReserves"]) * price |
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.
need to clarify the formula, see #201
synthetix, | ||
band, | ||
uniswap_v2, | ||
uniswap_v3, |
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 it's time we switch to trying uni v3 before v2? need to check it doesn't break historical exporter.
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.
didn't check that one yet
…aunched as a separate product.
…d use that for comparing with the current block.
…uded after the snapshot block.
…e function so it can be cached.
…rn-lens more explicit again.
914a627
to
092ce07
Compare
* fix: ironbank dash * fix: overview dash * update overview changes * update TVL in Yearn Ecosystem dash * update vault overview dash * run prettier
…-01-22 (yearn#199) * fix: added ust stablecoin. * feat: refactor multiple chain-based #get_price methods into a single one. * feat: set ironbank tvl to 0 after 2022-01-22T00:00:00Z because they launched as a separate product. * fix: define a constant for the ironbank snapshot block per network and use that for comparing with the current block. * fix: allow to override the default behaviour where the ib TVL is excluded after the snapshot block. * fix: remove __repr__ method. * fix: remove chain.id check. * fix: make token unwrapping chain-aware. * feat: refactor balance as a class. Move memory-cached code into a pure function so it can be cached. * feat: refactor pool-like markets and add #is_in_pool and #get_pool_price for them * fix: make the usage of the constant more explicit. * fix: remove special handling here to not obscure any underlying problems. * fix: order for if-check * fix: change market order. * fix: create two metrics to track ib tvl before and after the snapshot. * fix: revert changes and make querying of uniswap_v2, balancer and yearn-lens more explicit again. * fix: oracles could be empty for the given network. * feat: remove ib tvl from the total sums if the conditions are met. * fix: constant import * fix: remove unused __repr__ methods. * fix: resolve circular import for balancer. * Update dashboards (yearn#209) * fix: ironbank dash * fix: overview dash * update overview changes * update TVL in Yearn Ecosystem dash * update vault overview dash * run prettier Co-authored-by: Dark Ghosty <[email protected]>
Compared TVLs for ETH and FTM at e1c2867, they matched exactly to the numbers before the refactoring at a specific block:
With the ironbank tvl change 7c4a75b this might be harder to verify, I can also move the ib fix into a separate PR if that's preferred.