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.
Extends
Section titled “Extends”LendingProtocol<AaveProtocolConfig>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AaveProtocolEvm(
account,config?):AaveProtocolEvm
Defined in: protocol-lending-aave-evm/src/protocol.ts:153
Parameters
Section titled “Parameters”account
Section titled “account”IWalletAccountReadOnly | IWalletAccount
config?
Section titled “config?”AaveProtocolConfig = {}
Returns
Section titled “Returns”AaveProtocolEvm
Overrides
Section titled “Overrides”LendingProtocol<AaveProtocolConfig>.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”LendingProtocol._account
_config
Section titled “_config”
protectedreadonly_config:AaveProtocolConfig
Defined in: core/dist/index-QWdcwE6y.d.ts:310
Inherited from
Section titled “Inherited from”LendingProtocol._config
addressesProvider
Section titled “addressesProvider”
readonlyaddressesProvider:`0x${string}`
Defined in: protocol-lending-aave-evm/src/protocol.ts:140
chainId
Section titled “chainId”
readonlychainId:number
Defined in: protocol-lending-aave-evm/src/protocol.ts:138
preset
Section titled “preset”
readonlypreset:AaveMarket|null
Defined in: protocol-lending-aave-evm/src/protocol.ts:139
Methods
Section titled “Methods”borrow()
Section titled “borrow()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<AaveLendingResult>
Overrides
Section titled “Overrides”LendingProtocol.borrow
describeActivity()
Section titled “describeActivity()”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.
Parameters
Section titled “Parameters”ChainTx
DescribeActivityContext
Returns
Section titled “Returns”ActivityItem | null
Overrides
Section titled “Overrides”LendingProtocol.describeActivity
getAssetPrice()
Section titled “getAssetPrice()”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).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<bigint>
getBorrowApy()
Section titled “getBorrowApy()”getBorrowApy(
token):Promise<number>
Defined in: protocol-lending-aave-evm/src/protocol.ts:458
Variable borrow APY in percent.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<number>
getMarket()
Section titled “getMarket()”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.
Returns
Section titled “Returns”Promise<MarketInfo>
getPosition()
Section titled “getPosition()”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.
Returns
Section titled “Returns”Promise<Position>
getReserve()
Section titled “getReserve()”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’).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<ReserveInfo>
getReserves()
Section titled “getReserves()”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.
Parameters
Section titled “Parameters”__namedParameters?
Section titled “__namedParameters?”refresh?
Section titled “refresh?”boolean = false
Returns
Section titled “Returns”Promise<ReserveInfo[]>
getSupplyApy()
Section titled “getSupplyApy()”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).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<number>
getUserAccountData()
Section titled “getUserAccountData()”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.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<AccountData>
quoteBorrow()
Section titled “quoteBorrow()”quoteBorrow(
o):Promise<LendingQuote&object>
Defined in: protocol-lending-aave-evm/src/protocol.ts:670
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingQuote & object>
Overrides
Section titled “Overrides”LendingProtocol.quoteBorrow
quoteRepay()
Section titled “quoteRepay()”quoteRepay(
o):Promise<LendingQuote&object>
Defined in: protocol-lending-aave-evm/src/protocol.ts:739
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingQuote & object>
Overrides
Section titled “Overrides”LendingProtocol.quoteRepay
quoteSupply()
Section titled “quoteSupply()”quoteSupply(
o):Promise<LendingQuote&object>
Defined in: protocol-lending-aave-evm/src/protocol.ts:554
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingQuote & object>
Overrides
Section titled “Overrides”LendingProtocol.quoteSupply
quoteWithdraw()
Section titled “quoteWithdraw()”quoteWithdraw(
o):Promise<LendingQuote&object>
Defined in: protocol-lending-aave-evm/src/protocol.ts:613
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingQuote & object>
Overrides
Section titled “Overrides”LendingProtocol.quoteWithdraw
repay()
Section titled “repay()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingResult & object & object>
Overrides
Section titled “Overrides”LendingProtocol.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”LendingProtocol.requireSigningAccount
resolveToken()
Section titled “resolveToken()”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.
Parameters
Section titled “Parameters”string | undefined
Returns
Section titled “Returns”Promise<{ asset: `0x${string}`; native: boolean; }>
setCollateral()
Section titled “setCollateral()”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).
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”enabled
Section titled “enabled”boolean
string
Returns
Section titled “Returns”Promise<LendingResult>
supply()
Section titled “supply()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<AaveLendingResult>
Overrides
Section titled “Overrides”LendingProtocol.supply
withdraw()
Section titled “withdraw()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingResult & object & object>
Overrides
Section titled “Overrides”LendingProtocol.withdraw