Conversation
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
🔐 Commit Signature Verification✅ All 3 commit(s) passed verification
Summary
Required key type: Last verified: 2026-03-17 10:02 UTC |
packages/babylon-ts-sdk/src/tbv/integrations/aave/clients/__tests__/spoke.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3300f4fed1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
jrwbabylonlab
left a comment
There was a problem hiding this comment.
ah, ok. i assume u have relevant ticket tracking the todo?
core spoke-cf - collateral factor, thf - target health factor, lb - liquidation bonuscloses #1227
Greptile Summary
This PR introduces mock implementations for three Core Spoke governance parameters — Collateral Factor (CF), Target Health Factor (THF), and Liquidation Bonus (LB) — as placeholder reads until the real Core Spoke ABI is available. The changes follow the existing pattern of async contract-read functions in
spoke.ts, export the mocks via the publicaavemodule, and include an eslint rule update to allow_-prefixed unused parameters.Key changes:
MOCK_TARGET_HEALTH_FACTOR_WAD(1.10),MOCK_COLLATERAL_FACTOR_BPS(75%), andMOCK_LIQUIDATION_BONUS_WAD(1.05) toconstants.tsgetTargetHealthFactor,getCollateralFactor, andgetLiquidationBonustospoke.ts, each returning the corresponding mock constantaave/index.ts@typescript-eslint/no-unused-varsESLint rule withargsIgnorePattern: "^_"to suppress lint errors for the stub parametersgetCollateralFactorreturns a BPS-scaled value (7500n), whilegetTargetHealthFactorandgetLiquidationBonusreturn WAD-scaled values. This is inconsistent with the existingavgCollateralFactorfield ingetUserAccountData, which is WAD-scaled, and may cause calculation errors if callers assume a uniform scale across all three functions.Confidence Score: 3/5
getCollateralFactorreturns BPS while the other two functions return WAD — an inconsistency that also conflicts with the existingavgCollateralFactor(WAD) ingetUserAccountData. Since these mocks are exported as part of the public SDK API, consumers may already start building against the current scale conventions, making a later correction a breaking change.Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Caller] -->|getTargetHealthFactor| B[spoke.ts] A -->|getCollateralFactor| B A -->|getLiquidationBonus| B B -->|returns MOCK_TARGET_HEALTH_FACTOR_WAD| C["WAD scale\n1_100_000_000_000_000_000n\n÷ 1e18 = 1.10"] B -->|returns MOCK_COLLATERAL_FACTOR_BPS| D["BPS scale ⚠️\n7500n\n÷ 10000 = 0.75"] B -->|returns MOCK_LIQUIDATION_BONUS_WAD| E["WAD scale\n1_050_000_000_000_000_000n\n÷ 1e18 = 1.05"] C --> F[constants.ts] D --> F E --> F style D fill:#fff3cd,stroke:#ffc107,color:#000Last reviewed commit: 3300f4f