@strkfarm/sdk 2.0.0-staging.17 → 2.0.0-staging.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.global.js +212 -178
- package/dist/index.browser.mjs +184 -151
- package/dist/index.d.ts +38 -7
- package/dist/index.js +271 -237
- package/dist/index.mjs +184 -151
- package/package.json +1 -1
- package/src/dataTypes/_bignumber.ts +5 -0
- package/src/strategies/ekubo-cl-vault.tsx +15 -3
- package/src/strategies/universal-adapters/vesu-adapter.ts +46 -25
- package/src/strategies/universal-lst-muliplier-strategy.tsx +58 -63
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { logger } from "@/utils/logger";
|
|
2
2
|
import BigNumber from "bignumber.js";
|
|
3
|
+
import { uint256 } from "starknet";
|
|
3
4
|
|
|
4
5
|
export class _Web3Number<T extends _Web3Number<T>> extends BigNumber {
|
|
5
6
|
decimals: number;
|
|
@@ -107,6 +108,10 @@ export class _Web3Number<T extends _Web3Number<T>> extends BigNumber {
|
|
|
107
108
|
sign: sign,
|
|
108
109
|
}
|
|
109
110
|
}
|
|
111
|
+
|
|
112
|
+
toUint256() {
|
|
113
|
+
return uint256.bnToUint256(this.toWei());
|
|
114
|
+
}
|
|
110
115
|
}
|
|
111
116
|
|
|
112
117
|
BigNumber.config({ DECIMAL_PLACES: 18, ROUNDING_MODE: BigNumber.ROUND_DOWN });
|
|
@@ -302,7 +302,10 @@ export class EkuboCLVault extends BaseStrategy<
|
|
|
302
302
|
return [this.contract.populate("handle_fees", [])];
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
async getFeeHistory(
|
|
305
|
+
async getFeeHistory(
|
|
306
|
+
timePeriod: '24h' | '7d' | '30d' | '3m' | '6m' = '24h',
|
|
307
|
+
range?: { startTimestamp?: number; endTimestamp?: number }
|
|
308
|
+
): Promise<{
|
|
306
309
|
summary: DualTokenInfo,
|
|
307
310
|
history: FeeHistory[]
|
|
308
311
|
}> {
|
|
@@ -311,8 +314,15 @@ export class EkuboCLVault extends BaseStrategy<
|
|
|
311
314
|
query ContractFeeEarnings(
|
|
312
315
|
$timeframe: String!
|
|
313
316
|
$contract: String!
|
|
317
|
+
$startTimestamp: Float
|
|
318
|
+
$endTimestamp: Float
|
|
314
319
|
) {
|
|
315
|
-
contractFeeEarnings(
|
|
320
|
+
contractFeeEarnings(
|
|
321
|
+
timeframe: $timeframe
|
|
322
|
+
contract: $contract
|
|
323
|
+
startTimestamp: $startTimestamp
|
|
324
|
+
endTimestamp: $endTimestamp
|
|
325
|
+
) {
|
|
316
326
|
contract
|
|
317
327
|
dailyEarnings {
|
|
318
328
|
date
|
|
@@ -325,7 +335,9 @@ export class EkuboCLVault extends BaseStrategy<
|
|
|
325
335
|
`,
|
|
326
336
|
variables: {
|
|
327
337
|
timeframe: timePeriod,
|
|
328
|
-
contract: this.address.address
|
|
338
|
+
contract: this.address.address,
|
|
339
|
+
startTimestamp: range?.startTimestamp,
|
|
340
|
+
endTimestamp: range?.endTimestamp
|
|
329
341
|
},
|
|
330
342
|
fetchPolicy: 'no-cache',
|
|
331
343
|
});
|
|
@@ -234,6 +234,25 @@ export const VesuPools = {
|
|
|
234
234
|
Re7xSTRK: ContractAddr.from('0x052fb52363939c3aa848f8f4ac28f0a51379f8d1b971d8444de25fbd77d8f161'),
|
|
235
235
|
Re7xBTC: ContractAddr.from('0x3a8416bf20d036df5b1cf3447630a2e1cb04685f6b0c3a70ed7fb1473548ecf'),
|
|
236
236
|
Prime: ContractAddr.from('0x451fe483d5921a2919ddd81d0de6696669bccdacd859f72a4fba7656b97c3b5'),
|
|
237
|
+
Re7STRK: ContractAddr.from('0x01fcdacc1d8184eca7b472b5acbaf1500cec9d5683ca95fede8128b46c8f9cc2'),
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export const VesuPoolMetadata = {
|
|
241
|
+
[VesuPools.Genesis.address]: {
|
|
242
|
+
name: 'Genesis',
|
|
243
|
+
},
|
|
244
|
+
[VesuPools.Re7xSTRK.address]: {
|
|
245
|
+
name: 'Re7 xSTRK',
|
|
246
|
+
},
|
|
247
|
+
[VesuPools.Re7xBTC.address]: {
|
|
248
|
+
name: 'Re7 xBTC',
|
|
249
|
+
},
|
|
250
|
+
[VesuPools.Prime.address]: {
|
|
251
|
+
name: 'Prime',
|
|
252
|
+
},
|
|
253
|
+
[VesuPools.Re7STRK.address]: {
|
|
254
|
+
name: 'Re7 STRK',
|
|
255
|
+
},
|
|
237
256
|
}
|
|
238
257
|
|
|
239
258
|
export const extensionMap: {[key: string]: ContractAddr} = {};
|
|
@@ -418,14 +437,14 @@ export class VesuAdapter extends BaseAdapter {
|
|
|
418
437
|
}
|
|
419
438
|
}
|
|
420
439
|
|
|
421
|
-
getVesuModifyDelegationAdapter = (id: string): LeafAdapterFn<VesuModifyDelegationCallParams> => {
|
|
440
|
+
getVesuModifyDelegationAdapter = (id: string, delegatee: ContractAddr): LeafAdapterFn<VesuModifyDelegationCallParams> => {
|
|
422
441
|
return () => {
|
|
423
442
|
const { addr: VESU_SINGLETON, isV2 } = getVesuSingletonAddress(this.config.poolId);
|
|
424
443
|
const packedArguments: bigint[] = isV2 ? [
|
|
425
|
-
toBigInt(
|
|
444
|
+
toBigInt(delegatee.toString()), // v2
|
|
426
445
|
] : [
|
|
427
446
|
this.config.poolId.toBigInt(),
|
|
428
|
-
toBigInt(
|
|
447
|
+
toBigInt(delegatee.toString()), // v1
|
|
429
448
|
];
|
|
430
449
|
const output = this.constructSimpleLeafData({
|
|
431
450
|
id: id,
|
|
@@ -434,29 +453,31 @@ export class VesuAdapter extends BaseAdapter {
|
|
|
434
453
|
packedArguments
|
|
435
454
|
}, isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS);
|
|
436
455
|
|
|
437
|
-
return { leaf: output, callConstructor: this.getVesuModifyDelegationCall.bind(this) };
|
|
456
|
+
return { leaf: output, callConstructor: this.getVesuModifyDelegationCall(delegatee).bind(this) };
|
|
438
457
|
}
|
|
439
458
|
}
|
|
440
459
|
|
|
441
|
-
getVesuModifyDelegationCall = (
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
+
getVesuModifyDelegationCall = (delegatee: ContractAddr) => {
|
|
461
|
+
return (params: VesuModifyDelegationCallParams) => {
|
|
462
|
+
const VESU_SINGLETON = getVesuSingletonAddress(this.config.poolId).addr;
|
|
463
|
+
const { contract, isV2 } = this.getVesuSingletonContract(getMainnetConfig(), this.config.poolId);
|
|
464
|
+
const call = contract.populate('modify_delegation', isV2 ? {
|
|
465
|
+
delegatee: delegatee.toBigInt(),
|
|
466
|
+
delegation: params.delegation,
|
|
467
|
+
} : {
|
|
468
|
+
pool_id: this.config.poolId.toBigInt(),
|
|
469
|
+
delegatee: delegatee.toBigInt(),
|
|
470
|
+
delegation: params.delegation,
|
|
471
|
+
});
|
|
472
|
+
return {
|
|
473
|
+
sanitizer: isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
|
|
474
|
+
call: {
|
|
475
|
+
contractAddress: VESU_SINGLETON,
|
|
476
|
+
selector: hash.getSelectorFromName('modify_delegation'),
|
|
477
|
+
calldata: [
|
|
478
|
+
...call.calldata as bigint[]
|
|
479
|
+
]
|
|
480
|
+
}
|
|
460
481
|
}
|
|
461
482
|
}
|
|
462
483
|
}
|
|
@@ -654,12 +675,12 @@ export class VesuAdapter extends BaseAdapter {
|
|
|
654
675
|
amount: collateralAmount,
|
|
655
676
|
token: this.config.collateral,
|
|
656
677
|
usdValue: collateralAmount.multipliedBy(token1Price.price).toNumber(),
|
|
657
|
-
remarks:
|
|
678
|
+
remarks: `Collateral - ${VesuPoolMetadata[this.config.poolId.address].name} pool`
|
|
658
679
|
}, {
|
|
659
680
|
amount: debtAmount,
|
|
660
681
|
token: this.config.debt,
|
|
661
682
|
usdValue: debtAmount.multipliedBy(token2Price.price).toNumber(),
|
|
662
|
-
remarks:
|
|
683
|
+
remarks: `Debt - ${VesuPoolMetadata[this.config.poolId.address].name} pool`
|
|
663
684
|
}];
|
|
664
685
|
this.setCache(CACHE_KEY, value, 60000); // ttl: 1min
|
|
665
686
|
return value;
|
|
@@ -15,10 +15,9 @@ import { HealthFactorMath } from "@/utils/health-factor-math";
|
|
|
15
15
|
import { findMaxInputWithSlippage } from "@/utils/math-utils";
|
|
16
16
|
|
|
17
17
|
export interface HyperLSTStrategySettings extends UniversalStrategySettings {
|
|
18
|
-
borrowable_assets: TokenInfo[];
|
|
18
|
+
borrowable_assets: { token: TokenInfo, poolId: ContractAddr }[];
|
|
19
19
|
underlyingToken: TokenInfo;
|
|
20
20
|
defaultPoolId: ContractAddr;
|
|
21
|
-
altSupportedPoolIds: ContractAddr[];
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
export class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTStrategySettings> {
|
|
@@ -58,20 +57,20 @@ export class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTSt
|
|
|
58
57
|
// todo support lending assets of underlying as well (like if xSTRK looping is not viable, simply supply STRK)
|
|
59
58
|
getVesuAdapters() {
|
|
60
59
|
const adapters: VesuAdapter[] = [];
|
|
61
|
-
for (const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
for (const borrowableInfo of this.metadata.additionalInfo.borrowable_assets) {
|
|
61
|
+
// do not add adapter if the pool id does not match
|
|
62
|
+
const asset = borrowableInfo.token;
|
|
63
|
+
const poolId = borrowableInfo.poolId;
|
|
64
|
+
const vesuAdapter1 = new VesuAdapter({
|
|
65
|
+
poolId: poolId,
|
|
66
|
+
collateral: this.asset(),
|
|
67
|
+
debt: asset,
|
|
68
|
+
vaultAllocator: this.metadata.additionalInfo.vaultAllocator,
|
|
69
|
+
id: ''
|
|
70
|
+
})
|
|
71
|
+
vesuAdapter1.pricer = this.pricer;
|
|
72
|
+
vesuAdapter1.networkConfig = this.config;
|
|
73
|
+
adapters.push(vesuAdapter1);
|
|
75
74
|
}
|
|
76
75
|
return adapters;
|
|
77
76
|
}
|
|
@@ -760,7 +759,7 @@ export class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTSt
|
|
|
760
759
|
const STEP2_ID = getVesuGenericLegId(params.poolId.toString(), LST_MULTIPLIER_MANAGE_IDS.SWITCH_DELEGATION_ON);
|
|
761
760
|
const manage2Info = this.getProofs<VesuModifyDelegationCallParams>(STEP2_ID);
|
|
762
761
|
const manageCall2 = manage2Info.callConstructor({
|
|
763
|
-
delegation: true
|
|
762
|
+
delegation: true,
|
|
764
763
|
});
|
|
765
764
|
|
|
766
765
|
// deposit and borrow or repay and withdraw
|
|
@@ -907,7 +906,7 @@ function addVesuLeaves(
|
|
|
907
906
|
}]);
|
|
908
907
|
|
|
909
908
|
// avnu multiply
|
|
910
|
-
const { isV2, addr:
|
|
909
|
+
const { isV2, addr: poolAddr } = getVesuSingletonAddress(poolId);
|
|
911
910
|
|
|
912
911
|
// vesu multiply looping
|
|
913
912
|
const VESU_MULTIPLY = isV2 ? vesuAdapterLST.VESU_MULTIPLY : vesuAdapterLST.VESU_MULTIPLY_V1;
|
|
@@ -916,14 +915,18 @@ function addVesuLeaves(
|
|
|
916
915
|
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, VESU_MULTIPLY, leafIdApprove).bind(commonAdapter));
|
|
917
916
|
|
|
918
917
|
const leafIdDelegationOn = getVesuGenericLegId(poolId.toString(), LST_MULTIPLIER_MANAGE_IDS.SWITCH_DELEGATION_ON);
|
|
919
|
-
vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter(leafIdDelegationOn).bind(vesuAdapterLST));
|
|
918
|
+
vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter(leafIdDelegationOn, VESU_MULTIPLY).bind(vesuAdapterLST));
|
|
920
919
|
|
|
921
920
|
const leafIdDelegationOff = getVesuGenericLegId(poolId.toString(), LST_MULTIPLIER_MANAGE_IDS.SWITCH_DELEGATION_OFF);
|
|
922
|
-
vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter(leafIdDelegationOff).bind(vesuAdapterLST));
|
|
921
|
+
vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter(leafIdDelegationOff, VESU_MULTIPLY).bind(vesuAdapterLST));
|
|
923
922
|
|
|
924
923
|
const multiplID = getVesuLegId(LST_MULTIPLIER_MANAGE_IDS.MULTIPLY_VESU, underlyingToken.symbol, poolId.toString());
|
|
925
924
|
vaultSettings.leafAdapters.push(vesuAdapterLST.getMultiplyAdapter(multiplID).bind(vesuAdapterLST));
|
|
926
925
|
|
|
926
|
+
// direct modify position stuff
|
|
927
|
+
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, poolAddr, UNIVERSAL_MANAGE_IDS.APPROVE_TOKEN1).bind(commonAdapter));
|
|
928
|
+
vaultSettings.leafAdapters.push(vesuAdapterLST.getModifyPosition.bind(vesuAdapterLST));
|
|
929
|
+
|
|
927
930
|
return vesuAdapterLST;
|
|
928
931
|
}
|
|
929
932
|
|
|
@@ -931,8 +934,7 @@ function getLooperSettings(
|
|
|
931
934
|
lstSymbol: string,
|
|
932
935
|
underlyingSymbol: string,
|
|
933
936
|
vaultSettings: HyperLSTStrategySettings,
|
|
934
|
-
defaultPoolId: ContractAddr
|
|
935
|
-
altSupportedPoolIds: ContractAddr[] = []
|
|
937
|
+
defaultPoolId: ContractAddr
|
|
936
938
|
) {
|
|
937
939
|
vaultSettings.leafAdapters = [];
|
|
938
940
|
const pool1 = vaultSettings.defaultPoolId;
|
|
@@ -957,15 +959,15 @@ function getLooperSettings(
|
|
|
957
959
|
adapter: commonAdapter
|
|
958
960
|
}]);
|
|
959
961
|
|
|
960
|
-
// add vesu leaves for
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
// add vesu leaves for alt supported pool ids
|
|
964
|
-
altSupportedPoolIds.map(poolId => addVesuLeaves(poolId, lstSymbol, underlyingSymbol, vaultSettings, commonAdapter));
|
|
962
|
+
// add vesu leaves for all supported pool ids
|
|
963
|
+
vaultSettings.borrowable_assets.map(borrowableAsset => addVesuLeaves(borrowableAsset.poolId, lstSymbol, underlyingSymbol, vaultSettings, commonAdapter));
|
|
965
964
|
|
|
966
965
|
// approve lst once to avnu
|
|
967
966
|
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, AVNU_EXCHANGE, LST_MULTIPLIER_MANAGE_IDS.AVNU_MULTIPLY_APPROVE_WITHDRAW).bind(commonAdapter));
|
|
968
|
-
|
|
967
|
+
|
|
968
|
+
const uniqueBorrowableAssets = [...new Set(vaultSettings.borrowable_assets.map(borrowableAsset => borrowableAsset.token.symbol))];
|
|
969
|
+
for (let borrowableAssetSymbol of uniqueBorrowableAssets) {
|
|
970
|
+
const borrowableAsset = Global.getDefaultTokens().find(token => token.symbol === borrowableAssetSymbol)!;
|
|
969
971
|
// in-efficient avnu swap looping (but good with endur integration)
|
|
970
972
|
const debtAsset = borrowableAsset;
|
|
971
973
|
const approve_debt_token_id = getAvnuManageIDs(LST_MULTIPLIER_MANAGE_IDS.AVNU_MULTIPLY_APPROVE_DEPOSIT, debtAsset.symbol);
|
|
@@ -974,23 +976,6 @@ function getLooperSettings(
|
|
|
974
976
|
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(debtAsset.address, AVNU_EXCHANGE, approve_debt_token_id).bind(commonAdapter));
|
|
975
977
|
vaultSettings.leafAdapters.push(commonAdapter.getAvnuAdapter(debtAsset.address, lstToken.address, swap_debt_token_id, false).bind(commonAdapter));
|
|
976
978
|
vaultSettings.leafAdapters.push(commonAdapter.getAvnuAdapter(lstToken.address, debtAsset.address, swap_lst_token_id, false).bind(commonAdapter));
|
|
977
|
-
|
|
978
|
-
// approve LST to add collateral
|
|
979
|
-
const vesuAdapter = new VesuAdapter({
|
|
980
|
-
poolId: pool1,
|
|
981
|
-
collateral: lstToken,
|
|
982
|
-
debt: debtAsset,
|
|
983
|
-
vaultAllocator: vaultSettings.vaultAllocator,
|
|
984
|
-
id: getVesuLegId(UNIVERSAL_MANAGE_IDS.VESU_LEG1, debtAsset.symbol, pool1.toString())
|
|
985
|
-
});
|
|
986
|
-
const { isV2, addr:poolAddr } = getVesuSingletonAddress(pool1);
|
|
987
|
-
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, poolAddr, UNIVERSAL_MANAGE_IDS.APPROVE_TOKEN1).bind(commonAdapter));
|
|
988
|
-
vaultSettings.leafAdapters.push(vesuAdapter.getModifyPosition.bind(vesuAdapter));
|
|
989
|
-
|
|
990
|
-
// Vesu multiply
|
|
991
|
-
if (borrowableAsset.address.eq(underlyingToken.address)) {
|
|
992
|
-
continue; // already added in addVesuLeaves
|
|
993
|
-
}
|
|
994
979
|
}
|
|
995
980
|
|
|
996
981
|
|
|
@@ -998,8 +983,8 @@ function getLooperSettings(
|
|
|
998
983
|
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, vaultSettings.vaultAddress, UNIVERSAL_MANAGE_IDS.APPROVE_BRING_LIQUIDITY).bind(commonAdapter));
|
|
999
984
|
vaultSettings.leafAdapters.push(commonAdapter.getBringLiquidityAdapter(UNIVERSAL_MANAGE_IDS.BRING_LIQUIDITY).bind(commonAdapter));
|
|
1000
985
|
|
|
1001
|
-
// claim rewards
|
|
1002
|
-
vaultSettings.leafAdapters.push(vesuAdapterLST.getDefispringRewardsAdapter(UNIVERSAL_MANAGE_IDS.DEFISPRING_REWARDS).bind(vesuAdapterLST));
|
|
986
|
+
// claim rewards (defi spring ended)
|
|
987
|
+
// vaultSettings.leafAdapters.push(vesuAdapterLST.getDefispringRewardsAdapter(UNIVERSAL_MANAGE_IDS.DEFISPRING_REWARDS).bind(vesuAdapterLST));
|
|
1003
988
|
|
|
1004
989
|
// avnu swap for claims rewards
|
|
1005
990
|
const STRKToken = Global.getDefaultTokens().find(token => token.symbol === 'STRK')!;
|
|
@@ -1069,7 +1054,7 @@ const _riskFactor: RiskFactor[] = [
|
|
|
1069
1054
|
{type: RiskType.DEPEG_RISK, value: DepegRiskLevel.GENERALLY_STABLE, weight: 25, reason: "Generally stable pegged assets" },
|
|
1070
1055
|
];
|
|
1071
1056
|
|
|
1072
|
-
const
|
|
1057
|
+
const btcBorrowableAssets = [
|
|
1073
1058
|
'WBTC', 'tBTC', 'LBTC', 'solvBTC'
|
|
1074
1059
|
]
|
|
1075
1060
|
|
|
@@ -1083,10 +1068,13 @@ const hyperxSTRK: HyperLSTStrategySettings = {
|
|
|
1083
1068
|
adapters: [],
|
|
1084
1069
|
targetHealthFactor: 1.1,
|
|
1085
1070
|
minHealthFactor: 1.05,
|
|
1086
|
-
borrowable_assets:
|
|
1071
|
+
borrowable_assets: [
|
|
1072
|
+
...Global.getDefaultTokens().filter(token => token.symbol === 'STRK').map(token => ({ token, poolId: VesuPools.Re7xSTRK })),
|
|
1073
|
+
...Global.getDefaultTokens().filter(token => token.symbol === 'STRK').map(token => ({ token, poolId: VesuPools.Prime })),
|
|
1074
|
+
...Global.getDefaultTokens().filter(token => token.symbol === 'STRK').map(token => ({ token, poolId: VesuPools.Re7STRK })), // v2, new alt for Re7xSTRK
|
|
1075
|
+
],
|
|
1087
1076
|
underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'STRK')!,
|
|
1088
1077
|
defaultPoolId: VesuPools.Re7xSTRK,
|
|
1089
|
-
altSupportedPoolIds: [VesuPools.Prime],
|
|
1090
1078
|
}
|
|
1091
1079
|
|
|
1092
1080
|
const hyperxWBTC: HyperLSTStrategySettings = {
|
|
@@ -1099,10 +1087,14 @@ const hyperxWBTC: HyperLSTStrategySettings = {
|
|
|
1099
1087
|
adapters: [],
|
|
1100
1088
|
targetHealthFactor: 1.1,
|
|
1101
1089
|
minHealthFactor: 1.05,
|
|
1102
|
-
borrowable_assets:
|
|
1090
|
+
borrowable_assets: [
|
|
1091
|
+
// allow all BTC flavours borrowing on Re7xBTC pool
|
|
1092
|
+
...btcBorrowableAssets.map(asset => Global.getDefaultTokens().find(token => token.symbol === asset)!).map(token => ({ token, poolId: VesuPools.Re7xBTC })),
|
|
1093
|
+
// allow only WBTC borrowing on Prime pool
|
|
1094
|
+
...Global.getDefaultTokens().filter(token => token.symbol === 'WBTC').map(token => ({ token, poolId: VesuPools.Prime })),
|
|
1095
|
+
],
|
|
1103
1096
|
underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'WBTC')!,
|
|
1104
1097
|
defaultPoolId: VesuPools.Re7xBTC,
|
|
1105
|
-
altSupportedPoolIds: [VesuPools.Prime],
|
|
1106
1098
|
redemptionRouter: ContractAddr.from('0x6ea649f402898f69baf775c1afdd08522c071c640b9c4460192070ec2b96417')
|
|
1107
1099
|
}
|
|
1108
1100
|
|
|
@@ -1116,10 +1108,11 @@ const hyperxtBTC: HyperLSTStrategySettings = {
|
|
|
1116
1108
|
adapters: [],
|
|
1117
1109
|
targetHealthFactor: 1.1,
|
|
1118
1110
|
minHealthFactor: 1.05,
|
|
1119
|
-
borrowable_assets:
|
|
1111
|
+
borrowable_assets: [
|
|
1112
|
+
...Global.getDefaultTokens().filter(token => token.symbol === 'tBTC' || token.symbol === 'WBTC').map(token => ({ token, poolId: VesuPools.Re7xBTC })),
|
|
1113
|
+
],
|
|
1120
1114
|
underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'tBTC')!,
|
|
1121
1115
|
defaultPoolId: VesuPools.Re7xBTC,
|
|
1122
|
-
altSupportedPoolIds: [],
|
|
1123
1116
|
redemptionRouter: ContractAddr.from('0x3de9c409d1e357e25778fb7a3e2e2393666956846a5c2caa607296fa8e76b5d')
|
|
1124
1117
|
}
|
|
1125
1118
|
|
|
@@ -1133,10 +1126,11 @@ const hyperxsBTC: HyperLSTStrategySettings = {
|
|
|
1133
1126
|
adapters: [],
|
|
1134
1127
|
targetHealthFactor: 1.1,
|
|
1135
1128
|
minHealthFactor: 1.05,
|
|
1136
|
-
borrowable_assets:
|
|
1129
|
+
borrowable_assets: [
|
|
1130
|
+
...Global.getDefaultTokens().filter(token => token.symbol === 'solvBTC').map(token => ({ token, poolId: VesuPools.Re7xBTC })),
|
|
1131
|
+
],
|
|
1137
1132
|
underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'solvBTC')!,
|
|
1138
1133
|
defaultPoolId: VesuPools.Re7xBTC,
|
|
1139
|
-
altSupportedPoolIds: [],
|
|
1140
1134
|
}
|
|
1141
1135
|
|
|
1142
1136
|
const hyperxLBTC: HyperLSTStrategySettings = {
|
|
@@ -1149,10 +1143,11 @@ const hyperxLBTC: HyperLSTStrategySettings = {
|
|
|
1149
1143
|
adapters: [],
|
|
1150
1144
|
targetHealthFactor: 1.1,
|
|
1151
1145
|
minHealthFactor: 1.05,
|
|
1152
|
-
borrowable_assets:
|
|
1146
|
+
borrowable_assets: [
|
|
1147
|
+
...Global.getDefaultTokens().filter(token => token.symbol === 'LBTC').map(token => ({ token, poolId: VesuPools.Re7xBTC })),
|
|
1148
|
+
],
|
|
1153
1149
|
underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'LBTC')!,
|
|
1154
1150
|
defaultPoolId: VesuPools.Re7xBTC,
|
|
1155
|
-
altSupportedPoolIds: [],
|
|
1156
1151
|
}
|
|
1157
1152
|
|
|
1158
1153
|
function getInvestmentSteps(lstSymbol: string, underlyingSymbol: string) {
|
|
@@ -1262,14 +1257,14 @@ const HYPER_LST_REDEMPTION_INFO: RedemptionInfo = {
|
|
|
1262
1257
|
function getStrategySettings(
|
|
1263
1258
|
lstSymbol: string,
|
|
1264
1259
|
underlyingSymbol: string,
|
|
1265
|
-
|
|
1260
|
+
settings: HyperLSTStrategySettings,
|
|
1266
1261
|
isPreview: boolean = false
|
|
1267
1262
|
): IStrategyMetadata<HyperLSTStrategySettings> {
|
|
1268
1263
|
return {
|
|
1269
1264
|
id: `hyper_${lstSymbol.toLowerCase()}`,
|
|
1270
1265
|
name: `Hyper ${lstSymbol}`,
|
|
1271
1266
|
description: getDescription(lstSymbol, underlyingSymbol),
|
|
1272
|
-
address:
|
|
1267
|
+
address: settings.vaultAddress,
|
|
1273
1268
|
launchBlock: 0,
|
|
1274
1269
|
type: "Other",
|
|
1275
1270
|
vaultType: {
|
|
@@ -1284,8 +1279,8 @@ function getStrategySettings(
|
|
|
1284
1279
|
additionalInfo: getLooperSettings(
|
|
1285
1280
|
lstSymbol,
|
|
1286
1281
|
underlyingSymbol,
|
|
1287
|
-
|
|
1288
|
-
lstSymbol === "xSTRK" ? VesuPools.Re7xSTRK : VesuPools.Re7xBTC
|
|
1282
|
+
settings,
|
|
1283
|
+
lstSymbol === "xSTRK" ? VesuPools.Re7xSTRK : VesuPools.Re7xBTC,
|
|
1289
1284
|
),
|
|
1290
1285
|
risk: {
|
|
1291
1286
|
riskFactor: _riskFactor,
|
|
@@ -1303,7 +1298,7 @@ function getStrategySettings(
|
|
|
1303
1298
|
logo: "https://assets.troves.fi/integrations/unwraplabs/white.png"
|
|
1304
1299
|
},
|
|
1305
1300
|
settings: createHyperLSTSettings(lstSymbol, underlyingSymbol),
|
|
1306
|
-
contractDetails: getContractDetails(
|
|
1301
|
+
contractDetails: getContractDetails(settings),
|
|
1307
1302
|
faqs: getFAQs(lstSymbol, underlyingSymbol),
|
|
1308
1303
|
investmentSteps: getInvestmentSteps(lstSymbol, underlyingSymbol),
|
|
1309
1304
|
isPreview: isPreview,
|