feat: add pool type and duration metadata#2636
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA database migration adds Changes
Sequence DiagramsequenceDiagram
participant DB as Database
participant QRY as Query Layer
participant ADT as Adaptor Pipeline
participant CTL as API Controller
participant RSP as Response Formatter
DB->>QRY: Fetch config with type, duration
QRY->>ADT: Pass pool data (type, duration)
ADT->>ADT: Parse duration (string → number)
ADT->>ADT: Normalize & round (5 decimals)
ADT->>CTL: Forward to enrichment
CTL->>CTL: Include type, duration in enriched pool
CTL->>RSP: Build response object
RSP->>RSP: Format with type, duration columns
RSP-->>DB: Return enriched pool data
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 58 minutes and 53 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/api/controllers/enriched.js`:
- Around line 113-114: The code currently overwrites supply-side metadata by
unconditionally assigning p.type and p.duration from lendBorrow; change the
assignment so you only take lendBorrow.type and lendBorrow.duration when they
are defined (e.g. use lendBorrow?.type ?? p.type and lendBorrow?.duration ??
p.duration or an explicit check like if (lendBorrow && lendBorrow.type != null)
p.type = lendBorrow.type; same for duration) so poolSupplySide values are
preserved when the borrow-side is null/undefined; update the mapping where
p.type and p.duration are set to use these guarded/null-coalescing checks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 380d1435-c741-4fab-8f12-2966ec7216f5
📒 Files selected for processing (8)
migrations/1777200000000_add-pool-type-duration.jssrc/adaptors/test.jssrc/api/controllers/enriched.jssrc/handlers/triggerAdaptor.jssrc/queries/config.jssrc/queries/yield.jssrc/types/Pool.d.tssrc/utils/enrichedColumns.js
Summary
typeanddurationpool metadata to the shared yield-server pool contractconfig, include it in enrichment/public responses, and expose it in/poolsBorrowtypevalues and numericdurationTests
node --check src/queries/yield.jsnode --check src/handlers/triggerAdaptor.jsnode --check src/api/controllers/enriched.jsnode --check src/queries/config.jsnode --check src/adaptors/test.jsnode --check migrations/1777200000000_add-pool-type-duration.jsnpm test -- --runInBand src/adaptors/test.js --testPathPattern=src/adaptors/test.js(fails locally:jest: command not foundin this workspace)Notes
yield-server#1678after checking issue comments, PR history, and local code for overlap; there was no competing PR or claimSummary by CodeRabbit
Release Notes
type(categorizing pools as Variable Rate Lending, Fixed Rate Lending, Yield Farming, Concentrated Liquidity, or Other) andduration(numeric field)