Skip to content
docs

MorphoVaultProtocolEvm

Defined in: protocol-lending-morpho-evm/src/vault.ts:60

A Morpho vault — MetaMorpho (Vault V1) or Vault V2 — as a LendingProtocol: supply deposits the vault’s asset for shares, withdraw redeems them; borrow / repay reject, a vault does not lend to its depositors.

The vault is identified on-chain: one of the chain’s Morpho vault factories must acknowledge it (isMetaMorpho / isVaultV2), its asset() must be the token supplied, and deposits / withdrawals are checked before anything is sent, then proven with eth_call: a V1 vault against maxDeposit / maxWithdraw (caps, liquidity); a V2 vault — whose max* views answer 0 for everyone — against its transfer gates, with the eth_call proof deciding caps and liquidity (V2 enforces them by reverting). APY and TVL come from the Morpho API as decoration.

new MorphoVaultProtocolEvm(account, config): MorphoVaultProtocolEvm

Defined in: protocol-lending-morpho-evm/src/vault.ts:66

IWalletAccountReadOnly | IWalletAccount

MorphoVaultConfig

MorphoVaultProtocolEvm

MorphoBase<MorphoVaultConfig>.constructor

protected readonly _account: IWalletAccountReadOnly | IWalletAccount

Defined in: core/dist/index-QWdcwE6y.d.ts:309

MorphoBase._account


protected readonly _config: MorphoVaultConfig

Defined in: core/dist/index-QWdcwE6y.d.ts:310

MorphoBase._config


protected readonly api: MorphoApi | null

Defined in: protocol-lending-morpho-evm/src/base.ts:51

MorphoBase.api


readonly chain: MorphoChain

Defined in: protocol-lending-morpho-evm/src/base.ts:50

MorphoBase.chain


readonly chainId: number

Defined in: protocol-lending-morpho-evm/src/base.ts:49

MorphoBase.chainId


readonly vault: `0x${string}`

Defined in: protocol-lending-morpho-evm/src/vault.ts:61

get protected activityVault(): string

Defined in: protocol-lending-morpho-evm/src/vault.ts:64

A vault this instance targets (the vault protocol sets it); accepted by address in describeActivity.

string

MorphoBase.activityVault


get protected client(): object

Defined in: protocol-lending-morpho-evm/src/base.ts:99

object

MorphoBase.client

protected approvals(token, spender, amount): Promise<Tx[]>

Defined in: protocol-lending-morpho-evm/src/base.ts:160

Exact-amount ERC-20 approvals, with the approve(0) reset Ethereum’s USDT demands before a raise.

`0x${string}`

`0x${string}`

bigint

Promise<Tx[]>

MorphoBase.approvals


borrow(): Promise<never>

Defined in: protocol-lending-morpho-evm/src/vault.ts:259

Promise<never>

MorphoBase.borrow


describeActivity(tx, ctx): ActivityItem | null

Defined in: protocol-lending-morpho-evm/src/base.ts:84

Recognize Morpho transactions offline: Blue by the singleton’s address (preset for the transaction’s chain, or this instance’s), vaults by ERC-4626 selector + the called contract’s shares minted to / burned from the wallet. See activity.ts.

ChainTx

DescribeActivityContext

ActivityItem | null

MorphoBase.describeActivity


protected encode(abi, functionName, args): `0x${string}`

Defined in: protocol-lending-morpho-evm/src/base.ts:108

readonly unknown[]

string

readonly unknown[]

`0x${string}`

MorphoBase.encode


protected execute(plan, action): Promise<{ approveHashes: string[]; fee: bigint; hash: string; }>

Defined in: protocol-lending-morpho-evm/src/base.ts:171

Approvals (each awaited to a receipt), then the main transaction, proven first.

Tx[]

Tx

string

Promise<{ approveHashes: string[]; fee: bigint; hash: string; }>

MorphoBase.execute


getApy(): Promise<number>

Defined in: protocol-lending-morpho-evm/src/vault.ts:155

Net APY in percent from the Morpho API (after fees, incl. rewards).

Promise<number>


getPosition(): Promise<VaultPosition>

