Skip to content
docs

default

Defined in: protocol-lending-mellow-evm/src/protocol.ts:296

Mellow Core Vaults for EVM wallet accounts — Lido’s Earn vaults (EarnETH, EarnUSD, stRATEGY) and any other vault on the same contracts.

A Core Vault holds LP money that a curator allocates across DeFi through verified sub-vault calls; LPs hold vault shares (earnETH, earnUSD, …) priced by the vault’s oracle once per report (~daily). Money moves through per-asset queues the vault itself lists on-chain:

  • supply — deposit into the asset’s queue. The synchronous queue mints shares in the same transaction at the last report’s price (used first when instant is on); the asynchronous queue records a request that the next report prices, after which the shares are counted in the account’s balance without any further action (claimShares only moves them physically). One open async request per account; cancellable until it is priced (cancelSupply).
  • withdraw — redeem(shares) on the asset’s redeem queue: the shares burn at once, the request is not cancellable, the next report at least redeemInterval later prices it, the curator pulls liquidity, and claimWithdrawals pays the asset out. That second phase is what makes this a two-step withdraw; getWithdrawalRequests reports the queue.

Reads run through the account’s provider (viem). Every queue is found on-chain (getQueueCount / queueAt, classified by the methods it answers) and re-verified against the vault (hasQueue, direction, pause) before money touches it; a suspicious oracle report or a whitelist gate refuses instead of pricing blindly. Mellow’s registry only decorates.

borrow / repay reject: a vault does not lend.

new default(account, config?): MellowProtocolEvm

Defined in: protocol-lending-mellow-evm/src/protocol.ts:316

Creates a new interface to a Mellow Core Vault for evm blockchains.

MellowAccount

The wallet account (a @anywalletkit/wallet-evm account, or a read-only { getAddress } one for views).

MellowProtocolConfig = {}

The protocol’s configuration.

MellowProtocolEvm

LendingProtocol<MellowProtocolConfig>.constructor

protected readonly _account: IWalletAccountReadOnly | IWalletAccount

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

LendingProtocol._account


protected readonly _config: MellowProtocolConfig

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

LendingProtocol._config


readonly vault: string

Defined in: protocol-lending-mellow-evm/src/protocol.ts:298

The vault this protocol talks to.

protected _getSupplyPlan(token, amount, __namedParameters?): Promise<SupplyPlan>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:636

The transaction(s) a supply needs and the queue it goes to.

string

The asset.

bigint

The amount (base units).

boolean = ...

Promise<SupplyPlan>


protected _getWithdrawPlan(token, shares): Promise<WithdrawPlan>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:776

string

The payout asset.

bigint

Shares to redeem.

Promise<WithdrawPlan>


borrow(_options): Promise<never>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:875

Always rejects: a Mellow vault does not lend.

unknown

Promise<never>

LendingProtocol.borrow


cancelSupply(__namedParameters?): Promise<{ fee: bigint; hash: string; }>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:744

Cancels the account’s open asynchronous deposit request for an asset (only before a report prices it).

string

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


claimShares(__namedParameters?): Promise<{ fee: bigint; hash: string; }>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:760

Moves shares a report already priced from the asset’s deposit queue to the account. Optional — balances count them either way; cheap and idempotent.

string

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


claimWithdrawals(options?): Promise<{ assets: object[]; fee: bigint; hashes: string[]; }>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:848

Claims processed redemptions — the asset lands on the account. One transaction per payout asset; token picks one, otherwise every asset with claimable requests is swept in sequence.

Restrict to a payout asset and/or specific request timestamps.

number[]

string

Promise<{ assets: object[]; fee: bigint; hashes: string[]; }>

The transactions sent and what they claim.


describeActivity(tx, ctx): ActivityItem | null

Defined in: protocol-lending-mellow-evm/src/protocol.ts:934

Recognize Mellow queue transactions offline (deposit, cancelDepositRequest, claim on deposit queues; redeem, claim on redeem queues) for the preset vaults and the vault this instance targets. See activity.ts for the rule.

ChainTx

DescribeActivityContext

ActivityItem | null

LendingProtocol.describeActivity


getApr(): Promise<number>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:923

The vault’s APY in percent, from Mellow’s registry.

Promise<number>


getPosition(options?): Promise<Position>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:556

The account’s position: shares, their value in token at the latest report, and what sits in the queues.

Asset to value the shares in (default native, or the first vault asset when the vault has no native leg).

string

Promise<Position>


getReport(token?): Promise<OracleReport>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:493

The oracle’s latest report for an asset: shares per one unit of the asset (1e18 fixed point).

string

The asset (default native).

Promise<OracleReport>


getShares(): Promise<bigint>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:544

Vault shares the account holds (18 decimals), including shares priced by a report but not yet physically claimed.

Promise<bigint>


getStats(): Promise<Stats | null>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:899

The vault’s entry in Mellow’s registry: APY, TVL, average withdrawal time. Null when the registry is disabled, unreachable, or does not list the vault.

Promise<Stats | null>


getVaultData(__namedParameters?): Promise<VaultData>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:413

The vault’s components, assets and queues as the chain reports them, plus the fee and oracle parameters. Cached per instance (queues change rarely); pass { refresh: true } to re-read.

boolean = false

Promise<VaultData>


getWithdrawalRequests(): Promise<WithdrawalRequestsView>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:822

The account’s redemption queue across every payout asset: requests newest first, shares still waiting, and what is claimable per asset.

Promise<WithdrawalRequestsView>


quoteBorrow(_options): Promise<never>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:880

Always rejects.

unknown

Promise<never>

LendingProtocol.quoteBorrow


quoteRepay(_options): Promise<never>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:890

Always rejects.

unknown

Promise<never>

LendingProtocol.quoteRepay


quoteSupply(__namedParameters): Promise<{ fee: bigint; instant: boolean; queue: string; sharesOut: bigint; }>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:736

Quotes a supply: network fee (approvals included), shares at the latest report, and the queue it would take.

SupplyOptions

Promise<{ fee: bigint; instant: boolean; queue: string; sharesOut: bigint; }>

LendingProtocol.quoteSupply


quoteWithdraw(__namedParameters): Promise<{ assetsOut: bigint; fee: bigint; queue: string; }>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:813

Quotes a redemption request: network fee and the payout at the latest report (after the redeem fee).

WithdrawOptions

Promise<{ assetsOut: bigint; fee: bigint; queue: string; }>

LendingProtocol.quoteWithdraw


repay(_options): Promise<never>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:885

Always rejects.

unknown

Promise<never>

LendingProtocol.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

LendingProtocol.requireSigningAccount


supply(options): Promise<SupplyResult>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:701

Supplies an asset to the vault. ERC-20 legs approve first (awaited to a mined receipt); the synchronous queue is used when it can mint at once, otherwise the request enters the asynchronous queue and the next report prices it.

SupplyOptions

token (address or ‘native’) and amount in base units. onBehalfOf is not supported.

Promise<SupplyResult>

The result, whether shares minted at once, and the queue used.

LendingProtocol.supply


withdraw(options): Promise<WithdrawResult>

Defined in: protocol-lending-mellow-evm/src/protocol.ts:802

Requests a redemption: amount is in shares (the only unit known before the report); they burn at once and the request is not cancellable. The payout in token becomes claimable after the next report that is at least redeemInterval later and the curator’s liquidity handling — see getWithdrawalRequests and claimWithdrawals.

WithdrawOptions

token = payout asset, amount = shares. to is not supported.

Promise<WithdrawResult>

The result, the queue and the estimated payout.

LendingProtocol.withdraw