Skip to content

Conversation

@timbrinded
Copy link
Collaborator

This pull request updates the idle balances fetching logic to include the main vault in addition to all subvaults, ensuring that asset data is collected from every relevant contract. The associated tests have been updated to reflect the increased number of assets returned.

Idle balances fetching improvements:

  • The fetch_all_assets method in idle_balances.py now fetches idle balances for both the main vault and all subvaults, rather than just the subvaults. Logging messages and variable names have been updated to reflect this change.

Test updates:

  • Integration and non-integration tests for idle balances have been updated to expect 30 assets instead of 24, matching the new behavior of including the main vault. (test_idle_balances.py) [1] [2]

Copilot AI review requested due to automatic review settings October 31, 2025 14:44
@timbrinded timbrinded marked this pull request as ready for review October 31, 2025 14:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modifies the idle balances adapter to include the main vault contract in addition to subvaults when fetching idle balance data. Previously, only subvault balances were fetched.

  • Updated fetch_all_assets() to fetch idle balances from both the main vault and all subvaults
  • Updated test assertions from 24 to 30 total assets to account for the additional 6 assets from the main vault (1 main vault + 4 subvaults = 5 vaults × 6 supported assets = 30 total)
  • Improved documentation and logging messages to reflect the inclusion of the main vault

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/tq_oracle/adapters/asset_adapters/idle_balances.py Extended fetch_all_assets() to include main vault balances alongside subvault balances, with updated docstrings and log messages
tests/adapters/asset_adapters/test_idle_balances.py Updated integration test assertions to expect 30 total assets instead of 24
Comments suppressed due to low confidence (1)

src/tq_oracle/adapters/asset_adapters/idle_balances.py:91

  • The fetch_assets method now accepts main vault addresses in addition to subvault addresses, but the docstring and parameter name still refer exclusively to 'subvault'. Consider renaming the parameter to vault_address and updating the docstring to reflect that both main vault and subvault addresses are valid inputs.
    async def fetch_assets(self, subvault_address: str) -> list[AssetData]:
        """Fetch idle balances for the given subvault on the configured chain.

        Args:
            subvault_address: The specific subvault contract address to query

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@timbrinded timbrinded merged commit 883ba6e into master Oct 31, 2025
12 checks passed
@timbrinded timbrinded deleted the fix/add-main-vault-counting branch October 31, 2025 14:47
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.

2 participants