Defined in: protocol-lending-morpho-evm/src/vault.ts:127

Shares, their current value, and what is withdrawable right now.

Promise<VaultPosition>


getStats(): Promise<ApiVault | null>

Defined in: protocol-lending-morpho-evm/src/vault.ts:149

The vault’s API record (name, APY, TVL, listed) — null without API or when the API does not know the vault.

Promise<ApiVault | null>


getVault(): Promise<VaultInfo>

Defined in: protocol-lending-morpho-evm/src/vault.ts:73

The vault as the chain describes it (cached per instance). Refuses an unverified vault unless allowed.

Promise<VaultInfo>


protected me(): Promise<`0x${string}`>

Defined in: protocol-lending-morpho-evm/src/base.ts:112

Promise<`0x${string}`>

MorphoBase.me


protected prove(tx, action): Promise<void>

Defined in: protocol-lending-morpho-evm/src/base.ts:142

eth_call from the account; a Morpho / vault revert becomes a readable MorphoError.

Tx

string

Promise<void>

MorphoBase.prove


quoteBorrow(): Promise<never>

Defined in: protocol-lending-morpho-evm/src/vault.ts:260

Promise<never>

MorphoBase.quoteBorrow


protected quoteFee(txs): Promise<bigint>

Defined in: protocol-lending-morpho-evm/src/base.ts:150

Tx[]

Promise<bigint>

MorphoBase.quoteFee


quoteRepay(): Promise<never>

Defined in: protocol-lending-morpho-evm/src/vault.ts:262

Promise<never>

MorphoBase.quoteRepay


quoteSupply(o): Promise<LendingQuote & object>

Defined in: protocol-lending-morpho-evm/src/vault.ts:210

MorphoVaultSupplyOptions

Promise<LendingQuote & object>

MorphoBase.quoteSupply


quoteWithdraw(o): Promise<LendingQuote & object>

Defined in: protocol-lending-morpho-evm/src/vault.ts:253

MorphoVaultWithdrawOptions

Promise<LendingQuote & object>

MorphoBase.quoteWithdraw


protected read<T>(address, abi, functionName, args?): Promise<T>

Defined in: protocol-lending-morpho-evm/src/base.ts:104

T

`0x${string}`

readonly unknown[]

string

readonly unknown[] = []

Promise<T>

MorphoBase.read


repay(): Promise<never>

Defined in: protocol-lending-morpho-evm/src/vault.ts:261

Promise<never>

MorphoBase.repay


protected requireSigningAccount(methodName): IWalletAccount

Defined in: core/dist/index-QWdcwE6y.d.ts:322

The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.

string

IWalletAccount

MorphoBase.requireSigningAccount


protected send(tx): Promise<{ fee: bigint; hash: string; }>

Defined in: protocol-lending-morpho-evm/src/base.ts:120

Tx

Promise<{ fee: bigint; hash: string; }>

MorphoBase.send


supply(o): Promise<LendingResult & object>

Defined in: protocol-lending-morpho-evm/src/vault.ts:204

Deposits the vault’s asset (token may be omitted) for shares minted to onBehalfOf (default: the account).

MorphoVaultSupplyOptions

Promise<LendingResult & object>

MorphoBase.supply


protected tokenMeta(token): Promise<{ decimals: number; symbol: string; }>

Defined in: protocol-lending-morpho-evm/src/base.ts:185

`0x${string}`

Promise<{ decimals: number; symbol: string; }>

MorphoBase.tokenMeta


protected wait(hash): Promise<void>

Defined in: protocol-lending-morpho-evm/src/base.ts:128

string

Promise<void>

MorphoBase.wait


withdraw(o): Promise<LendingResult & object>

Defined in: protocol-lending-morpho-evm/src/vault.ts:245

Withdraws amount of the asset (or ‘max’ → redeem every share) to to (default: the account).

MorphoVaultWithdrawOptions

Promise<LendingResult & object>

MorphoBase.withdraw


protected writable(method): IWalletAccount

Defined in: protocol-lending-morpho-evm/src/base.ts:116

string

IWalletAccount

MorphoBase.writable