BTB Finance for agents

Protocols / Lending

Aave V4

Aave V4 lending built as hubs and spokes. Hubs hold liquidity for each asset. Spokes are the markets users interact with, each with its own collateral and risk settings. An agent calls a Spoke with a reserveId (read it with getReserveId) to supply, withdraw, borrow, repay, toggle collateral and liquidate. Native tokens go through the native token gateway on Base.

On-chainEVM7 contractsWebsite · Docs

get_protocol({ "protocol": "aave-v4" })

Risks an agent should know

What an agent can do

supplySupply an asset to a reserve
Approve the underlying to the Spoke, then Spoke.supply(reserveId, amount, onBehalfOf)
borrowBorrow against collateral
Spoke.borrow(reserveId, amount, onBehalfOf) after checking getUserAccountData
repayRepay debt
Approve the underlying to the Spoke, then Spoke.repay(reserveId, amount, onBehalfOf)
withdrawWithdraw supplied assets
Spoke.withdraw(reserveId, amount, onBehalfOf). Pass a very large amount for a full withdrawal.
use as collateralEnable or disable a supplied asset as collateral
Spoke.setUsingAsCollateral(reserveId, true, onBehalfOf)
native tokenSupply, borrow, repay or withdraw the native token
Spoke.setUserPositionManager(gateway, true) once, then NativeTokenGateway.supplyNative(spoke, reserveId, amount) with msg.value
liquidateRepay an unhealthy debt and take collateral
Approve the debt asset to the Spoke, then Spoke.liquidationCall(collateralReserveId, debtReserveId, user, debtToCover, receiveShares)

Contracts

ethereum · chain id 1

ContractAddressKey functionsTry
Core Hub (Ethereum)
pool
0xCca852Bc40e560adC3b1Cc58CA5b55638ce826c9
source
readgetAssetCount()
readgetAssetDrawnRate(uint256)
readgetAssetConfig(uint256)
readgetAssetAccruedFees(uint256)
readgetSpokeCount(uint256)
readisSpokeListed(uint256,address)
readgetSpokeAddress(uint256,uint256)
Full ABI
Main Spoke (Ethereum)
pool
0x94e7A5dCbE816e498b89aB752661904E2F56c485
source
writesupply(uint256,uint256,address)
writewithdraw(uint256,uint256,address)
writeborrow(uint256,uint256,address)
writerepay(uint256,uint256,address)
writesetUsingAsCollateral(uint256,bool,address)
writeupdateUserRiskPremium(address)
writesetUserPositionManager(address,bool)
writeliquidationCall(uint256,uint256,address,uint256,bool)
+7 more via get_protocol
Full ABI

avalanche · chain id 43114

ContractAddressKey functionsTry
Core Hub (Avalanche)
pool
0xd07369fAE4A5BB13c9Ce446B052c7867B1AbDf6e
source
readgetAssetCount()
readgetAssetDrawnRate(uint256)
readgetAssetConfig(uint256)
readgetAssetAccruedFees(uint256)
readgetSpokeCount(uint256)
readisSpokeListed(uint256,address)
readgetSpokeAddress(uint256,uint256)
Full ABI
Main Spoke (Avalanche)
pool
0x435272CefF93a1E657E8ABfdf0A13e95900A3a56
source
writesupply(uint256,uint256,address)
writewithdraw(uint256,uint256,address)
writeborrow(uint256,uint256,address)
writerepay(uint256,uint256,address)
writesetUsingAsCollateral(uint256,bool,address)
writeupdateUserRiskPremium(address)
writesetUserPositionManager(address,bool)
writeliquidationCall(uint256,uint256,address,uint256,bool)
+7 more via get_protocol
Full ABI

base · chain id 8453

ContractAddressKey functionsTry
Equities Hub (Base)
pool
0xa4d5947Eb727A052bae69C593FfC84247EC9864E
source
readgetAssetCount()
readgetAssetDrawnRate(uint256)
readgetAssetConfig(uint256)
readgetAssetAccruedFees(uint256)
readgetSpokeCount(uint256)
readisSpokeListed(uint256,address)
readgetSpokeAddress(uint256,uint256)
Full ABI
MAG7 Spoke (Base)
pool
0x17905Db0e4A3514467539956c084180616AE7B8D
source
writesupply(uint256,uint256,address)
writewithdraw(uint256,uint256,address)
writeborrow(uint256,uint256,address)
writerepay(uint256,uint256,address)
writesetUsingAsCollateral(uint256,bool,address)
writeupdateUserRiskPremium(address)
writesetUserPositionManager(address,bool)
writeliquidationCall(uint256,uint256,address,uint256,bool)
+7 more via get_protocol
Full ABI
NativeTokenGateway (Base)
other
0xdFC11f7037Ba11D9cC29A822844f5dC19C42B70d
source
writesupplyNative(address,uint256,uint256)
writesupplyAsCollateralNative(address,uint256,uint256)
writewithdrawNative(address,uint256,uint256)
writeborrowNative(address,uint256,uint256)
writerepayNative(address,uint256,uint256)
readNATIVE_TOKEN_WRAPPER()
Full ABI

Notes

Ethereum, Avalanche and Base entries come from the Aave address book. Ethereum has many more Spokes, for example the BLUECHIP, LIDO and ETHERFI markets. See AaveV4Ethereum.sol for the full list. Arc is listed on DefiLlama but left out because its chain id was not confirmed from an official source. The address book has no core Hub on Base, so the Base entries are the equities Hub, the MAG7 Spoke and the native gateway. The gateway takes the Spoke as an argument, so it can serve any Spoke where the user has approved it.

Sources

Researched 2026-11-28. Addresses are copied from the official sources above; check them before moving large amounts.