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

Superform USDC rate providers and vaults on Mainnet and Base #257

Merged
merged 9 commits into from
Feb 5, 2025

Conversation

MattPereira
Copy link
Member

@MattPereira MattPereira commented Jan 31, 2025

Closes #224

Summary

  • Each SuperVault manages multiple "Superforms", which are positions linked to other vaults.
  • An EoA with the SuperVaultManager role controls a whitelist of vaults where funds can be allocated.
  • An EoA with the SuperVaultStrategist role is allowed to rebalance the allocation of assets amongst whitelisted vaults
  • Didn't see anything upgradeable about the rate provider or pipeline
  • SuperVaults may need to be added to buffer block list because of failing test at Add tests for superform USDC on base and mainnet balancer-v3-erc4626-tests#24
    • For vault registery, i set "isCompatible": false assuming that compatibility refers to buffers

@MattPereira MattPereira force-pushed the superform-USDC-vaults branch from 35e65d5 to 44d780f Compare February 3, 2025 19:44

## Conclusion
**Summary judgment: USABLE**
The outlined ERC4626 Vaults should work with Balancer pools, but are not compatible with buffers since `testWithdraw` reverts with "too much loss", perhaps because SuperVaults leverage Yearn v3 `TokenizedStrategy` contract, which requires profits to be gradually unlocked over time, making it difficult to guarantee immediate withdrawals at the expected share price. Fork tests can be seen [here](https://github.com/balancer/balancer-v3-erc4626-tests/pull/24)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Without knowing the contract in details I suspect that gradual unlocks of profits should not lead to "losses" accrueing. At most the same amounts should be withdrawn, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

My interpretation of the failling test was that it attempts to withdraw based on an expected amount the test calculates, but that amount ends up being too low because the SuperVault contract will only release funds that have been unlocked, and not the full amount including profits until the over time part elapses

"summary": "safe",
"review": "./SuperformSuperVaultReview.md",
"warnings": ["buffer"],
"isCompatible": "false"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The failing fork tests are an indication that this Vault is not comppatible

### Administrative Privileges
- [ ] The Rate Provider is upgradeable (e.g., via a proxy architecture or an `onlyOwner` function that updates the price source address).

- [ ] Some other portion of the price pipeline is upgradeable (e.g., the token itself, an oracle, or some piece of a larger system that tracks the price).
Copy link
Collaborator

Choose a reason for hiding this comment

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

You mentioned it in your context section, the entity authorised by onlySuperVaultsStrategist. Can add RebalanceArgs. This includes a adding new superforms.

Since totalAssets() is changed as part of a _harvestAndReport we would want to understand for example how:

  • numberOfSuperforms
  • IBaseForm(superform).previewRedeemFrom(spBalance)

behaves. As part of the review we learned that as part of the rebalance numberOfSuperforms can be increased and potentially add new external call targets influencing the rate.

Based on my reading so far, there is super form validation to make sure only accurate data is added during a rebalance. The data validation includes:

  • duplicate checks
  • whitelist checks
  • is superform from factory check
  • superform existence check

Suggestion: I would tick the upgradeable section as it is not a "proxy upgrade" but a new contract inclusion upgrade and give a rundown of how such a process could potentially be misused and what guardrails are in place to protect against that. Ultimately add the address of the VaultStrategist and get in touch with Superform on the security of the pk / multisig and if helpful for the reader add that information here

@MattPereira MattPereira requested a review from mkflow27 February 5, 2025 18:11
Copy link
Collaborator

@mkflow27 mkflow27 left a comment

Choose a reason for hiding this comment

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

lgtm

### Administrative Privileges
- [ ] The Rate Provider is upgradeable (e.g., via a proxy architecture or an `onlyOwner` function that updates the price source address).

- [x] Some other portion of the price pipeline is upgradeable (e.g., the token itself, an oracle, or some piece of a larger system that tracks the price).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding this information.

@mkflow27 mkflow27 merged commit 408b5da into main Feb 5, 2025
1 check passed
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.

Superform USDC Rate Providers
2 participants