Skip to content

sky-lending: add stUSDS (Expert Mode) pool#2789

Open
techsqrt wants to merge 5 commits into
DefiLlama:masterfrom
techsqrt:add-stusds-pool
Open

sky-lending: add stUSDS (Expert Mode) pool#2789
techsqrt wants to merge 5 commits into
DefiLlama:masterfrom
techsqrt:add-stusds-pool

Conversation

@techsqrt

@techsqrt techsqrt commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds the stUSDS pool (Sky's Expert Mode staked-USDS product) to the sky-lending adapter:

  • ~$180M TVL, ~7.0% APY — currently not listed by any adapter (only visible indirectly as collateral in Morpho markets and inside Curve LPs)
  • APY read on-chain from the contract's str() per-second RAY rate accumulator — same mechanism as the existing sUSDS ssr() path
  • TVL = totalSupply × coins.llama.fi price (ethereum:0x99CD4Ec3f88A45940936F469E4bB72A2A701EEB9, priced with confidence 1.0)
  • Click-out deep-links to the product page on app.sky.money

Note: stacked on #2782 (which stacks on #2781) since all three touch this adapter — merging in order avoids conflicts. Only the last commit (557f4a3) is new here.

Suite run from repo root: 249/249 passed, 24 pools.

Summary by CodeRabbit

  • New Features

    • Added support for additional savings and staking pools, including a new expert-mode STUSDS pool.
    • Expanded farm coverage with richer pool details and direct links to related app pages.
    • Added support for an additional network configuration for sUSDS pools.
  • Bug Fixes

    • Improved APY calculations and pool metadata so rewards and pricing display more accurately.
    • Prevents reward APY from showing when a farm is inactive or missing required pricing data.

techsqrt added 5 commits July 7, 2026 14:04
- New pool: SKY staking engine rewards farm
  0xB44c2Fb4181D7cb06BdFf34a46FdFE4A259b40Fc (StakingRewards; staked
  token lsSKY is the engine's 1:1 SKY wrapper, priced via SKY).
- farmsAPY generalized: per-farm stake token/symbol/poolMeta/url instead
  of hardcoded USDS.
- sUSDS pools get per-pool urls to the savings widget (ethereum /
  arbitrumone), replacing the project-level homepage fallback.
- USDS->SPK farm 0x173e314C7635B45322cd8Cb14f44b312e079F3af listed under
  sky-lending with the ${address}-${chain} pool id form, alongside the
  bare-address row the sparklend adapter owns - mirroring how
  spark-savings lists this adapter's sUSDS pools on Arbitrum/Base with
  suffixed ids.
- sUSDS on Base (0x5875eEE1...) added to the savings configs (bare
  pool id; spark-savings holds the suffixed one).
An active farm with zero staked balance would divide by zero and emit
apyReward Infinity; return 0 instead.
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updates the Sky Lending adaptor to add url fields and a base network config to susdsAPY, introduces a new stusdsAPY function for expert-mode STUSDS APY, expands farmsAPY with additional farm configs and revised tvl/reward computation, and aggregates the new function into the exported apy.

Changes

Sky Lending Adaptor Updates

Layer / File(s) Summary
sUSDS config and url propagation
src/adaptors/sky-lending/index.js
Adds per-network url values and a new base network entry to susdsAPY configs, propagates url through the async mapping and returned pool objects.
New stusdsAPY expert-mode function
src/adaptors/sky-lending/index.js
Adds stusdsAPY, which reads STUSDS str() accumulator and totalSupply, fetches STUSDS price, computes apyBase, and returns an expert-mode Ethereum pool with isIntrinsicSource: true.
Expanded farmsAPY configs and computation
src/adaptors/sky-lending/index.js
Expands the farms list with GROVE, SKY staking, and SPK configs and richer metadata; fetches both stake and reward token prices; computes tvlUsd and apyReward conditionally on activity, reward price, and tvl; returns updated pool objects with poolMeta and url.
apy aggregator update
src/adaptors/sky-lending/index.js
Adds stusdsAPY() to the Promise.all aggregation alongside main(), susdsAPY(), and farmsAPY().

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • DefiLlama/yield-server#2779: Both PRs modify farmsAPY logic in the same file to add/compute USDS staking farm pools and shape returned farm pool objects consistently.

Suggested reviewers: 0xkr3p

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main addition: a new stUSDS Expert Mode pool in the sky-lending adapter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

The sky-lending adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 249 passed, 249 total
Snapshots: 0 total
Time: 0.284 s
Ran all test suites.

Nb of pools: 22
 

Sample pools:
┌─────────┬───────────────────────────────────────────────────────┬──────────┬───────────────┬────────────┬──────────────────────────────────────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────────────────┬──────────────────────┬────────────────────┬──────────────────────────────────────────────────┬─────┬───────────────────┬────────────────────┬────────────────────┬────────────────────┬───────────────────┬────────────┬──────────────────────────────────────────────┬────────────┬────────────────────┐
│ (index) │ pool                                                  │ symbol   │ project       │ chain      │ token                                        │ tvlUsd             │ apyBase            │ underlyingTokens                                 │ url                                                                                                        │ isIntrinsicSource │ poolMeta             │ apyReward          │ rewardTokens                                     │ apy │ apyBaseBorrow     │ totalSupplyUsd     │ totalBorrowUsd     │ availableBorrowUsd │ debtCeilingUsd    │ mintedCoin │ borrowToken                                  │ borrowable │ ltv                │
├─────────┼───────────────────────────────────────────────────────┼──────────┼───────────────┼────────────┼──────────────────────────────────────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────┼──────────────────────┼────────────────────┼──────────────────────────────────────────────────┼─────┼───────────────────┼────────────────────┼────────────────────┼────────────────────┼───────────────────┼────────────┼──────────────────────────────────────────────┼────────────┼────────────────────┤
│ 0       │ '0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD'          │ 'SUSDS'  │ 'sky-lending' │ 'ethereum' │ '0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD' │ 5429876440.512984  │ 3.6000004252923823 │ [ '0xdC035D45d973E3EC169d2276DDab16f1e407384F' ] │ 'https://app.sky.money/?network=ethereum&widget=savings'                                                   │ true              │                      │                    │                                                  │     │                   │                    │                    │                    │                   │            │                                              │            │                    │
│ 1       │ '0xB44c2Fb4181D7cb06BdFf34a46FdFE4A259b40Fc'          │ 'SKY'    │ 'sky-lending' │ 'ethereum' │ '0xB44c2Fb4181D7cb06BdFf34a46FdFE4A259b40Fc' │ 906068788.7823873  │                    │ [ '0x56072C95FAA701256059aa122697B133aDEd9279' ] │ 'https://app.sky.money/?network=ethereum&widget=stake'                                                     │                   │ 'SKY Staking Engine' │ 5.69124820031787   │ [ '0x56072C95FAA701256059aa122697B133aDEd9279' ] │     │                   │                    │                    │                    │                   │            │                                              │            │                    │
│ 2       │ '0xF04a5cC80B1E94C69B48f5ee68a08CD2F09A7c3E'          │ 'WETH'   │ 'sky-lending' │ 'ethereum' │ null                                         │ 889093308.752441   │                    │ [ '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' ] │                                                                                                            │                   │ 'ETH-C'              │                    │                                                  │ 0   │ 8.250000000014952 │ 889093308.752441   │ 288889004.81379974 │ 99505698.7344369   │ 388394703.5482366 │ 'DAI'      │ '0x6B175474E89094C44Da98b954EedeAC495271d0F' │ true       │ 0.5882352941176471 │
│ 3       │ '0x173e314c7635b45322cd8cb14f44b312e079f3af-ethereum' │ 'USDS'   │ 'sky-lending' │ 'ethereum' │ '0x173e314C7635B45322cd8Cb14f44b312e079F3af' │ 568156511.4902563  │                    │ [ '0xdC035D45d973E3EC169d2276DDab16f1e407384F' ] │ 'https://app.sky.money/?network=ethereum&widget=rewards&reward=0x173e314C7635B45322cd8Cb14f44b312e079F3af' │                   │ 'SPK Farming Pool'   │ 3.3919557414342445 │ [ '0xc20059e0317DE91738d13af027DfC4a50781b066' ] │     │                   │                    │                    │                    │                   │            │                                              │            │                    │
│ 4       │ '0x2F0b23f53734252Bda2277357e97e1517d6B042A'          │ 'WETH'   │ 'sky-lending' │ 'ethereum' │ null                                         │ 503777745.3610487  │                    │ [ '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' ] │                                                                                                            │                   │ 'ETH-A'              │                    │                                                  │ 0   │ 8.499999999986533 │ 503777745.3610487  │ 175875868.0611271  │ 138359690.50768712 │ 314235558.5688142 │ 'DAI'      │ '0x6B175474E89094C44Da98b954EedeAC495271d0F' │ true       │ 0.6896551724137931 │
│ 5       │ '0xddb46999f8891663a8f2828d25298f70416d7610'          │ 'SUSDS'  │ 'sky-lending' │ 'arbitrum' │ '0xddb46999f8891663a8f2828d25298f70416d7610' │ 360216364.63908404 │ 3.6000004252923823 │ [ '0x6491c05a82219b8d1479057361ff1654749b876b' ] │ 'https://app.sky.money/?network=arbitrumone&widget=savings'                                                │                   │                      │                    │                                                  │     │                   │                    │                    │                    │                   │            │                                              │            │                    │
│ 6       │ '0x83F20F44975D03b1b09e64809B757c47f942BEeA'          │ 'sDAI'   │ 'sky-lending' │ 'ethereum' │ '0x83F20F44975D03b1b09e64809B757c47f942BEeA' │ 214292789.38216344 │ 1.2500001331042565 │ [ '0x6B175474E89094C44Da98b954EedeAC495271d0F' ] │                                                                                                            │ true              │                      │                    │                                                  │     │                   │                    │                    │                    │                   │            │                                              │            │                    │
│ 7       │ '0x99CD4Ec3f88A45940936F469E4bB72A2A701EEB9'          │ 'STUSDS' │ 'sky-lending' │ 'ethereum' │ '0x99CD4Ec3f88A45940936F469E4bB72A2A701EEB9' │ 180503600.32035443 │ 6.989999905394906  │ [ '0xdC035D45d973E3EC169d2276DDab16f1e407384F' ] │ 'https://app.sky.money/?network=ethereum&widget=expert&expert_module=stusds&flow=supply'                   │ true              │ 'Expert Mode'        │                    │                                                  │     │                   │                    │                    │                    │                   │            │                                              │            │                    │
│ 8       │ '0x4E41488C19cD35EB4de3083Fc3e204854c75c86a'          │ 'USDS'   │ 'sky-lending' │ 'ethereum' │ '0x4E41488C19cD35EB4de3083Fc3e204854c75c86a' │ 173532613.26025873 │                    │ [ '0xdC035D45d973E3EC169d2276DDab16f1e407384F' ] │ 'https://app.sky.money/?network=ethereum&widget=rewards&reward=0x4E41488C19cD35EB4de3083Fc3e204854c75c86a' │                   │ 'GROVE Farming Pool' │ 21.00371827549439  │ [ '0xb30FE1CF884b48A22A50D22A9282004f2c5E9406' ] │     │                   │                    │                    │                    │                   │            │                                              │            │                    │
│ 9       │ '0x10CD5fbe1b404B7E19Ef964B63939907bdaf42E2'          │ 'wstETH' │ 'sky-lending' │ 'ethereum' │ null                                         │ 39239483.569003195 │                    │ [ '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0' ] │                                                                                                            │                   │ 'WSTETH-A'           │                    │                                                  │ 0   │ 9.499999999990068 │ 39239483.569003195 │ 17385832.674049098 │ 42213628.74720031  │ 59599461.42124941 │ 'DAI'      │ '0x6B175474E89094C44Da98b954EedeAC495271d0F' │ true       │ 0.6666666666666666 │
└─────────┴───────────────────────────────────────────────────────┴──────────┴───────────────┴────────────┴──────────────────────────────────────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────────────┴──────────────────────┴────────────────────┴──────────────────────────────────────────────────┴─────┴───────────────────┴────────────────────┴────────────────────┴────────────────────┴───────────────────┴────────────┴──────────────────────────────────────────────┴────────────┴────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/adaptors/sky-lending/index.js`:
- Around line 572-585: The STUSDS pool object returned from the sky-lending
adaptor is missing the declared confidence value. Update the pool record in the
return array built by the STUSDS block in index.js to include a confidence field
set to 1.0 alongside the existing properties like pool, symbol, tvlUsd, and
apyBase.
🪄 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: d4e0aa05-0968-4552-bf5b-2d3ab7ed7f9f

📥 Commits

Reviewing files that changed from the base of the PR and between 6719a9c and 557f4a3.

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

Comment on lines +572 to +585
return [
{
pool: STUSDS,
symbol: 'STUSDS',
project: 'sky-lending',
chain: 'ethereum',
token: STUSDS,
poolMeta: 'Expert Mode',
tvlUsd: (totalSupplyRes.output / 1e18) * price,
apyBase,
underlyingTokens: [USDS],
isIntrinsicSource: true,
url: 'https://app.sky.money/?network=ethereum&widget=expert&expert_module=stusds&flow=supply',
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Add the declared confidence to the STUSDS pool.

The PR objective says STUSDS TVL is reported with confidence 1.0, but the returned pool object does not include it.

Proposed fix
       tvlUsd: (totalSupplyRes.output / 1e18) * price,
       apyBase,
+      confidence: 1,
       underlyingTokens: [USDS],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return [
{
pool: STUSDS,
symbol: 'STUSDS',
project: 'sky-lending',
chain: 'ethereum',
token: STUSDS,
poolMeta: 'Expert Mode',
tvlUsd: (totalSupplyRes.output / 1e18) * price,
apyBase,
underlyingTokens: [USDS],
isIntrinsicSource: true,
url: 'https://app.sky.money/?network=ethereum&widget=expert&expert_module=stusds&flow=supply',
},
return [
{
pool: STUSDS,
symbol: 'STUSDS',
project: 'sky-lending',
chain: 'ethereum',
token: STUSDS,
poolMeta: 'Expert Mode',
tvlUsd: (totalSupplyRes.output / 1e18) * price,
apyBase,
confidence: 1,
underlyingTokens: [USDS],
isIntrinsicSource: true,
url: 'https://app.sky.money/?network=ethereum&widget=expert&expert_module=stusds&flow=supply',
},
🤖 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/sky-lending/index.js` around lines 572 - 585, The STUSDS pool
object returned from the sky-lending adaptor is missing the declared confidence
value. Update the pool record in the return array built by the STUSDS block in
index.js to include a confidence field set to 1.0 alongside the existing
properties like pool, symbol, tvlUsd, and apyBase.

@techsqrt

techsqrt commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Not applied — confidence isn't an allowed pool field (see the allowed-fields list in src/adaptors/test.js), so adding it would fail the "should only contain allowed keys" check. The "confidence 1.0" in the PR description refers to the coins.llama.fi price-feed confidence for the stUSDS token, not a pool property; the adapter already skips the pool when no price is returned.

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