Add XOXNO Lending yield adapter#2753
Conversation
|
Warning Review limit reached
Next review available in: 32 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA XOXNO lending adaptor fetches Stellar lending exports, converts hub and routing-reserve markets into DeFiLlama pool objects, filters invalid hub numeric fields, and exports updated protocol metadata. ChangesXOXNO Lending Adaptor
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant apy
participant getExport
participant XOXNO_API as XOXNO Lending API
participant keepFinite
apy->>getExport: request configured chain export
getExport->>XOXNO_API: fetch export with timeout and User-Agent
XOXNO_API-->>getExport: return JSON lending data
getExport-->>apy: provide market export
apy->>apy: normalize hub and routing-reserve pools
apy->>keepFinite: filter invalid hub pools
keepFinite-->>apy: return valid hub pools
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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. Comment |
|
Error while running xoxno-lending adapter: Test Suites: 1 failed, 1 total |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/adaptors/xoxno-lending/index.js (1)
34-43: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winConsider reusing shared
utils.keepFiniteto avoid over-filtering.This local filter is stricter than the repository’s shared contract and can exclude valid pools when optional fields are missing.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/adaptors/xoxno-lending/index.js` around lines 34 - 43, The local keepFinite function is unnecessarily strict and filters out valid pools. Instead of checking all seven fields with every(), use the shared utils.keepFinite utility that already exists in the repository. Replace the local keepFinite function implementation with a call to the shared utils.keepFinite function to align with the repository's standard filtering logic and avoid excluding valid pools when optional fields are missing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/adaptors/xoxno-lending/index.js`:
- Around line 30-31: The return statement that returns data.markets ?? [] does
not properly validate that markets is actually an array before returning it,
which allows non-array values to be passed through and causes runtime errors
when the result is iterated at line 55. Replace the return statement with a
guard that explicitly checks if data.markets is an array using Array.isArray,
returning the markets array if it passes the check or an empty array otherwise,
to ensure the function always returns a valid array for iteration.
- Around line 21-24: The getMarkets function's fetch call lacks a timeout
mechanism, which can cause the adaptor to hang if upstream services are slow or
unresponsive. Add an AbortSignal with a 5000 millisecond timeout to the fetch
options by including a signal property that uses AbortSignal.timeout(5000) in
the fetch configuration object, similar to the pattern used in
evaa-protocol/getPrices.js.
---
Nitpick comments:
In `@src/adaptors/xoxno-lending/index.js`:
- Around line 34-43: The local keepFinite function is unnecessarily strict and
filters out valid pools. Instead of checking all seven fields with every(), use
the shared utils.keepFinite utility that already exists in the repository.
Replace the local keepFinite function implementation with a call to the shared
utils.keepFinite function to align with the repository's standard filtering
logic and avoid excluding valid pools when optional fields are missing.
🪄 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: 5c9847ba-c602-47ce-a631-4829e1dc30ea
📒 Files selected for processing (1)
src/adaptors/xoxno-lending/index.js
d5aa68c to
906795d
Compare
|
Error while running xoxno-lending adapter: Test Suites: 1 failed, 1 total |
906795d to
18b20e9
Compare
|
Error while running xoxno-lending adapter: Test Suites: 1 failed, 1 total |
18b20e9 to
909e58d
Compare
|
Update: the adapter now exports protocolId |
|
Error while running xoxno-lending adapter: Test Suites: 1 failed, 1 total |
909e58d to
7e7d2a4
Compare
|
Error while running xoxno-lending adapter: Test Suites: 1 failed, 1 total |
- protocolId 8049 -> 8109 (the registered xoxno-lending DefiLlama protocol); fixes the 'protocolId matching its protocol slug' test. - Read the export's hubMarkets (per hub/asset, with APY) and spokeMarkets (per spoke/hub/asset). Hub pools carry the yield with poolMeta = hub name (Core/RWA). Spoke reserves emit as poolKind 'routing_reserve' with poolMeta 'hub / spoke', LTV, borrowability and per-spoke debt but no APY, mirroring Aave V4's Core / <spoke> layer. - Deep-link each pool to its XOXNO page (hub + spoke/hub/asset).
|
The xoxno-lending adapter exports pools: Test Suites: 1 passed, 1 total |
|
The xoxno-lending adapter exports pools: Test Suites: 1 passed, 1 total |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/adaptors/xoxno-lending/index.js`:
- Around line 66-86: Add a utilization field to each normalized pool created in
the hubMarkets loop, using the API utilization value when available or deriving
it from supplied and borrowed totals. Normalize the result to percentage points,
consistent with the existing apyBase and apyBaseBorrow fields.
- Around line 89-120: Update the xoxno-lending ingestion path around the
routing_reserve pools created from spokeMarkets so these rows are not removed by
triggerAdaptor’s all-null APY filter. Preserve routing-reserve metadata and
ensure the downstream contract explicitly retains these APY-less pools, or stop
emitting them if persistence cannot support them; do not leave rows that are
guaranteed to be discarded.
- Around line 129-134: Update the protocolId field in the exported XOXNO Lending
adapter configuration to use the registered value 8049 instead of 8109; leave
the surrounding apy, timetravel, and url fields unchanged.
🪄 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: e1475f47-7e8a-4e22-a0d0-ab7828edba41
📒 Files selected for processing (1)
src/adaptors/xoxno-lending/index.js
Mirror the aave-v4/euler-v2/exactly treatment: routing_collateral and routing_reserve pools carry no APY, so without an allowlist entry they are dropped by the all-APY-null filter and never reach the pools table. Add xoxno-lending so its Aave-V4-style spoke reserves survive ingestion.
|
The xoxno-lending adapter exports pools: Test Suites: 1 passed, 1 total |
Summary
Adds XOXNO Lending Stellar markets to the DefiLlama yield server.
The adapter emits one pool per XOXNO Stellar lending market, including supply APY, borrow APY, utilization, TVL, total supplied, and total borrowed.
Data Source
https://api.xoxno.com/integrations/lending/stellarUser-Agent: dune-analyticsxoxno-lendingThe API export is built from the XOXNO Stellar lending indexer and current market state. It includes the listed markets, current balances, APYs, utilization, and token metadata.
Methodology
tvlUsduses pool reserves / net deposits from the market export.totalSupplyUsduses total supplied market balance.totalBorrowUsduses outstanding borrowed balance.apyBaseuses the market supply APY from the XOXNO export.apyBaseBorrowuses the market borrow APY from the XOXNO export.The adapter is structured so a future MultiversX lending deployment can be added with the same response shape.
Validation
node --check src/adaptors/xoxno-lending/index.jsSummary by CodeRabbit