Skip to content

fix: vvs-standard returning 0 pools (farms moved to CraftsmanV2 rewarders)#2785

Open
0xshubhs wants to merge 3 commits into
DefiLlama:masterfrom
0xshubhs:fix/vvs-standard
Open

fix: vvs-standard returning 0 pools (farms moved to CraftsmanV2 rewarders)#2785
0xshubhs wants to merge 3 commits into
DefiLlama:masterfrom
0xshubhs:fix/vvs-standard

Conversation

@0xshubhs

@0xshubhs 0xshubhs commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Problem

The vvs-standard adapter silently returns 0 pools. It enumerates the V1 Craftsman (0xDccd...564bc) and keeps pools with allocPoint > 0, but VVS redirected all V1 emissions about a year ago: totalAllocPoint is now 1 and the only pool with a non-zero allocPoint is pid 154, a dummy "vvs deposit token" (VDT) pool. Every LP farm has allocPoint 0, so the filter drops everything.

What changed on VVS side

  • Native VVS emissions to LP farms ended (emissionApr is 0 for all farms on vvs.finance).
  • Active farms (currently 4: VVS-FM, WCRO-CORGIAI, WCRO-BARA, PACK-WCRO) are staked through the CraftsmanV2 wrapper (0xbc149c62EFe8AFC61728fC58b1b66a0661712e76), which holds the whole V1 position per pool and pays third-party rewarder incentives (FM, CORGIAI, BARA, PACK).
  • The frontend gets its farm list and APRs from api.vvs.finance.

Change

Rewrote the adapter to:

  • pull the farm list (/general/api/v1/farms) and APRs (/general/api/info/v1/farm-aprs) from the same API the vvs.finance UI uses, keeping only non-finished farms
  • compute staked TVL on-chain: the CraftsmanV2 wrapper's userInfo amount in V1 Craftsman for V2 farms (LP balanceOf the Craftsman for any legacy V1 farm), priced via the pair's reserveUSD/totalSupply from the VVS exchange subgraph (also switched to the current graph-v2.cronoslabs.com host)
  • apyBase = LP fee APR, apyReward = VVS emission APR (currently 0) + active rewarder APRs, with matching rewardTokens
  • dropped the now-unused web3 dependency and V1 masterchef/LP ABIs
  • removed the vvs-standard entry from the exclusion list so the fixed adapter is triggered again

Test

npm run test --adapter=vvs-standard passes, returning 4 pools that match the vvs.finance/farms UI:

PACK-WCRO     tvlUsd 154,764  apyBase 9.26   apyReward 15.89 (PACK)
WCRO-BARA     tvlUsd  74,231  apyBase 0.19   apyReward 28.58 (BARA)
VVS-FM        tvlUsd  60,016  apyBase 0.03   apyReward 39.87 (FM)
WCRO-CORGIAI  tvlUsd  29,257  apyBase 1.07   apyReward  7.33 (CORGIAI)

Summary by CodeRabbit

  • Bug Fixes
    • Updated farm APY/TVL calculations to use active farm APR metadata and on-chain staking balances for more accurate yield and TVL across the portfolio.
    • Improved reward token discovery so currently emitted rewards are displayed more reliably.
  • Changes
    • Re-enabled the VVS Standard protocol in the app so it appears again in supported results.

Copilot AI review requested due to automatic review settings July 7, 2026 20:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3b57cf8e-c8e7-436a-ba52-6418809fc725

📥 Commits

Reviewing files that changed from the base of the PR and between 30e11ee and c10c00f.

📒 Files selected for processing (2)
  • src/adaptors/vvs-standard/index.js
  • src/utils/exclude.js
💤 Files with no reviewable changes (1)
  • src/utils/exclude.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/adaptors/vvs-standard/index.js

📝 Walkthrough

Walkthrough

The vvs-standard adaptor removes its ABI export file and rewrites yield calculation to use VVS farm APIs, subgraph pair metadata, and Craftsman staking multicalls instead of MasterChef and volume-based inputs.

Changes

VVS Standard Adaptor Rewrite

Layer / File(s) Summary
New constants, ABI, and query setup
src/adaptors/vvs-standard/index.js
Introduces Craftsman V1/V2 constants, API and subgraph endpoints, simplified staking ABIs, and a GraphQL query for pair metadata by LP or pair id.
Farm and pair data acquisition
src/adaptors/vvs-standard/index.js
Fetches farms and farm APR metadata from VVS APIs, filters active farms by chain and finished status, builds an APR lookup by LP address, and queries the subgraph for pair data.
Onchain staking reads via multicall
src/adaptors/vvs-standard/index.js
Replaces MasterChef pool and reserve reads with multicalls to Craftsman V1 and V2 contracts to obtain staked amounts per farm.
APY/TVL computation and reward token construction
src/adaptors/vvs-standard/index.js
Computes tvlUsd from reserveUSD, totalSupply, and staked amount; derives apyBase and apyReward from APR metadata; builds rewardTokens; and filters out farms missing required inputs.

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

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 summarizes the main fix: vvs-standard was returning no pools because farms moved to CraftsmanV2 rewarders.
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 7, 2026

