Optional
signer: Ed25519AccountBuilds a transaction for the specified user, function, and arguments.
The account address of the user initiating the transaction.
The identifier of the Move function to be called.
An array of arguments for the entry function.
A promise that resolves to a SimpleTransaction object.
Calls a view method on the Aptos blockchain.
The identifier of the function to call.
The arguments to pass to the function.
Optional generic type arguments for the function (e.g. ["0x1::aptos_coin::AptosCoin"]
).
Transfers the collected fees by the collector to a given account.
The asset address.
The account address to whom to transfer the collected fees.
The collected fee amount to transfer.
A promise that resolves to a CommittedTransactionResponse.
Configures a reserve as collateral by setting the loan-to-value (LTV), liquidation threshold, and liquidation bonus for a given asset.
The address of the asset to be configured as collateral.
The loan-to-value ratio for the asset, represented as a bigint.
The threshold at which the asset will be liquidated, represented as a bigint.
The bonus applied during liquidation, represented as a bigint.
A promise that resolves to a CommittedTransactionResponse once the transaction is committed.
Disables the liquidation with no grace period.
The address of the asset.
A promise that resolves to a CommittedTransactionResponse
object.
Drops a reserve from the pool.
The account address of the asset to be dropped.
A promise that resolves to the committed transaction response.
Sets a new apt fee to the fee manager.
The new apt fee to apply.
A promise that resolves to a CommittedTransactionResponse.
Transfers the collected fees by the fee manager to a given account.
The account address to whom to transfer the collected fees.
The collected fee amount to transfer.
A promise that resolves to a CommittedTransactionResponse.
Funds an account with a specified amount.
The address of the account to be funded.
The amount to fund the account with, in bigint.
A promise that resolves to a UserTransactionResponse.
Retrieves the Aptos balance of a specified account.
The Ed25519 account object.
The address of the account to retrieve the balance for.
Optional
versionToWaitFor: bigint(Optional) The specific version to wait for before retrieving the balance.
A promise that resolves to the balance of the account in bigint.
Retrieves all AToken data from the pool contract.
A promise that resolves to an array of TokenData objects.
Retrieves all reserve tokens from the pool contract.
A promise that resolves to an array of TokenData objects.
Retrieves all variable tokens from the pool contract.
A promise that resolves to an array of TokenData objects.
Retrieves the total supply of AToken for a given asset.
The account address of the asset.
A promise that resolves to the total supply of the AToken as a bigint.
Retrieves the bridge protocol fee from the pool contract.
A promise that resolves to the bridge protocol fee as a bigint.
Retrieves the collector address.
A promise that resolves to the collector address.
Retrieves the total fees collected by the collector.
A promise that resolves to the fee collector total collected fees.
Returns if the address is the funds admin of the collector.
A promise that resolves to a boolean.
Retrieves the debt ceiling for a given asset.
The account address of the asset for which to get the debt ceiling.
A promise that resolves to the debt ceiling as a bigint.
Retrieves the debt ceiling decimals from the pool contract.
A promise that resolves to the debt ceiling decimals as a bigint.
Retrieves the eMode category data for a given category ID.
The ID of the eMode category to retrieve data for.
A promise that resolves to the eMode category data as a number.
Retrieves the eMode (efficiency mode) label from the pool contract.
The emode cateogory number.
A promise that resolves to the emode label as a sting.
Retrieves the eMode (efficiency mode) liquidation bonus from the pool contract.
The emode cateogory of the user.
A promise that resolves to the emode liquidation bonus as a number.
Retrieves events associated with a specific account.
The address of the account to retrieve events for.
The maximum number of events to retrieve.
A promise that resolves to an array of event objects, each containing:
account_address
: The address of the account.creation_number
: The creation number of the event.data
: The data associated with the event.event_index
: The index of the event.sequence_number
: The sequence number of the event.transaction_block_height
: The block height of the transaction.transaction_version
: The version of the transaction.type
: The type of the event.indexed_type
: The indexed type of the event.Retrieves the fee collector address.
A promise that resolves to the fee collector address.
Retrieves the fee collector apt balance.
A promise that resolves to the fee collector apt balance.
Retrieves the apt fee of the manager.
A promise that resolves to the apt fee as a bigint.
Retrieves the fee manager object address.
A promise that resolves to the fee manager object address.
Retrieves the total fees collected by the fee manager.
A promise that resolves to the fee collector total collected fees.
Checks if flash loans are enabled for a given asset.
The address of the asset to check.
A promise that resolves to a boolean indicating whether flash loans are enabled for the specified asset.
Retrieves the flashloan premium to the protocol.
This method calls a view function on the pool contract to get the flashloan premium that is allocated to the protocol. The result is mapped to a bigint and returned.
A promise that resolves to the flashloan premium as a bigint.
Retrieves the total flashloan premium from the pool contract.
This method calls the PoolGetFlashloanPremiumTotalFuncAddr
function on the pool contract
and maps the response to a bigint.
A promise that resolves to the total flashloan premium as a bigint.
Retrieves the liquidation protocol fee for a given asset.
The account address of the asset for which to retrieve the liquidation protocol fee.
A promise that resolves to the liquidation protocol fee as a bigint.
Retrieves the maximum number of reserves allowed in the pool.
A promise that resolves to the maximum number of reserves as a bigint.
Retrieves the normalized debt by reserve data.
The address of the reserve data.
A promise that resolves to the normalized debt as a bigint.
Checks if the specified asset is paused.
The address of the asset to check.
A promise that resolves to a boolean indicating whether the asset is paused.
Retrieves the pending ltv for an asset from the pool contract.
A promise that resolves to the pending ltv as a bigint.
Retrieves the reserve address associated with a given ID.
The ID of the reserve to retrieve the address for.
A promise that resolves to the AccountAddress
of the reserve.
Retrieves the reserve caps for a given asset.
The address of the asset account.
A promise that resolves to an object containing the borrow cap and supply cap as big integers.
Retrieves the reserve configuration for a given asset.
The address of the asset for which to get the reserve configuration.
A promise that resolves to the reserve configuration map of the specified asset.
Retrieves the reserve configuration data for a given asset.
The account address of the asset.
A promise that resolves to an object containing the reserve configuration data.
The returned object includes the following properties:
decimals
: The number of decimals for the asset.ltv
: The loan-to-value ratio.liquidationThreshold
: The liquidation threshold.liquidationBonus
: The liquidation bonus.reserveFactor
: The reserve factor.usageAsCollateralEnabled
: A boolean indicating if the asset can be used as collateral.borrowingEnabled
: A boolean indicating if borrowing is enabled for the asset.isActive
: A boolean indicating if the asset is active.isFrozen
: A boolean indicating if the asset is frozen.Retrieves the reserve data for a given asset.
The address of the asset for which to retrieve reserve data.
A promise that resolves to the reserve data of the specified asset.
Retrieves reserve data for a given asset.
The address of the asset to retrieve reserve data for.
A promise that resolves to an object containing reserve data.
The returned object includes the following properties:
reserveUnbacked
: The amount of unbacked reserve.reserveAccruedToTreasury
: The amount accrued to the treasury.aTokenSupply
: The total supply of aTokens.varTokenSupply
: The total supply of variable tokens.reserveCurrentLiquidityRate
: The current liquidity rate of the reserve.reserveCurrentVariableBorrowRate
: The current variable borrow rate of the reserve.reserveLiquidityIndex
: The liquidity index of the reserve.reserveVarBorrowIndex
: The variable borrow index of the reserve.reserveLastUpdateTimestamp
: The timestamp of the last update to the reserve data.Retrieves reserve data and the count of reserves for a given asset.
The account address of the asset.
A promise that resolves to an object containing the reserve data and the count of reserves.
Retrieves the reserve deficit for a given asset.
The address of the asset to check.
A promise that resolves to a bigint.
Retrieves the eMode category for a given reserve asset.
The account address of the reserve asset.
A promise that resolves to the eMode category number of the specified asset.
Retrieves the normalized income for a given reserve asset.
The address of the reserve asset.
A promise that resolves to the normalized income of the reserve asset as a bigint.
Retrieves the normalized variable debt for a given reserve asset.
The address of the reserve asset.
A promise that resolves to the normalized variable debt as a bigint.
Retrieves the count of reserves from the pool contract.
A promise that resolves to the count of reserves as a bigint.
Retrieves the list of reserve accounts from the pool contract.
A promise that resolves to an array of AccountAddress objects representing the reserve accounts.
Retrieves the addresses of the reserve tokens for a given asset.
The address of the asset for which to get the reserve token addresses.
A promise that resolves to an object containing the addresses of the reserve AToken and the reserve Variable Debt Token.
Retrieves the scaled AToken balance of a specified owner.
The address of the account owner whose balance is being queried.
The address of the AToken contract.
A promise that resolves to the scaled AToken balance as a bigint.
Retrieves the scaled total supply of an AToken.
The address of the AToken.
A promise that resolves to the scaled total supply of the AToken as a bigint.
Retrieves the scaled variable token balance of a specified owner for a given variable token address.
The account address of the token owner.
The account address of the variable token.
A promise that resolves to the scaled variable token balance as a bigint.
Retrieves the scaled total supply of variable tokens for a given aToken address.
The address of the aToken whose scaled variable token total supply is to be fetched.
A promise that resolves to the scaled total supply of variable tokens as a bigint.
Retrieves the current Ed25519Account signer.
The current signer.
Retrieves the siloed borrowing status for a given asset.
The account address of the asset to check.
A promise that resolves to a boolean indicating whether the asset has siloed borrowing enabled.
Retrieves the total debt for a given asset.
The address of the asset account.
A promise that resolves to the total debt as a bigint.
Retrieves the events associated with a given transaction hash.
The hash of the transaction to retrieve events for.
A promise that resolves to an array of objects containing the event data.
Retrieves the user account data by user emode category from the pool contract.
The emode cateogory of the user.
A promise that resolves to the emode ltv and liquidation threshold as a number.
Retrieves the user configuration for a given account.
The address of the account to retrieve the configuration for.
A promise that resolves to the user's configuration map.
Retrieves the eMode (efficiency mode) of a user from the pool contract.
The account address of the user.
A promise that resolves to the eMode of the user as a number.
Retrieves the reserve data for a specific user and asset.
The address of the asset.
The address of the user.
A promise that resolves to an object containing the user's reserve data.
The returned object includes the following properties:
currentATokenBalance
: The current balance of A tokens held by the user.currentVariableDebt
: The current variable debt of the user.scaledVariableDebt
: The scaled variable debt of the user.liquidityRate
: The liquidity rate of the reserve.usageAsCollateralEnabled
: A boolean indicating if the asset is being used as collateral.Initializes the reserves in the pool.
An array of account addresses representing the underlying assets.
An array of account addresses representing the treasury.
An array of strings representing the names of the aTokens.
An array of strings representing the symbols of the aTokens.
An array of strings representing the names of the variable debt tokens.
An array of strings representing the symbols of the variable debt tokens.
An array of addresses representing the incentives controllers.
An array of numbers representing the optimal usage ratios.
An array of numbers representing the base variable borrow rates.
An array of numbers representing the variable rate slopes 1.
An array of numbers representing the variable rate slopes 2.
A promise that resolves to a CommittedTransactionResponse.
Checks if the combination user and asset categories are an emode or not.
The emode cateogory of the user.
The emode cateogory of the asset.
A promise that resolves to a boolean.
Mints the assets accrued through the reserve factor to the treasury in the form of aTokens.
An array of account addresses representing the assets to be minted to the treasury.
A promise that resolves to a CommittedTransactionResponse
object.
Retrieves the number of active and dropped reserves.
A promise that resolves to the number of active and dropped reserves.
Retrieves the number of active reserves.
A promise that resolves to the number of active reserves.
Rescues tokens from the pool contract and sends them to a specified address.
The address of the token to be rescued.
The address to which the rescued tokens will be sent.
The amount of tokens to be rescued.
A promise that resolves to the response of the committed transaction.
Resets the total debt for an asset in isolation mode.
The account address of the asset for which the total debt is to be reset.
A promise that resolves to a CommittedTransactionResponse
object.
Sends a transaction and awaits the response.
The ID of the Move function to be called.
An array of arguments for the entry function.
A promise that resolves to the committed transaction response.
Sets the eMode category for a specific asset.
The address of the asset for which the eMode category is being set.
The new eMode category ID to be assigned to the asset.
A promise that resolves to the response of the committed transaction.
Sets whether a specific asset is borrowable in isolation mode.
The address of the asset to be configured.
A boolean indicating if the asset should be borrowable in isolation.
A promise that resolves to a CommittedTransactionResponse
object.
Sets the borrow cap for a specific asset.
The address of the asset for which the borrow cap is being set.
The new borrow cap value to be set for the asset.
A promise that resolves to the response of the committed transaction.
Sets the bridge protocol fee for the pool.
The new protocol fee to be set, represented as a bigint.
A promise that resolves to a CommittedTransactionResponse once the transaction is committed.
Sets the debt ceiling for a specific asset.
The account address of the asset for which the debt ceiling is being set.
The new debt ceiling value to be set, represented as a bigint.
A promise that resolves to a CommittedTransactionResponse once the transaction is committed.
Sets the eMode category for the pool.
The ID of the eMode category.
The loan-to-value ratio for the category.
The liquidation threshold for the category.
The liquidation bonus for the category.
The label for the eMode category.
A promise that resolves to the committed transaction response.
Sets the flashloan premiums for the pool.
The total premium for the flashloan as a bigint.
The portion of the premium that goes to the protocol as a bigint.
A promise that resolves to a CommittedTransactionResponse.
Sets the incentives controllers.
An array of account addresses representing the assets on which to set incentives controllers.
An array of account addresses representing the addresses of the incentives controllers.
A promise that resolves to a CommittedTransactionResponse
object.
Sets the liquidation protocol fee for a given asset.
The address of the asset for which the liquidation protocol fee is being set.
The new liquidation protocol fee to be set, represented as a bigint.
A promise that resolves to a CommittedTransactionResponse once the transaction is committed.
Pauses or unpauses the pool.
A boolean indicating whether to pause (true) or unpause (false) the pool.
The grace period the pause is applied for.
A promise that resolves to a CommittedTransactionResponse
object.
Pauses or unpauses the pool without setting any grace period.
A boolean indicating whether to pause (true) or unpause (false) the pool.
A promise that resolves to a CommittedTransactionResponse
object.
Sets the active status of a reserve.
The address of the asset's account.
A boolean indicating whether the reserve should be active (true) or inactive (false).
A promise that resolves to a CommittedTransactionResponse
object.
Sets the borrowing status for a specific reserve asset.
The address of the asset for which borrowing is being enabled or disabled.
A boolean indicating whether borrowing should be enabled (true) or disabled (false) for the specified asset.
A promise that resolves to a CommittedTransactionResponse
object once the transaction is committed.
Sets the reserve factor for a given asset.
The account address of the asset for which the reserve factor is being set.
The new reserve factor to be set, represented as a bigint.
A promise that resolves to a CommittedTransactionResponse once the transaction is committed.
Enables or disables flash loaning for a specific reserve asset.
The address of the reserve asset.
A boolean indicating whether flash loaning should be enabled (true) or disabled (false).
A promise that resolves to a CommittedTransactionResponse
object.
Sets the freeze status of a reserve asset.
The address of the reserve asset to be frozen or unfrozen.
A boolean indicating whether to freeze (true) or unfreeze (false) the reserve asset.
A promise that resolves to a CommittedTransactionResponse
object.
Sets the paused state of a reserve with a grace period.
The address of the asset to be paused or unpaused.
A boolean indicating whether to pause (true) or unpause (false) the reserve.
A number indicationg the grace period.
A promise that resolves to a CommittedTransactionResponse
object.
Sets the paused state of a reserve without a grace period.
The address of the asset to be paused or unpaused.
A boolean indicating whether to pause (true) or unpause (false) the reserve.
A promise that resolves to a CommittedTransactionResponse
object.
Sets the signer for the client.
The Ed25519 account to be used as the signer.
Sets the siloed borrowing status for a given asset.
The address of the asset for which to set the siloed borrowing status.
A boolean indicating the new siloed borrowing status.
A promise that resolves to a CommittedTransactionResponse
object.
Sets the supply cap for a given asset.
The account address of the asset for which the supply cap is being set.
The new supply cap value to be set for the asset.
A promise that resolves to a CommittedTransactionResponse
object.
Sets the user's eMode category.
The ID of the eMode category to set for the user.
A promise that resolves to a CommittedTransactionResponse
object.
Transfers aTokens from the user to the recipient.
The recipient of the aTokens
The amount of aTokens to transfer
The Metadata of the aToken
A promise that resolves to a CommittedTransactionResponse
object.
Updates the flashloan premium to protocol.
The new flashloan premium to be set, represented as a bigint.
A promise that resolves to a CommittedTransactionResponse.
Updates the flashloan premium total in the pool configurator.
The new flashloan premium total as a bigint.
A promise that resolves to a CommittedTransactionResponse.
Updates the interest rate strategy.
The account address of the asset for which the interest rate strategy is to be applied.
The optimal usage ratio of the interest rate strategy which is to be applied.
The base variable borrow rate for which the interest rate strategy is to be applied.
The variable rate slope 1 of the interest rate strategy which is to be applied.
The variable rate slope 2 of the interest rate strategy which is to be applied.
A promise that resolves to a CommittedTransactionResponse.
Sets the signer to the module signer and returns the current instance.
The current instance with the module signer set.
Sets the signer for the current instance using the provided Ed25519 account.
The Ed25519 account to be used as the signer.
The current instance with the signer set.
Static
buildCreates an instance of PoolClient
using the default signer provided by the AptosProvider
.
An instance of AptosProvider
which provides the necessary configurations and signer.
A new instance of PoolClient
initialized with the default signer.
The
PoolClient
class provides methods to interact with the Aave protocol's pool contracts on the Aptos blockchain. It extends theAptosContractWrapperBaseClass
and includes functionalities for managing reserves, configuring pool parameters, handling user positions, and managing protocol fees.Remarks
This client is designed to work with the core pool contracts and provides a high-level API for pool operations. The client can be instantiated in two ways:
Example
Param: provider
The AptosProvider instance used to interact with the Aptos blockchain.
Param: signer
Optional Ed25519Account signer for transaction signing.