Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
📝 Walkthrough📝 WalkthroughWalkthroughThe changes in this pull request enhance various components related to market data by introducing a new "Oracle" column and refining the handling of oracle-related information. Key modifications include the addition of the Changes
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (2)
🧰 Additional context used🔇 Additional comments (9)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 9
🧹 Outside diff range and nitpick comments (4)
src/components/OracleVendorBadge.tsx (1)
41-68: Tooltip implementation and export look good.Consider memoizing the tooltip content for performance in larger renders.
Example:
const tooltipContent = React.useMemo(() => ( <div className="m-2"> {/* ... existing tooltip content ... */} </div> ), [vendors]); // Then in the JSX: <Tooltip content={tooltipContent} className="rounded-sm"> {content} </Tooltip>app/positions/components/SuppliedMarketsDetail.tsx (1)
169-173: New Oracle data cell added.Oracle data cell looks good. Consider adding a fallback for missing oracle data.
<td data-label="Oracle" className="text-center"> <div className="flex justify-center"> - <OracleVendorBadge oracleData={position.market.oracle.data} useTooltip /> + {position.market.oracle.data ? ( + <OracleVendorBadge oracleData={position.market.oracle.data} useTooltip /> + ) : ( + 'N/A' + )} </div> </td>src/utils/types.ts (2)
61-63: Simplify theoracleproperty structureIs the
datafield necessary? You could directly defineoracle: MorphoChainlinkOracleData;.
330-332: Consider simplifying theoraclepropertyAs with the earlier suggestion, you might define
oracle: MorphoChainlinkOracleData;without thedatawrapper.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (5)
src/imgs/oracles/chainlink.pngis excluded by!**/*.pngsrc/imgs/oracles/lido.pngis excluded by!**/*.pngsrc/imgs/oracles/pyth.pngis excluded by!**/*.pngsrc/imgs/oracles/redstone.pngis excluded by!**/*.pngsrc/imgs/oracles/uma.pngis excluded by!**/*.png
📒 Files selected for processing (12)
- app/markets/components/MarketRowDetail.tsx (1 hunks)
- app/markets/components/MarketTableBody.tsx (3 hunks)
- app/markets/components/marketsTable.tsx (1 hunks)
- app/positions/components/SuppliedMarketsDetail.tsx (4 hunks)
- src/components/FeedInfo/OracleFeedInfo.tsx (1 hunks)
- src/components/OracleVendorBadge.tsx (1 hunks)
- src/components/TokenIcon.tsx (0 hunks)
- src/hooks/useMarkets.ts (1 hunks)
- src/hooks/useUserPositions.ts (1 hunks)
- src/utils/oracle.ts (1 hunks)
- src/utils/types.ts (3 hunks)
- src/utils/warnings.ts (2 hunks)
💤 Files with no reviewable changes (1)
- src/components/TokenIcon.tsx
🧰 Additional context used
🔇 Additional comments (20)
src/utils/oracle.ts (3)
1-6: Import and type look good.Clean import and clear type definition.
8-16: Enum covers known vendors.Good inclusion of 'Unknown' for handling unexpected cases.
28-36: Good input handling.Null and empty checks prevent errors.
src/components/OracleVendorBadge.tsx (2)
1-11: Imports and type definition look good.Clean imports and clear type definition.
13-16: Component setup is solid.Good use of utility function and early checks.
src/utils/warnings.ts (3)
8-8: Good update.Expanded description covers more cases.
14-14: Nice clarification.More precise about multiple feed routes.
95-95: Good formatting.Improved readability.
app/markets/components/marketsTable.tsx (1)
65-65: New Oracle column added.The change looks good. Ensure
MarketTableBodyis updated to populate this column.✅ Verification successful
Oracle column rendering confirmed.
The "Oracle" column is populated using
OracleVendorBadgeandMarketOracleIndicatorcomponents.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if MarketTableBody component renders Oracle data ast-grep --lang typescript --pattern 'function MarketTableBody($$$) { $$$ <td>$_oracle$_</td> $$$ }'Length of output: 108
Script:
#!/bin/bash # Search for Oracle column rendering in MarketTableBody component rg '<td\s*>Oracle\s*</td>' app/markets/components/marketsTable.tsxLength of output: 68
Script:
#!/bin/bash # Search for any references to 'Oracle' within MarketTableBody component rg 'Oracle' app/markets/components/MarketTableBody.tsxLength of output: 408
app/markets/components/MarketTableBody.tsx (3)
7-7: Import looks good.New OracleVendorBadge import added correctly.
120-124: New Oracle column added correctly.OracleVendorBadge component used with proper data.
183-183: Colspan updated correctly.Expanded row now spans full table width, including new Oracle column.
app/positions/components/SuppliedMarketsDetail.tsx (3)
5-5: New import added.Import for OracleVendorBadge looks good.
103-103: New Oracle column added.Oracle column in table header is correct.
116-117: Calculation reformatted.Improved readability of percentageOfPortfolio calculation.
src/components/FeedInfo/OracleFeedInfo.tsx (1)
14-19: Update usages ofOracleFeedInfoto match the new signatureThe function now accepts
feedinstead ofaddressandtitle. Ensure all components usingOracleFeedInfoare updated accordingly.Run the following script to find usages with old props:
✅ Verification successful
All usages of
OracleFeedInfohave been updated to the new signature. No instances with old props found.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Find usages of `OracleFeedInfo` with old props 'address' and 'title'. # Expectation: No matches should be found. rg --type tsx --type jsx 'OracleFeedInfo\s*.*address\s*=.*title\s*='Length of output: 98
Script:
#!/bin/bash # Description: Find usages of `OracleFeedInfo` with old props 'address' and 'title'. # Expectation: No matches should be found. rg -g '*.tsx' -g '*.jsx' 'OracleFeedInfo\s*.*address\s*=.*title\s*='Length of output: 70
app/markets/components/MarketRowDetail.tsx (1)
1-5: Imports are correctly addedsrc/utils/types.ts (2)
249-259:OracleFeedtype definition is correct
261-266:MorphoChainlinkOracleDatatype looks goodsrc/hooks/useMarkets.ts (1)
50-136: Verify that the new oracle data is used correctlyEnsure that the application logic properly handles the new
oracledata structure. Check if components or functions consuming this data are updated accordingly.Run this script to find usages of the
oraclefields:
Summary by CodeRabbit
Release Notes
New Features
OracleVendorBadge.Improvements
Bug Fixes