@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
|
@@ -17936,16 +17936,16 @@ ${r2}}` : "}", l2;
|
|
|
17936
17936
|
solidityUint256PackedKeccak256: () => solidityUint256PackedKeccak2562,
|
|
17937
17937
|
starknetKeccak: () => starknetKeccak2
|
|
17938
17938
|
});
|
|
17939
|
-
var
|
|
17939
|
+
var import_starknet26 = require_lib3();
|
|
17940
17940
|
var import_sha34 = require_sha3();
|
|
17941
17941
|
var import_utils210 = require_utils2();
|
|
17942
17942
|
function keccakBn2(value) {
|
|
17943
17943
|
const hexWithoutPrefix = removeHexPrefix2(toHex3(BigInt(value)));
|
|
17944
17944
|
const evenHex = hexWithoutPrefix.length % 2 === 0 ? hexWithoutPrefix : `0${hexWithoutPrefix}`;
|
|
17945
|
-
return addHexPrefix2((0,
|
|
17945
|
+
return addHexPrefix2((0, import_starknet26.keccak)(hexToBytes5(addHexPrefix2(evenHex))).toString(16));
|
|
17946
17946
|
}
|
|
17947
17947
|
function keccakHex2(str) {
|
|
17948
|
-
return addHexPrefix2((0,
|
|
17948
|
+
return addHexPrefix2((0, import_starknet26.keccak)(utf8ToArray2(str)).toString(16));
|
|
17949
17949
|
}
|
|
17950
17950
|
function starknetKeccak2(str) {
|
|
17951
17951
|
const hash3 = BigInt(keccakHex2(str));
|
|
@@ -20192,7 +20192,7 @@ ${r2}}` : "}", l2;
|
|
|
20192
20192
|
hashDAMode: () => hashDAMode2,
|
|
20193
20193
|
hashFeeField: () => hashFeeField
|
|
20194
20194
|
});
|
|
20195
|
-
var
|
|
20195
|
+
var import_starknet27 = require_lib3();
|
|
20196
20196
|
var AToBI2 = (array) => array.map((it) => BigInt(it));
|
|
20197
20197
|
var DATA_AVAILABILITY_MODE_BITS2 = 32n;
|
|
20198
20198
|
var MAX_AMOUNT_BITS2 = 64n;
|
|
@@ -20212,7 +20212,7 @@ ${r2}}` : "}", l2;
|
|
|
20212
20212
|
function hashFeeField(tip, bounds) {
|
|
20213
20213
|
const L1Bound = encodeResourceBoundsL12(bounds);
|
|
20214
20214
|
const L2Bound = encodeResourceBoundsL22(bounds);
|
|
20215
|
-
return (0,
|
|
20215
|
+
return (0, import_starknet27.poseidonHashMany)([BigInt(tip), L1Bound, L2Bound]);
|
|
20216
20216
|
}
|
|
20217
20217
|
function calculateTransactionHashCommon22(txHashPrefix, version5, senderAddress, chainId, nonce, tip, paymasterData, nonceDataAvailabilityMode, feeDataAvailabilityMode, resourceBounds, additionalData = []) {
|
|
20218
20218
|
const feeFieldHash = hashFeeField(tip, resourceBounds);
|
|
@@ -20222,13 +20222,13 @@ ${r2}}` : "}", l2;
|
|
|
20222
20222
|
version5,
|
|
20223
20223
|
senderAddress,
|
|
20224
20224
|
feeFieldHash,
|
|
20225
|
-
(0,
|
|
20225
|
+
(0, import_starknet27.poseidonHashMany)(AToBI2(paymasterData)),
|
|
20226
20226
|
chainId,
|
|
20227
20227
|
nonce,
|
|
20228
20228
|
dAModeHash,
|
|
20229
20229
|
...AToBI2(additionalData)
|
|
20230
20230
|
]);
|
|
20231
|
-
return toHex3((0,
|
|
20231
|
+
return toHex3((0, import_starknet27.poseidonHashMany)(dataToHash));
|
|
20232
20232
|
}
|
|
20233
20233
|
function calculateDeployAccountTransactionHash22(contractAddress, classHash, compiledConstructorCalldata, salt, version5, chainId, nonce, nonceDataAvailabilityMode, feeDataAvailabilityMode, resourceBounds, tip, paymasterData) {
|
|
20234
20234
|
return calculateTransactionHashCommon22(
|
|
@@ -20242,7 +20242,7 @@ ${r2}}` : "}", l2;
|
|
|
20242
20242
|
nonceDataAvailabilityMode,
|
|
20243
20243
|
feeDataAvailabilityMode,
|
|
20244
20244
|
resourceBounds,
|
|
20245
|
-
[(0,
|
|
20245
|
+
[(0, import_starknet27.poseidonHashMany)(AToBI2(compiledConstructorCalldata)), classHash, salt]
|
|
20246
20246
|
);
|
|
20247
20247
|
}
|
|
20248
20248
|
function calculateDeclareTransactionHash22(classHash, compiledClassHash, senderAddress, version5, chainId, nonce, accountDeploymentData, nonceDataAvailabilityMode, feeDataAvailabilityMode, resourceBounds, tip, paymasterData) {
|
|
@@ -20257,7 +20257,7 @@ ${r2}}` : "}", l2;
|
|
|
20257
20257
|
nonceDataAvailabilityMode,
|
|
20258
20258
|
feeDataAvailabilityMode,
|
|
20259
20259
|
resourceBounds,
|
|
20260
|
-
[(0,
|
|
20260
|
+
[(0, import_starknet27.poseidonHashMany)(AToBI2(accountDeploymentData)), classHash, compiledClassHash]
|
|
20261
20261
|
);
|
|
20262
20262
|
}
|
|
20263
20263
|
function calculateInvokeTransactionHash3(senderAddress, version5, compiledCalldata, chainId, nonce, accountDeploymentData, nonceDataAvailabilityMode, feeDataAvailabilityMode, resourceBounds, tip, paymasterData) {
|
|
@@ -20272,7 +20272,7 @@ ${r2}}` : "}", l2;
|
|
|
20272
20272
|
nonceDataAvailabilityMode,
|
|
20273
20273
|
feeDataAvailabilityMode,
|
|
20274
20274
|
resourceBounds,
|
|
20275
|
-
[(0,
|
|
20275
|
+
[(0, import_starknet27.poseidonHashMany)(AToBI2(accountDeploymentData)), (0, import_starknet27.poseidonHashMany)(AToBI2(compiledCalldata))]
|
|
20276
20276
|
);
|
|
20277
20277
|
}
|
|
20278
20278
|
function isV3InvokeTx2(args) {
|
|
@@ -27962,6 +27962,7 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
27962
27962
|
VesuAdapter: () => VesuAdapter,
|
|
27963
27963
|
VesuAmountDenomination: () => VesuAmountDenomination,
|
|
27964
27964
|
VesuAmountType: () => VesuAmountType,
|
|
27965
|
+
VesuPoolMetadata: () => VesuPoolMetadata,
|
|
27965
27966
|
VesuPools: () => VesuPools,
|
|
27966
27967
|
VesuRebalance: () => VesuRebalance,
|
|
27967
27968
|
VesuRebalanceStrategies: () => VesuRebalanceStrategies,
|
|
@@ -30606,91 +30607,6 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
30606
30607
|
|
|
30607
30608
|
// src/dataTypes/_bignumber.ts
|
|
30608
30609
|
var import_bignumber = __toESM(require_bignumber());
|
|
30609
|
-
var _Web3Number = class extends import_bignumber.default {
|
|
30610
|
-
constructor(value, decimals) {
|
|
30611
|
-
super(value);
|
|
30612
|
-
this.decimals = decimals;
|
|
30613
|
-
}
|
|
30614
|
-
toWei() {
|
|
30615
|
-
return super.mul(10 ** this.decimals).toFixed(0);
|
|
30616
|
-
}
|
|
30617
|
-
multipliedBy(value) {
|
|
30618
|
-
const _value2 = this.getStandardString(value);
|
|
30619
|
-
return this.construct(super.mul(_value2).toString(), this.decimals);
|
|
30620
|
-
}
|
|
30621
|
-
dividedBy(value) {
|
|
30622
|
-
const _value2 = this.getStandardString(value);
|
|
30623
|
-
return this.construct(super.dividedBy(_value2).toString(), this.decimals);
|
|
30624
|
-
}
|
|
30625
|
-
plus(value) {
|
|
30626
|
-
const rawValue = this.getStandardString(value);
|
|
30627
|
-
const thisBN = new import_bignumber.default(this.toString());
|
|
30628
|
-
const result2 = thisBN.plus(rawValue);
|
|
30629
|
-
return this.construct(result2.toString(), this.decimals);
|
|
30630
|
-
}
|
|
30631
|
-
minus(n2, base2) {
|
|
30632
|
-
const rawValue = this.getStandardString(n2);
|
|
30633
|
-
const thisBN = new import_bignumber.default(this.toString());
|
|
30634
|
-
const result2 = thisBN.minus(rawValue, base2);
|
|
30635
|
-
return this.construct(result2.toString(), this.decimals);
|
|
30636
|
-
}
|
|
30637
|
-
construct(value, decimals) {
|
|
30638
|
-
return new this.constructor(value, decimals);
|
|
30639
|
-
}
|
|
30640
|
-
toString() {
|
|
30641
|
-
return super.toString();
|
|
30642
|
-
}
|
|
30643
|
-
toJSON() {
|
|
30644
|
-
return this.toString();
|
|
30645
|
-
}
|
|
30646
|
-
valueOf() {
|
|
30647
|
-
return this.toString();
|
|
30648
|
-
}
|
|
30649
|
-
maxToFixedDecimals() {
|
|
30650
|
-
return Math.min(this.decimals, 18);
|
|
30651
|
-
}
|
|
30652
|
-
getStandardString(value) {
|
|
30653
|
-
if (typeof value === "string") {
|
|
30654
|
-
return value;
|
|
30655
|
-
}
|
|
30656
|
-
if (typeof value === "number") {
|
|
30657
|
-
return value.toString();
|
|
30658
|
-
}
|
|
30659
|
-
return import_bignumber.default.prototype.toString.call(value);
|
|
30660
|
-
}
|
|
30661
|
-
minimum(value) {
|
|
30662
|
-
const _value2 = new import_bignumber.default(value);
|
|
30663
|
-
const _valueMe = new import_bignumber.default(this.toString());
|
|
30664
|
-
const answer = _value2.lessThanOrEqualTo(_valueMe) ? _value2 : _valueMe;
|
|
30665
|
-
return this.construct(answer.toString(), this.decimals);
|
|
30666
|
-
}
|
|
30667
|
-
maximum(value) {
|
|
30668
|
-
const _value2 = new import_bignumber.default(value);
|
|
30669
|
-
const _valueMe = new import_bignumber.default(this.toString());
|
|
30670
|
-
const answer = _value2.greaterThanOrEqualTo(_valueMe) ? _value2 : _valueMe;
|
|
30671
|
-
return this.construct(answer.toString(), this.decimals);
|
|
30672
|
-
}
|
|
30673
|
-
abs() {
|
|
30674
|
-
return this.construct(Math.abs(this.toNumber()).toFixed(12), this.decimals);
|
|
30675
|
-
}
|
|
30676
|
-
toI129() {
|
|
30677
|
-
const sign2 = this.isNegative() ? 1 : 0;
|
|
30678
|
-
return {
|
|
30679
|
-
mag: BigInt(this.toWei()) * (this.isNegative() ? -1n : 1n),
|
|
30680
|
-
sign: sign2
|
|
30681
|
-
};
|
|
30682
|
-
}
|
|
30683
|
-
};
|
|
30684
|
-
import_bignumber.default.config({ DECIMAL_PLACES: 18, ROUNDING_MODE: import_bignumber.default.ROUND_DOWN });
|
|
30685
|
-
_Web3Number.config({ DECIMAL_PLACES: 18, ROUNDING_MODE: import_bignumber.default.ROUND_DOWN });
|
|
30686
|
-
|
|
30687
|
-
// src/dataTypes/bignumber.browser.ts
|
|
30688
|
-
var Web3Number = class _Web3Number2 extends _Web3Number {
|
|
30689
|
-
static fromWei(weiNumber, decimals) {
|
|
30690
|
-
const bn = new _Web3Number2(weiNumber, decimals).dividedBy(10 ** decimals);
|
|
30691
|
-
return new _Web3Number2(bn.toString(), decimals);
|
|
30692
|
-
}
|
|
30693
|
-
};
|
|
30694
30610
|
|
|
30695
30611
|
// node_modules/.pnpm/@starknet-io+types-js@0.9.2/node_modules/@starknet-io/types-js/dist/esm/index.js
|
|
30696
30612
|
var esm_exports = {};
|
|
@@ -49170,6 +49086,96 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
49170
49086
|
};
|
|
49171
49087
|
var export_TypedDataRevision = api_exports3.TypedDataRevision;
|
|
49172
49088
|
|
|
49089
|
+
// src/dataTypes/_bignumber.ts
|
|
49090
|
+
var _Web3Number = class extends import_bignumber.default {
|
|
49091
|
+
constructor(value, decimals) {
|
|
49092
|
+
super(value);
|
|
49093
|
+
this.decimals = decimals;
|
|
49094
|
+
}
|
|
49095
|
+
toWei() {
|
|
49096
|
+
return super.mul(10 ** this.decimals).toFixed(0);
|
|
49097
|
+
}
|
|
49098
|
+
multipliedBy(value) {
|
|
49099
|
+
const _value2 = this.getStandardString(value);
|
|
49100
|
+
return this.construct(super.mul(_value2).toString(), this.decimals);
|
|
49101
|
+
}
|
|
49102
|
+
dividedBy(value) {
|
|
49103
|
+
const _value2 = this.getStandardString(value);
|
|
49104
|
+
return this.construct(super.dividedBy(_value2).toString(), this.decimals);
|
|
49105
|
+
}
|
|
49106
|
+
plus(value) {
|
|
49107
|
+
const rawValue = this.getStandardString(value);
|
|
49108
|
+
const thisBN = new import_bignumber.default(this.toString());
|
|
49109
|
+
const result2 = thisBN.plus(rawValue);
|
|
49110
|
+
return this.construct(result2.toString(), this.decimals);
|
|
49111
|
+
}
|
|
49112
|
+
minus(n2, base2) {
|
|
49113
|
+
const rawValue = this.getStandardString(n2);
|
|
49114
|
+
const thisBN = new import_bignumber.default(this.toString());
|
|
49115
|
+
const result2 = thisBN.minus(rawValue, base2);
|
|
49116
|
+
return this.construct(result2.toString(), this.decimals);
|
|
49117
|
+
}
|
|
49118
|
+
construct(value, decimals) {
|
|
49119
|
+
return new this.constructor(value, decimals);
|
|
49120
|
+
}
|
|
49121
|
+
toString() {
|
|
49122
|
+
return super.toString();
|
|
49123
|
+
}
|
|
49124
|
+
toJSON() {
|
|
49125
|
+
return this.toString();
|
|
49126
|
+
}
|
|
49127
|
+
valueOf() {
|
|
49128
|
+
return this.toString();
|
|
49129
|
+
}
|
|
49130
|
+
maxToFixedDecimals() {
|
|
49131
|
+
return Math.min(this.decimals, 18);
|
|
49132
|
+
}
|
|
49133
|
+
getStandardString(value) {
|
|
49134
|
+
if (typeof value === "string") {
|
|
49135
|
+
return value;
|
|
49136
|
+
}
|
|
49137
|
+
if (typeof value === "number") {
|
|
49138
|
+
return value.toString();
|
|
49139
|
+
}
|
|
49140
|
+
return import_bignumber.default.prototype.toString.call(value);
|
|
49141
|
+
}
|
|
49142
|
+
minimum(value) {
|
|
49143
|
+
const _value2 = new import_bignumber.default(value);
|
|
49144
|
+
const _valueMe = new import_bignumber.default(this.toString());
|
|
49145
|
+
const answer = _value2.lessThanOrEqualTo(_valueMe) ? _value2 : _valueMe;
|
|
49146
|
+
return this.construct(answer.toString(), this.decimals);
|
|
49147
|
+
}
|
|
49148
|
+
maximum(value) {
|
|
49149
|
+
const _value2 = new import_bignumber.default(value);
|
|
49150
|
+
const _valueMe = new import_bignumber.default(this.toString());
|
|
49151
|
+
const answer = _value2.greaterThanOrEqualTo(_valueMe) ? _value2 : _valueMe;
|
|
49152
|
+
return this.construct(answer.toString(), this.decimals);
|
|
49153
|
+
}
|
|
49154
|
+
abs() {
|
|
49155
|
+
return this.construct(Math.abs(this.toNumber()).toFixed(12), this.decimals);
|
|
49156
|
+
}
|
|
49157
|
+
toI129() {
|
|
49158
|
+
const sign2 = this.isNegative() ? 1 : 0;
|
|
49159
|
+
return {
|
|
49160
|
+
mag: BigInt(this.toWei()) * (this.isNegative() ? -1n : 1n),
|
|
49161
|
+
sign: sign2
|
|
49162
|
+
};
|
|
49163
|
+
}
|
|
49164
|
+
toUint256() {
|
|
49165
|
+
return uint256_exports.bnToUint256(this.toWei());
|
|
49166
|
+
}
|
|
49167
|
+
};
|
|
49168
|
+
import_bignumber.default.config({ DECIMAL_PLACES: 18, ROUNDING_MODE: import_bignumber.default.ROUND_DOWN });
|
|
49169
|
+
_Web3Number.config({ DECIMAL_PLACES: 18, ROUNDING_MODE: import_bignumber.default.ROUND_DOWN });
|
|
49170
|
+
|
|
49171
|
+
// src/dataTypes/bignumber.browser.ts
|
|
49172
|
+
var Web3Number = class _Web3Number2 extends _Web3Number {
|
|
49173
|
+
static fromWei(weiNumber, decimals) {
|
|
49174
|
+
const bn = new _Web3Number2(weiNumber, decimals).dividedBy(10 ** decimals);
|
|
49175
|
+
return new _Web3Number2(bn.toString(), decimals);
|
|
49176
|
+
}
|
|
49177
|
+
};
|
|
49178
|
+
|
|
49173
49179
|
// src/dataTypes/address.ts
|
|
49174
49180
|
var ContractAddr = class _ContractAddr {
|
|
49175
49181
|
constructor(address) {
|
|
@@ -103865,14 +103871,21 @@ spurious results.`);
|
|
|
103865
103871
|
handleFeesCall() {
|
|
103866
103872
|
return [this.contract.populate("handle_fees", [])];
|
|
103867
103873
|
}
|
|
103868
|
-
async getFeeHistory(timePeriod = "24h") {
|
|
103874
|
+
async getFeeHistory(timePeriod = "24h", range2) {
|
|
103869
103875
|
const { data } = await apollo_client_default.query({
|
|
103870
103876
|
query: gql`
|
|
103871
103877
|
query ContractFeeEarnings(
|
|
103872
103878
|
$timeframe: String!
|
|
103873
103879
|
$contract: String!
|
|
103880
|
+
$startTimestamp: Float
|
|
103881
|
+
$endTimestamp: Float
|
|
103874
103882
|
) {
|
|
103875
|
-
contractFeeEarnings(
|
|
103883
|
+
contractFeeEarnings(
|
|
103884
|
+
timeframe: $timeframe
|
|
103885
|
+
contract: $contract
|
|
103886
|
+
startTimestamp: $startTimestamp
|
|
103887
|
+
endTimestamp: $endTimestamp
|
|
103888
|
+
) {
|
|
103876
103889
|
contract
|
|
103877
103890
|
dailyEarnings {
|
|
103878
103891
|
date
|
|
@@ -103885,7 +103898,9 @@ spurious results.`);
|
|
|
103885
103898
|
`,
|
|
103886
103899
|
variables: {
|
|
103887
103900
|
timeframe: timePeriod,
|
|
103888
|
-
contract: this.address.address
|
|
103901
|
+
contract: this.address.address,
|
|
103902
|
+
startTimestamp: range2?.startTimestamp,
|
|
103903
|
+
endTimestamp: range2?.endTimestamp
|
|
103889
103904
|
},
|
|
103890
103905
|
fetchPolicy: "no-cache"
|
|
103891
103906
|
});
|
|
@@ -114887,7 +114902,25 @@ spurious results.`);
|
|
|
114887
114902
|
Genesis: ContractAddr.from("0x4dc4f0ca6ea4961e4c8373265bfd5317678f4fe374d76f3fd7135f57763bf28"),
|
|
114888
114903
|
Re7xSTRK: ContractAddr.from("0x052fb52363939c3aa848f8f4ac28f0a51379f8d1b971d8444de25fbd77d8f161"),
|
|
114889
114904
|
Re7xBTC: ContractAddr.from("0x3a8416bf20d036df5b1cf3447630a2e1cb04685f6b0c3a70ed7fb1473548ecf"),
|
|
114890
|
-
Prime: ContractAddr.from("0x451fe483d5921a2919ddd81d0de6696669bccdacd859f72a4fba7656b97c3b5")
|
|
114905
|
+
Prime: ContractAddr.from("0x451fe483d5921a2919ddd81d0de6696669bccdacd859f72a4fba7656b97c3b5"),
|
|
114906
|
+
Re7STRK: ContractAddr.from("0x01fcdacc1d8184eca7b472b5acbaf1500cec9d5683ca95fede8128b46c8f9cc2")
|
|
114907
|
+
};
|
|
114908
|
+
var VesuPoolMetadata = {
|
|
114909
|
+
[VesuPools.Genesis.address]: {
|
|
114910
|
+
name: "Genesis"
|
|
114911
|
+
},
|
|
114912
|
+
[VesuPools.Re7xSTRK.address]: {
|
|
114913
|
+
name: "Re7 xSTRK"
|
|
114914
|
+
},
|
|
114915
|
+
[VesuPools.Re7xBTC.address]: {
|
|
114916
|
+
name: "Re7 xBTC"
|
|
114917
|
+
},
|
|
114918
|
+
[VesuPools.Prime.address]: {
|
|
114919
|
+
name: "Prime"
|
|
114920
|
+
},
|
|
114921
|
+
[VesuPools.Re7STRK.address]: {
|
|
114922
|
+
name: "Re7 STRK"
|
|
114923
|
+
}
|
|
114891
114924
|
};
|
|
114892
114925
|
var extensionMap = {};
|
|
114893
114926
|
extensionMap[VesuPools.Re7xSTRK.address] = ContractAddr.from("0x04e06e04b8d624d039aa1c3ca8e0aa9e21dc1ccba1d88d0d650837159e0ee054");
|
|
@@ -115030,15 +115063,15 @@ spurious results.`);
|
|
|
115030
115063
|
}
|
|
115031
115064
|
};
|
|
115032
115065
|
};
|
|
115033
|
-
this.getVesuModifyDelegationAdapter = (id2) => {
|
|
115066
|
+
this.getVesuModifyDelegationAdapter = (id2, delegatee) => {
|
|
115034
115067
|
return () => {
|
|
115035
115068
|
const { addr: VESU_SINGLETON2, isV2 } = getVesuSingletonAddress(this.config.poolId);
|
|
115036
115069
|
const packedArguments = isV2 ? [
|
|
115037
|
-
toBigInt3(
|
|
115070
|
+
toBigInt3(delegatee.toString())
|
|
115038
115071
|
// v2
|
|
115039
115072
|
] : [
|
|
115040
115073
|
this.config.poolId.toBigInt(),
|
|
115041
|
-
toBigInt3(
|
|
115074
|
+
toBigInt3(delegatee.toString())
|
|
115042
115075
|
// v1
|
|
115043
115076
|
];
|
|
115044
115077
|
const output2 = this.constructSimpleLeafData({
|
|
@@ -115047,29 +115080,31 @@ spurious results.`);
|
|
|
115047
115080
|
method: "modify_delegation",
|
|
115048
115081
|
packedArguments
|
|
115049
115082
|
}, isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS);
|
|
115050
|
-
return { leaf: output2, callConstructor: this.getVesuModifyDelegationCall.bind(this) };
|
|
115083
|
+
return { leaf: output2, callConstructor: this.getVesuModifyDelegationCall(delegatee).bind(this) };
|
|
115051
115084
|
};
|
|
115052
115085
|
};
|
|
115053
|
-
this.getVesuModifyDelegationCall = (
|
|
115054
|
-
|
|
115055
|
-
|
|
115056
|
-
|
|
115057
|
-
|
|
115058
|
-
|
|
115059
|
-
|
|
115060
|
-
|
|
115061
|
-
|
|
115062
|
-
|
|
115063
|
-
|
|
115064
|
-
|
|
115065
|
-
|
|
115066
|
-
|
|
115067
|
-
|
|
115068
|
-
|
|
115069
|
-
|
|
115070
|
-
|
|
115071
|
-
|
|
115072
|
-
|
|
115086
|
+
this.getVesuModifyDelegationCall = (delegatee) => {
|
|
115087
|
+
return (params) => {
|
|
115088
|
+
const VESU_SINGLETON2 = getVesuSingletonAddress(this.config.poolId).addr;
|
|
115089
|
+
const { contract, isV2 } = this.getVesuSingletonContract(getMainnetConfig(), this.config.poolId);
|
|
115090
|
+
const call = contract.populate("modify_delegation", isV2 ? {
|
|
115091
|
+
delegatee: delegatee.toBigInt(),
|
|
115092
|
+
delegation: params.delegation
|
|
115093
|
+
} : {
|
|
115094
|
+
pool_id: this.config.poolId.toBigInt(),
|
|
115095
|
+
delegatee: delegatee.toBigInt(),
|
|
115096
|
+
delegation: params.delegation
|
|
115097
|
+
});
|
|
115098
|
+
return {
|
|
115099
|
+
sanitizer: isV2 ? SIMPLE_SANITIZER_V2 : SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
|
|
115100
|
+
call: {
|
|
115101
|
+
contractAddress: VESU_SINGLETON2,
|
|
115102
|
+
selector: hash_exports.getSelectorFromName("modify_delegation"),
|
|
115103
|
+
calldata: [
|
|
115104
|
+
...call.calldata
|
|
115105
|
+
]
|
|
115106
|
+
}
|
|
115107
|
+
};
|
|
115073
115108
|
};
|
|
115074
115109
|
};
|
|
115075
115110
|
this.getDefispringRewardsAdapter = (id2) => {
|
|
@@ -115272,12 +115307,12 @@ spurious results.`);
|
|
|
115272
115307
|
amount: collateralAmount,
|
|
115273
115308
|
token: this.config.collateral,
|
|
115274
115309
|
usdValue: collateralAmount.multipliedBy(token1Price.price).toNumber(),
|
|
115275
|
-
remarks:
|
|
115310
|
+
remarks: `Collateral - ${VesuPoolMetadata[this.config.poolId.address].name} pool`
|
|
115276
115311
|
}, {
|
|
115277
115312
|
amount: debtAmount,
|
|
115278
115313
|
token: this.config.debt,
|
|
115279
115314
|
usdValue: debtAmount.multipliedBy(token2Price.price).toNumber(),
|
|
115280
|
-
remarks:
|
|
115315
|
+
remarks: `Debt - ${VesuPoolMetadata[this.config.poolId.address].name} pool`
|
|
115281
115316
|
}];
|
|
115282
115317
|
this.setCache(CACHE_KEY, value, 6e4);
|
|
115283
115318
|
return value;
|
|
@@ -119406,20 +119441,19 @@ spurious results.`);
|
|
|
119406
119441
|
// todo support lending assets of underlying as well (like if xSTRK looping is not viable, simply supply STRK)
|
|
119407
119442
|
getVesuAdapters() {
|
|
119408
119443
|
const adapters = [];
|
|
119409
|
-
for (const
|
|
119410
|
-
const
|
|
119411
|
-
|
|
119412
|
-
|
|
119413
|
-
|
|
119414
|
-
|
|
119415
|
-
|
|
119416
|
-
|
|
119417
|
-
|
|
119418
|
-
|
|
119419
|
-
|
|
119420
|
-
|
|
119421
|
-
|
|
119422
|
-
}
|
|
119444
|
+
for (const borrowableInfo of this.metadata.additionalInfo.borrowable_assets) {
|
|
119445
|
+
const asset = borrowableInfo.token;
|
|
119446
|
+
const poolId = borrowableInfo.poolId;
|
|
119447
|
+
const vesuAdapter1 = new VesuAdapter({
|
|
119448
|
+
poolId,
|
|
119449
|
+
collateral: this.asset(),
|
|
119450
|
+
debt: asset,
|
|
119451
|
+
vaultAllocator: this.metadata.additionalInfo.vaultAllocator,
|
|
119452
|
+
id: ""
|
|
119453
|
+
});
|
|
119454
|
+
vesuAdapter1.pricer = this.pricer;
|
|
119455
|
+
vesuAdapter1.networkConfig = this.config;
|
|
119456
|
+
adapters.push(vesuAdapter1);
|
|
119423
119457
|
}
|
|
119424
119458
|
return adapters;
|
|
119425
119459
|
}
|
|
@@ -120045,19 +120079,21 @@ spurious results.`);
|
|
|
120045
120079
|
id: getVesuLegId("vesu_leg1" /* VESU_LEG1 */, underlyingToken.symbol, poolId.toString()),
|
|
120046
120080
|
adapter: vesuAdapterLST
|
|
120047
120081
|
}]);
|
|
120048
|
-
const { isV2, addr:
|
|
120082
|
+
const { isV2, addr: poolAddr } = getVesuSingletonAddress(poolId);
|
|
120049
120083
|
const VESU_MULTIPLY = isV2 ? vesuAdapterLST.VESU_MULTIPLY : vesuAdapterLST.VESU_MULTIPLY_V1;
|
|
120050
120084
|
const leafIdApprove = getVesuGenericLegId(poolId.toString(), "multiple_approve" /* MULTIPLE_APPROVE */);
|
|
120051
120085
|
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, VESU_MULTIPLY, leafIdApprove).bind(commonAdapter));
|
|
120052
120086
|
const leafIdDelegationOn = getVesuGenericLegId(poolId.toString(), "switch_delegation_on" /* SWITCH_DELEGATION_ON */);
|
|
120053
|
-
vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter(leafIdDelegationOn).bind(vesuAdapterLST));
|
|
120087
|
+
vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter(leafIdDelegationOn, VESU_MULTIPLY).bind(vesuAdapterLST));
|
|
120054
120088
|
const leafIdDelegationOff = getVesuGenericLegId(poolId.toString(), "switch_delegation_off" /* SWITCH_DELEGATION_OFF */);
|
|
120055
|
-
vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter(leafIdDelegationOff).bind(vesuAdapterLST));
|
|
120089
|
+
vaultSettings.leafAdapters.push(vesuAdapterLST.getVesuModifyDelegationAdapter(leafIdDelegationOff, VESU_MULTIPLY).bind(vesuAdapterLST));
|
|
120056
120090
|
const multiplID = getVesuLegId("multiply_vesu" /* MULTIPLY_VESU */, underlyingToken.symbol, poolId.toString());
|
|
120057
120091
|
vaultSettings.leafAdapters.push(vesuAdapterLST.getMultiplyAdapter(multiplID).bind(vesuAdapterLST));
|
|
120092
|
+
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, poolAddr, "approve_token1" /* APPROVE_TOKEN1 */).bind(commonAdapter));
|
|
120093
|
+
vaultSettings.leafAdapters.push(vesuAdapterLST.getModifyPosition.bind(vesuAdapterLST));
|
|
120058
120094
|
return vesuAdapterLST;
|
|
120059
120095
|
}
|
|
120060
|
-
function getLooperSettings2(lstSymbol, underlyingSymbol, vaultSettings, defaultPoolId
|
|
120096
|
+
function getLooperSettings2(lstSymbol, underlyingSymbol, vaultSettings, defaultPoolId) {
|
|
120061
120097
|
vaultSettings.leafAdapters = [];
|
|
120062
120098
|
const pool1 = vaultSettings.defaultPoolId;
|
|
120063
120099
|
if (!pool1.eq(defaultPoolId)) {
|
|
@@ -120076,10 +120112,11 @@ spurious results.`);
|
|
|
120076
120112
|
id: "common_adapter" /* COMMON */,
|
|
120077
120113
|
adapter: commonAdapter
|
|
120078
120114
|
}]);
|
|
120079
|
-
|
|
120080
|
-
altSupportedPoolIds.map((poolId) => addVesuLeaves(poolId, lstSymbol, underlyingSymbol, vaultSettings, commonAdapter));
|
|
120115
|
+
vaultSettings.borrowable_assets.map((borrowableAsset) => addVesuLeaves(borrowableAsset.poolId, lstSymbol, underlyingSymbol, vaultSettings, commonAdapter));
|
|
120081
120116
|
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, AVNU_EXCHANGE, "avnu_mul_approve_withdr" /* AVNU_MULTIPLY_APPROVE_WITHDRAW */).bind(commonAdapter));
|
|
120082
|
-
|
|
120117
|
+
const uniqueBorrowableAssets = [...new Set(vaultSettings.borrowable_assets.map((borrowableAsset) => borrowableAsset.token.symbol))];
|
|
120118
|
+
for (let borrowableAssetSymbol of uniqueBorrowableAssets) {
|
|
120119
|
+
const borrowableAsset = Global.getDefaultTokens().find((token) => token.symbol === borrowableAssetSymbol);
|
|
120083
120120
|
const debtAsset = borrowableAsset;
|
|
120084
120121
|
const approve_debt_token_id = getAvnuManageIDs("avnu_mul_approve_dep" /* AVNU_MULTIPLY_APPROVE_DEPOSIT */, debtAsset.symbol);
|
|
120085
120122
|
const swap_debt_token_id = getAvnuManageIDs("avnu_mul_swap_dep" /* AVNU_MULTIPLY_SWAP_DEPOSIT */, debtAsset.symbol);
|
|
@@ -120087,23 +120124,9 @@ spurious results.`);
|
|
|
120087
120124
|
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(debtAsset.address, AVNU_EXCHANGE, approve_debt_token_id).bind(commonAdapter));
|
|
120088
120125
|
vaultSettings.leafAdapters.push(commonAdapter.getAvnuAdapter(debtAsset.address, lstToken.address, swap_debt_token_id, false).bind(commonAdapter));
|
|
120089
120126
|
vaultSettings.leafAdapters.push(commonAdapter.getAvnuAdapter(lstToken.address, debtAsset.address, swap_lst_token_id, false).bind(commonAdapter));
|
|
120090
|
-
const vesuAdapter = new VesuAdapter({
|
|
120091
|
-
poolId: pool1,
|
|
120092
|
-
collateral: lstToken,
|
|
120093
|
-
debt: debtAsset,
|
|
120094
|
-
vaultAllocator: vaultSettings.vaultAllocator,
|
|
120095
|
-
id: getVesuLegId("vesu_leg1" /* VESU_LEG1 */, debtAsset.symbol, pool1.toString())
|
|
120096
|
-
});
|
|
120097
|
-
const { isV2, addr: poolAddr } = getVesuSingletonAddress(pool1);
|
|
120098
|
-
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, poolAddr, "approve_token1" /* APPROVE_TOKEN1 */).bind(commonAdapter));
|
|
120099
|
-
vaultSettings.leafAdapters.push(vesuAdapter.getModifyPosition.bind(vesuAdapter));
|
|
120100
|
-
if (borrowableAsset.address.eq(underlyingToken.address)) {
|
|
120101
|
-
continue;
|
|
120102
|
-
}
|
|
120103
120127
|
}
|
|
120104
120128
|
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(lstToken.address, vaultSettings.vaultAddress, "approve_bring_liquidity" /* APPROVE_BRING_LIQUIDITY */).bind(commonAdapter));
|
|
120105
120129
|
vaultSettings.leafAdapters.push(commonAdapter.getBringLiquidityAdapter("bring_liquidity" /* BRING_LIQUIDITY */).bind(commonAdapter));
|
|
120106
|
-
vaultSettings.leafAdapters.push(vesuAdapterLST.getDefispringRewardsAdapter("defispring_rewards" /* DEFISPRING_REWARDS */).bind(vesuAdapterLST));
|
|
120107
120130
|
const STRKToken = Global.getDefaultTokens().find((token) => token.symbol === "STRK");
|
|
120108
120131
|
vaultSettings.leafAdapters.push(commonAdapter.getApproveAdapter(STRKToken.address, AVNU_EXCHANGE, "approve_swap_token1" /* APPROVE_SWAP_TOKEN1 */).bind(commonAdapter));
|
|
120109
120132
|
vaultSettings.leafAdapters.push(commonAdapter.getAvnuAdapter(STRKToken.address, lstToken.address, "avnu_swap_rewards" /* AVNU_SWAP_REWARDS */, false).bind(commonAdapter));
|
|
@@ -120162,7 +120185,7 @@ spurious results.`);
|
|
|
120162
120185
|
{ type: "Technical Risk" /* TECHNICAL_RISK */, value: 1 /* STABLE_INFRASTRUCTURE */, weight: 25, reason: "Liquidation can only happen if vault is left un-monitored for weeks, which is highly unlikely. We actively monitor all services on a daily basis." },
|
|
120163
120186
|
{ type: "Depeg Risk" /* DEPEG_RISK */, value: 2 /* GENERALLY_STABLE */, weight: 25, reason: "Generally stable pegged assets" }
|
|
120164
120187
|
];
|
|
120165
|
-
var
|
|
120188
|
+
var btcBorrowableAssets = [
|
|
120166
120189
|
"WBTC",
|
|
120167
120190
|
"tBTC",
|
|
120168
120191
|
"LBTC",
|
|
@@ -120178,10 +120201,14 @@ spurious results.`);
|
|
|
120178
120201
|
adapters: [],
|
|
120179
120202
|
targetHealthFactor: 1.1,
|
|
120180
120203
|
minHealthFactor: 1.05,
|
|
120181
|
-
borrowable_assets:
|
|
120204
|
+
borrowable_assets: [
|
|
120205
|
+
...Global.getDefaultTokens().filter((token) => token.symbol === "STRK").map((token) => ({ token, poolId: VesuPools.Re7xSTRK })),
|
|
120206
|
+
...Global.getDefaultTokens().filter((token) => token.symbol === "STRK").map((token) => ({ token, poolId: VesuPools.Prime })),
|
|
120207
|
+
...Global.getDefaultTokens().filter((token) => token.symbol === "STRK").map((token) => ({ token, poolId: VesuPools.Re7STRK }))
|
|
120208
|
+
// v2, new alt for Re7xSTRK
|
|
120209
|
+
],
|
|
120182
120210
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "STRK"),
|
|
120183
|
-
defaultPoolId: VesuPools.Re7xSTRK
|
|
120184
|
-
altSupportedPoolIds: [VesuPools.Prime]
|
|
120211
|
+
defaultPoolId: VesuPools.Re7xSTRK
|
|
120185
120212
|
};
|
|
120186
120213
|
var hyperxWBTC = {
|
|
120187
120214
|
vaultAddress: ContractAddr.from("0x2da9d0f96a46b453f55604313785dc866424240b1c6811d13bef594343db818"),
|
|
@@ -120193,10 +120220,14 @@ spurious results.`);
|
|
|
120193
120220
|
adapters: [],
|
|
120194
120221
|
targetHealthFactor: 1.1,
|
|
120195
120222
|
minHealthFactor: 1.05,
|
|
120196
|
-
borrowable_assets:
|
|
120223
|
+
borrowable_assets: [
|
|
120224
|
+
// allow all BTC flavours borrowing on Re7xBTC pool
|
|
120225
|
+
...btcBorrowableAssets.map((asset) => Global.getDefaultTokens().find((token) => token.symbol === asset)).map((token) => ({ token, poolId: VesuPools.Re7xBTC })),
|
|
120226
|
+
// allow only WBTC borrowing on Prime pool
|
|
120227
|
+
...Global.getDefaultTokens().filter((token) => token.symbol === "WBTC").map((token) => ({ token, poolId: VesuPools.Prime }))
|
|
120228
|
+
],
|
|
120197
120229
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "WBTC"),
|
|
120198
120230
|
defaultPoolId: VesuPools.Re7xBTC,
|
|
120199
|
-
altSupportedPoolIds: [VesuPools.Prime],
|
|
120200
120231
|
redemptionRouter: ContractAddr.from("0x6ea649f402898f69baf775c1afdd08522c071c640b9c4460192070ec2b96417")
|
|
120201
120232
|
};
|
|
120202
120233
|
var hyperxtBTC = {
|
|
@@ -120209,10 +120240,11 @@ spurious results.`);
|
|
|
120209
120240
|
adapters: [],
|
|
120210
120241
|
targetHealthFactor: 1.1,
|
|
120211
120242
|
minHealthFactor: 1.05,
|
|
120212
|
-
borrowable_assets:
|
|
120243
|
+
borrowable_assets: [
|
|
120244
|
+
...Global.getDefaultTokens().filter((token) => token.symbol === "tBTC" || token.symbol === "WBTC").map((token) => ({ token, poolId: VesuPools.Re7xBTC }))
|
|
120245
|
+
],
|
|
120213
120246
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "tBTC"),
|
|
120214
120247
|
defaultPoolId: VesuPools.Re7xBTC,
|
|
120215
|
-
altSupportedPoolIds: [],
|
|
120216
120248
|
redemptionRouter: ContractAddr.from("0x3de9c409d1e357e25778fb7a3e2e2393666956846a5c2caa607296fa8e76b5d")
|
|
120217
120249
|
};
|
|
120218
120250
|
var hyperxsBTC = {
|
|
@@ -120225,10 +120257,11 @@ spurious results.`);
|
|
|
120225
120257
|
adapters: [],
|
|
120226
120258
|
targetHealthFactor: 1.1,
|
|
120227
120259
|
minHealthFactor: 1.05,
|
|
120228
|
-
borrowable_assets:
|
|
120260
|
+
borrowable_assets: [
|
|
120261
|
+
...Global.getDefaultTokens().filter((token) => token.symbol === "solvBTC").map((token) => ({ token, poolId: VesuPools.Re7xBTC }))
|
|
120262
|
+
],
|
|
120229
120263
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "solvBTC"),
|
|
120230
|
-
defaultPoolId: VesuPools.Re7xBTC
|
|
120231
|
-
altSupportedPoolIds: []
|
|
120264
|
+
defaultPoolId: VesuPools.Re7xBTC
|
|
120232
120265
|
};
|
|
120233
120266
|
var hyperxLBTC = {
|
|
120234
120267
|
vaultAddress: ContractAddr.from("0x64cf24d4883fe569926419a0569ab34497c6956a1a308fa883257f7486d7030"),
|
|
@@ -120240,10 +120273,11 @@ spurious results.`);
|
|
|
120240
120273
|
adapters: [],
|
|
120241
120274
|
targetHealthFactor: 1.1,
|
|
120242
120275
|
minHealthFactor: 1.05,
|
|
120243
|
-
borrowable_assets:
|
|
120276
|
+
borrowable_assets: [
|
|
120277
|
+
...Global.getDefaultTokens().filter((token) => token.symbol === "LBTC").map((token) => ({ token, poolId: VesuPools.Re7xBTC }))
|
|
120278
|
+
],
|
|
120244
120279
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "LBTC"),
|
|
120245
|
-
defaultPoolId: VesuPools.Re7xBTC
|
|
120246
|
-
altSupportedPoolIds: []
|
|
120280
|
+
defaultPoolId: VesuPools.Re7xBTC
|
|
120247
120281
|
};
|
|
120248
120282
|
function getInvestmentSteps(lstSymbol, underlyingSymbol) {
|
|
120249
120283
|
return [
|
|
@@ -120339,12 +120373,12 @@ spurious results.`);
|
|
|
120339
120373
|
tab: "withdraw"
|
|
120340
120374
|
}]
|
|
120341
120375
|
};
|
|
120342
|
-
function getStrategySettings(lstSymbol, underlyingSymbol,
|
|
120376
|
+
function getStrategySettings(lstSymbol, underlyingSymbol, settings2, isPreview = false) {
|
|
120343
120377
|
return {
|
|
120344
120378
|
id: `hyper_${lstSymbol.toLowerCase()}`,
|
|
120345
120379
|
name: `Hyper ${lstSymbol}`,
|
|
120346
120380
|
description: getDescription2(lstSymbol, underlyingSymbol),
|
|
120347
|
-
address:
|
|
120381
|
+
address: settings2.vaultAddress,
|
|
120348
120382
|
launchBlock: 0,
|
|
120349
120383
|
type: "Other",
|
|
120350
120384
|
vaultType: {
|
|
@@ -120359,7 +120393,7 @@ spurious results.`);
|
|
|
120359
120393
|
additionalInfo: getLooperSettings2(
|
|
120360
120394
|
lstSymbol,
|
|
120361
120395
|
underlyingSymbol,
|
|
120362
|
-
|
|
120396
|
+
settings2,
|
|
120363
120397
|
lstSymbol === "xSTRK" ? VesuPools.Re7xSTRK : VesuPools.Re7xBTC
|
|
120364
120398
|
),
|
|
120365
120399
|
risk: {
|
|
@@ -120377,7 +120411,7 @@ spurious results.`);
|
|
|
120377
120411
|
logo: "https://assets.troves.fi/integrations/unwraplabs/white.png"
|
|
120378
120412
|
},
|
|
120379
120413
|
settings: createHyperLSTSettings(lstSymbol, underlyingSymbol),
|
|
120380
|
-
contractDetails: getContractDetails(
|
|
120414
|
+
contractDetails: getContractDetails(settings2),
|
|
120381
120415
|
faqs: getFAQs2(lstSymbol, underlyingSymbol),
|
|
120382
120416
|
investmentSteps: getInvestmentSteps(lstSymbol, underlyingSymbol),
|
|
120383
120417
|
isPreview,
|