Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
67 changes: 67 additions & 0 deletions coins/src/adapters/other/hypezion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { Write } from "../utils/dbInterfaces";
import { getApi } from "../utils/sdk";
import getWrites from "../utils/getWrites";

/**
* HypeZion Finance — Token Pricing Adapter
*
* Provides pricing data for HypeZion protocol tokens on Hyperliquid L1:
* - hzUSD: stablecoin pegged to $1, price derived from on-chain NAV
* - BullHYPE: leverage token, price = zHYPE NAV in HYPE × HYPE price
* - shzUSD: staked hzUSD vault share, price = share price from ERC-4626
*/

const chain = "hyperliquid";

// Token addresses (Hyperliquid Mainnet)
const HZUSD = "0x6E2ade6FFc94d24A81406285c179227dfBFc97CE";
const BULLHYPE = "0x12cF926C3884dda144e18E11e2659c0675cF20eA";
const STAKED_HZUSD = "0xce01a9B9bc08f0847fb745044330Eff1181360Cd";

// HypeZionExchangeInformation proxy
// TODO: Verify address after deploying ExchangeInformation upgrade
const EXCHANGE_INFO = "0x9286ABAC7c29e8A183155E961a4E4BBA2E162c7A";
Comment thread
huy090202 marked this conversation as resolved.
Outdated

const abis = {
getProtocolNavInUSD:
"function getProtocolNavInUSD() view returns (uint256 zusdNav, uint256 zhypeNav, uint256 szusdNav, uint256 hypePrice)",
totalAssets: "uint256:totalAssets",
totalSupply: "uint256:totalSupply",
};

export default async function getTokenPrices(timestamp: number = 0) {
const api = await getApi(chain, timestamp);
const pricesObject: any = {};

// Fetch NAVs from ExchangeInformation
const navData = await api.call({
target: EXCHANGE_INFO,
abi: abis.getProtocolNavInUSD,
});

const zusdNav = Number(navData.zusdNav) / 1e18; // hzUSD NAV in USD (~$1)
const zhypeNav = Number(navData.zhypeNav) / 1e18; // BullHYPE NAV in USD
const szusdNav = Number(navData.szusdNav) / 1e18; // shzUSD NAV in USD (share price)

// hzUSD — stablecoin pegged to $1
if (zusdNav > 0) {
pricesObject[HZUSD] = { price: zusdNav };
}

// BullHYPE — leverage token
if (zhypeNav > 0) {
pricesObject[BULLHYPE] = { price: zhypeNav };
}

// shzUSD — staked hzUSD vault share price
if (szusdNav > 0) {
pricesObject[STAKED_HZUSD] = { price: szusdNav };
}

return getWrites({
chain,
timestamp,
pricesObject,
projectName: "hypezion-finance",
});
}
5 changes: 5 additions & 0 deletions coins/src/adapters/other/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import gmdV2 from "./gmdV2";
import { getApi } from "../utils/sdk";
import getWrites from "../utils/getWrites";
import cap from "./cap";
import hypezionAdapter from "./hypezion";

export { glp };

Expand All @@ -59,6 +60,9 @@ export function opdx(timestamp: number = 0) {
export function defiChain(timestamp: number = 0) {
return defiChainAdapter(timestamp);
}
export function hypezion(timestamp: number = 0) {
return hypezionAdapter(timestamp);
}
export function synthetix(timestamp: number = 0) {
return synthetixAdapter(timestamp);
}
Expand Down Expand Up @@ -556,6 +560,7 @@ async function matrixdock(timestamp: number = 0, writes: Write[] = []) {
export const adapters = {
symboitic,
defiChain,
hypezion,
shlb,
metronome,
buck,
Expand Down