Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 111 additions & 8 deletions src/adaptors/growihf/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ const https = require('https');

const VAULT_ADDRESS = '0x1e37a337ed460039d1b15bd3bc489de789768d5e';
const API_URL = 'https://api.hyperliquid.xyz/info';
const USDC_ADDRESS = '0xb88339CB7199b77E23DB6E890353E22632Ba630f';
const ARBITRUM_NATIVE_USDC_ADDRESS = '0xaf88d065e77c8cC2239327C5EDb3A432268e5831';

function fetchVaultDetails() {
const GROWI_ALPHA_VAULT_ID = 2;
const HIBACHI_DATA_API = 'https://data-api.hibachi.xyz';
const USDT_ADDRESS_ARBITRUM = '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9';

function fetchHyperliquidVaultDetails() {
return new Promise((resolve, reject) => {
const data = JSON.stringify({
type: 'vaultDetails',
Expand Down Expand Up @@ -38,7 +42,7 @@ function fetchVaultDetails() {
});
}

function computeAPYInception(vaultDetails) {
function computeHyperliquidAPYInception(vaultDetails) {
const portfolio = vaultDetails.portfolio.find((p) => p[0] === 'allTime');
if (!portfolio) throw new Error('Missing allTime portfolio');

Expand Down Expand Up @@ -78,8 +82,8 @@ function computeAPYInception(vaultDetails) {
}
}

function computeAPY7Day(vaultDetails) {
let alltimeData = computeAPYInception(vaultDetails);
function computeHyperliquidAPY7Day(vaultDetails) {
let alltimeData = computeHyperliquidAPYInception(vaultDetails);

const portfolio = vaultDetails.portfolio.find((p) => p[0] === 'week');
if (!portfolio) throw new Error('Missing weekly portfolio');
Expand Down Expand Up @@ -121,16 +125,115 @@ function computeAPY7Day(vaultDetails) {
tvlUsd: alltimeData['tvlUsd'],
apy: ann_yield * 100,
apyBaseInception: alltimeData['apyBaseInception'] * 100,
underlyingTokens: [USDC_ADDRESS],
underlyingTokens: [ARBITRUM_NATIVE_USDC_ADDRESS],
poolMeta: 'Hyperliquid Vault',
url: 'https://app.hf.growi.fi/',
};
}

function fetchHibachiDataAPI(url) {
return new Promise((resolve, reject) => {
https
.get(url, (res) => {
let body = '';
res.on('data', (chunk) => (body += chunk));
res.on('end', () => {
try {
resolve(JSON.parse(body));
} catch (err) {
reject(err);
}
});
})
.on('error', reject);
});
}

function groupHibachiIntervalsByDay(intervals) {
const map = new Map();
for (const iv of intervals) {
const day = Math.floor(iv.timestamp / 86400);
const existing = map.get(day);
if (!existing || iv.timestamp > existing.timestamp) {
map.set(day, iv);
}
}
return [...map.values()].sort((a, b) => a.timestamp - b.timestamp);
}

function computeHibachiAPYInterval(intervals) {
if (intervals.length < 2) throw new Error('Not enough data points');
const first = intervals[0];
const last = intervals[intervals.length - 1];
const days = (last.timestamp - first.timestamp) / 86400;
if (days <= 0) throw new Error('Non-positive time span');
const priceRatio =
parseFloat(last.perSharePrice) / parseFloat(first.perSharePrice);
if (!(priceRatio > 0)) throw new Error('Invalid share price');
return Math.pow(priceRatio, 365 / days) - 1;
}

async function computeHibachiAPY7Day() {
const infoData = await fetchHibachiDataAPI(`${HIBACHI_DATA_API}/vault/info`);
const info = (infoData || []).find((v) => v.vaultId === GROWI_ALPHA_VAULT_ID);
if (!info) throw new Error('Growi Alpha Vault info not found');

const performanceData = await fetchHibachiDataAPI(`${HIBACHI_DATA_API}/vault/performance?vaultId=${GROWI_ALPHA_VAULT_ID}&timeRange=All`);
const intervals = performanceData.vaultPerformanceIntervals || [];
if (intervals.length < 3) throw new Error('Not enough data points');

const apyBaseInception = computeHibachiAPYInterval(intervals);

const dailyBuckets = groupHibachiIntervalsByDay(intervals);
const week = dailyBuckets.slice(-7);
const apy7d =
week.length >= 2 ? computeHibachiAPYInterval(week) : apyBaseInception;

const tvlUsdLatest =
parseFloat(performanceData.vaultPerformanceIntervals.at(-1).totalValueLocked);

return {
pool: `growihf-alpha-vault-hibachi`,
chain: 'hibachi',
project: 'growihf',
symbol: 'USDT',
tvlUsd: tvlUsdLatest,
apy: apy7d * 100,
apyBaseInception: apyBaseInception * 100,
underlyingTokens: [USDT_ADDRESS_ARBITRUM],
poolMeta: 'Hibachi Vault',
url: 'https://app.hf.growi.fi/',
};
}
Comment on lines +176 to +207
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 5, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Look at how other adaptors pair chain with underlyingTokens to see whether
# cross-chain token addresses are an accepted pattern in this repo.
rg -nP --type=js -C3 "chain:\s*['\"]hibachi['\"]"
rg -nP --type=js -C2 "underlyingTokens" src/adaptors/growihf/

Repository: DefiLlama/yield-server

Length of output: 1188


🌐 Web query:

Hibachi exchange Growi Alpha Vault deposit token USDT or USDC

💡 Result:

Hibachi (including its Growi Alpha Vault / GAV vaults) accepts deposits in stablecoins USDC and USDT (collateral), on supported networks (Base and Arbitrum). [1] What to use for “deposit token”: - USDC or USDT are both supported as deposit/collateral assets on Hibachi. [1][2] - Deposit availability can vary by vault, but the docs state users can deposit USDC or USDT into Hibachi vaults. [1] Notes (important for deposits): - Hibachi currently supports deposits/withdrawals only on Base and Arbitrum; sending to other networks can lock funds on-chain. [3] If you meant something else by “Hibachi exchange” (e.g., a specific UI deposit screen for Growi Alpha Vault), tell me the exact vault link/screen text and I can map which token (USDT vs USDC) it allows there.

Citations:


🏁 Script executed:

#!/bin/bash
# Check the address definitions and any comments about tokens in the growihf adaptor
cat -n src/adaptors/growihf/index.js | head -50

Repository: DefiLlama/yield-server

Length of output: 1924


🏁 Script executed:

#!/bin/bash
# Look for USDT_ADDRESS_ARBITRUM and ARBITRUM_NATIVE_USDC_ADDRESS definitions
rg -n "USDT_ADDRESS_ARBITRUM|ARBITRUM_NATIVE_USDC_ADDRESS" src/adaptors/growihf/

Repository: DefiLlama/yield-server

Length of output: 458


🏁 Script executed:

#!/bin/bash
# Check if there are any Hibachi-specific token addresses referenced in the codebase
rg -n "hibachi" -i src/adaptors/growihf/ -A2 -B2

Repository: DefiLlama/yield-server

Length of output: 3719


🏁 Script executed:

#!/bin/bash
# Look at how other adaptors handle chain definitions to see if cross-chain addresses are common
rg -n "chain:" src/adaptors/ --type=js -A1 | grep -i "arbitrum\|ethereum\|polygon" | head -20

Repository: DefiLlama/yield-server

Length of output: 1522


🌐 Web query:

Growi Alpha Vault Hibachi deposit token specifications USDT USDC

💡 Result:

Growi Alpha Vault (GAV) deposit token specifications (USDT / USDC) 1) Which tokens are supported for deposits - Hibachi vaults support deposits of either USDC or USDT (deposit availability may vary by vault) [1]. 2) Network / chain support - Deposits of USDC or USDT are supported on Base and Arbitrum [1]. 3) Token-specific details (contract address, decimals, chain-specific behavior) - The Hibachi docs content available in the retrieved sources does not specify the ERC-20 contract addresses, decimals, or other token-level parameters specifically for USDT and USDC within the Growi Alpha Vault (GAV) page/snippets we accessed [2][1]. - What is explicitly described for vault deposits is the supported deposit assets (USDC/USDT) and that the deposit configuration and availability can vary by vault [1]. Net: Based on the authoritative Hibachi documentation excerpts retrieved, the Growi Alpha Vault deposit tokens are USDC and USDT, available to deposit on Base and Arbitrum, but the sources provided here do not include the USDC/USDT token contract addresses or other low-level token specs for GAV [1].

Citations:


🏁 Script executed:

#!/bin/bash
# Search for 'hibachi' chain in other parts of the codebase
rg -rn "hibachi" --type=js src/adaptors/ | grep -v "growihf"

Repository: DefiLlama/yield-server

Length of output: 48


🏁 Script executed:

#!/bin/bash
# Look for chain definitions or valid chains list
find src -name "*.ts" -o -name "*.js" | xargs grep -l "chain.*=\|chains.*=" | head -10

Repository: DefiLlama/yield-server

Length of output: 480


🏁 Script executed:

#!/bin/bash
# Check if there's any configuration or index defining valid chains
rg -n "hibachi|arbitrum|ethereum" src/utils/ src/config/ -A1 -B1 2>/dev/null | head -30

Repository: DefiLlama/yield-server

Length of output: 1518


🏁 Script executed:

#!/bin/bash
# Look at the full Hibachi function to see if there are clues about deposit token
sed -n '176,207p' src/adaptors/growihf/index.js

Repository: DefiLlama/yield-server

Length of output: 1316


🌐 Web query:

Growi Alpha Vault GAV Hibachi specifically USDT or USDC which token deposit

💡 Result:

The Growi Alpha Vault (GAV) on Hibachi accepts deposits of USDC or USDT, as Hibachi vaults generally support these stablecoins on their supported chains (Base for USDC, Arbitrum for USDT).[1][2] Specific deposit availability for GAV may vary by allocation periods, such as top point earners.[3][4] Growi Finance's related products, like Growi HF on Hyperliquid (via Arbitrum), also use USDC deposits.[5][6]

Citations:


🏁 Script executed:

#!/bin/bash
# Search for chain validation or chain list in the codebase
find src -type f \( -name "*.ts" -o -name "*.js" \) -exec grep -l "const.*CHAIN\|export.*chain" {} \; | head -10

Repository: DefiLlama/yield-server

Length of output: 7970


🏁 Script executed:

#!/bin/bash
# Look for any documentation or schema validation for pool object structure
find src -type f \( -name "*.ts" -o -name "*.js" \) -exec grep -l "underlyingTokens\|poolSchema\|validatePool" {} \; | head -5

Repository: DefiLlama/yield-server

Length of output: 35210


🏁 Script executed:

#!/bin/bash
# Check if there's any reference material about Hibachi being a chain vs protocol
rg -n "Hibachi\|hibachi" --type=js src/ | head -20

Repository: DefiLlama/yield-server

Length of output: 48


🌐 Web query:

DefiLlama yield-server supported chains list hibachi chain

💡 Result:

DefiLlama yield-server “supported chains list” for the Hibachi chain: Hibachi is on the chains Arbitrum and Base.[1][2] What I can and can’t confirm from the yield-server code: 1) The DefiLlama yield-server repository defines how an adaptor returns pools including a required chain field, which should match DefiLlama’s chain names.[3] However, the sources I retrieved don’t include the Hibachi adaptor’s actual exported pool objects, so I can’t enumerate the exact chain strings as implemented in the yield-server adaptor. 2) Hibachi’s DefiLlama chain pages indicate its ecosystem/charts are associated with Arbitrum and Base.[1][2] So, the grounded answer to “hibachi chain” is: Arbitrum and Base.[1][2]

Citations:


🌐 Web query:

Hibachi protocol blockchain settlement layer which network Arbitrum Base

💡 Result:

Hibachi’s blockchain settlement layer is implemented as zk-verified on-chain settlement (“collateral can only move on-chain if the movement has been validated via a zk proof”). [1] Hibachi is deployed on both Arbitrum and Base (so settlement happens on the user’s chosen network). [2][3][4] What network connects to which chain: - Arbitrum: users must have assets and ETH on Arbitrum; Hibachi accepts USDT as collateral on Arbitrum. [2][5] - Base: users must have assets and ETH on Base; Hibachi accepts USDC as collateral on Base. [2][5] Additional detail: Hibachi’s “verification/settlement layer” is described as zk-verification, but the docs and other sources do not present a separate third “settlement layer chain” beyond the fact that Hibachi runs on Arbitrum and Base for on-chain settlement. [1][5]

Citations:


Change chain: 'hibachi' to chain: 'arbitrum' to match the Arbitrum USDT address.

Hibachi is a protocol that settles on Arbitrum and Base—not a settlement layer itself. Using chain: 'hibachi' with USDT_ADDRESS_ARBITRUM creates a mismatch that will likely break token resolution in DefiLlama's pipeline. Since the underlying token is explicitly an Arbitrum address, the pool should declare chain: 'arbitrum' to ensure proper token pricing and metadata.

Verify which stablecoin (USDT vs USDC) the Growi Alpha Vault actually accepts on Arbitrum and confirm the correct address is being used.

🤖 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/growihf/index.js` around lines 176 - 207, In
computeHibachiAPY7Day, change the pool chain field from the incorrect literal
'hibachi' to the actual settlement chain 'arbitrum' to match the underlying
token constant USDT_ADDRESS_ARBITRUM and ensure proper token resolution; update
the value assigned to the chain property in the returned object and as a
follow-up verify the vault accepts USDT on Arbitrum and that
USDT_ADDRESS_ARBITRUM is the correct token constant for this vault (switch to
USDC_ADDRESS_ARBITRUM if the vault uses USDC).

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.

@IsmaAG can you check this pls?

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.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Copy Markdown
Contributor Author

@IsmaAG IsmaAG May 18, 2026

Choose a reason for hiding this comment

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

@0xkr3p Is there a way to make the adapter live on Hibachi chain? The point is to have both Hyperliquid and Hibachi chains in the protocol page, it does not make sense to have Hibachi as Arbitrum. Should I set the token address to another one, generic Ethereum for example? Or what should I do to keep chain:hibachi?


module.exports = {
timetravel: false,
apy: async () => {
const vaultDetails = await fetchVaultDetails();
return [computeAPY7Day(vaultDetails)];
const pools = [];

const sources = [
{
name: 'hyperliquid',
build: async () => {
const details = await fetchHyperliquidVaultDetails();
return computeHyperliquidAPY7Day(details);
},
},
{
name: 'hibachi',
build: computeHibachiAPY7Day,
},
];

for (const { name, build } of sources) {
try {
pools.push(await build());
} catch (err) {
console.error(`growihf: skipping ${name}: ${err.message}`);
continue;
}
}

return pools;
},
};
Loading