Skip to content

feat: add 3jane-lending#2415

Merged
0xkr3p merged 2 commits intoDefiLlama:masterfrom
0xkr3p:feat/add-3jane-lending
Feb 25, 2026
Merged

feat: add 3jane-lending#2415
0xkr3p merged 2 commits intoDefiLlama:masterfrom
0xkr3p:feat/add-3jane-lending

Conversation

@0xkr3p
Copy link
Contributor

@0xkr3p 0xkr3p commented Feb 24, 2026

Summary by CodeRabbit

  • New Features
    • Added 3jane-lending support on Ethereum for USD3 and sUSD3 pools.
    • Live TVL and APY metrics for both pools, including leveraged sUSD3 APY calculations.
    • Parallelized market data fetching for accurate 7-day rate growth and annualized yields.
    • Supply dashboard link available: https://app.3jane.xyz/supply

@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

📝 Walkthrough

Walkthrough

A new adaptor module for 3jane-lending on Ethereum was added; it fetches block heights and market data (Aave, MorphoCredit), computes TVL and 7-day-based APY for USD3 and sUSD3 pools, and exports an apy function, timetravel:false, and a URL.

Changes

Cohort / File(s) Summary
3jane-lending Adaptor
src/adaptors/3jane-lending/index.js
New adaptor: fetches current and 7-day-ago blocks, retrieves totalAssets/pricePerShare for USD3/sUSD3, computes TVL in USD, derives aaveApy (waUSDC growth) and creditApy (MorphoCredit supply share growth) over 7d, calculates levered sUSD3 APY, filters finite values, returns two pool objects, and exports apy, timetravel: false, and url.

Sequence Diagram

sequenceDiagram
    participant Adaptor as 3jane Adaptor
    participant SDK as DefiLlama SDK
    participant APIs as External APIs (Aave, MorphoCredit)
    participant Utils as Utils (keepFinite/format)
    participant Response as Pool Data Response

    Adaptor->>SDK: fetch current block
    Adaptor->>SDK: fetch block (7d ago)
    SDK-->>Adaptor: block heights

    Adaptor->>APIs: fetch USD3 & sUSD3 totalAssets & pricePerShare
    Adaptor->>APIs: fetch waUSDC rate at current & 7d blocks
    Adaptor->>APIs: fetch MorphoCredit market data at current & 7d blocks
    APIs-->>Adaptor: market data

    Adaptor->>Adaptor: compute usd3TvlUsd, susd3TvlUsd
    Adaptor->>Adaptor: compute aaveApy (waUSDC growth annualized)
    Adaptor->>Adaptor: compute creditApy (supply share growth)
    Adaptor->>Adaptor: compute sUSD3 APY = (creditApy + aaveApy) * leverage

    Adaptor->>Utils: filter/format pools
    Utils-->>Adaptor: formatted pools

    Adaptor->>Response: return [USD3-ETH pool, sUSD3-ETH pool]
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through blocks and markets wide,
Calculated yields with joy inside,
Two pools now gleam, TVL in sight,
Seven days of growth took flight,
A tiny rabbit cheers this lending tide.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add 3jane-lending' clearly and concisely summarizes the main change: adding a new adaptor for 3jane-lending lending protocol.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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/adaptors/3jane-lending/index.js`:
- Around line 99-110: The supply-share-price calculation can divide by zero;
update the sppNow and spp7d computations (used from
marketNow.output.totalSupplyShares and market7d.output.totalSupplyShares) to
check that totalSupplyShares > 0 before dividing and set sppNow/spp7d to null
(or undefined) when the denominator is zero, then compute creditApy only if both
sppNow and spp7d are finite numbers (use Number.isFinite) otherwise set
creditApy = null; ensure downstream uses (susd3Apy and keepFinite) handle null
instead of relying on || 0 so you don't mask missing data with 0 or propagate
Infinity/NaN.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8f9655 and 4811366.

📒 Files selected for processing (1)
  • src/adaptors/3jane-lending/index.js

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/adaptors/3jane-lending/index.js (1)

131-149: Deduplicate the app URL string into a constant.

Using a single constant avoids drift between pool entries and module export.

Suggested refactor
 const PROJECT = '3jane-lending';
+const APP_URL = 'https://app.3jane.xyz/supply';
@@
-      url: 'https://app.3jane.xyz/supply',
+      url: APP_URL,
@@
-      url: 'https://app.3jane.xyz/supply',
+      url: APP_URL,
@@
-  url: 'https://app.3jane.xyz/supply',
+  url: APP_URL,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/adaptors/3jane-lending/index.js` around lines 131 - 149, The app URL
'https://app.3jane.xyz/supply' is duplicated in the pool objects and
module.exports; create a single constant (e.g., const APP_URL =
'https://app.3jane.xyz/supply') near the top of the adaptor, replace all literal
occurrences in the apy pools (where pool objects are created — referenced by
variables like susd3TvlUsd, susd3Apy and the array returned from apy) and in
module.exports.url with APP_URL, and ensure utils.keepFinite(p) logic remains
unchanged.
🤖 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/adaptors/3jane-lending/index.js`:
- Around line 23-25: The axios GET for the block lookup (`axios.get` using CHAIN
and timestamp) can hang; add an explicit HTTP timeout (e.g., 3–10s) so the
request fails fast instead of blocking the adapter. Update the call that builds
the URL for `https://coins.llama.fi/block/${CHAIN}/${timestamp}` to pass a
timeout option (or use an axios instance with a default timeout) and ensure any
surrounding logic (e.g., the function performing the lookup) handles the timeout
rejection appropriately.

---

Nitpick comments:
In `@src/adaptors/3jane-lending/index.js`:
- Around line 131-149: The app URL 'https://app.3jane.xyz/supply' is duplicated
in the pool objects and module.exports; create a single constant (e.g., const
APP_URL = 'https://app.3jane.xyz/supply') near the top of the adaptor, replace
all literal occurrences in the apy pools (where pool objects are created —
referenced by variables like susd3TvlUsd, susd3Apy and the array returned from
apy) and in module.exports.url with APP_URL, and ensure utils.keepFinite(p)
logic remains unchanged.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4811366 and d79c644.

📒 Files selected for processing (1)
  • src/adaptors/3jane-lending/index.js

Comment on lines +23 to +25
const res = await axios.get(
`https://coins.llama.fi/block/${CHAIN}/${timestamp}`
);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

rg -n "axios\.get\(" src/adaptors/3jane-lending/index.js -C2

Repository: DefiLlama/yield-server

Length of output: 214


🏁 Script executed:

rg -n "timeout\s*:" src/adaptors/3jane-lending/index.js -C2

Repository: DefiLlama/yield-server

Length of output: 48


🏁 Script executed:

rg -n "axios\\.defaults" src/adaptors/3jane-lending/index.js

Repository: DefiLlama/yield-server

Length of output: 48


🏁 Script executed:

rg -n "axios.*timeout" src/adaptors/ --max-count=5 -l

Repository: DefiLlama/yield-server

Length of output: 134


🏁 Script executed:

rg -n "axios.*timeout" src/adaptors/pancakeswap-amm/index.js -C1

Repository: DefiLlama/yield-server

Length of output: 242


🏁 Script executed:

rg -n "axios.*timeout" src/adaptors/euler-v2/index.js -C1

Repository: DefiLlama/yield-server

Length of output: 257


Add an explicit HTTP timeout for block lookup.

This external request can hang indefinitely and stall the adapter run if the upstream endpoint is slow/unresponsive. Other adapters in the codebase establish timeout configurations as standard practice.

Suggested fix
 const SECONDS_PER_DAY = 86400;
+const HTTP_TIMEOUT_MS = 10_000;
@@
 const getBlock = async (timestamp) => {
   const res = await axios.get(
-    `https://coins.llama.fi/block/${CHAIN}/${timestamp}`
+    `https://coins.llama.fi/block/${CHAIN}/${timestamp}`,
+    { timeout: HTTP_TIMEOUT_MS }
   );
   return res.data.height;
 };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/adaptors/3jane-lending/index.js` around lines 23 - 25, The axios GET for
the block lookup (`axios.get` using CHAIN and timestamp) can hang; add an
explicit HTTP timeout (e.g., 3–10s) so the request fails fast instead of
blocking the adapter. Update the call that builds the URL for
`https://coins.llama.fi/block/${CHAIN}/${timestamp}` to pass a timeout option
(or use an axios instance with a default timeout) and ensure any surrounding
logic (e.g., the function performing the lookup) handles the timeout rejection
appropriately.

@0xkr3p 0xkr3p merged commit 40152bc into DefiLlama:master Feb 25, 2026
2 of 3 checks passed
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.

1 participant