-
Notifications
You must be signed in to change notification settings - Fork 19
feat(vault-v2): market v1 adapter #434
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
…V1Adapter interfaces
…ramsList and update fetch logic
…market-v1-adapter
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.
Pull Request Overview
This PR adds support for Morpho Market V1 adapters in the VaultV2 system by introducing VaultV2MorphoMarketV1Adapter classes and their corresponding fetch utilities. This extends the existing VaultV2 adapter architecture to support direct market interactions alongside the existing vault V1 adapters.
Key Changes:
- Introduced
VaultV2MorphoMarketV1AdapterandAccrualVaultV2MorphoMarketV1Adapterclasses for handling market-based adapters - Added fetch utilities and deployless query contracts for market V1 adapters
- Made the
timestampparameter optional in accrual methods to support both adapter types
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/blue-sdk/src/vault/v2/index.ts |
Exports the new market V1 adapter |
packages/blue-sdk/src/vault/v2/VaultV2MorphoMarketV1Adapter.ts |
Defines core market V1 adapter classes with allocation logic |
packages/blue-sdk/src/vault/v2/VaultV2MorphoVaultV1Adapter.ts |
Makes timestamp parameter optional for consistency |
packages/blue-sdk/src/vault/Vault.ts |
Makes timestamp parameter optional in accrual methods |
packages/blue-sdk-viem/src/fetch/vault-v2/VaultV2Adapter.ts |
Updates adapter detection to support market V1 adapters |
packages/blue-sdk-viem/src/fetch/vault-v2/VaultV2MorphoMarketV1Adapter.ts |
Implements fetch logic for market V1 adapters |
packages/blue-sdk-viem/src/queries/vault-v2/GetVaultV2MorphoMarketV1Adapter.ts |
Deployless query contract bytecode and ABI |
packages/blue-sdk-viem/src/abis.ts |
Adds ABIs for market V1 adapter and factory contracts |
packages/blue-sdk-viem/contracts/vault-v2/interfaces/IMorphoMarketV1Adapter.sol |
Defines Solidity interface for market V1 adapters |
packages/blue-sdk-viem/contracts/vault-v2/GetVaultV2MorphoMarketV1Adapter.sol |
Deployless query contract implementation |
packages/blue-sdk-viem/test/VaultV2Adapter.test.ts |
Adds tests for market V1 adapter and refactors existing tests |
packages/blue-sdk-viem/test/setup.ts |
Updates fork block number for testing |
packages/blue-sdk-viem/src/fetch/Vault.ts |
Minor refactor from Array.from to .map() |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/blue-sdk-viem/src/fetch/vault-v2/VaultV2MorphoMarketV1Adapter.ts
Outdated
Show resolved
Hide resolved
| }); | ||
|
|
||
| describe("LiquidityAdapter", () => { | ||
| describe("maxDeposit function", () => { |
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.
IMO we should add a maxWithdraw test case limited by market liquidity
Fixes DVXSDK-33