Skip to content

Commit 215beb2

Browse files
authored
adding hyperwave positions (#17334)
1 parent f37fe3c commit 215beb2

File tree

4 files changed

+105
-3
lines changed

4 files changed

+105
-3
lines changed

projects/hyperwave/constants.js

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const HWLP_VAULT = "0x9FD7466f987Fd4C45a5BBDe22ED8aba5BC8D72d1";
55
const HWHYPE_VAULT = "0x4DE03cA1F02591B717495cfA19913aD56a2f5858";
66
const HWUSD_VAULT = "0xa2f8Da4a55898B6c947Fa392eF8d6BFd87A4Ff77";
77

8+
// Start Blocks
9+
const HWHYPE_VAULT_START_BLOCK = 9855743;
10+
811
// HyperLiquid Multi-Sigs
912
const MS_1 = "0x128Cc5830214aBAF05A0aC178469a28de56c0BA9";
1013
const MS_2 = "0x950e6bc9bba0edf4e093b761df05cf5abd0a32e7";
@@ -38,11 +41,20 @@ const HWHYPE_VAULT_TOKENS = [
3841
'0xfFaa4a3D97fE9107Cef8a3F48c069F577Ff76cC1', // stHYPE
3942
'0xfD739d4e423301CE9385c1fb8850539D657C296D', // kHYPE
4043
'0x5748ae796AE46A4F1348a1693de4b50560485562', // LHYPE
44+
'0x9BA2EDc44E0A4632EB4723E81d4142353e1bB160', // vkHYPE
45+
// Lending
4146
'0x4DE03cA1F02591B717495cfA19913aD56a2f5858', // hyHYPE (hypurrfi)
4247
'0x0D745EAA9E70bb8B6e2a0317f85F1d536616bD34', // hHYPE (hyperlend)
43-
'0x311dB0FDe558689550c68355783c95eFDfe25329', // PT-kHYPE (pendle)
44-
'0x31CC92a2f8c02b8F9f427c48f12E21a848e69847', // PT-vkHYPE (pendle)
45-
'0x810f9D4a751cafd5193617022B35Fa0b0C166b4c', // PT-hbHYPE (pendle)
48+
'0xa55DE93CDE5A34c5521B7584022846829CB74366', // hkHYPE (hyperlend)
49+
// PTs
50+
'0x311dB0FDe558689550c68355783c95eFDfe25329', // PT-kHYPE (13 Nov 2025)
51+
'0xea84ca9849D9e76a78B91F221F84e9Ca065FC9f5', // PT-kHYPE (19 Mar 2026)
52+
'0x31CC92a2f8c02b8F9f427c48f12E21a848e69847', // PT-vkHYPE (13 Nov 2025)
53+
'0x701c084Db0FEA269aBA3122d87787F6c001f372c', // PT-vkHYPE (19 Mar 2026)
54+
'0x810f9D4a751cafd5193617022B35Fa0b0C166b4c', // PT-hbHYPE (18 Dec 2025)
55+
'0xCBaaB2463a6bA43A65A138a41C39d541a51810CF', // PT-stHYPE (26 Feb 2026)
56+
// LPs
57+
'0x8867d2b7aDb8609c51810237EcC9A25A2F601B97', // LP-kHYPE (13 Nov 2025)
4658
];
4759

4860
const HYPEREVM_HWUSD_VAULT_TOKENS = [
@@ -180,11 +192,20 @@ const KHYPE_DEPLOYMENTS = {
180192
STAKING_ACCOUNTANT: "0x9209648Ec9D448EF57116B73A2f081835643dc7A",
181193
}
182194

195+
const BEHYPE_DEPLOYMENTS = {
196+
WITHDRAWALS_MANAGER: "0x9d0B0877b9f2204CF414Ca7862E4f03506822538",
197+
}
198+
199+
const VKHYPE_DEPLOYMENTS = {
200+
BORING_ONCHAIN_QUEUE: "0x08a9552688F8DEC4835f5396ca3D1fd2713f79A7"
201+
}
202+
183203
module.exports = {
184204
ADDRESSES,
185205
HWLP_VAULT,
186206
HWHYPE_VAULT,
187207
HWUSD_VAULT,
208+
HWHYPE_VAULT_START_BLOCK,
188209
MS_ALL,
189210
HLP_VAULT,
190211
DELAY,
@@ -198,4 +219,6 @@ module.exports = {
198219
HWUSD_META_MORPHO_VAULTS,
199220
HYPER_CORE_TOKENS,
200221
KHYPE_DEPLOYMENTS,
222+
BEHYPE_DEPLOYMENTS,
223+
VKHYPE_DEPLOYMENTS,
201224
};

projects/hyperwave/evm/behype.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const sdk = require('@defillama/sdk');
2+
const { sumUnknownTokens } = require('../../helper/unknownTokens');
3+
const { BEHYPE_DEPLOYMENTS, HWHYPE_VAULT, HWHYPE_VAULT_TOKENS, ADDRESSES } = require('../constants');
4+
5+
async function behypeUnstaking(api) {
6+
const unclaimedIds = await sdk.api.abi.call({
7+
target: BEHYPE_DEPLOYMENTS.WITHDRAWALS_MANAGER,
8+
abi: "function getUserUnclaimedWithdrawals(address user) view returns (uint256[] ids)",
9+
chain: 'hyperliquid',
10+
params: [HWHYPE_VAULT],
11+
});
12+
13+
const unstakes = await sdk.api.abi.multiCall({
14+
calls: unclaimedIds.output.map(id => ({
15+
target: BEHYPE_DEPLOYMENTS.WITHDRAWALS_MANAGER,
16+
params: [id],
17+
})),
18+
abi: "function withdrawalQueue(uint256 id) view returns (address user, uint256 beHypeAmount, uint256 hypeAmount, bool claimed)",
19+
chain: 'hyperliquid',
20+
permitFailure: true,
21+
})
22+
23+
unstakes.output.forEach((unstake) => {
24+
if (!unstake.success) return;
25+
// console.log(data.output);
26+
const amount = unstake.output.hypeAmount;
27+
api.add(ADDRESSES.hyperliquid.WHYPE, amount);
28+
})
29+
30+
return sumUnknownTokens({ api, useDefaultCoreAssets: true });
31+
}
32+
33+
module.exports = {
34+
behypeUnstaking,
35+
}

projects/hyperwave/evm/vkhype.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
const sdk = require('@defillama/sdk');
2+
const { getLogs } = require("../../helper/cache/getLogs")
3+
const { sumUnknownTokens } = require('../../helper/unknownTokens');
4+
const { VKHYPE_DEPLOYMENTS, HWHYPE_VAULT_START_BLOCK, HWHYPE_VAULT, HWHYPE_VAULT_TOKENS, ADDRESSES } = require('../constants');
5+
6+
async function vkhypeUnstaking(api) {
7+
/**
8+
* 1. Fetches active requests from the BoringOnchainQueue contract
9+
* 2. Fetches onchain withdraw requests from the BoringOnchainQueue contract
10+
* 3. Filters out requests that are not for HWHYPE vault
11+
* 4. Filters out requests that are not active
12+
* 5. Adds the amount of WHYPE to the balance
13+
*/
14+
const activeRequests = await api.call({
15+
target: VKHYPE_DEPLOYMENTS.BORING_ONCHAIN_QUEUE,
16+
abi: 'function getRequestIds() view returns (bytes32[] requests)',
17+
})
18+
19+
const onchainWithdrawRequests = await getLogs({
20+
api,
21+
target: VKHYPE_DEPLOYMENTS.BORING_ONCHAIN_QUEUE,
22+
// fromBlock: HWHYPE_VAULT_START_BLOCK,
23+
fromBlock: 19413700,
24+
eventAbi: "event OnChainWithdrawRequested(bytes32 indexed requestId, address indexed user, address indexed assetOut, uint96 nonce, uint128 amountOfShares, uint128 amountOfAssets, uint40 creationTime, uint24 secondsToMaturity, uint24 secondsToDeadline)",
25+
onlyArgs: true,
26+
})
27+
const hwhypeWithdrawRequests = onchainWithdrawRequests.filter((w) => w[1] === HWHYPE_VAULT)
28+
const pendingRequests = hwhypeWithdrawRequests.filter((w) => activeRequests.includes(w[0]))
29+
30+
pendingRequests.forEach((w) => {
31+
const amount = w[5]
32+
api.add(ADDRESSES.hyperliquid.WHYPE, amount)
33+
})
34+
35+
return sumUnknownTokens({ api, useDefaultCoreAssets: true })
36+
}
37+
38+
module.exports = {
39+
vkhypeUnstaking,
40+
}

projects/hyperwave/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const { hyperevmHwhypeMorphoTvl, hyperevmHwusdMorphoTvl, mainnetHwusdMorphoTvl,
55
const { hypercoreHwhlpVaultTvl, hyperCoreSpotBalance } = require('./hypercore/index');
66
const { mainnetHwhlpVaultTvl, hwhlpVaultTvl, hwhypeVaultTvl, mainnetHwusdVaultTvl, hyperevmHwhusdVaultTvl, baseHwusdVaultTvl } = require('./evm/erc20');
77
const { khypeUnstaking } = require('./evm/khype');
8+
const { behypeUnstaking } = require('./evm/behype');
9+
const { vkhypeUnstaking } = require('./evm/vkhype');
810

911
module.exports = {
1012
timetravel: false,
@@ -36,6 +38,8 @@ module.exports = {
3638
hwhypeVaultTvl,
3739
hyperevmHwhypeMorphoTvl,
3840
khypeUnstaking,
41+
behypeUnstaking,
42+
vkhypeUnstaking,
3943
// hwUSD
4044
hyperevmHwhusdVaultTvl,
4145
hyperevmHwusdMorphoTvl,

0 commit comments

Comments
 (0)