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.
Extends
Section titled “Extends”MorphoBase<MorphoVaultConfig>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MorphoVaultProtocolEvm(
account,config):MorphoVaultProtocolEvm
Defined in: protocol-lending-morpho-evm/src/vault.ts:66
Parameters
Section titled “Parameters”account
Section titled “account”IWalletAccountReadOnly | IWalletAccount
config
Section titled “config”Returns
Section titled “Returns”MorphoVaultProtocolEvm
Overrides
Section titled “Overrides”MorphoBase<MorphoVaultConfig>.constructor
Properties
Section titled “Properties”_account
Section titled “_account”
protectedreadonly_account:IWalletAccountReadOnly|IWalletAccount
Defined in: core/dist/index-QWdcwE6y.d.ts:309
Inherited from
Section titled “Inherited from”MorphoBase._account
_config
Section titled “_config”
protectedreadonly_config:MorphoVaultConfig
Defined in: core/dist/index-QWdcwE6y.d.ts:310
Inherited from
Section titled “Inherited from”MorphoBase._config
protectedreadonlyapi:MorphoApi|null
Defined in: protocol-lending-morpho-evm/src/base.ts:51
Inherited from
Section titled “Inherited from”MorphoBase.api
readonlychain:MorphoChain
Defined in: protocol-lending-morpho-evm/src/base.ts:50
Inherited from
Section titled “Inherited from”MorphoBase.chain
chainId
Section titled “chainId”
readonlychainId:number
Defined in: protocol-lending-morpho-evm/src/base.ts:49
Inherited from
Section titled “Inherited from”MorphoBase.chainId
readonlyvault:`0x${string}`
Defined in: protocol-lending-morpho-evm/src/vault.ts:61
Accessors
Section titled “Accessors”activityVault
Section titled “activityVault”Get Signature
Section titled “Get Signature”get
protectedactivityVault():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.
Returns
Section titled “Returns”string
Overrides
Section titled “Overrides”MorphoBase.activityVault
client
Section titled “client”Get Signature
Section titled “Get Signature”get
protectedclient():object
Defined in: protocol-lending-morpho-evm/src/base.ts:99
Returns
Section titled “Returns”object
Inherited from
Section titled “Inherited from”MorphoBase.client
Methods
Section titled “Methods”approvals()
Section titled “approvals()”
protectedapprovals(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.
Parameters
Section titled “Parameters”`0x${string}`
spender
Section titled “spender”`0x${string}`
amount
Section titled “amount”bigint
Returns
Section titled “Returns”Promise<Tx[]>
Inherited from
Section titled “Inherited from”MorphoBase.approvals
borrow()
Section titled “borrow()”borrow():
Promise<never>
Defined in: protocol-lending-morpho-evm/src/vault.ts:259
Returns
Section titled “Returns”Promise<never>
Overrides
Section titled “Overrides”MorphoBase.borrow
describeActivity()
Section titled “describeActivity()”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.
Parameters
Section titled “Parameters”ChainTx
DescribeActivityContext
Returns
Section titled “Returns”ActivityItem | null
Inherited from
Section titled “Inherited from”MorphoBase.describeActivity
encode()
Section titled “encode()”
protectedencode(abi,functionName,args):`0x${string}`
Defined in: protocol-lending-morpho-evm/src/base.ts:108
Parameters
Section titled “Parameters”readonly unknown[]
functionName
Section titled “functionName”string
readonly unknown[]
Returns
Section titled “Returns”`0x${string}`
Inherited from
Section titled “Inherited from”MorphoBase.encode
execute()
Section titled “execute()”
protectedexecute(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.
Parameters
Section titled “Parameters”approvals
Section titled “approvals”Tx[]
action
Section titled “action”string
Returns
Section titled “Returns”Promise<{ approveHashes: string[]; fee: bigint; hash: string; }>
Inherited from
Section titled “Inherited from”MorphoBase.execute
getApy()
Section titled “getApy()”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).
Returns
Section titled “Returns”Promise<number>
getPosition()
Section titled “getPosition()”getPosition():
Promise<VaultPosition>
Defined in: protocol-lending-morpho-evm/src/vault.ts:127
Shares, their current value, and what is withdrawable right now.
Returns
Section titled “Returns”Promise<VaultPosition>
getStats()
Section titled “getStats()”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.
Returns
Section titled “Returns”Promise<ApiVault | null>
getVault()
Section titled “getVault()”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.
Returns
Section titled “Returns”Promise<VaultInfo>
protectedme():Promise<`0x${string}`>
Defined in: protocol-lending-morpho-evm/src/base.ts:112
Returns
Section titled “Returns”Promise<`0x${string}`>
Inherited from
Section titled “Inherited from”MorphoBase.me
prove()
Section titled “prove()”
protectedprove(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.
Parameters
Section titled “Parameters”action
Section titled “action”string
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MorphoBase.prove
quoteBorrow()
Section titled “quoteBorrow()”quoteBorrow():
Promise<never>
Defined in: protocol-lending-morpho-evm/src/vault.ts:260
Returns
Section titled “Returns”Promise<never>
Overrides
Section titled “Overrides”MorphoBase.quoteBorrow
quoteFee()
Section titled “quoteFee()”
protectedquoteFee(txs):Promise<bigint>
Defined in: protocol-lending-morpho-evm/src/base.ts:150
Parameters
Section titled “Parameters”Tx[]
Returns
Section titled “Returns”Promise<bigint>
Inherited from
Section titled “Inherited from”MorphoBase.quoteFee
quoteRepay()
Section titled “quoteRepay()”quoteRepay():
Promise<never>
Defined in: protocol-lending-morpho-evm/src/vault.ts:262
Returns
Section titled “Returns”Promise<never>
Overrides
Section titled “Overrides”MorphoBase.quoteRepay
quoteSupply()
Section titled “quoteSupply()”quoteSupply(
o):Promise<LendingQuote&object>
Defined in: protocol-lending-morpho-evm/src/vault.ts:210
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingQuote & object>
Overrides
Section titled “Overrides”MorphoBase.quoteSupply
quoteWithdraw()
Section titled “quoteWithdraw()”quoteWithdraw(
o):Promise<LendingQuote&object>
Defined in: protocol-lending-morpho-evm/src/vault.ts:253
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingQuote & object>
Overrides
Section titled “Overrides”MorphoBase.quoteWithdraw
read()
Section titled “read()”
protectedread<T>(address,abi,functionName,args?):Promise<T>
Defined in: protocol-lending-morpho-evm/src/base.ts:104
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”address
Section titled “address”`0x${string}`
readonly unknown[]
functionName
Section titled “functionName”string
readonly unknown[] = []
Returns
Section titled “Returns”Promise<T>
Inherited from
Section titled “Inherited from”MorphoBase.read
repay()
Section titled “repay()”repay():
Promise<never>
Defined in: protocol-lending-morpho-evm/src/vault.ts:261
Returns
Section titled “Returns”Promise<never>
Overrides
Section titled “Overrides”MorphoBase.repay
requireSigningAccount()
Section titled “requireSigningAccount()”
protectedrequireSigningAccount(methodName):IWalletAccount
Defined in: core/dist/index-QWdcwE6y.d.ts:322
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
Parameters
Section titled “Parameters”methodName
Section titled “methodName”string
Returns
Section titled “Returns”IWalletAccount
Inherited from
Section titled “Inherited from”MorphoBase.requireSigningAccount
send()
Section titled “send()”
protectedsend(tx):Promise<{fee:bigint;hash:string; }>
Defined in: protocol-lending-morpho-evm/src/base.ts:120
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<{ fee: bigint; hash: string; }>
Inherited from
Section titled “Inherited from”MorphoBase.send
supply()
Section titled “supply()”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).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingResult & object>
Overrides
Section titled “Overrides”MorphoBase.supply
tokenMeta()
Section titled “tokenMeta()”
protectedtokenMeta(token):Promise<{decimals:number;symbol:string; }>
Defined in: protocol-lending-morpho-evm/src/base.ts:185
Parameters
Section titled “Parameters”`0x${string}`
Returns
Section titled “Returns”Promise<{ decimals: number; symbol: string; }>
Inherited from
Section titled “Inherited from”MorphoBase.tokenMeta
wait()
Section titled “wait()”
protectedwait(hash):Promise<void>
Defined in: protocol-lending-morpho-evm/src/base.ts:128
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”MorphoBase.wait
withdraw()
Section titled “withdraw()”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).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingResult & object>
Overrides
Section titled “Overrides”MorphoBase.withdraw
writable()
Section titled “writable()”
protectedwritable(method):IWalletAccount
Defined in: protocol-lending-morpho-evm/src/base.ts:116
Parameters
Section titled “Parameters”method
Section titled “method”string
Returns
Section titled “Returns”IWalletAccount
Inherited from
Section titled “Inherited from”MorphoBase.writable