Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/aave use case #23

Merged
merged 19 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/Protocol/data-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ The data sources defined by a market can be static or dynamic, depending on the

## Static Data Sources

Our implementation of a data market serves datasets to render a live Uniswap V2 dashboard. Further details about the data source configuration and snapshot schema can be found in the following section of our documentation:
Our implementation of a data market serves datasets to render live Uniswap V2 and Aave V3 dashboards. Further details about the data source configurations and snapshot schemas can be found in the following sections of our documentation:

* [Building with Powerloom -- Uniswap V2 Dashboard](/docs/build-with-powerloom/use-cases/existing-implementations/uniswapv2-dashboard/)
* [Building with Powerloom -- Aave V3 Dashboard](/docs/build-with-powerloom/use-cases/existing-implementations/aavev3-dashboard/)

Continuing with this example, you can explore the data sources list defined as part of the Uniswap v2 specific configuration in the [`snapshotter-configs`](https://github.com/Powerloom/snapshotter-configs/blob/fcf9b852bac9694258d7afcd8beeaa4cf961c65f/projects.example.json#L1-L11) repository.
Continuing with the Uniswap V2 example, you can explore the data sources list defined as part of the Uniswap v2 specific configuration in the [`snapshotter-configs`](https://github.com/Powerloom/snapshotter-configs/blob/fcf9b852bac9694258d7afcd8beeaa4cf961c65f/projects.example.json#L1-L11) repository.

```json reference
https://github.com/Powerloom/snapshotter-configs/blob/fcf9b852bac9694258d7afcd8beeaa4cf961c65f/projects.example.json#L1-L11
Expand Down
5 changes: 5 additions & 0 deletions docs/build-with-powerloom/snapshotter-node/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Use case-specific logic for generating snapshots and other configurations are av

* DEXs like Uniswap v2, Quickswap
* Bridges like bungee.exchange, Owlto finance
* Lending markets like Aave and Compound

The architecture has been designed to facilitate the seamless interchange of configuration and modules. Adapting the system to different use cases is as straightforward as changing a Git branch.

Expand All @@ -25,11 +26,15 @@ You can observe the corresponding branches within [snapshotter-configs](https://
#### Snapshotter Computes
* `eth_uniswapv2`: Pooler implementation for the Uniswap v2 dashboard
* `eth_uniswapv2_lite`: Pooler implementation for the Uniswap v2 dashboard but without the calculation of complex aggregate data points from scratch.
* `aave`: Pooler implementation for the Aave v3 dashboard
* `aave-lite`: Pooler implementation for the Aave v3 dashboard but without the calculation of complex aggregate data points from scratch.
* `zkevm_quests`: Implementation for Quests on Polygon zkEVM

#### Snapshotter Configs
* `eth_uniswapv2_5_pairs`: Pooler lite mode config with only 5 chosen Uniswap v2 pair contracts
* `eth_uniswapv2`: Pooler config with only 180 Uniswap v2 pair contracts
* `aave`: Pooler config with all Aave v3 asset contracts
* `aave-lite`: Pooler config to be used with the aave-lite compute branch
* `zkevm_quests`: Config for Quests on Polygon zkEVM

### Configuration Files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ curl -X 'GET' \
{
"epochId": 12,
"submittedSnapshotCid": "snapshotcid",
"submittedSnapshot": {}
"submittedSnapshot": {},
"finalizedSnapshotCid": "finalizedsnapshotcid",
"finalizedSnapshot": {},
"reason": "reason for incorrect submission"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"label": "AaveV3 Dashboard",
"position": 1,
"link": {
"type": "generated-index",
"description": "AaveV3 Dashboard Implementation using Powerloom protocol"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
sidebar_position: 1
---

# Datapoints

![AaveV3 Dashboard Powerloom](/images/aavev3-dashboard-powerloom.png)

In Aave V3-Pooler, data points are specific, quantifiable elements derived from Aave V3 lending activities.
Each snapshot inherits `Snapshot Base` which looks something like this
```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/6fb98b1bbc22be8b5aba8bdc860004d35786f4df/utils/models/message_models.py#L9-L17
```

The following type of Base Snapshots are generated for the Aave V3 dashboard:

**1. Asset Metrics Snapshot:**

The Asset Metrics refer to the total supplied and borrowed amounts, supply and borrow interest rates, and the indices used to compute future rate changes.
The asset snapshot looks something like this:

```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L26-L42
```
* **1a. AaveSupplyData and AaveDebtData**

The nominal token amount and the token amount in terms of USD at the time of snapshotting:

```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/data_models.py#L65-L72
```
* **1b. AssetDetailsData**

Additional asset details include the maximum loan-to-value ratio, liquidation information, the asset's reserve factor, borrow/supply caps, and available eMode options.

For further information, please see the Aave V3 Protocol [Documentation](https://docs.aave.com/risk/asset-risk/risk-parameters).

```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/data_models.py#L25-L34
```

* **1c. RateDetailsData**

Additional rate details describing the interest rate strategy for the asset.

For further information, please see the Aave V3 Protocol [Documentation](https://docs.aave.com/risk/liquidity-risk/borrow-interest-rate).

```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/data_models.py#L37-L45
```

**2. Volume-by-Action Snapshot**

The asset's total volume-by-action for the Epoch, and the corresponding events for each action emitted by the blockchain.
The volume-by-action snapshot looks something like this:

```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L91-L98
```

* **2a. volumeData**

The total nominal token volume and the volume in terms of USD at the time of snapshotting:

```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/data_models.py#L92-L94
```

* **2b. liquidationData**

Additional details describing a liquidation action:

```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/data_models.py#L117-L122
```

These base snapshots are used as the data source for higher-order aggregates. These aggregates are then used to generate the data points present in the Aave V3 Dashboard. Refer to [data-composition](/docs/protocol/data-composition) for more details on how data points are composed.

The following aggregate snapshots are generated by AaveV3-Pooler using base snapshots.

**1. Top Assets by Marketshare Snapshot:** All assets are organized by the total market share on the protocol. The top assets by marketshare snapshot look something like this:

```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L55-L69
```

**2. 24 Hour Volume-by-Action Snapshot:** 24-hour volume-by-action for each asset per Epoch. The 24-hour volume-by-action snapshot looks something like this:

```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L101-L107
```

**3. Top Assets by 24 Hour Volume Snapshot:** All assets are organized by total, 24-hour total volume-by-action. The top assets by volume snapshot looks something like this:

```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L110-L128
```

**4. 6 Hour Average Rate Snapshot:** Average supply and borrow rates over the previous 6 hours per Epoch. The 6-hour rate snapshot looks something like this:

```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L82-L88
```

**5. 24 hours Total Market Stats Snapshot:** 24-hour stats for the entire Aave lending market. The 24-hour stats snapshot looks something like this

```python reference
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L72-L79
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
sidebar_position: 0
---

# Introduction

## Pooler - AaveV3 Data Market

Powerloom's AaveV3 dashboard is an [extension](/docs/build-with-powerloom/use-cases/building-new-usecase/extending-uniswapv2-dashboard) of the Pooler framework. Its design is similar to the [UniswapV2](/docs/build-with-powerloom/use-cases/existing-implementations/uniswapv2-dashboard/) dashboard use case. The data network is powered by [Snapshotters](/docs/build-with-powerloom/snapshotter-node/introduction) who capture critical data points from Aave's on-chain Smart Contracts. This data is then processed, aggregated, and displayed on the dashboard to provide users of the Aave protocol with actionable metrics. This implementation is a testament to the composable nature of Pooler and the Powerloom data network's flexibility in capturing a diverse range of data points.

The Dashboard is hosted at [aave-v3.powerloom.io/](https://aave-v3.powerloom.io/)

### Data Points and Aggregated Metrics

Data points are essential elements that serve as the foundational units upon which base snapshots are built. In the Aave protocol, they capture key information about loans, such as the total supplied and borrowed amounts, interest rates, and asset prices at the time of the lending. These base data points are snapshotted and then aggregated by AaveV3-Pooler to provide broader loan market statistics & insights, such as 24-hour lending/borrowing volumes and historical APR rates. Due to their inherent complexity, participants may find lending markets challenging to navigate. Access to actionable metrics is important for users seeking to deploy their capital efficiently and at the appropriate risk levels.

---

### Development and Extension

Snapshotter Node's design enables extensions and custom use case implementations. A developer can extend the pooler compute files found in [snapshotter-computes](https://github.com/PowerLoom/snapshotter-computes/tree/eth_uniswapv2) and config files found in [snapshotter-configs](https://github.com/PowerLoom/snapshotter-configs/tree/eth_uniswapv2) to build their own custom use case implementations.

The documentation has a dedicated section that discusses further implementation and use-case extensions.
Check out our guide on [Setup and Extension](/docs/build-with-powerloom/use-cases/existing-implementations/aavev3-dashboard/setup-and-extension.md) -->
Loading
Loading