-
Notifications
You must be signed in to change notification settings - Fork 6
cap alerts for liquidity #113
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
Conversation
cap/liquidity.py
Outdated
|
|
||
| if len(lines) > 0: | ||
| message = "💧 CAP Withdrawable Liquidity (Mainnet)\n" + "\n".join(lines) | ||
| send_telegram_message(message, PROTOCOL, True) |
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 disable notifications for this message?
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.
ah didn't know this tbh, making it "False"
| # Batch 1: resolve vault addresses for each asset | ||
| with client.batch_requests() as batch: | ||
| for asset in assets: | ||
| batch.add(ctoken.functions.fractionalReserveVault(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.
Better to use call fractionalReserveVaults():https://etherscan.io/address/0xcCcc62962d17b8914c62D74FfB843d73B2a3cccC#readProxyContract#F13
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.
thought about that but if we use this, you can't know what's the underlying asset for the vault you fetch.
| with client.batch_requests() as batch: | ||
| for asset, vault_addr in zip(assets, vault_addresses): | ||
| vault = client.eth.contract(address=vault_addr, abi=load_abi("cap/abi/YearnV3Vault.json")) | ||
| token = client.eth.contract(address=asset, abi=load_abi("common-abi/ERC20.json")) |
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 do you need to fetch token here? Token should be the same as asset?! token==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.
asset.address == token.address
returnt "asset" is not an eth_contract instance but "token" is
it's a backing token so yeah we should |
|
solves part of #105 |
No description provided.