Adding newly launched yValos and yPythagoras tokens on YieldFi#2482
Adding newly launched yValos and yPythagoras tokens on YieldFi#2482neelra8n wants to merge 10 commits intoDefiLlama:masterfrom
Conversation
📝 WalkthroughWalkthroughAdds two Ethereum tokens (yValos, yPYMN) to the YieldFi adaptor by introducing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
|
The yieldfi adapter exports pools: Test Suites: 1 passed, 1 total |
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/adaptors/yieldfi/index.js`:
- Around line 78-84: Add missing trailing semicolons to the constant
declarations YVALOS_CONTRACTS and YPYTHAGORAS_CONTRACTS to match project style
(same as YHLP_CONTRACTS), and while here, validate the two Ethereum addresses
(0xd04ae722...8ff0 and 0x06c2c73f...4f27) by checking Etherscan/chain data or
official project docs; if they are incorrect or unverified, replace with the
correct mainnet vault addresses or add a TODO comment documenting the
verification step.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 65c3b747-79c7-407c-bb86-698461f7627f
📒 Files selected for processing (1)
src/adaptors/yieldfi/index.js
| const YVALOS_CONTRACTS = { | ||
| ethereum: "0xd04ae722b3fe56812e13bb212a79cea7c1b08ff0", | ||
| } | ||
|
|
||
| const YPYTHAGORAS_CONTRACTS = { | ||
| ethereum: "0x06c2c73f30135c831d010ec7b82d0f32321c4f27", | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify the contract addresses exist and retrieve basic info
echo "Checking yValos contract..."
curl -s "https://api.etherscan.io/api?module=contract&action=getabi&address=0xd04ae722b3fe56812e13bb212a79cea7c1b08ff0" | jq -r '.message'
echo "Checking yPythagoras contract..."
curl -s "https://api.etherscan.io/api?module=contract&action=getabi&address=0x06c2c73f30135c831d010ec7b82d0f32321c4f27" | jq -r '.message'Repository: DefiLlama/yield-server
Length of output: 138
🏁 Script executed:
#!/bin/bash
# Check the DECIMALS constant and verify structure
head -20 src/adaptors/yieldfi/index.js | cat -n
# Check if yValos or yPythagoras are in DECIMALS
grep -n "DECIMALS\|yValos\|yPythagoras" src/adaptors/yieldfi/index.js | head -30
# Check the getUnderlying function
sed -n '200,220p' src/adaptors/yieldfi/index.js | cat -nRepository: DefiLlama/yield-server
Length of output: 1748
🏁 Script executed:
#!/bin/bash
# Check the processToken function implementation
sed -n '220,260p' src/adaptors/yieldfi/index.js | cat -n
# Verify contract addresses look correct (valid hex format)
echo "yValos address check: 0xd04ae722b3fe56812e13bb212a79cea7c1b08ff0"
echo "yPythagoras address check: 0x06c2c73f30135c831d010ec7b82d0f32321c4f27"
# Check what happens when decimals is undefined in getTVL
sed -n '177,190p' src/adaptors/yieldfi/index.js | cat -n
# Look for how tokens without explicit decimals are handled
grep -n "processToken\|getTVL" src/adaptors/yieldfi/index.js | head -20Repository: DefiLlama/yield-server
Length of output: 3468
🏁 Script executed:
#!/bin/bash
# Check for yPrism and yHLP which were added earlier - do they have DECIMALS entries?
grep -n "yPrism\|yHLP\|YPRISM\|YHLP" src/adaptors/yieldfi/index.js | grep -E "DECIMALS|const"
# Check if there's any test data or config that validates these addresses
find . -name "*yieldfi*" -type f | head -10
# Look for any comments or descriptions in the file about these new tokens
sed -n '70,95p' src/adaptors/yieldfi/index.js | cat -nRepository: DefiLlama/yield-server
Length of output: 1137
🏁 Script executed:
#!/bin/bash
# Try alternative approach - check if addresses have any code on ethereum mainnet
# We can check the file to see if there are any comments about these addresses
grep -B5 -A2 "YVALOS_CONTRACTS\|YPYTHAGORAS_CONTRACTS" src/adaptors/yieldfi/index.js
# Also check git log to see if there's commit message info
git log --oneline -20 | head -10
# Check if there's a README or CONTRIBUTING guide with info about new tokens
find . -maxdepth 2 -name "README*" -o -name "CONTRIBUTING*" | xargs ls -la 2>/dev/nullRepository: DefiLlama/yield-server
Length of output: 896
Add trailing semicolons for consistency with existing contract declarations.
The new contract constant declarations are missing trailing semicolons, which is inconsistent with the existing style (see YHLP_CONTRACTS at line 77).
🧹 Proposed fix
const YVALOS_CONTRACTS = {
ethereum: "0xd04ae722b3fe56812e13bb212a79cea7c1b08ff0",
-}
+};
const YPYTHAGORAS_CONTRACTS = {
ethereum: "0x06c2c73f30135c831d010ec7b82d0f32321c4f27",
-}
+};Both contract addresses returned NOTOK when queried against Etherscan's API:
0xd04ae722b3fe56812e13bb212a79cea7c1b08ff0(yValos)0x06c2c73f30135c831d010ec7b82d0f32321c4f27(yPythagoras)
This suggests the addresses may be invalid, unverified, or non-existent on mainnet. These should be validated on-chain (e.g., by checking live transaction data or the official project documentation) to ensure correctness.
📝 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.
| const YVALOS_CONTRACTS = { | |
| ethereum: "0xd04ae722b3fe56812e13bb212a79cea7c1b08ff0", | |
| } | |
| const YPYTHAGORAS_CONTRACTS = { | |
| ethereum: "0x06c2c73f30135c831d010ec7b82d0f32321c4f27", | |
| } | |
| const YVALOS_CONTRACTS = { | |
| ethereum: "0xd04ae722b3fe56812e13bb212a79cea7c1b08ff0", | |
| }; | |
| const YPYTHAGORAS_CONTRACTS = { | |
| ethereum: "0x06c2c73f30135c831d010ec7b82d0f32321c4f27", | |
| }; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/adaptors/yieldfi/index.js` around lines 78 - 84, Add missing trailing
semicolons to the constant declarations YVALOS_CONTRACTS and
YPYTHAGORAS_CONTRACTS to match project style (same as YHLP_CONTRACTS), and while
here, validate the two Ethereum addresses (0xd04ae722...8ff0 and
0x06c2c73f...4f27) by checking Etherscan/chain data or official project docs; if
they are incorrect or unverified, replace with the correct mainnet vault
addresses or add a TODO comment documenting the verification step.
Co-authored-by: Neel Ratn <neelratn.official@gmail.com>
…ts-6f59 Rename YPYTHAGORAS_CONTRACTS to YPYMN_CONTRACTS in yieldfi adapter
|
The yieldfi adapter exports pools: Test Suites: 1 passed, 1 total |
|
The yieldfi adapter exports pools: Test Suites: 1 passed, 1 total |
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/adaptors/yieldfi/index.js`:
- Around line 292-293: processToken is returning null because APY data is
missing for yValos and yPYMN; update the external API or repository state so
yValos returns a valid APY and yPYMN is registered (or remove yPYMN from
YPYMN_CONTRACTS if the vault isn't ready), and add explicit decimals entries for
these tokens in the DECIMALS constant instead of relying on the 18 default;
specifically, update the API/registry for the vaults referenced by
YVALOS_CONTRACTS and YPYMN_CONTRACTS (or remove the yPYMN contract entry) and
add DECIMALS['yValos'] = <correct_decimals> and DECIMALS['yPYMN'] =
<correct_decimals> if they differ from 18.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0f673588-e2c9-4d39-b29c-b73fb332ecfc
📒 Files selected for processing (1)
src/adaptors/yieldfi/index.js
| processToken(YVALOS_CONTRACTS[chain], 'yValos', chain), | ||
| processToken(YPYMN_CONTRACTS[chain], 'yPYMN', chain) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify API endpoints return valid data for the new tokens
echo "Checking yValos API endpoint..."
curl -s "https://gw.yield.fi/vault/api/public/vaults/yvalos" | jq '.data.vault.metrics.apy // "No APY found"'
echo ""
echo "Checking yPYMN API endpoint..."
curl -s "https://gw.yield.fi/vault/api/public/vaults/ypymn" | jq '.data.vault.metrics.apy // "No APY found"'Repository: DefiLlama/yield-server
Length of output: 146
🏁 Script executed:
cat -n src/adaptors/yieldfi/index.js | head -50Repository: DefiLlama/yield-server
Length of output: 2343
🏁 Script executed:
rg "DECIMALS|YVALOS_CONTRACTS|YPYMN_CONTRACTS" src/adaptors/yieldfi/index.js -A 5 -B 2Repository: DefiLlama/yield-server
Length of output: 1187
🏁 Script executed:
rg "fetchLatestAPY" src/adaptors/yieldfi/index.js -A 15Repository: DefiLlama/yield-server
Length of output: 927
🏁 Script executed:
rg "const processToken" src/adaptors/yieldfi/index.js -A 30Repository: DefiLlama/yield-server
Length of output: 958
🏁 Script executed:
# Double-check yPYMN API endpoint response structure more carefully
curl -s "https://gw.yield.fi/vault/api/public/vaults/ypymn" | jq '.'Repository: DefiLlama/yield-server
Length of output: 360
🏁 Script executed:
# Check if getTVL is called with explicit decimals anywhere for new tokens
rg "getTVL.*yValos|getTVL.*yPYMN|YVALOS_CONTRACTS|YPYMN_CONTRACTS" src/adaptors/yieldfi/index.js -B 3 -A 3Repository: DefiLlama/yield-server
Length of output: 786
Pools for yValos and yPYMN will not be created due to missing APY data.
The processToken function returns null when APY is unavailable (line 242), preventing pool creation. Current status:
- yValos: API endpoint exists but returns APY = 0, causing pool creation to fail
- yPYMN: API returns "VAULT_NOT_FOUND" error; vault does not exist in the API
Additionally, neither token has an explicit entry in the DECIMALS constant (lines 6-13), so both will use the default 18 decimals.
Ensure:
- yValos vault has valid APY data in the API
- yPYMN vault is properly registered in the API (or remove if not ready)
- Decimals are explicitly configured if they differ from 18
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/adaptors/yieldfi/index.js` around lines 292 - 293, processToken is
returning null because APY data is missing for yValos and yPYMN; update the
external API or repository state so yValos returns a valid APY and yPYMN is
registered (or remove yPYMN from YPYMN_CONTRACTS if the vault isn't ready), and
add explicit decimals entries for these tokens in the DECIMALS constant instead
of relying on the 18 default; specifically, update the API/registry for the
vaults referenced by YVALOS_CONTRACTS and YPYMN_CONTRACTS (or remove the yPYMN
contract entry) and add DECIMALS['yValos'] = <correct_decimals> and
DECIMALS['yPYMN'] = <correct_decimals> if they differ from 18.
|
The yieldfi adapter exports pools: Test Suites: 1 passed, 1 total |
|
The yieldfi adapter exports pools: Test Suites: 1 passed, 1 total |
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/adaptors/yieldfi/index.js`:
- Around line 13-14: Replace the transposed DECIMALS key `yPYNM` with the
correct `yPYMN` in src/adaptors/yieldfi/index.js so it matches the existing
contract constant YPYMN_CONTRACTS and the `processToken` call that uses
`'yPYMN'`; update the DECIMALS object entry (currently `yPYNM: 18`) to `yPYMN:
18` and scan for any other occurrences of the mis-typed key to ensure
consistency across uses of YPYMN.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8e1cdbc8-033d-480f-a961-cd8fec1643b0
📒 Files selected for processing (1)
src/adaptors/yieldfi/index.js
| yPYNM: 18, | ||
| yValos: 18 |
There was a problem hiding this comment.
Typo in DECIMALS key: yPYNM should be yPYMN.
The key yPYNM has the letters N and M transposed. The contract constant is YPYMN_CONTRACTS and the processToken call on line 295 uses 'yPYMN'. This should be consistent for maintainability.
🐛 Proposed fix
const DECIMALS = {
yUSD: 18,
vyUSD: 18,
yETH: 18,
vyETH: 18,
yBTC: 18,
vyBTC: 18,
- yPYNM: 18,
+ yPYMN: 18,
yValos: 18
};🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/adaptors/yieldfi/index.js` around lines 13 - 14, Replace the transposed
DECIMALS key `yPYNM` with the correct `yPYMN` in src/adaptors/yieldfi/index.js
so it matches the existing contract constant YPYMN_CONTRACTS and the
`processToken` call that uses `'yPYMN'`; update the DECIMALS object entry
(currently `yPYNM: 18`) to `yPYMN: 18` and scan for any other occurrences of the
mis-typed key to ensure consistency across uses of YPYMN.
In this PR, we have added newly launched yValos and yPythagoras
yValos: https://etherscan.io/address/0xd04ae722b3fe56812e13bb212a79cea7c1b08ff0
yPythagoras: https://etherscan.io/address/0x06c2c73f30135c831d010ec7b82d0f32321c4f27
Please update the price feed for these vaults,
Thanks
Summary by CodeRabbit