Skip to content

Latest commit

 

History

History
73 lines (51 loc) · 1.76 KB

File metadata and controls

73 lines (51 loc) · 1.76 KB

Alchemy Smart Wallets for Aave

Two approaches for integrating with Aave using Alchemy's Smart Wallets - Core (recommended) and Wallet APIs.

Quick Start

  1. Setup environment variables:

    cp .env.example .env
    # Fill in your values in .env
  2. Install dependencies:

    npm install
  3. Initialize your smart wallet:

    npm run account  # Get your smart wallet address
  4. Fund your smart wallet: Send 0.01+ DAI to the smart wallet address from step 3

  5. Run examples:

    npm run supply   # Supply DAI to Aave
    npm run withdraw # Withdraw DAI from Aave

Environment Variables

Required in .env:

Implementation Approaches

🔧 Core (Recommended)

  • npm run core:* - Direct @aa-sdk/core implementation
  • Simpler API, fewer lines of code

🏛️ Wallet APIs

  • npm run wallet:* - @account-kit/wallet-client implementation
  • Full prepare/sign/send workflow

Configuration

To customize chain, token addresses, or amounts, edit src/config.ts:

export const config = {
  chain: arbitrum,        // Change to sepolia, polygon, etc.
  amounts: {
    deposit: "0.01",      // Change deposit amount
    withdraw: "0.01",     // Change withdraw amount
  }
}

Notes

  • Uses Arbitrum network and DAI token by default
  • Creates smart wallets (not EOAs) - fund the smart wallet address
  • Gas fees sponsored via Alchemy Gas Manager
  • Get DAI on Arbitrum: Uniswap