What you can do
| supply | Supply a stablecoin or RWA reserve asset to earn interest | Approve the Horizon Pool for the asset, then call Pool.supply(asset, amount, onBehalfOf, 0). The caller must be an approved (permissioned) address. |
| borrow | Borrow a stablecoin against supplied collateral | Check getUserAccountData(user).availableBorrowsBase, then call Pool.borrow(asset, amount, 2, 0, onBehalfOf). |
| repay | Repay a stablecoin debt | Approve the Pool, then call Pool.repay(asset, amount, 2, onBehalfOf). Use type(uint256).max for the full debt when repaying your own debt. |
| withdraw | Withdraw a supplied asset | Call Pool.withdraw(asset, amount, to). Use type(uint256).max for the full balance. |
Access is permissioned. Wallets that are not approved cannot use the market.
Collateral is tokenized real-world assets. Their prices, transfer limits and redemption terms can differ from DeFi assets, and a price drop can trigger liquidation.
Borrowing uses a health factor. Falling collateral value can make a position liquidatable.
Liquidity can be low for some assets. A withdrawal or borrow can revert when the reserve has no cash.
Contracts
Read any function, or build a write and sign it. Amounts are in base units (1 USDC = 1000000).Aave Horizon Poolpool on ethereum0xAe05Cd22df81871bc7cC2a04BeCfb516bFe332C8
write supply(address,uint256,address,uint16)
Supply a reserve asset: (asset, amount, onBehalfOf, referralCode=0). Approve the Pool first. Mints aTokens to onBehalfOf. Access is permissioned, so the caller must be an approved address.
write withdraw(address,uint256,address)
Withdraw a supplied asset: (asset, amount, to). Burns aTokens. type(uint256).max withdraws the whole balance. Reverts if it would push the health factor below 1 or if the reserve lacks liquidity.
write borrow(address,uint256,uint256,uint16,address)
Borrow a stablecoin against collateral: (asset, amount, interestRateMode, referralCode=0, onBehalfOf). Use interestRateMode 2 (variable). Needs enough collateral; see getUserAccountData.
write repay(address,uint256,uint256,address)
Repay debt: (asset, amount, interestRateMode=2, onBehalfOf). Approve the Pool first. type(uint256).max repays the full debt when onBehalfOf is the caller.
read getUserAccountData(address)
Returns (totalCollateralBase, totalDebtBase, availableBorrowsBase, currentLiquidationThreshold, ltv, healthFactor). healthFactor has 18 decimals. Below 1e18 the position can be liquidated.
read getReserveData(address)
Reserve state and config for an asset, including aTokenAddress and variableDebtTokenAddress. Use it to find the receipt and debt tokens.
read getReservesList()
All reserve asset addresses in the Horizon market. The list changes over time, so read it rather than hard-coding it.
write setUserUseReserveAsCollateral(address,bool)
Enable or disable a supplied asset as collateral. Disabling reverts if it would drop the health factor below 1.
write setUserEMode(uint8)
Enter an efficiency-mode category for correlated assets, or 0 to leave. Reverts if current positions are not allowed in the category.
read getUserEMode(address)
Efficiency-mode category of a user (0 = none).
read getEModeCategoryData(uint8)
LTV, liquidation threshold, liquidation bonus and label of an e-mode category.