Skip to content

Commit 4a32419

Browse files
authored
Merge pull request #23 from PowerLoom/feat/aave-use-case
Feat/aave use case
2 parents 2e65d32 + 9acfdce commit 4a32419

File tree

13 files changed

+304
-16
lines changed

13 files changed

+304
-16
lines changed

docs/Protocol/data-sources.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ The data sources defined by a market can be static or dynamic, depending on the
1111

1212
## Static Data Sources
1313

14-
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:
14+
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:
1515

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

18-
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.
19+
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.
1920

2021
```json reference
2122
https://github.com/Powerloom/snapshotter-configs/blob/fcf9b852bac9694258d7afcd8beeaa4cf961c65f/projects.example.json#L1-L11

docs/build-with-powerloom/snapshotter-node/architecture.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Use case-specific logic for generating snapshots and other configurations are av
1717

1818
* DEXs like Uniswap v2, Quickswap
1919
* Bridges like bungee.exchange, Owlto finance
20+
* Lending markets like Aave and Compound
2021

2122
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.
2223

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

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

3540
### Configuration Files

docs/build-with-powerloom/snapshotter-node/full-node/health-tracking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ curl -X 'GET' \
127127
{
128128
"epochId": 12,
129129
"submittedSnapshotCid": "snapshotcid",
130-
"submittedSnapshot": {}
130+
"submittedSnapshot": {},
131131
"finalizedSnapshotCid": "finalizedsnapshotcid",
132132
"finalizedSnapshot": {},
133133
"reason": "reason for incorrect submission"

docs/build-with-powerloom/use-cases/building-new-usecase/extending-uniswapv2-dashboard.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
sidebar_position: 0
33
---
4-
# Extending Pooler
4+
# Extending Uniswap V2 dashboard usecase
55

6-
This documentation provides a step-by-step guide for developers looking to extend the functionality of the UniswapV2 Dashboard, specifically focusing on implementing new data points. The goal is to empower developers to enhance the dashboard with custom features, making it a valuable tool in hackathons and blockchain analytics.
6+
This documentation provides a step-by-step guide for developers looking to extend the functionality of the UniswapV2 Dashboard use case, specifically focusing on implementing new data points. The goal is to empower developers to enhance the dashboard with custom features, making it a valuable tool in hackathons and blockchain analytics.
77

88
## Extending with New Data Points
99

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "AaveV3 Dashboard",
3+
"position": 1,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "AaveV3 Dashboard Implementation using Powerloom protocol"
7+
}
8+
}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Datapoints
6+
7+
![AaveV3 Dashboard Powerloom](/images/aavev3-dashboard-powerloom.png)
8+
9+
In Aave V3-Pooler, data points are specific, quantifiable elements derived from Aave V3 lending activities.
10+
Each snapshot inherits `Snapshot Base` which looks something like this
11+
```python reference
12+
https://github.com/PowerLoom/snapshotter-computes/blob/6fb98b1bbc22be8b5aba8bdc860004d35786f4df/utils/models/message_models.py#L9-L17
13+
```
14+
15+
The following type of Base Snapshots are generated for the Aave V3 dashboard:
16+
17+
**1. Asset Metrics Snapshot:**
18+
19+
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.
20+
The asset snapshot looks something like this:
21+
22+
```python reference
23+
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L26-L42
24+
```
25+
* **1a. AaveSupplyData and AaveDebtData**
26+
27+
The nominal token amount and the token amount in terms of USD at the time of snapshotting:
28+
29+
```python reference
30+
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/data_models.py#L65-L72
31+
```
32+
* **1b. AssetDetailsData**
33+
34+
Additional asset details include the maximum loan-to-value ratio, liquidation information, the asset's reserve factor, borrow/supply caps, and available eMode options.
35+
36+
For further information, please see the Aave V3 Protocol [Documentation](https://docs.aave.com/risk/asset-risk/risk-parameters).
37+
38+
```python reference
39+
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/data_models.py#L25-L34
40+
```
41+
42+
* **1c. RateDetailsData**
43+
44+
Additional rate details describing the interest rate strategy for the asset.
45+
46+
For further information, please see the Aave V3 Protocol [Documentation](https://docs.aave.com/risk/liquidity-risk/borrow-interest-rate).
47+
48+
```python reference
49+
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/data_models.py#L37-L45
50+
```
51+
52+
**2. Volume-by-Action Snapshot**
53+
54+
The asset's total volume-by-action for the Epoch, and the corresponding events for each action emitted by the blockchain.
55+
The volume-by-action snapshot looks something like this:
56+
57+
```python reference
58+
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L91-L98
59+
```
60+
61+
* **2a. volumeData**
62+
63+
The total nominal token volume and the volume in terms of USD at the time of snapshotting:
64+
65+
```python reference
66+
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/data_models.py#L92-L94
67+
```
68+
69+
* **2b. liquidationData**
70+
71+
Additional details describing a liquidation action:
72+
73+
```python reference
74+
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/data_models.py#L117-L122
75+
```
76+
77+
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.
78+
79+
The following aggregate snapshots are generated by AaveV3-Pooler using base snapshots.
80+
81+
**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:
82+
83+
```python reference
84+
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L55-L69
85+
```
86+
87+
**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:
88+
89+
```python reference
90+
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L101-L107
91+
```
92+
93+
**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:
94+
95+
```python reference
96+
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L110-L128
97+
```
98+
99+
**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:
100+
101+
```python reference
102+
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L82-L88
103+
```
104+
105+
**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
106+
107+
```python reference
108+
https://github.com/PowerLoom/snapshotter-computes/blob/aave/utils/models/message_models.py#L72-L79
109+
```
110+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
sidebar_position: 0
3+
---
4+
5+
# Introduction
6+
7+
## Pooler - AaveV3 Data Market
8+
9+
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.
10+
11+
The Dashboard is hosted at [aave-v3.powerloom.io/](https://aave-v3.powerloom.io/)
12+
13+
### Data Points and Aggregated Metrics
14+
15+
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.
16+
17+
---
18+
19+
### Development and Extension
20+
21+
The Pooler framework builds upon the modular architecture of a Snapshotter Node and 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/aave) and config files found in [snapshotter-configs](https://github.com/PowerLoom/snapshotter-configs/tree/aave) to build their own custom use case implementations.
22+
23+
The documentation has a dedicated section that discusses further implementation and use-case extensions.
24+
Check out our guide on [Setup and Extension](/docs/build-with-powerloom/use-cases/existing-implementations/aavev3-dashboard/setup-and-extension.md).

0 commit comments

Comments
 (0)