OnchainAave

Aave V3 protocol wrappers for Elixir -- pool reads/writes, oracle, math, and type structs. Built on onchain.

Installation

def deps do
[
{:onchain, "~> 0.8"},
{:onchain_aave, "~> 0.2"}
]
end

Modules

ModulePurpose
Onchain.Aave.PoolPool read + write calls (getUserAccountData, supply, borrow, repay; get_user_account_data_many batches many users via Multicall3)
Onchain.Aave.OracleAsset price oracle + Chainlink
Onchain.Aave.MathUSD conversion, LTV, health factor, ray math
Onchain.Aave.Math.V4Aave V4 ray/wad math (cross-validated against revm)
Onchain.Aave.DebtTokenVariable/stable debt-token credit delegation (approveDelegation, borrowAllowance)
Onchain.Aave.ContractsVerified address registry (mainnet + multi-chain, V3 + V4)
Onchain.Aave.UiPoolDataProviderReserves and user reserves data
Onchain.Aave.FaucetTestnet faucet interactions (mint test tokens)

Discovery

All modules use descripex for self-describing APIs:

OnchainAave.describe() # Module overview
OnchainAave.describe(:pool) # Function listings
OnchainAave.describe(:pool, :supply) # Full function details

Configuration

Requires an Ethereum JSON-RPC endpoint, configured via onchain/cartouche:

config :cartouche, :ethereum_node, "https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY"

Or pass :rpc_url per-call to any function.