Skip to content

Conversation

@tapired
Copy link
Collaborator

@tapired tapired commented Dec 16, 2025

No description provided.

@tapired tapired requested a review from spalen0 December 16, 2025 15:50
cap/liquidity.py Outdated

if len(lines) > 0:
message = "💧 CAP Withdrawable Liquidity (Mainnet)\n" + "\n".join(lines)
send_telegram_message(message, PROTOCOL, True)
Copy link
Collaborator

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?

Copy link
Collaborator Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

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"))
Copy link
Collaborator

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?

Copy link
Collaborator Author

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

@tapired
Copy link
Collaborator Author

tapired commented Dec 16, 2025

In the message, do we need value wWTGXX?

💧 CAP Withdrawable Liquidity (Mainnet)
USDC: 293,388,127.976766
wWTGXX: 4,999,998.000074

TODO:

  • We need to have some threshold value. When the liquidity drops below it, only then script should send telegram alert.
  • Run script in github actions file. Do you know if this value updates daily, hourly or anytime?

it's a backing token so yeah we should

@spalen0 spalen0 merged commit 9a752a9 into main Dec 19, 2025
2 checks passed
@spalen0
Copy link
Collaborator

spalen0 commented Dec 19, 2025

solves part of #105

@spalen0 spalen0 deleted the cap-alerts branch December 19, 2025 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants