High-level Aave V3 UiPoolDataProvider read operations.
Composes Address, Contracts, ABI, RPC, and type structs into single-call
functions that return typed structs. Consumers don't need to manually encode
ABI calls, make RPC requests, and decode responses.
Contract
Calls the UiPoolDataProvider contract (registered as :ui_pool_data_provider
in Contracts), passing the PoolAddressesProvider address (:pool_addresses_provider)
as a parameter.
Error Format
Errors pass through from the underlying module that failed:
| Source | Error Shape |
|---|---|
Onchain.Aave.Contracts.address/2 | {:error, {:unsupported_network, network}} |
Onchain.ABI.encode_call/2 | {:error, {:encode_error, reason}} |
Onchain.RPC.eth_call/3 | {:error, {:rpc_error, map}} |
Onchain.ABI.decode_response/2 | {:error, {:decode_error, reason}} |
Onchain.Address.validate/1 | {:error, {:invalid_address, input}} |
Functions
| Function | Purpose |
|---|---|
get_reserves_list/1 | List of reserve token addresses |
get_reserves_list!/1 | Same, raises on error |
get_reserves_data/1 | Per-reserve data + base currency info |
get_reserves_data!/1 | Same, raises on error |
get_user_reserves_data/2 | Per-user reserve balances |
get_user_reserves_data!/2 | Same, raises on error |
API Functions
| Function | Arity | Description | Param Kinds |
|---|---|---|---|
get_user_reserves_data! | 2 | Fetch per-user reserve balances and e-mode category. Raises on error. | user_address: value, opts: value |
get_user_reserves_data | 2 | Fetch per-user reserve balances and e-mode category. | user_address: value, opts: value |
get_reserves_data! | 1 | Fetch per-reserve aggregated data and base currency info. Raises on error. | opts: value |
get_reserves_data | 1 | Fetch per-reserve aggregated data and base currency info. | opts: value |
get_reserves_list! | 1 | Fetch the list of reserve token addresses. Raises on error. | opts: value |
get_reserves_list | 1 | Fetch the list of reserve token addresses from the Aave V3 pool. | opts: value |
Summary
Functions
Fetch per-reserve aggregated data and base currency info.
Fetch per-reserve aggregated data and base currency info. Raises on error.
Fetch the list of reserve token addresses from the Aave V3 pool.
Fetch the list of reserve token addresses. Raises on error.
Fetch per-user reserve balances and e-mode category.
Fetch per-user reserve balances and e-mode category. Raises on error.
Functions
@spec get_reserves_data(keyword()) :: {:ok, {[Onchain.Aave.Types.AggregatedReserveData.t()], Onchain.Aave.Types.BaseCurrencyInfo.t()}} | {:error, term()}
Fetch per-reserve aggregated data and base currency info.
Parameters
opts- Options: :network (default :ethereum), :rpc_url, :timeout, :block (default:[], value)
Returns
Tuple of reserve data list and base currency info ({:ok, {[AggregatedReserveData.t()], BaseCurrencyInfo.t()}} | {:error, term()})
# descripex:contract
%{
params: %{
opts: %{
default: [],
description: "Options: :network (default :ethereum), :rpc_url, :timeout, :block",
kind: :value
}
},
returns: %{
type: "{:ok, {[AggregatedReserveData.t()], BaseCurrencyInfo.t()}} | {:error, term()}",
description: "Tuple of reserve data list and base currency info"
}
}
@spec get_reserves_data!(keyword()) :: {[Onchain.Aave.Types.AggregatedReserveData.t()], Onchain.Aave.Types.BaseCurrencyInfo.t()}
Fetch per-reserve aggregated data and base currency info. Raises on error.
Parameters
opts- Options: :network (default :ethereum), :rpc_url, :timeout, :block (default:[], value)
Returns
Tuple of reserve data list and base currency info ({[AggregatedReserveData.t()], BaseCurrencyInfo.t()})
# descripex:contract
%{
params: %{
opts: %{
default: [],
description: "Options: :network (default :ethereum), :rpc_url, :timeout, :block",
kind: :value
}
},
returns: %{
type: "{[AggregatedReserveData.t()], BaseCurrencyInfo.t()}",
description: "Tuple of reserve data list and base currency info"
}
}
Fetch the list of reserve token addresses from the Aave V3 pool.
Parameters
opts- Options: :network (default :ethereum), :rpc_url, :timeout, :block (default:[], value)
Returns
List of checksummed reserve token addresses ({:ok, [String.t()]} | {:error, term()})
# descripex:contract
%{
params: %{
opts: %{
default: [],
description: "Options: :network (default :ethereum), :rpc_url, :timeout, :block",
kind: :value
}
},
returns: %{
type: "{:ok, [String.t()]} | {:error, term()}",
description: "List of checksummed reserve token addresses"
}
}
Fetch the list of reserve token addresses. Raises on error.
Parameters
opts- Options: :network (default :ethereum), :rpc_url, :timeout, :block (default:[], value)
Returns
List of checksummed reserve token addresses ([String.t()])
# descripex:contract
%{
params: %{
opts: %{
default: [],
description: "Options: :network (default :ethereum), :rpc_url, :timeout, :block",
kind: :value
}
},
returns: %{
type: "[String.t()]",
description: "List of checksummed reserve token addresses"
}
}
@spec get_user_reserves_data( String.t() | binary(), keyword() ) :: {:ok, {[Onchain.Aave.Types.UserReserveData.t()], non_neg_integer()}} | {:error, term()}
Fetch per-user reserve balances and e-mode category.
Parameters
user_address- User address as 0x hex string or 20-byte binary (value)opts- Options: :network (default :ethereum), :rpc_url, :timeout, :block (default:[], value)
Returns
Tuple of user reserve data list and e-mode category ID ({:ok, {[UserReserveData.t()], non_neg_integer()}} | {:error, term()})
# descripex:contract
%{
params: %{
opts: %{
default: [],
description: "Options: :network (default :ethereum), :rpc_url, :timeout, :block",
kind: :value
},
user_address: %{
description: "User address as 0x hex string or 20-byte binary",
kind: :value
}
},
returns: %{
type: "{:ok, {[UserReserveData.t()], non_neg_integer()}} | {:error, term()}",
description: "Tuple of user reserve data list and e-mode category ID"
}
}
@spec get_user_reserves_data!( String.t() | binary(), keyword() ) :: {[Onchain.Aave.Types.UserReserveData.t()], non_neg_integer()}
Fetch per-user reserve balances and e-mode category. Raises on error.
Parameters
user_address- User address as 0x hex string or 20-byte binary (value)opts- Options: :network (default :ethereum), :rpc_url, :timeout, :block (default:[], value)
Returns
Tuple of user reserve data list and e-mode category ID ({[UserReserveData.t()], non_neg_integer()})
# descripex:contract
%{
params: %{
opts: %{
default: [],
description: "Options: :network (default :ethereum), :rpc_url, :timeout, :block",
kind: :value
},
user_address: %{
description: "User address as 0x hex string or 20-byte binary",
kind: :value
}
},
returns: %{
type: "{[UserReserveData.t()], non_neg_integer()}",
description: "Tuple of user reserve data list and e-mode category ID"
}
}