> For the complete documentation index, see [llms.txt](https://andrewkimjoseph.gitbook.io/celina-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://andrewkimjoseph.gitbook.io/celina-sdk/guides/aave.md).

# Aave

Supply and withdraw assets on Aave V3 via unsigned transaction flows.

## Supply

```ts
const flow = await celina.aave.prepareSupply(from, "USDm", "100");
```

Returns 1–2 steps:

1. **Approve** (if allowance insufficient) — approve Aave pool to spend underlying
2. **Supply** — deposit into Aave V3

```ts
for (const step of flow.steps) {
  await sendTransactionAsync({
    to: step.to,
    data: step.data,
    value: step.value ? BigInt(step.value) : undefined,
  });
}
```

## Withdraw

Partial withdraw:

```ts
const flow = await celina.aave.prepareWithdraw(from, "USDm", "50");
```

Withdraw full supplied balance:

```ts
const flow = await celina.aave.prepareWithdraw(from, "USDm", undefined, true);
// or
const flow = await celina.aave.prepareWithdraw(from, "USDm", undefined, /* withdrawMax */ true);
```

Withdraw returns a single step (no approval needed).

## Supported assets

Assets are resolved by symbol via the Aave config on Celo. Common tokens include `USDm`, `USDC`, `USDT`, and wrapped `CELO`.

Use `resolveToken` symbols from the token registry — see [TokenService](/celina-sdk/services/tokenservice.md).

## Important: CELO must be wrapped

Aave on Celo uses **wrapped CELO (ERC-20)**, not native CELO. If the user holds native CELO, they must wrap it first. Supplying native CELO will fail with:

```
Insufficient CELO balance. ... Aave requires wrapped CELO (ERC-20), not native CELO.
```

## Balance checks

**Supplied positions (aTokens):**

```ts
const positions = await celina.aave.getBalances(from);
// MCP: get_aave_balances
```

Returns aToken holdings in underlying token units (including accrued interest). Omits zero balances by default.

**Underlying wallet balance before supply:**

Use `get_celo_balances` or `get_token_balance` — see [TokenService](/celina-sdk/services/tokenservice.md).

`prepareSupply` checks underlying token balance before building steps. `prepareWithdraw` checks aToken balance for partial withdraws. aToken `balanceOf` returns the redeemable underlying amount including interest.

## Multi-step supply

When allowance is insufficient, supply flows include an approve step first. Wait for approval confirmation before sending the supply transaction — same pattern as [Mento FX](/celina-sdk/guides/mento-fx.md).

Before signing, call `simulatePreparedStep` for each step — see [Prepared-step simulation](/celina-sdk/guides/prepared-step-simulation.md).

## Related

* [Prepared-step simulation](/celina-sdk/guides/prepared-step-simulation.md)
* [wagmi integration](/celina-sdk/guides/wagmi-integration.md)
* [Prepared flows](/celina-sdk/concepts/prepared-flows.md)
* [AaveService API](/celina-sdk/services/aaveservice.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://andrewkimjoseph.gitbook.io/celina-sdk/guides/aave.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.
