fix: update token distribution - #5778
Conversation
🦋 Changeset detectedLatest commit: ce9ddf5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThe PR updates reward-distribution formatting to consume supply and borrow APY ratios supplied by the API instead of calculating APYs from market balances.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/evm/src/utilities/formatApiRewardDistributors/index.ts | Reads API-provided supply and borrow APY ratios and forwards converted percentages into token distributions. |
| apps/evm/src/clients/api/queries/useGetPools/useGetPoolsQuery/getPools/formatOutput/formatDistributions/index.ts | Removes the obsolete balance and token-price inputs, resolving the previously reported formatter input mismatch. |
| apps/evm/src/types/index.ts | Adds the API ratio fields and normalized percentage fields required by the updated reward-distribution contract. |
| apps/evm/src/utilities/convertRatioToPercentage/index.ts | Adds a focused helper that converts decimal APY ratios into BigNumber percentage values. |
Reviews (2): Last reviewed commit: "fix: read token distribution APYs from s..." | Re-trigger Greptile
| export interface FormatApiRewardDistributorsInput { | ||
| apiRewardDistributors: ApiRewardDistributor[]; | ||
| tokens: Token[]; | ||
| supplyBalanceDollars: BigNumber; | ||
| borrowBalanceDollars: BigNumber; | ||
| blocksPerDay?: number; | ||
| currentBlockNumber?: bigint; |
There was a problem hiding this comment.
Formatter input contract breaks caller
When TypeScript checks the production pool-formatting path, formatDistributions still passes supplyBalanceDollars and borrowBalanceDollars even though this changed interface no longer accepts them, causing excess-property errors that prevent the application typecheck and build from succeeding.
Context Used: AGENTS.md (source)
1ac7cdc to
ce9ddf5
Compare
|
@therealemjy I think this can be closed, the current API should be compatible with the live code and #5757 |
Changes
supplyApyRatioandborrowApyRatioproperties