https://github.com/aave/aptos-aave-v3
Aave's V3 Protocol on Aptos
https://github.com/aave/aptos-aave-v3
Last synced: 5 months ago
JSON representation
Aave's V3 Protocol on Aptos
- Host: GitHub
- URL: https://github.com/aave/aptos-aave-v3
- Owner: aave
- License: mit
- Created: 2024-07-01T12:50:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-07T09:09:26.000Z (over 1 year ago)
- Last Synced: 2025-01-07T09:35:27.670Z (over 1 year ago)
- Language: Move
- Homepage:
- Size: 858 KB
- Stars: 36
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Aave's V3 Protocol on Aptos
This is the official Aptos version of the Aave V3 Protocol.
๐ Documentation
ย
๐ Report Bug
ย
โจ Request Feature
---
```bash=
โโโ aave-acl // Access control list Package
โโโ aave-config // Configurator Package
โโโ aave-data // Data & Deployment Configurations
โโโ aave-large-packages // Large Packages Package
โโโ aave-math // Math library Package
โโโ aave-mock-underlyings // Mock Underlyings Package
โโโ aave-oracle // Oracle Package
โโโ aave-core // Core Package
```
---
## ๐ Inter-package Dependency Graph
```mermaid
flowchart TD
%% Level 1
aave-config
chainlink-data-feeds
aave-large-packages
aave-mock-underlyings
%% Level 2
aave-acl --> aave-config
aave-math --> aave-config
%% Level 3
aave-oracle --> aave-config
aave-oracle --> aave-acl
aave-oracle --> chainlink-data-feeds
%% Level 4
aave-pool --> aave-acl
aave-pool --> aave-config
aave-pool --> aave-math
aave-pool --> aave-oracle
%% Level 5
aave-data --> aave-acl
aave-data --> aave-config
aave-data --> aave-oracle
aave-data --> aave-data
aave-data --> aave-pool
```
---
## ๐ Getting Started
### 1. ๐งฉ Clone the Repository
```bash
git clone https://github.com/aave/aptos-aave-v3.git && cd aptos-aave-v3
```
---
### 2. ๐ ๏ธ Prerequisites
Make sure the following tools are installed:
- [Aptos CLI](https://aptos.dev/tools/aptos-cli/)
- [yq](https://github.com/mikefarah/yq)
- [Node.js + pnpm](https://pnpm.io/installation)
- [codespell](https://pypi.org/project/codespell/)
- [pre-commit](https://pre-commit.com/#install)
- [Python 3](https://www.python.org/downloads/)
- [GNU Make](https://www.gnu.org/software/make/)
---
## ๐งช Running a Local Testnet
### ๐งฐ Option 1: Using Makefile
Start by copying `.env.template` to `.env` and editing any relevant values.
#### โ
Start the testnet
```bash
make local-testnet
```
#### โ
With indexer (e.g. for Petra Wallet support)
```bash
make local-testnet-with-indexer
```
#### ๐ง Configure workspace
```bash
make set-workspace-config \
&& make init-workspace-config \
&& make init-profiles \
&& make init-test-profiles \
&& make fund-profiles \
&& make fund-test-profiles
```
This will initialize, configure, and fund local accounts with APT.
#### ๐ ๏ธ Compile & Deploy
```bash
make compile-all
make publish-all
```
#### ๐ View your local testnet
[https://explorer.aptoslabs.com/?network=local](https://explorer.aptoslabs.com/?network=local)
---
### ๐ณ Option 2: Using `aave-test-kit` (Docker)
[`aave-test-kit`](aave-test-kit/README.md) is a local simulation environment for Aave on Aptos, inspired by Tenderly.
โก๏ธ See the linked README for Docker-based setup and usage.
---
## ๐งช Testing
### โ
Run Unit Tests (Move)
These do **not require a local testnet**.
```bash
make test-all
```
---
### ๐ฌ Run TypeScript Integration Tests
These must be run **after successful contract deployment**:
```bash
make ts-test
```
---
## ๐ Generate Aptos Move Docs
Generate full module documentation across all packages:
```bash
make doc-all
```
Docs will be generated under each package's `doc/` directory.
---
## ๐งฐ TypeScript SDK
A TypeScript SDK is available for interacting with the Aave V3 Protocol on Aptos directly from your applications.
### ๐ฆ Install via npm
```bash
pnpm add @aave/aave-v3-aptos-ts-sdk
# or
npm install @aave/aave-v3-aptos-ts-sdk
```
### ๐ Explore the SDK
๐ **[View on npm](https://www.npmjs.com/package/@aave/aave-v3-aptos-ts-sdk)**
Browse available functions, types, and usage examples.
๐ For full usage details, please refer to the [README documentation](https://www.npmjs.com/package/@aave/aave-v3-aptos-ts-sdk#readme) on the npm package page.
---
## ๐ Security Audits
All audit reports related to Aave's Move implementation on Aptos are stored in the `/audits` directory at the root of this repository.
### ๐ Audit Directory Structure
```bash
/audits
โโโ Certora Aave Aptos Core V3.0.2 Report.pdf
โโโ Certora Aave Aptos Core V3.1-V3.3 Report.pdf
โโโ Certora Aave Aptos Periphery V3.0.2 Report.pdf
โโโ Ottersec Aave Aptos V3.1-V3.3 Report.pdf
โโโ Spearbit Aave Aptos Core V3.0.2 Report.pdf
โโโ Spearbit Aave Aptos Core V3.1-V3.3 Report.pdf
โโโ Spearbit Aave Aptos Periphery V3.0.2 Report.pdf
```
๐ [Browse Audit Reports](/audits)
---
## ๐ Aave Move Smart Contract Docs
Official documentation for Aave's Move-based smart contracts is now available via GitHub Pages.
The docs are auto-generated from each package and published using [MkDocs Material](https://squidfunk.github.io/mkdocs-material/), with clean navigation and search.
### ๐ฅ Explore the Docs
๐ **[View Smart Contract Documentation](https://aave.github.io/aptos-aave-v3)**
Browse all modules, structs, functions, and events used across Aave's V3 Aptos packages.
---
## ๐ Running Examples
In addition to Move unit tests and integration tests, this repository contains **example scripts** (such as flashloans) that demonstrate how to interact with the deployed protocol on Aptos. They are all located under the `./examples` packages at root level.
### ๐ ๏ธ Compile Example Scripts
Example are compiled separately via calling the main commands listed under `./examples/Makefile`:
```bash
# For testnet
make compile-scripts-testnet
# For mainnet
make compile-scripts-mainnet
```
### ๐ Execute Example Scripts
Once compiled, scripts can be executed against the target network compiled above. For example:
```bash
# Simple flashloan example
make execute-flashloan-simple
# Complex flashloan example
make execute-flashloan-complex
```
Each script corresponds to a .mv compiled Move script under `./examples/build/AaveScripts/bytecode_scripts/`. They are executed via aptos move run-script, with arguments such as asset addresses and flashloan amounts passed in from the Makefile.
๐ These scripts are primarily intended as examples and tests of protocol functionality, such as taking and repaying flashloans.
---