Integrations

Aave V3

Lending & borrowing integration with Aave V3 across multiple chains.

Overview

Lending

Supply assets to Aave V3 pools & earn interest on your deposits.

Borrowing

Borrow assets using supplied collateral with competitive interest rates.

Health Factor

Monitor your borrowing position health factor to avoid liquidation.

Supported Markets

Ethereum Mainnet
Base
Arbitrum
Polygon
Optimism

Integration

aave-integration.ts
import { 
  supplyToAave, 
  withdrawFromAave,
  borrowFromAave,
  repayToAave,
  getAavePosition 
} from '@/lib/aave'

// Supply assets
const supplyTx = await supplyToAave({
  asset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
  amount: '1000000000', // 1000 USDC
  chainId: 1,
  userAddress: userAddress,
})

// Borrow assets
const borrowTx = await borrowFromAave({
  asset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
  amount: '500000000', // 500 USDC
  interestRateMode: 'VARIABLE',
  chainId: 1,
  userAddress: userAddress,
})

// Check position
const position = await getAavePosition({
  userAddress,
  chainId: 1,
})

console.log('Supplied:', position.supplied)
console.log('Borrowed:', position.borrowed)
console.log('Health Factor:', position.healthFactor)
Was this helpful?