Skip to content
docs

AaveProtocolEvm

Defined in: protocol-lending-aave-evm/src/protocol.ts:137

Aave v3 for EVM wallet accounts: supply, withdraw, borrow (variable rate) and repay on any Aave v3 market, plus the reads a wallet screen needs — reserves with rates and caps, the account’s health factor, the position.

Nothing but the PoolAddressesProvider is trusted from configuration: the Pool, oracle and data provider are read from it on-chain and the preset’s Pool address must match. Before money moves, the module checks the reserve (active, not frozen or paused, borrowing enabled, caps) and proves the call with eth_call from the account, translating Aave’s revert codes and custom errors into readable messages. ERC-20 legs approve the exact amount (a one-transaction supplyWithPermit / repayWithPermit when the token and the account support EIP-2612); native legs go through WrappedTokenGatewayV3.

new AaveProtocolEvm(account, config?): AaveProtocolEvm

Defined in: protocol-lending-aave-evm/src/protocol.ts:153

IWalletAccountReadOnly | IWalletAccount

AaveProtocolConfig = {}

AaveProtocolEvm

LendingProtocol<AaveProtocolConfig>.constructor

protected readonly _account: IWalletAccountReadOnly | IWalletAccount

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

LendingProtocol._account


protected readonly _config: AaveProtocolConfig

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

LendingProtocol._config


readonly addressesProvider: `0x${string}`

Defined in: protocol-lending-aave-evm/src/protocol.ts:140


readonly chainId: number

Defined in: protocol-lending-aave-evm/src/protocol.ts:138


readonly preset: AaveMarket | null

Defined in: protocol-lending-aave-evm/src/protocol.ts:139

borrow(o): Promise<AaveLendingResult>

Defined in: protocol-lending-aave-evm/src/protocol.ts:664

Borrows amount of token at the variable rate against the account’s collateral (or against onBehalfOf’s, who must have delegated credit). Refused before sending when the amount exceeds the borrowing power.

AaveBorrowOptions

Promise<AaveLendingResult>

LendingProtocol.borrow


describeActivity(tx, ctx): ActivityItem | null

Defined in: protocol-lending-aave-evm/src/protocol.ts:206

Recognize this protocol’s transactions offline: a call to a known Aave v3 Pool or WrappedTokenGatewayV3 (every preset market on the transaction’s chain, plus the market this instance is configured with). See activity.ts for the rule.

ChainTx

DescribeActivityContext

ActivityItem | null

LendingProtocol.describeActivity


getAssetPrice(token): Promise<bigint>

Defined in: protocol-lending-aave-evm/src/protocol.ts:446

Oracle price in base currency units (8-decimal USD on every market today).

string

Promise<bigint>


getBorrowApy(token): Promise<number>

Defined in: protocol-lending-aave-evm/src/protocol.ts:458

Variable borrow APY in percent.

string

Promise<number>


getMarket(): Promise<MarketInfo>

Defined in: protocol-lending-aave-evm/src/protocol.ts:355

The market as the addresses provider reports it; the expected Pool (preset or config) must agree. Cached per instance.

Promise<MarketInfo>


getPosition(): Promise<Position>

Defined in: protocol-lending-aave-evm/src/protocol.ts:480

Supplied and borrowed balances per reserve, with the collateral flag, plus the account totals.

Promise<Position>


getReserve(token): Promise<ReserveInfo>

Defined in: protocol-lending-aave-evm/src/protocol.ts:437

The reserve for a token (or the wrapped native for ‘native’).

string

Promise<ReserveInfo>


getReserves(__namedParameters?): Promise<ReserveInfo[]>

Defined in: protocol-lending-aave-evm/src/protocol.ts:388

Every reserve of the market with configuration, rates and token addresses. Cached reserveTtlMs.

boolean = false

Promise<ReserveInfo[]>


getSupplyApy(token): Promise<number>

Defined in: protocol-lending-aave-evm/src/protocol.ts:453

Supply APY in percent for a token (what Aave’s UI shows).

string

Promise<number>


getUserAccountData(user?): Promise<AccountData>

Defined in: protocol-lending-aave-evm/src/protocol.ts:465

Pool.getUserAccountData for the account (or user), with the health factor as a number.

string

Promise<AccountData>


quoteBorrow(o): Promise<LendingQuote & object>

Defined in: protocol-lending-aave-evm/src/protocol.ts:670

AaveBorrowOptions

Promise<LendingQuote & object>

LendingProtocol.quoteBorrow


quoteRepay(o): Promise<LendingQuote & object>

Defined in: protocol-lending-aave-evm/src/protocol.ts:739

AaveRepayOptions

Promise<LendingQuote & object>

LendingProtocol.quoteRepay


quoteSupply(o): Promise<LendingQuote & object>

Defined in: protocol-lending-aave-evm/src/protocol.ts:554

AaveSupplyOptions

Promise<LendingQuote & object>

LendingProtocol.quoteSupply


quoteWithdraw(o): Promise<LendingQuote & object>

Defined in: protocol-lending-aave-evm/src/protocol.ts:613

AaveWithdrawOptions

Promise<LendingQuote & object>

LendingProtocol.quoteWithdraw


repay(o): Promise<LendingResult & object & object>

Defined in: protocol-lending-aave-evm/src/protocol.ts:733

Repays amount (or ‘max’) of variable debt in token for the account or onBehalfOf. A full repayment approves (or sends, for native) the debt plus 0.1 % so the interest of the next seconds is covered; the Pool takes only what is owed and the gateway refunds the rest.

AaveRepayOptions

Promise<LendingResult & object & object>

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


resolveToken(token): Promise<{ asset: `0x${string}`; native: boolean; }>

Defined in: protocol-lending-aave-evm/src/protocol.ts:426

‘native’ / zero address / ‘ETH’ → the gateway’s wrapped native; else a checksummed ERC-20.

string | undefined

Promise<{ asset: `0x${string}`; native: boolean; }>


setCollateral(__namedParameters): Promise<LendingResult>

Defined in: protocol-lending-aave-evm/src/protocol.ts:748

Enable or disable a supplied asset as collateral (refused when it would break the health factor).

boolean

string

Promise<LendingResult>


supply(o): Promise<AaveLendingResult>

Defined in: protocol-lending-aave-evm/src/protocol.ts:548

Supplies amount of token (‘native’ goes through the gateway); aTokens land on onBehalfOf (default: the account). ERC-20 legs approve the exact amount first and wait for the receipt, or use one supplyWithPermit when the token and the account support permits.

AaveSupplyOptions

Promise<AaveLendingResult>

LendingProtocol.supply


withdraw(o): Promise<LendingResult & object & object>

Defined in: protocol-lending-aave-evm/src/protocol.ts:607

Withdraws amount (or ‘max’) of a supplied token to to (default: the account). Refused by the protocol — and reported here before sending — when it would push the health factor below 1.

AaveWithdrawOptions

Promise<LendingResult & object & object>

LendingProtocol.withdraw