Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .nx/version-plans/version-plan-1754071902926.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
ability-morpho: major
---

Added market operations supply and withdrawCollateral. Redefined operation values to clearly distinguish between market and vault operations
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The Vincent system consists of several key components:
- **ability-debridge**: An ability to utilize cross-chain bridging through Debridge from a Vincent app on behalf of the delegator.
- **ability-transaction-signer**: An ability to sign transactions from a Vincent app on behalf of the delegator.
- **ability-uniswap-swap**: An ability to trigger swaps on Uniswap from a Vincent app on behalf of the delegator.
- **ability-morpho**: An ability to operate on Morpho vaults from a Vincent app on behalf of the delegator.
- **ability-morpho**: An ability to operate on Morpho vaults and markets from a Vincent app on behalf of the delegator.
- **policy-contract-whitelist**: A policy that restricts interactions to a predefined set of whitelisted contract addresses.
- **policy-send-counter**: A policy that limits the number of transactions that can be sent within a specific time period.
- **mcp-sdk**: A Model Context Protocol Wrapper that converts any Vincent app into an MCP server that can be connected to any LLM client to provide it with Vincent abilities.
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/ability-morpho/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This document provides guidelines for contributing to the Vincent Ability Morpho

## Overview

The Vincent Ability Morpho is a ability to send deposit, withdraw or redeem Morpho transactions from a Vincent app on behalf of the delegator. It's part of the Vincent Abilities ecosystem and is built using the Vincent Ability SDK.
The Vincent Ability Morpho is a ability to send deposit, withdraw or redeem Morpho vault transactions and supply or withdrawCollateral Morpho market transactions from a Vincent app on behalf of the delegator. It's part of the Vincent Abilities ecosystem and is built using the Vincent Ability SDK.

## Setup

Expand Down
45 changes: 28 additions & 17 deletions packages/apps/ability-morpho/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Vincent Ability Morpho

A ability to interact with Morpho vaults (deposit, withdraw, redeem) from a Vincent app on behalf of the delegator.
An ability to interact with Morpho vaults (deposit, withdraw, redeem) or markets (supply,
withdrawCollateral) from a Vincent app on behalf of the delegator.

## Overview

The Vincent Ability Morpho is part of the Vincent Abilities ecosystem and is built using the Vincent Ability SDK. It allows
Vincent apps to interact with Morpho vaults on behalf of users, enabling seamless integration with DeFi yield
The Vincent Ability Morpho is part of the Vincent Abilities ecosystem and is built using the Vincent
Ability SDK. It allows
Vincent apps to interact with Morpho vaults on behalf of users, enabling seamless integration with
DeFi yield
strategies.

## Features
Expand All @@ -28,7 +31,7 @@ This ability can be used in Vincent apps to interact with Morpho vaults:

```typescript
import { getVincentAbilityClient } from '@lit-protocol/vincent-app-sdk/abilityClient';
import { bundledVincentAbility } from '@lit-protocol/vincent-ability-morpho';
import { bundledVincentAbility, MorphoOperation } from '@lit-protocol/vincent-ability-morpho';

// One of delegatee signers from your app's Vincent Dashboard
const delegateeSigner = new ethers.Wallet('YOUR_DELEGATEE_PRIVATE_KEY');
Expand All @@ -41,10 +44,11 @@ const abilityClient = getVincentAbilityClient({
const delegatorPkpEthAddress = '0x09182301238'; // The delegator PKP Eth Address

const abilityParams = {
operation: 'deposit', // 'deposit', 'withdraw', or 'redeem'
vaultAddress: '0x1234...', // The Morpho vault address
amount: '1.0', // Amount to deposit/withdraw/redeem
chain: 'base', // The chain where the vault is deployed
operation: MorphoOperation.VAULT_DEPOSIT, // The morpho operation, can apply to vault or market
marketId: '0x1234...', // The market id. Mandatory for market operations
vaultAddress: '0x1234...', // The Morpho vault or market contract address
amount: '1.0', // Amount to deposit/withdraw/redeem in the vault or supply/withdrawCollateral in the market
chain: 'base', // The chain where the contract is deployed
onBehalfOf: '0xabcd...', // Optional: address to receive vault shares (defaults to delegator)
};

Expand Down Expand Up @@ -81,16 +85,22 @@ The ability supports the following operations on Morpho vaults:
- **WITHDRAW** - Withdraw assets from a Morpho vault
- **REDEEM** - Redeem vault shares for underlying assets

And the following operations on Morpho markets:

- **SUPPLY** - Supply collateral to a Morpho market to earn yield
- **WITHDRAW_COLLATERAL** - Withdraw collateral from a Morpho market

## Parameters

| Parameter | Type | Required | Description |
| -------------- | ------------------------------------- | -------- | -------------------------------------------------------- |
| `operation` | `"deposit" \| "withdraw" \| "redeem"` | ✅ | The vault operation to perform |
| `vaultAddress` | `string` | ✅ | Morpho vault contract address (0x format) |
| `amount` | `string` | ✅ | Amount as string (assets for deposit, shares for redeem) |
| `chain` | `string` | ✅ | Chain identifier (e.g., "base") |
| `onBehalfOf` | `string` | ❌ | Address to receive tokens (defaults to sender) |
| `rpcUrl` | `string` | ❌ | Custom RPC URL (for precheck validation) |
| Parameter | Type | Required | Description |
| -------------- | --------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------ |
| `operation` | `"vault_deposit" \| "vault_withdraw" \| "vault_redeem" \| "market_supply" \| "market_withdrawCollateral"` | ✅ | The vault or market operation to perform. Can use `MorphoOperation` enum |
| `marketId` | `string` | ❌ | The market id. Mandatory for market operations |
| `vaultAddress` | `string` | ✅ | Morpho vault contract address (0x format) |
| `amount` | `string` | ✅ | Amount as string (assets for deposit, shares for redeem) |
| `chain` | `string` | ✅ | Chain identifier (e.g., "base") |
| `onBehalfOf` | `string` | ❌ | Address to receive tokens (defaults to sender) |
| `rpcUrl` | `string` | ❌ | Custom RPC URL (for precheck validation) |

## Supported Networks

Expand Down Expand Up @@ -118,7 +128,8 @@ nx e2e ability-morpho-e2e

## Contributing

Please see [CONTRIBUTING.md](../../../CONTRIBUTING.md) for guidelines on how to contribute to this project.
Please see [CONTRIBUTING.md](../../../CONTRIBUTING.md) for guidelines on how to contribute to this
project.

## License

Expand Down
4 changes: 2 additions & 2 deletions packages/apps/ability-morpho/src/generated/lit-action.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ipfsCid": "QmdncJ71t5Bxri6PUxBsBR3ibWewkDgoRWg1t3X3QoYKKi"
"ipfsCid": "QmYFVgnW8wgDJonoGwBW5JNfj8vUW2x84MQyokHWwefbjk"
}
Loading
Loading