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 4 commits into
base: main
Choose a base branch
from
Open

feat: markets page APY range select #2288

wants to merge 4 commits into from

Conversation

defispartan
Copy link
Collaborator

@defispartan defispartan commented Dec 17, 2024

General Changes

  • Add APY range select to markets screen
  • Query and calculate historical rates with indeces from protocol subgraphs
  • Propagate rates to MarketsAssetsList
  • Account for index not aligning directly with selected time range
  • react-query
  • Handle edge cases where subgraph query fails or asset history unavailable

Historical Rate Logic

The average APY over a selected time-frame can be calculated by comparing the difference in supply (liquidityIndex) or borrow (variableBorrowIndex) indeces:

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

Protocol subgraphs are event-driven, to account for this the closest reserve data update above below the current and target timestamps are queried and startIndex / endIndex can be approximated.

Give two recorded events at times Tp​ and Tn​ with indices Ip​ and In​, the index at exact start and end timestamps can be estimated:

  • The chosen start time Tstart​ lies between these two events, so Tp < Tstart < Tn
  • averageGrowthRate = (In - Ip) / (Tn - Tp)
  • estimatedIndex = Ip + (averageGrowthRate * (Tstart - Tp))

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 Dec 20, 2024 5:13pm
interface-ez7q ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 5:13pm

@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.

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