DeFi Lending

Aave Setup Guide

Time: 15 minutes | Difficulty: Advanced | Market: DeFi Lending Mode: Full automation | API: Smart contract interaction | Docs: docs.aave.com

This guide wires an Aave DeFi lending bot to the Aave V3 smart contracts using the botwir3 runtime. Configure a wallet, connect to lending pools, and run automated yield and lending strategies locally.


Before you start

Verify that automated operation is permitted under Aave's current terms of service before deploying. Aave is a permissionless protocol — interaction is through smart contracts on Ethereum and other supported chains. botwir3 provides tools for building structured automation. The user is responsible for compliance with all applicable regulations.

Aave Terms of Service | Last verified: May 2026

What you need

  • An Ethereum wallet with ETH for gas and tokens to supply/borrow
  • A private key or keystore file for the wallet (stored locally — never shared)
  • The botwir3 runtime downloaded and unzipped
  • A strategy config file from the builder
  • An RPC endpoint (Infura, Alchemy, or a self-hosted node)

Step 1: Configure wallet credentials

Aave is a permissionless protocol. There are no API keys — the bot interacts with smart contracts using a wallet private key.

🔒 Security. The wallet private key controls all funds in the wallet. Use a dedicated wallet for bot operations with only the funds allocated to the strategy. The private key is stored in a local config file and is not transmitted to botwir3 or any third party.

Step 2: Configure the adapter

Create adapter.json in the bot directory:

{
  "adapter": "aave",
  "credentials": {
    "private_key": "paste-wallet-private-key-here",
    "rpc_url": "https://mainnet.infura.io/v3/paste-project-id-here"
  },
  "asset": "USDC",
  "chain": "ethereum",
  "action": "supply",
  "environment": "live",
  "rate_limit_ms": 15000
}

asset: The token to supply or borrow. Common: USDC, USDT, WETH, DAI, WBTC.

chain: Aave V3 is deployed on Ethereum, Polygon, Arbitrum, Optimism, Avalanche, and Base. Set the chain and RPC URL accordingly.

action: "supply" (earn yield), "borrow" (take a loan against collateral), or "monitor" (track rates without transacting).

API keys (RPC endpoint credentials) are stored in a local config file on the machine running the bot. They are not transmitted to botwir3 or any third party. botwir3 never sees, stores, or has access to wallet credentials.

Step 3: Test the connection

botwir3 test --adapter aave

Expected output:

[botwir3] Adapter: aave
[botwir3] Connection: OK (Ethereum mainnet via Infura)
[botwir3] Wallet: 0x1234...abcd
[botwir3] Chain: ethereum
[botwir3] Rate limit: gas-limited (block time ~12s)

Step 4: Start the bot

botwir3 start --config my-strategy.json

The runtime loads the strategy, computes the spec hash, connects to the Aave smart contracts via the configured RPC endpoint, and begins evaluating signals. The gate function compares proposed actions against the configured spec. The user is responsible for monitoring the bot and verifying execution outcomes.

Rate limits and considerations

ComponentLimitNotes
RPC endpointProvider-dependentInfura free tier: 100,000 requests/day.
Transaction throughput~12 seconds/block (Ethereum)One transaction per block per wallet nonce. Faster on L2s.
Gas costsVariableEach supply/withdraw/borrow/repay costs gas.

Liquidation risk. Borrow positions on Aave can be liquidated if the health factor drops below 1.0 (collateral value falls relative to borrowed amount). The user is responsible for configuring position sizing and monitoring the health factor.

Common Aave bot configurations include yield optimization (moving funds between supply pools to capture the highest APY), automated collateral management (adjusting positions when health factor approaches thresholds), and rate arbitrage between Aave and other lending protocols (Compound, Morpho). All actions and decisions are recorded in the local ledger.

Troubleshooting

ErrorCauseFix
CONNECTION_REFUSEDRPC endpoint unreachable or invalid project IDVerify rpc_url in adapter config
INSUFFICIENT_FUNDSWallet balance too low for transaction + gasFund the wallet with additional ETH and tokens
TRANSACTION_REVERTEDInsufficient collateral, or token approval missingApprove the token for the Aave lending pool contract. Check health factor.
HEALTH_FACTOR_LOWBorrow position approaching liquidationRepay part of the loan or add collateral
MANDATE_INTEGRITY_VIOLATIONConfig file modified while bot is runningStop the bot, verify config, restart

Related guides


One bot. $129. No subscription. No $749/mo platform. → Build for Aave


Build your Aave bot

Ready to build?