Copy link
Copy Markdown

The vvs-standard adapter exports pools:

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

Nb of pools: 4
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬──────────┬────────────────┬────────────────┬────────────────────┬──────────┬───────────┬────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────────┐
│ (index) │ pool                                         │ chain    │ project        │ symbol         │ tvlUsd             │ apyBase  │ apyReward │ underlyingTokens                                                                               │ rewardTokens                                     │
├─────────┼──────────────────────────────────────────────┼──────────┼────────────────┼────────────────┼────────────────────┼──────────┼───────────┼────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────┤
│ 0       │ '0xcc2f3b5d2f1f154d31344b07e18335485d2ca57d' │ 'Cronos' │ 'vvs-standard' │ 'PACK-WCRO'    │ 154808.3910649265  │ 9.2646   │ 15.887024 │ [ '0x0d0b4a6fc6e7f5635c2ff38de75af2e96d6d6804', '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23' ] │ [ '0x0d0b4a6fc6e7f5635c2ff38de75af2e96d6d6804' ] │
│ 1       │ '0xc77580d7aeb496ebc9163f1e11059821ec63e47c' │ 'Cronos' │ 'vvs-standard' │ 'WCRO-BARA'    │ 74231.47910268331  │ 0.189076 │ 28.577428 │ [ '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23', '0xf24409d155965ca87c45ad5bc084ad8ad3be4f39' ] │ [ '0xf24409d155965ca87c45ad5bc084ad8ad3be4f39' ] │
│ 2       │ '0x1577b7e25ef2b136e643271fb7116141bad61c35' │ 'Cronos' │ 'vvs-standard' │ 'VVS-FM'       │ 60015.69486575772  │ 0.034392 │ 39.869883 │ [ '0x2d03bece6747adc00e1a131bba1469c15fd11e03', '0x37888159581ac2cdea5fb9c3ed50265a19ede8dd' ] │ [ '0x37888159581ac2cdea5fb9c3ed50265a19ede8dd' ] │
│ 3       │ '0x8f9baccf9a130a755520cbabb20543adb3006f14' │ 'Cronos' │ 'vvs-standard' │ 'WCRO-CORGIAI' │ 29256.535685492527 │ 1.071611 │ 7.329184  │ [ '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23', '0x6b431b8a964bfcf28191b07c91189ff4403957d0' ] │ [ '0x6b431b8a964bfcf28191b07c91189ff4403957d0' ] │
└─────────┴──────────────────────────────────────────────┴──────────┴────────────────┴────────────────┴────────────────────┴──────────┴───────────┴────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────┘

