# Aave V3

Aave V3 methods return a single transaction object rather than the two-phase pattern used by Morpho. The SDK does not auto-handle ERC-20 approvals for Aave, so your app needs to manage those separately before calling supply or repay methods.

#### Supply

Supplies assets into an Aave V3 pool as a lender. Make sure you have already approved the pool to spend the underlying token before executing this transaction.

```
const tx = await lendingClient.buildAaveSupplyTx({
  pool: "0xYourAavePoolAddress",
  asset: "0xYourReserveAsset",
  amount: 1_000_000n, // Amount in underlying token decimals
});
```

**Note:** Approvals are handled separately by your app. You will need to send a standard ERC-20 `approve` call to the asset contract with the pool address as spender before this transaction will succeed.

#### Borrow

Borrows assets from an Aave V3 pool. You need collateral supplied to the pool beforehand, and the borrow amount must keep your health factor above 1.

```
const tx = await lendingClient.buildAaveBorrowTx({
  pool: "0xYourAavePoolAddress",
  asset: "0xYourReserveAsset",
  amount: 500_000n,
});
```

#### Repay

Repays a borrow position on Aave V3. As with supply, make sure you approve the pool to spend the repayment token first.

```
const tx = await lendingClient.buildAaveRepayTx({
  pool: "0xYourAavePoolAddress",
  asset: "0xYourReserveAsset",
  amount: 500_000n,
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://city-protocol.gitbook.io/docs/software-development-kit/lending-borrowing/aave-v3.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
