Skip to content

Conversation

@creed-victor
Copy link
Contributor

No description provided.

@creed-victor creed-victor self-assigned this Dec 8, 2025
Copilot AI review requested due to automatic review settings December 8, 2025 13:35
@netlify
Copy link

netlify bot commented Dec 8, 2025

Deploy Preview for sovryn-layer ready!

Name Link
🔨 Latest commit bd49c9d
🔍 Latest deploy log https://app.netlify.com/projects/sovryn-layer/deploys/6936d4211f516100086e50da
😎 Deploy Preview https://deploy-preview-18--sovryn-layer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@creed-victor creed-victor merged commit ad1c82e into develop Dec 8, 2025
3 of 4 checks passed
@creed-victor creed-victor deleted the feat/SOV-5257-money-market-list-active branch December 8, 2025 13:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements functionality to display active user positions in the money market interface by integrating real-time data from the blockchain and calculating comprehensive user metrics.

  • Adds backend API endpoint to fetch and calculate user positions with detailed financial metrics
  • Updates frontend components to display real user data instead of mock constants
  • Downgrades @aave packages from 1.36.2 to 1.29.1 to use legacy ABI compatibility

Reviewed changes

Copilot reviewed 37 out of 38 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
packages/shared/src/lib/http-client.ts Adds console.error logging for HTTP request failures
packages/shared/src/lib/decimal.ts Adds pow method for decimal power calculations
packages/sdk/src/types.ts Updates MoneyMarketPoolReserve interface and adds MoneyMarketPoolPosition and MoneyMarketUserSummary types
packages/sdk/src/managers/money-market/money-market.manager.ts Adds listUserPositions method to fetch user position data
packages/sdk/src/constants.ts Adds USD_DECIMALS constant
packages/sdk/package.json Downgrades @aave packages to version 1.29.1
apps/web-app/src/routes/money-market.tsx Replaces mock data with real user positions from API
apps/web-app/src/routes/__root.tsx Adds connection function to router context
apps/web-app/src/main.tsx Provides getConnection function to router context
apps/web-app/src/integrations/wagmi/config.ts Exports getConnection helper function
apps/web-app/src/components/ui/select.tsx Reorders imports
apps/web-app/src/components/MoneyMarket/components/TopPanel/TopPanel.tsx Adds loading skeleton states for pending data
apps/web-app/src/components/MoneyMarket/components/LendPositionsList/components/AssetsTable/AssetsTable.tsx Updates to use MoneyMarketPoolPosition data instead of mock LendPosition type
apps/web-app/src/components/MoneyMarket/components/LendPositionsList/components/AssetsTable/AssetsTable.constants.tsx Removes mock LEND_POSITIONS constant
apps/web-app/src/components/MoneyMarket/components/LendPositionsList/LendPositionsList.tsx Updates to use MoneyMarketPoolPosition type and changes default accordion state to open
apps/web-app/src/components/MoneyMarket/components/LendDialog/LendDialog.tsx Updates to use canBeCollateral property
apps/web-app/src/components/MoneyMarket/components/LendAssetsList/components/AssetsTable/AssetsTable.tsx Updates to display liquidity data and use canBeCollateral property
apps/web-app/src/components/MoneyMarket/components/LendAssetsList/LendAssetsList.tsx Removes zero balance filter functionality
apps/web-app/src/components/MoneyMarket/components/BorrowPositionsList/components/AssetsTable/AssetsTable.tsx Updates to use MoneyMarketPoolPosition data and display APY selection
apps/web-app/src/components/MoneyMarket/components/BorrowPositionsList/components/AssetsTable/AssetsTable.constants.tsx Removes mock BORROW_POSITIONS constant
apps/web-app/src/components/MoneyMarket/components/BorrowPositionsList/BorrowPositionsList.tsx Updates to use MoneyMarketPoolPosition type and real data
apps/web-app/src/components/MoneyMarket/components/BorrowAssetsList/components/AssetsTable/AssetsTable.tsx Updates to display liquidity data and use canBeBorrowed property
apps/web-app/src/components/MoneyMarket/MoneyMarket.constants.ts Removes mock constant values
apps/web-app/package.json Adds @wagmi/core dependency
apps/indexer/src/main.ts Refactors to use zodFastify helper function
apps/indexer/src/libs/validators/validators.ts Adds custom Zod validator for Ethereum addresses
apps/indexer/src/libs/utils/user-reserves.ts Removes unused transformUserReservesData function
apps/indexer/src/libs/server.ts Adds zodFastify helper to configure Fastify with Zod type provider
apps/indexer/src/libs/loaders/money-market.ts Updates to use legacy @aave ABI and adds data transformation for reserves and user positions
apps/indexer/src/libs/aave/index.ts Adds empty placeholder file
apps/indexer/src/env.ts Adds RPC_BOB_TESTNET and NO_CACHE environment variables
apps/indexer/src/configs/constants.ts Adds USD_DECIMALS constant
apps/indexer/src/configs/chains.ts Adds configurable RPC URL for BOB Sepolia
apps/indexer/src/app/routes/root.ts Updates to use ZodFastifyInstance type
apps/indexer/src/app/routes/_chain/routes.ts Implements user positions endpoint with comprehensive calculations for financial metrics
apps/indexer/src/app/plugins/cache.ts Adds BigInt serialization support and maybeCache helper function
apps/indexer/package.json Adds @aave/math-utils and @aave/contract-helpers at version 1.29.1
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

throw new Error(`Cannot convert to Decimal: ${value}`);
}

static pow(exponent: number): Decimal {
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The method name 'pow' is ambiguous as it suggests a general power operation, but it specifically calculates powers of 10. Consider renaming to 'pow10' or 'fromPowerOfTen' to better reflect its specific behavior.

Suggested change
static pow(exponent: number): Decimal {
static pow10(exponent: number): Decimal {

Copilot uses AI. Check for mistakes.
disabled={!asset.canToggleCollateral}
id={`collateral-${asset.token.address}`}
onClick={() => toggleCollateral(asset.id)}
// disabled={!asset}
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commented-out disabled attribute should either be properly implemented or removed. The comment 'disabled={!asset}' doesn't make sense as 'asset' will always be truthy in this context.

Suggested change
// disabled={!asset}

Copilot uses AI. Check for mistakes.
Comment on lines +146 to +149
value={String(asset.borrowApy)}
// onValueChange={(val) =>
// handleApyTypeChange(asset, index, val)
// }
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commented-out onValueChange handler suggests incomplete functionality. The Select component allows user interaction but doesn't respond to changes. Either implement the handler to enable APY type switching or make the Select read-only/disabled.

Copilot uses AI. Check for mistakes.
Comment on lines +575 to +578
symbol: 'todo', // todo
// symbol: ammSymbolMap[reserveRaw.underlyingAsset.toLowerCase()]
// ? ammSymbolMap[reserveRaw.underlyingAsset.toLowerCase()]
// : reserveRaw.symbol,
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded 'todo' value for symbol should be properly implemented. This will display 'todo' as the token symbol in the UI, which is incorrect.

Suggested change
symbol: 'todo', // todo
// symbol: ammSymbolMap[reserveRaw.underlyingAsset.toLowerCase()]
// ? ammSymbolMap[reserveRaw.underlyingAsset.toLowerCase()]
// : reserveRaw.symbol,
symbol: ammSymbolMap && ammSymbolMap[reserveRaw.underlyingAsset.toLowerCase()]
? ammSymbolMap[reserveRaw.underlyingAsset.toLowerCase()]
: reserveRaw.symbol,

Copilot uses AI. Check for mistakes.
.toFixed(USD_DECIMALS),
canBeCollateral: item.usageAsCollateralEnabled,
isActive: item.isActive,
isFroze: item.isFrozen,
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'isFroze' to 'isFrozen'.

Suggested change
isFroze: item.isFrozen,
isFrozen: item.isFrozen,

Copilot uses AI. Check for mistakes.
isActive: item.isActive,
isFroze: item.isFrozen,
// eModes: item.eModes,
i: item,
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The property 'i' is ambiguous. Consider using a more descriptive name like 'rawItem' or 'formattedReserve', or remove it if it's not needed in the response.

Suggested change
i: item,
rawItem: item,

Copilot uses AI. Check for mistakes.
Comment on lines +358 to +359
// eslint-disable-next-line @typescript-eslint/no-explicit-any
id: (item as any).id,
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of 'any' cast suggests the type definition is incomplete. The 'item' should have an 'id' property in its type definition rather than requiring a cast.

Copilot uses AI. Check for mistakes.
.toFixed(USD_DECIMALS),
canBeCollateral: item.reserve.usageAsCollateralEnabled,
isActive: item.reserve.isActive,
isFroze: item.reserve.isFrozen,
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'isFroze' to 'isFrozen'.

Suggested change
isFroze: item.reserve.isFrozen,
isFrozen: item.reserve.isFrozen,

Copilot uses AI. Check for mistakes.
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.

3 participants