Skip to content

Commit ef9566f

Browse files
authored
Merge pull request #477 from curvefi/feat/make-hyperliquid-fully
feat: add hyperliquid to hardcoded networks
2 parents ccf8b44 + 91d2a11 commit ef9566f

File tree

11 files changed

+882
-2206
lines changed

11 files changed

+882
-2206
lines changed

package-lock.json

Lines changed: 809 additions & 2192 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@curvefi/api",
3-
"version": "2.66.31",
3+
"version": "2.67.0",
44
"description": "JavaScript library for curve.finance",
55
"main": "lib/index.js",
66
"author": "Macket",
@@ -42,7 +42,7 @@
4242
"vue-eslint-parser": "^10.1.3"
4343
},
4444
"dependencies": {
45-
"@curvefi/ethcall": "^6.0.13",
45+
"@curvefi/ethcall": "^6.0.14",
4646
"bignumber.js": "^9.3.0",
4747
"ethers": "^6.14.1",
4848
"memoizee": "^0.4.17"

src/constants/coins/hyperliquid.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { lowerCaseValues } from "../utils.js";
2+
import { IDict } from "../../interfaces.js";
3+
4+
5+
export const COINS_HYPERLIQUID: IDict<string> = lowerCaseValues({
6+
crv: '0x5af79133999f7908953e94b7a5cf367740ebee35',
7+
s: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
8+
});

src/constants/coins/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { COINS_FRAXTAL } from "./fraxtal.js";
1616
import { COINS_XLAYER } from "./xlayer.js";
1717
import { COINS_MANTLE } from "./mantle.js";
1818
import { COINS_SONIC } from "./sonic.js";
19-
19+
import { COINS_HYPERLIQUID } from "./hyperliquid.js";
2020
export {
2121
COINS_ETHEREUM, cTokensEthereum, yTokensEthereum, ycTokensEthereum, aTokensEthereum,
2222
COINS_POLYGON, aTokensPolygon,
@@ -36,4 +36,5 @@ export {
3636
COINS_XLAYER,
3737
COINS_MANTLE,
3838
COINS_SONIC,
39+
COINS_HYPERLIQUID,
3940
};

src/constants/factory/crypto.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ export const tricryptoDeployImplementations = {
8484
amm_native_transfers_enabled: '0x18d01726FeDaBd91579A9368DFB2F8A24f905280'.toLowerCase(),
8585
implementationIdx: 0,
8686
},
87+
999: { // HYPERLIQUID
88+
amm_native_transfers_disabled: '0x635742dCC8313DCf8c904206037d962c042EAfBd'.toLowerCase(), // 1
89+
amm_native_transfers_enabled: '0x0000000000000000000000000000000000000000'.toLowerCase(), // 0
90+
implementationIdx: 1,
91+
},
8792
1284: { // MOONBEAM
8893
amm_native_transfers_disabled: '0x0000000000000000000000000000000000000000'.toLowerCase(),
8994
amm_native_transfers_enabled: '0x0000000000000000000000000000000000000000'.toLowerCase(),
@@ -166,6 +171,9 @@ export const CRYPTO_FACTORY_CONSTANTS: { [index: number]: {
166171
324: { // ZKSYNC
167172
tricryptoDeployImplementations: tricryptoDeployImplementations[324],
168173
},
174+
999: { // HYPERLIQUID
175+
tricryptoDeployImplementations: tricryptoDeployImplementations[999],
176+
},
169177
1284: { // MOONBEAM
170178
tricryptoDeployImplementations: tricryptoDeployImplementations[1284],
171179
},

src/constants/factory/stable.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,9 @@ export const STABLE_FACTORY_CONSTANTS: { [index: number]: { implementationABIDic
465465
324: { // ZKSYNC
466466
stableNgBasePoolZap: stableNgBasePoolZap,
467467
},
468+
999: { // HYPERLIQUID
469+
stableNgBasePoolZap: stableNgBasePoolZap,
470+
},
468471
1284: { // MOONBEAM
469472
implementationABIDict: implementationABIDictMoonbeam,
470473
},

src/constants/network_constants.ts

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
POOLS_DATA_XLAYER,
2020
POOLS_DATA_MANTLE,
2121
POOLS_DATA_SONIC,
22+
POOLS_DATA_HYPERLIQUID,
2223
} from './pools/index.js';
2324
import {
2425
COINS_ETHEREUM, cTokensEthereum, yTokensEthereum, ycTokensEthereum, aTokensEthereum,
@@ -39,6 +40,7 @@ import {
3940
COINS_XLAYER,
4041
COINS_MANTLE,
4142
COINS_SONIC,
43+
COINS_HYPERLIQUID,
4244
} from "./coins/index.js";
4345

4446
const ALIASES_ETHEREUM = lowerCaseValues({
@@ -411,21 +413,39 @@ const ALIASES_MANTLE = lowerCaseValues({
411413
});
412414

413415
const ALIASES_SONIC = lowerCaseValues({
414-
"crv": "0x5af79133999f7908953e94b7a5cf367740ebee35", //
415-
"child_gauge_factory": "0xf3A431008396df8A8b2DF492C913706BDB0874ef", //
416+
"crv": "0x5af79133999f7908953e94b7a5cf367740ebee35",
417+
"child_gauge_factory": "0xf3A431008396df8A8b2DF492C913706BDB0874ef",
416418
"voting_escrow": "0x0000000000000000000000000000000000000000",
417419
"fee_distributor": "0x0000000000000000000000000000000000000000",
418420
"gauge_controller": "0x0000000000000000000000000000000000000000",
419-
"address_provider": "0x87FE17697D0f14A222e8bEf386a0860eCffDD617", //
421+
"address_provider": "0x87FE17697D0f14A222e8bEf386a0860eCffDD617",
420422

421-
"router": "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", //
422-
"deposit_and_stake": "0x505d666E4DD174DcDD7FA090ed95554486d2Be44", //
423+
"router": "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E",
424+
"deposit_and_stake": "0x505d666E4DD174DcDD7FA090ed95554486d2Be44",
423425

424-
"stable_ng_factory": '0x7C2085419BE6a04f4ad88ea91bC9F5C6E6C463D8', //
425-
"twocrypto_factory": '0x1A83348F9cCFD3Fe1A8C0adBa580Ac4e267Fe495', //
426-
"tricrypto_factory": '0x635742dCC8313DCf8c904206037d962c042EAfBd', //
426+
"stable_ng_factory": '0x7C2085419BE6a04f4ad88ea91bC9F5C6E6C463D8',
427+
"twocrypto_factory": '0x1A83348F9cCFD3Fe1A8C0adBa580Ac4e267Fe495',
428+
"tricrypto_factory": '0x635742dCC8313DCf8c904206037d962c042EAfBd',
427429

428-
"factory_admin": '0x0000000000000000000000000000000000000000', //
430+
"factory_admin": '0x0000000000000000000000000000000000000000',
431+
});
432+
433+
const ALIASES_HYPERLIQUID = lowerCaseValues({
434+
"crv": "0x0000000000000000000000000000000000000000", //
435+
"child_gauge_factory": "0x8b3EFBEfa6eD222077455d6f0DCdA3bF4f3F57A6", //
436+
"voting_escrow": "0x0000000000000000000000000000000000000000",
437+
"fee_distributor": "0x0000000000000000000000000000000000000000",
438+
"gauge_controller": "0x0000000000000000000000000000000000000000",
439+
"address_provider": "0x87FE17697D0f14A222e8bEf386a0860eCffDD617",
440+
441+
"router": "0xd2002373543Ce3527023C75e7518C274A51ce712", //
442+
"deposit_and_stake": "0x5a8C93EE12a8Df4455BA111647AdA41f29D5CfcC", //
443+
444+
"stable_ng_factory": '0x604388Bb1159AFd21eB5191cE22b4DeCdEE2Ae22', //
445+
"twocrypto_factory": '0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F', //
446+
"tricrypto_factory": '0x5702BDB1Ec244704E3cBBaAE11a0275aE5b07499', //
447+
448+
"factory_admin": '0x0000000000000000000000000000000000000000',
429449
});
430450

431451

@@ -558,6 +578,18 @@ export const NETWORK_CONSTANTS: { [index: number]: any } = {
558578
wrappedAddress: '0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91'.toLowerCase(),
559579
},
560580
},
581+
999: {
582+
NAME: 'hyperliquid',
583+
ALIASES: ALIASES_HYPERLIQUID,
584+
POOLS_DATA: POOLS_DATA_HYPERLIQUID,
585+
COINS: COINS_HYPERLIQUID,
586+
NATIVE_COIN: {
587+
symbol: 'HYPE',
588+
wrappedSymbol: 'WHYPE',
589+
address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
590+
wrappedAddress: '0x5555555555555555555555555555555555555555'.toLowerCase(),
591+
},
592+
},
561593
1284: {
562594
NAME: 'moonbeam',
563595
ALIASES: ALIASES_MOONBEAM,

src/constants/pools/hyperliquid.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { lowerCasePoolDataAddresses } from "../utils.js";
2+
import { IPoolData, IDict } from "../../interfaces.js";
3+
4+
export const POOLS_DATA_HYPERLIQUID: IDict<IPoolData> = lowerCasePoolDataAddresses({});

src/constants/pools/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { POOLS_DATA_FRAXTAL } from "./fraxtal.js";
1717
import { POOLS_DATA_XLAYER } from "./xlayer.js";
1818
import { POOLS_DATA_MANTLE } from "./mantle.js";
1919
import { POOLS_DATA_SONIC } from "./sonic.js";
20-
20+
import { POOLS_DATA_HYPERLIQUID } from "./hyperliquid.js";
2121
export {
2222
POOLS_DATA_ETHEREUM,
2323
LLAMMAS_DATA_ETHEREUM,
@@ -38,4 +38,5 @@ export {
3838
POOLS_DATA_XLAYER,
3939
POOLS_DATA_MANTLE,
4040
POOLS_DATA_SONIC,
41+
POOLS_DATA_HYPERLIQUID,
4142
};

src/constants/volumeNetworks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface IVolumeNetworks {
77
}
88

99
export const volumeNetworks: IVolumeNetworks = {
10-
getVolumes: [1,10,100,137,250,252,8453,42161,146],
10+
getVolumes: [1,10,100,137,250,252,999,8453,42161,146],
1111
getSubgraphData: [43114],
1212
getFactoryAPYs: [56,196,324,1284,2222,5000,42220,1313161554],
1313
}

src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ export async function _getUsdRate(this: Curve, assetId: string): Promise<number>
353353
250: 'fantom',
354354
252: 'fraxtal',
355355
324: 'zksync',
356+
999: 'hyperliquid',
356357
1284: 'moonbeam',
357358
2222: 'kava',
358359
5000: 'mantle',
@@ -375,6 +376,7 @@ export async function _getUsdRate(this: Curve, assetId: string): Promise<number>
375376
252: 'frax-share',
376377
324: 'ethereum',
377378
1284: 'moonbeam',
379+
999: 'hyperliquid',
378380
2222: 'kava',
379381
5000: 'mantle',
380382
8453: 'ethereum',

0 commit comments

Comments
 (0)