@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/vvs-standard/index.js`:
- Around line 73-100: Guard the multicall results in vvs-standard/index.js
before using them in the activeFarms.map loop: with permitFailure: true,
wrapperStakes.output[i] and craftsmanBalances.output[i] may be absent or missing
output, so add per-row checks before reading amount or output. Update the logic
around the Promise.all results and the pools mapping so each farm is skipped or
handled safely when its corresponding multicall entry failed, instead of
dereferencing the missing row and throwing.
🪄 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: 645bef24-ad6a-46dd-b1eb-38ed17afb8cc

📥 Commits

Reviewing files that changed from the base of the PR and between 1329169 and 30e11ee.

📒 Files selected for processing (2)
  • src/adaptors/vvs-standard/abis.js
  • src/adaptors/vvs-standard/index.js
💤 Files with no reviewable changes (1)
  • src/adaptors/vvs-standard/abis.js

Comment thread src/adaptors/vvs-standard/index.js Outdated
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

The vvs-standard adapter exports pools:

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

Nb of pools: 4
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬──────────┬────────────────┬────────────────┬────────────────────┬──────────┬───────────┬────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────────┐
│ (index) │ pool                                         │ chain    │ project        │ symbol         │ tvlUsd             │ apyBase  │ apyReward │ underlyingTokens                                                                               │ rewardTokens                                     │
├─────────┼──────────────────────────────────────────────┼──────────┼────────────────┼────────────────┼────────────────────┼──────────┼───────────┼────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────┤
│ 0       │ '0xcc2f3b5d2f1f154d31344b07e18335485d2ca57d' │ 'Cronos' │ 'vvs-standard' │ 'PACK-WCRO'    │ 155028.74263720048 │ 9.248235 │ 15.909538 │ [ '0x0d0b4a6fc6e7f5635c2ff38de75af2e96d6d6804', '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23' ] │ [ '0x0d0b4a6fc6e7f5635c2ff38de75af2e96d6d6804' ] │
│ 1       │ '0xc77580d7aeb496ebc9163f1e11059821ec63e47c' │ 'Cronos' │ 'vvs-standard' │ 'WCRO-BARA'    │ 74220.58198808307  │ 0.189104 │ 28.577422 │ [ '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23', '0xf24409d155965ca87c45ad5bc084ad8ad3be4f39' ] │ [ '0xf24409d155965ca87c45ad5bc084ad8ad3be4f39' ] │
│ 2       │ '0x1577b7e25ef2b136e643271fb7116141bad61c35' │ 'Cronos' │ 'vvs-standard' │ 'VVS-FM'       │ 60006.919209955755 │ 0.034397 │ 39.869854 │ [ '0x2d03bece6747adc00e1a131bba1469c15fd11e03', '0x37888159581ac2cdea5fb9c3ed50265a19ede8dd' ] │ [ '0x37888159581ac2cdea5fb9c3ed50265a19ede8dd' ] │
│ 3       │ '0x8f9baccf9a130a755520cbabb20543adb3006f14' │ 'Cronos' │ 'vvs-standard' │ 'WCRO-CORGIAI' │ 29264.13729626994  │ 1.072903 │ 7.329266  │ [ '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23', '0x6b431b8a964bfcf28191b07c91189ff4403957d0' ] │ [ '0x6b431b8a964bfcf28191b07c91189ff4403957d0' ] │
└─────────┴──────────────────────────────────────────────┴──────────┴────────────────┴────────────────┴────────────────────┴──────────┴───────────┴────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────┘

@0xshubhs

0xshubhs commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Guarded the multicall rows in c10c00f so a farm whose call failed gets skipped instead of throwing. Harness still green, 4 pools.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

The vvs-standard adapter exports pools:

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

Nb of pools: 4
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬──────────┬────────────────┬────────────────┬────────────────────┬──────────┬───────────┬────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────────┐
│ (index) │ pool                                         │ chain    │ project        │ symbol         │ tvlUsd             │ apyBase  │ apyReward │ underlyingTokens                                                                               │ rewardTokens                                     │
├─────────┼──────────────────────────────────────────────┼──────────┼────────────────┼────────────────┼────────────────────┼──────────┼───────────┼────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────┤
│ 0       │ '0xcc2f3b5d2f1f154d31344b07e18335485d2ca57d' │ 'Cronos' │ 'vvs-standard' │ 'PACK-WCRO'    │ 154366.4325950768  │ 8.789943 │ 15.663454 │ [ '0x0d0b4a6fc6e7f5635c2ff38de75af2e96d6d6804', '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23' ] │ [ '0x0d0b4a6fc6e7f5635c2ff38de75af2e96d6d6804' ] │
│ 1       │ '0xc77580d7aeb496ebc9163f1e11059821ec63e47c' │ 'Cronos' │ 'vvs-standard' │ 'WCRO-BARA'    │ 72781.82574689404  │ 0.201251 │ 28.491887 │ [ '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23', '0xf24409d155965ca87c45ad5bc084ad8ad3be4f39' ] │ [ '0xf24409d155965ca87c45ad5bc084ad8ad3be4f39' ] │
│ 2       │ '0x1577b7e25ef2b136e643271fb7116141bad61c35' │ 'Cronos' │ 'vvs-standard' │ 'VVS-FM'       │ 58835.179594438094 │ 0.053831 │ 39.905729 │ [ '0x2d03bece6747adc00e1a131bba1469c15fd11e03', '0x37888159581ac2cdea5fb9c3ed50265a19ede8dd' ] │ [ '0x37888159581ac2cdea5fb9c3ed50265a19ede8dd' ] │
│ 3       │ '0x8f9baccf9a130a755520cbabb20543adb3006f14' │ 'Cronos' │ 'vvs-standard' │ 'WCRO-CORGIAI' │ 28850.363999278976 │ 1.080199 │ 7.34581   │ [ '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23', '0x6b431b8a964bfcf28191b07c91189ff4403957d0' ] │ [ '0x6b431b8a964bfcf28191b07c91189ff4403957d0' ] │
└─────────┴──────────────────────────────────────────────┴──────────┴────────────────┴────────────────┴────────────────────┴──────────┴───────────┴────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────┘

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.

2 participants