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: markets page APY range select #2288

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

feat: markets page APY range select #2288

wants to merge 13 commits into from

Conversation

defispartan
Copy link
Collaborator

@defispartan defispartan commented Dec 17, 2024

General Changes

historicapytoggle

  • Add APY range select menu to markets screen
  • Query and calculate historical rates with indeces from protocol subgraphs
  • Add selectedTimeRange to root store
  • Display implied historic rates in MarketsAssetsList based on selectedTimeRange
  • react-query cache (5 min refresh)
  • Loading state
  • Disable incentives display for historical time range

Historical Rate Logic

The implied APY for a selected time-frame is calculated by comparing the growth in supply (liquidityIndex) or borrow (variableBorrowIndex) indeces over the selected time range, and scaling the growth to a timescale of one year:

impliedAPY = (endIndex / startIndex)^(365 / timeRange) - 1

Subgraph Queries

Protocol subgraphs are event-driven, to account for this the most recent reserve update and the update closest to the historical timestamps are queried to very closely approximate the startIndex and endIndex.

The subgraph query works by concatenating a request to fetch the current and previous index for each individual underlyingAsset, and exeucting them as a single network request.

Any reserve which was listed after the selected time range will not display a historic rate (i.e. if reserve was added 50 days ago it will not have a historic APY for the 60 day time range and beyond).

Copy link

height bot commented Dec 17, 2024

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Copy link

vercel bot commented Dec 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
interface ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2025 5:45am
interface-ez7q ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2025 5:45am

@defispartan defispartan changed the title feat: scaffold APY range select feat: markets page APY range select Dec 17, 2024
Copy link

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

Two Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/governance 84.19 KB (🟡 +19 B) 628.59 KB
/markets 27.86 KB (🟡 +559 B) 572.26 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

Copy link

Copy link

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 539.06 KB (🟢 -5.63 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Thirteen Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 52.25 KB (🟡 +4.46 KB) 591.31 KB
/404 6.95 KB (🔴 +4.42 KB) 546.02 KB
/500 7.38 KB (🔴 +4.4 KB) 546.44 KB
/bridge 40.63 KB (🟡 +4.6 KB) 579.7 KB
/faucet 19.93 KB (🔴 +4.83 KB) 558.99 KB
/governance 89.05 KB (🟡 +4.88 KB) 628.12 KB
/governance/ipfs-preview 102.42 KB (🟡 +4.84 KB) 641.48 KB
/governance/v3/proposal 128.93 KB (🟡 +4.78 KB) 668 KB
/history 29.54 KB (🟡 +5.77 KB) 568.6 KB
/markets 33.68 KB (🟡 +6.37 KB) 572.74 KB
/reserve-overview 25.25 KB (🔴 +5.56 KB) 564.31 KB
/staking 28.21 KB (🟡 +4.93 KB) 567.27 KB
/v3-migration 35.72 KB (🟡 +5.11 KB) 574.78 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

📦 Next.js Bundle Analysis for aave-ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 859.29 KB (🟡 +1.32 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Thirteen Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/ 50.38 KB (🟢 -2.28 KB) 909.68 KB
/404 5.08 KB (🟢 -2.31 KB) 864.38 KB
/500 5.5 KB (🟢 -2.31 KB) 864.79 KB
/bridge 37.51 KB (🟢 -2.31 KB) 896.8 KB
/faucet 17.52 KB (🟢 -2.31 KB) 876.81 KB
/governance 85.38 KB (🟢 -2.3 KB) 944.67 KB
/governance/ipfs-preview 102.84 KB (🟢 -2.31 KB) 962.14 KB
/governance/v3/proposal 128.71 KB (🟢 -2.31 KB) 988 KB
/history 26.17 KB (🟢 -2.31 KB) 885.47 KB
/markets 32.66 KB (🟢 -795 B) 891.95 KB
/reserve-overview 24.04 KB (🟢 -2.31 KB) 883.33 KB
/staking 36 KB (🟢 -2.31 KB) 895.29 KB
/v3-migration 34.36 KB (🟢 -2.28 KB) 893.65 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant