Skip to content

Conversation

@creed-victor
Copy link
Contributor

@creed-victor creed-victor commented Nov 19, 2025

@creed-victor creed-victor self-assigned this Nov 19, 2025
@netlify
Copy link

netlify bot commented Nov 19, 2025

Deploy Preview for sovryn-layer ready!

Name Link
🔨 Latest commit 2688eb5
🔍 Latest deploy log https://app.netlify.com/projects/sovryn-layer/deploys/6923feb3f2bd17000890971a
😎 Deploy Preview https://deploy-preview-16--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 force-pushed the feat/SOV-5222-implement-sc-interactions-to branch from e5f30ac to f2c0a59 Compare November 19, 2025 09:48
@creed-victor creed-victor marked this pull request as ready for review November 19, 2025 11:34
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 borrow and lending functionality for a money market feature, along with supporting infrastructure improvements.

Key Changes:

  • Added borrow and lend transaction flows with dialog UI components
  • Implemented money market pool and reserve data fetching from on-chain contracts
  • Enhanced caching system with Redis-based response caching and stale-while-revalidate support
  • Added decimal formatting utilities (shortened and formatted representations)

Reviewed Changes

Copilot reviewed 54 out of 57 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
packages/shared/src/lib/decimal.ts Added formatting methods for decimal display (formatted with separators, shortened with magnitude suffixes)
packages/shared/src/helpers.ts Added address equality comparison helper
packages/sdk/src/types.ts Refactored token types and expanded money market pool/reserve interfaces
packages/sdk/src/managers/money-market/money-market.manager.ts New manager implementing borrow and supply operations with ERC20 and native token support
packages/sdk/src/lib/transaction.ts Added approval transaction helper for ERC20 tokens
apps/web-app/src/components/MoneyMarket/components/BorrowDialog New borrow dialog with form validation
apps/web-app/src/components/MoneyMarket/components/LendDialog New lend dialog with form validation
apps/web-app/src/lib/transactions/store.ts Enhanced transaction store with completion tracking and close callbacks
apps/indexer/src/app/plugins/cache.ts New Redis-based caching plugin with background revalidation
apps/indexer/src/libs/loaders/money-market.ts Added on-chain data fetching for pool reserves using contract ABIs

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

{balance && (
<span className="ml-2 text-sm font-normal text-gray-400">
(Balance:{' '}
{Decimal.from(balance.value, balance.decimals).toFormatted(88)}{' '}
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

The magic number 88 for decimal places is unclear. Consider extracting this to a named constant (e.g., MAX_DISPLAY_DECIMALS) or adding a comment explaining why 88 decimal places are used for balance display.

Suggested change
{Decimal.from(balance.value, balance.decimals).toFormatted(88)}{' '}
{Decimal.from(balance.value, balance.decimals).toFormatted(MAX_DISPLAY_DECIMALS)}{' '}

Copilot uses AI. Check for mistakes.
Comment on lines 241 to 242
// By default, don't cache error responses
if (reply.statusCode >= 400) return payload;
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

[nitpick] The condition reply.statusCode >= 400 will prevent caching of both client errors (4xx) and server errors (5xx). Consider whether client errors like 404 should be cached differently from server errors like 500, as 404s are typically stable while 500s may be transient.

Suggested change
// By default, don't cache error responses
if (reply.statusCode >= 400) return payload;
// By default, don't cache server error responses (5xx)
if (reply.statusCode >= 500) return payload;

Copilot uses AI. Check for mistakes.
@creed-victor creed-victor merged commit 9c37750 into develop Nov 24, 2025
4 of 5 checks passed
@creed-victor creed-victor deleted the feat/SOV-5222-implement-sc-interactions-to branch November 24, 2025 06:44
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.

4 participants