# Aave V3 Periphery on Aptos

> [!WARNING]
> Aave V3 on Aptos is deprecated. Supplying and borrowing are disabled, but
> users can still repay debt and withdraw supplied assets. See the [governance
> proposal](https://app.aave.com/governance/v3/proposal/?proposalId=521).

Reference for the non-incentives modules in `sources/aave-periphery` of the `aave-pool` package: the fee collector, coin migration and the UI pool data provider.

## Collector

The `collector` module manages the collection and distribution of protocol fees.

### Key Functions

#### deposit

```move
public fun deposit(sender: &signer, fa: FungibleAsset)
```

Deposits fungible assets into the collector.

**Input Parameters:**

| Name   | Type          | Description                   |
| ------ | ------------- | ----------------------------- |
| **sender** | &signer       | The signer of the transaction |
| **fa** | FungibleAsset | The fungible asset to deposit |

#### withdraw

```move
public fun withdraw(
    sender: &signer,
    asset_metadata: Object<Metadata>,
    receiver: address,
    amount: u64
)
```

Withdraws assets from the collector to a specified receiver.

**Input Parameters:**

| Name           | Type               | Description                      |
| -------------- | ------------------ | -------------------------------- |
| **sender**     | &signer            | The signer of the transaction    |
| **asset_metadata** | Object\<Metadata\> | The metadata object of the asset |
| **receiver**   | address            | The address receiving the assets |
| **amount**     | u64                | The amount to withdraw           |

### View Methods

#### get_collected_fees

```move
#[view]
public fun get_collected_fees(asset_metadata: Object<Metadata>): u64
```

Returns the amount of fees collected for a specific asset.

**Input Parameters:**

| Name           | Type               | Description                      |
| -------------- | ------------------ | -------------------------------- |
| **asset_metadata** | Object\<Metadata\> | The metadata object of the asset |

**Return Values:**

| Type | Description                      |
| ---- | -------------------------------- |
| u64  | The fees collected for the asset |

## CoinMigrator

The `coin_migrator` module provides functionality to convert between Coin and FungibleAsset representations.

### View Methods

#### get_fa_address

```move
public fun get_fa_address<CoinType>(): address
```

Returns the address of the fungible asset associated with a specific coin type.

**Return Values:**

| Type    | Description                       |
| ------- | --------------------------------- |
| address | The address of the fungible asset |

#### get_fa_balance

```move
#[view]
public fun get_fa_balance<CoinType>(owner: address): u64
```

Returns the fungible asset balance for a specific coin type and owner.

**Input Parameters:**

| Name  | Type    | Description              |
| ----- | ------- | ------------------------ |
| **owner** | address | The address of the owner |

**Return Values:**

| Type | Description                             |
| ---- | --------------------------------------- |
| u64  | The fungible asset balance of the owner |

## UI Pool Data Provider

The `ui_pool_data_provider_v3` module provides view functions to query pool data for UI display.

### View Methods

#### get_reserves_list

```move
#[view]
public fun get_reserves_list(): vector<address>
```

Returns the list of all reserves in the protocol.

**Return Values:**

| Type              | Description                   |
| ----------------- | ----------------------------- |
| vector\<address\> | The addresses of all reserves |

#### get_reserves_data

```move
#[view]
public fun get_reserves_data(): (vector<AggregatedReserveData>, BaseCurrencyInfo)
```

Returns detailed data about all reserves in the protocol, including configuration, rates, and other parameters.

**Return Values:**

| Type                            | Description                   |
| ------------------------------- | ----------------------------- |
| vector\<AggregatedReserveData\> | The data of every reserve     |
| BaseCurrencyInfo                | The base currency information |

#### get_user_reserves_data

```move
#[view]
public fun get_user_reserves_data(user: address): (vector<UserReserveData>, u8)
```

Returns data about a user’s positions in the protocol, including balances and configuration.
