feat: add supply and withdraw morpho market operations to morpho ability#251
Draft
FedericoAmura wants to merge 4 commits intomainfrom
Draft
feat: add supply and withdraw morpho market operations to morpho ability#251FedericoAmura wants to merge 4 commits intomainfrom
FedericoAmura wants to merge 4 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR extends the Morpho ability to support market operations directly, expanding beyond the existing vault operations. The changes enable users to interact with Morpho markets for supply and withdraw collateral operations without requiring intermediary vaults.
- Adds market operations (
market_supply,market_withdrawCollateral) alongside existing vault operations - Updates parameter validation to handle both vault and market contracts with appropriate market ID requirements
- Implements separate execution paths for vault vs market operations with dedicated ABIs and helper functions
Reviewed Changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| vincent-ability.ts | Main logic updates to handle both vault and market operations with unified validation and execution flows |
| schemas.ts | Schema updates to rename operation types, add market contract support, and include market-specific fields |
| helpers/index.ts | Adds Morpho Market ABI, new market operation execution function, and updates validation logic for market operations |
Comments suppressed due to low confidence (2)
packages/apps/ability-morpho/src/lib/helpers/index.ts:13
- The operation name 'market_withdrawCollateral' is inconsistent with the other operation names which use underscores throughout (e.g., 'vault_deposit'). Consider using 'market_withdraw_collateral' for consistency.
USDC: '0xA0b86991c6218A36c1D19D4a2e9Eb0cE3606eB48', // Circle USDC
packages/apps/ability-morpho/src/lib/helpers/index.ts:532
- This case should use the enum value MorphoOperation.MARKET_WITHDRAW_COLLATERAL instead of the string literal to maintain consistency and type safety.
case 'market_withdrawCollateral':
Base automatically changed from
feature/drel-865-migrate-morpho-and-other-tools-to-vincent-monorepo
to
main
August 5, 2025 16:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds market operations supply and withdrawCollateral to the morpho ability. This way we will be able to operate on markets directly without using the intermediary vaults
Operation definitions have been updated to differentiate from vault and market operations
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist:
nx release plan) describing my changes and the version bump