@strkfarm/sdk 1.1.46 → 1.1.48
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 +25 -23
- package/dist/index.browser.mjs +25 -25
- package/dist/index.js +25 -25
- package/dist/index.mjs +25 -25
- package/package.json +1 -1
- package/src/modules/harvests.ts +11 -9
- package/src/strategies/universal-lst-muliplier-strategy.tsx +4 -4
|
@@ -55715,17 +55715,6 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
55715
55715
|
return res.data;
|
|
55716
55716
|
}
|
|
55717
55717
|
|
|
55718
|
-
// src/strategies/constants.ts
|
|
55719
|
-
var COMMON_CONTRACTS = [{
|
|
55720
|
-
address: ContractAddr.from("0x0636a3f51cc37f5729e4da4b1de6a8549a28f3c0d5bf3b17f150971e451ff9c2"),
|
|
55721
|
-
name: "Access Controller",
|
|
55722
|
-
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
|
|
55723
|
-
}];
|
|
55724
|
-
var ENDPOINTS = {
|
|
55725
|
-
VESU_BASE: "https://proxy.api.troves.fi/vesu",
|
|
55726
|
-
VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
|
|
55727
|
-
};
|
|
55728
|
-
|
|
55729
55718
|
// src/modules/harvests.ts
|
|
55730
55719
|
var Harvests = class _Harvests {
|
|
55731
55720
|
constructor(config3) {
|
|
@@ -55783,17 +55772,19 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
55783
55772
|
}
|
|
55784
55773
|
};
|
|
55785
55774
|
var VESU_REWARDS_CONTRACT = ContractAddr.from("0x0387f3eb1d98632fbe3440a9f1385Aec9d87b6172491d3Dd81f1c35A7c61048F");
|
|
55775
|
+
var VESU_REWARDS_ENDPOINT = "https://staging.api.vesu.xyz";
|
|
55786
55776
|
var VesuHarvests = class _VesuHarvests extends Harvests {
|
|
55787
|
-
async getHarvests(addr) {
|
|
55788
|
-
const result2 = await fetch(`${
|
|
55789
|
-
const
|
|
55777
|
+
async getHarvests(addr, endpoint = VESU_REWARDS_ENDPOINT) {
|
|
55778
|
+
const result2 = await fetch(`${endpoint}/users/${addr.address}/rewards/calldata`);
|
|
55779
|
+
const _data = await result2.json();
|
|
55790
55780
|
const rewardsContract = VESU_REWARDS_CONTRACT;
|
|
55791
55781
|
const cls = await this.config.provider.getClassAt(rewardsContract.address);
|
|
55792
55782
|
const contract = new Contract({ abi: cls.abi, address: rewardsContract.address, providerOrAccount: this.config.provider });
|
|
55793
55783
|
const _claimed_amount = await contract.call("amount_already_claimed", [addr.address]);
|
|
55794
55784
|
const claimed_amount = Web3Number.fromWei(_claimed_amount.toString(), 18);
|
|
55795
55785
|
logger2.verbose(`${_VesuHarvests.name}: claimed_amount: ${claimed_amount.toString()}`);
|
|
55796
|
-
const
|
|
55786
|
+
const data = _data.data["defiSpring"];
|
|
55787
|
+
const actualReward = Web3Number.fromWei(data.amount, 18).minus(claimed_amount);
|
|
55797
55788
|
logger2.verbose(`${_VesuHarvests.name}: actualReward: ${actualReward.toString()}`);
|
|
55798
55789
|
return [{
|
|
55799
55790
|
rewardsContract,
|
|
@@ -55802,15 +55793,15 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
55802
55793
|
endDate: /* @__PURE__ */ new Date(0),
|
|
55803
55794
|
claim: {
|
|
55804
55795
|
id: 0,
|
|
55805
|
-
amount: Web3Number.fromWei(num_exports.getDecimalString(data.
|
|
55796
|
+
amount: Web3Number.fromWei(num_exports.getDecimalString(data.amount), 18),
|
|
55806
55797
|
claimee: addr
|
|
55807
55798
|
},
|
|
55808
55799
|
actualReward,
|
|
55809
|
-
proof: data.
|
|
55800
|
+
proof: data.proof
|
|
55810
55801
|
}];
|
|
55811
55802
|
}
|
|
55812
|
-
async getUnHarvestedRewards(addr) {
|
|
55813
|
-
return await this.getHarvests(addr);
|
|
55803
|
+
async getUnHarvestedRewards(addr, endpoint = VESU_REWARDS_ENDPOINT) {
|
|
55804
|
+
return await this.getHarvests(addr, endpoint);
|
|
55814
55805
|
}
|
|
55815
55806
|
};
|
|
55816
55807
|
|
|
@@ -61263,6 +61254,17 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
61263
61254
|
]
|
|
61264
61255
|
};
|
|
61265
61256
|
|
|
61257
|
+
// src/strategies/constants.ts
|
|
61258
|
+
var COMMON_CONTRACTS = [{
|
|
61259
|
+
address: ContractAddr.from("0x0636a3f51cc37f5729e4da4b1de6a8549a28f3c0d5bf3b17f150971e451ff9c2"),
|
|
61260
|
+
name: "Access Controller",
|
|
61261
|
+
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
|
|
61262
|
+
}];
|
|
61263
|
+
var ENDPOINTS = {
|
|
61264
|
+
VESU_BASE: "https://proxy.api.troves.fi/vesu",
|
|
61265
|
+
VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
|
|
61266
|
+
};
|
|
61267
|
+
|
|
61266
61268
|
// src/strategies/vesu-rebalance.tsx
|
|
61267
61269
|
var import_jsx_runtime2 = __toESM(require_jsx_runtime());
|
|
61268
61270
|
var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
@@ -94907,7 +94909,7 @@ spurious results.`);
|
|
|
94907
94909
|
* @param params
|
|
94908
94910
|
*/
|
|
94909
94911
|
async getVesuMultiplyCall(params) {
|
|
94910
|
-
const
|
|
94912
|
+
const vesuAdapter1 = this.getVesuSameTokenAdapter();
|
|
94911
94913
|
const legLTV = await vesuAdapter1.getLTVConfig(this.config);
|
|
94912
94914
|
logger2.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
|
|
94913
94915
|
if (!params.isDeposit) {
|
|
@@ -95383,7 +95385,7 @@ spurious results.`);
|
|
|
95383
95385
|
adapters: [],
|
|
95384
95386
|
targetHealthFactor: 1.1,
|
|
95385
95387
|
minHealthFactor: 1.05,
|
|
95386
|
-
borrowable_assets:
|
|
95388
|
+
borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "tBTC" || token.symbol === "WBTC"),
|
|
95387
95389
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "tBTC")
|
|
95388
95390
|
};
|
|
95389
95391
|
var hyperxsBTC = {
|
|
@@ -95396,7 +95398,7 @@ spurious results.`);
|
|
|
95396
95398
|
adapters: [],
|
|
95397
95399
|
targetHealthFactor: 1.1,
|
|
95398
95400
|
minHealthFactor: 1.05,
|
|
95399
|
-
borrowable_assets:
|
|
95401
|
+
borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "solvBTC"),
|
|
95400
95402
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "solvBTC")
|
|
95401
95403
|
};
|
|
95402
95404
|
var hyperxLBTC = {
|
|
@@ -95409,7 +95411,7 @@ spurious results.`);
|
|
|
95409
95411
|
adapters: [],
|
|
95410
95412
|
targetHealthFactor: 1.1,
|
|
95411
95413
|
minHealthFactor: 1.05,
|
|
95412
|
-
borrowable_assets:
|
|
95414
|
+
borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "LBTC"),
|
|
95413
95415
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "LBTC")
|
|
95414
95416
|
};
|
|
95415
95417
|
function getInvestmentSteps(lstSymbol, underlyingSymbol) {
|
package/dist/index.browser.mjs
CHANGED
|
@@ -4116,19 +4116,6 @@ async function getAPIUsingHeadlessBrowser(url) {
|
|
|
4116
4116
|
|
|
4117
4117
|
// src/modules/harvests.ts
|
|
4118
4118
|
import { Contract as Contract4, num as num3 } from "starknet";
|
|
4119
|
-
|
|
4120
|
-
// src/strategies/constants.ts
|
|
4121
|
-
var COMMON_CONTRACTS = [{
|
|
4122
|
-
address: ContractAddr.from("0x0636a3f51cc37f5729e4da4b1de6a8549a28f3c0d5bf3b17f150971e451ff9c2"),
|
|
4123
|
-
name: "Access Controller",
|
|
4124
|
-
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
|
|
4125
|
-
}];
|
|
4126
|
-
var ENDPOINTS = {
|
|
4127
|
-
VESU_BASE: "https://proxy.api.troves.fi/vesu",
|
|
4128
|
-
VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
|
|
4129
|
-
};
|
|
4130
|
-
|
|
4131
|
-
// src/modules/harvests.ts
|
|
4132
4119
|
var Harvests = class _Harvests {
|
|
4133
4120
|
constructor(config) {
|
|
4134
4121
|
this.config = config;
|
|
@@ -4185,17 +4172,19 @@ var EkuboHarvests = class extends Harvests {
|
|
|
4185
4172
|
}
|
|
4186
4173
|
};
|
|
4187
4174
|
var VESU_REWARDS_CONTRACT = ContractAddr.from("0x0387f3eb1d98632fbe3440a9f1385Aec9d87b6172491d3Dd81f1c35A7c61048F");
|
|
4175
|
+
var VESU_REWARDS_ENDPOINT = "https://staging.api.vesu.xyz";
|
|
4188
4176
|
var VesuHarvests = class _VesuHarvests extends Harvests {
|
|
4189
|
-
async getHarvests(addr) {
|
|
4190
|
-
const result = await fetch(`${
|
|
4191
|
-
const
|
|
4177
|
+
async getHarvests(addr, endpoint = VESU_REWARDS_ENDPOINT) {
|
|
4178
|
+
const result = await fetch(`${endpoint}/users/${addr.address}/rewards/calldata`);
|
|
4179
|
+
const _data = await result.json();
|
|
4192
4180
|
const rewardsContract = VESU_REWARDS_CONTRACT;
|
|
4193
4181
|
const cls = await this.config.provider.getClassAt(rewardsContract.address);
|
|
4194
4182
|
const contract = new Contract4({ abi: cls.abi, address: rewardsContract.address, providerOrAccount: this.config.provider });
|
|
4195
4183
|
const _claimed_amount = await contract.call("amount_already_claimed", [addr.address]);
|
|
4196
4184
|
const claimed_amount = Web3Number.fromWei(_claimed_amount.toString(), 18);
|
|
4197
4185
|
logger.verbose(`${_VesuHarvests.name}: claimed_amount: ${claimed_amount.toString()}`);
|
|
4198
|
-
const
|
|
4186
|
+
const data = _data.data["defiSpring"];
|
|
4187
|
+
const actualReward = Web3Number.fromWei(data.amount, 18).minus(claimed_amount);
|
|
4199
4188
|
logger.verbose(`${_VesuHarvests.name}: actualReward: ${actualReward.toString()}`);
|
|
4200
4189
|
return [{
|
|
4201
4190
|
rewardsContract,
|
|
@@ -4204,15 +4193,15 @@ var VesuHarvests = class _VesuHarvests extends Harvests {
|
|
|
4204
4193
|
endDate: /* @__PURE__ */ new Date(0),
|
|
4205
4194
|
claim: {
|
|
4206
4195
|
id: 0,
|
|
4207
|
-
amount: Web3Number.fromWei(num3.getDecimalString(data.
|
|
4196
|
+
amount: Web3Number.fromWei(num3.getDecimalString(data.amount), 18),
|
|
4208
4197
|
claimee: addr
|
|
4209
4198
|
},
|
|
4210
4199
|
actualReward,
|
|
4211
|
-
proof: data.
|
|
4200
|
+
proof: data.proof
|
|
4212
4201
|
}];
|
|
4213
4202
|
}
|
|
4214
|
-
async getUnHarvestedRewards(addr) {
|
|
4215
|
-
return await this.getHarvests(addr);
|
|
4203
|
+
async getUnHarvestedRewards(addr, endpoint = VESU_REWARDS_ENDPOINT) {
|
|
4204
|
+
return await this.getHarvests(addr, endpoint);
|
|
4216
4205
|
}
|
|
4217
4206
|
};
|
|
4218
4207
|
|
|
@@ -9665,6 +9654,17 @@ var vesu_pools_default = {
|
|
|
9665
9654
|
]
|
|
9666
9655
|
};
|
|
9667
9656
|
|
|
9657
|
+
// src/strategies/constants.ts
|
|
9658
|
+
var COMMON_CONTRACTS = [{
|
|
9659
|
+
address: ContractAddr.from("0x0636a3f51cc37f5729e4da4b1de6a8549a28f3c0d5bf3b17f150971e451ff9c2"),
|
|
9660
|
+
name: "Access Controller",
|
|
9661
|
+
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
|
|
9662
|
+
}];
|
|
9663
|
+
var ENDPOINTS = {
|
|
9664
|
+
VESU_BASE: "https://proxy.api.troves.fi/vesu",
|
|
9665
|
+
VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
|
|
9666
|
+
};
|
|
9667
|
+
|
|
9668
9668
|
// src/strategies/vesu-rebalance.tsx
|
|
9669
9669
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
9670
9670
|
var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
@@ -31002,7 +31002,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
|
|
|
31002
31002
|
* @param params
|
|
31003
31003
|
*/
|
|
31004
31004
|
async getVesuMultiplyCall(params) {
|
|
31005
|
-
const
|
|
31005
|
+
const vesuAdapter1 = this.getVesuSameTokenAdapter();
|
|
31006
31006
|
const legLTV = await vesuAdapter1.getLTVConfig(this.config);
|
|
31007
31007
|
logger.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
|
|
31008
31008
|
if (!params.isDeposit) {
|
|
@@ -31478,7 +31478,7 @@ var hyperxtBTC = {
|
|
|
31478
31478
|
adapters: [],
|
|
31479
31479
|
targetHealthFactor: 1.1,
|
|
31480
31480
|
minHealthFactor: 1.05,
|
|
31481
|
-
borrowable_assets:
|
|
31481
|
+
borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "tBTC" || token.symbol === "WBTC"),
|
|
31482
31482
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "tBTC")
|
|
31483
31483
|
};
|
|
31484
31484
|
var hyperxsBTC = {
|
|
@@ -31491,7 +31491,7 @@ var hyperxsBTC = {
|
|
|
31491
31491
|
adapters: [],
|
|
31492
31492
|
targetHealthFactor: 1.1,
|
|
31493
31493
|
minHealthFactor: 1.05,
|
|
31494
|
-
borrowable_assets:
|
|
31494
|
+
borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "solvBTC"),
|
|
31495
31495
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "solvBTC")
|
|
31496
31496
|
};
|
|
31497
31497
|
var hyperxLBTC = {
|
|
@@ -31504,7 +31504,7 @@ var hyperxLBTC = {
|
|
|
31504
31504
|
adapters: [],
|
|
31505
31505
|
targetHealthFactor: 1.1,
|
|
31506
31506
|
minHealthFactor: 1.05,
|
|
31507
|
-
borrowable_assets:
|
|
31507
|
+
borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "LBTC"),
|
|
31508
31508
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "LBTC")
|
|
31509
31509
|
};
|
|
31510
31510
|
function getInvestmentSteps(lstSymbol, underlyingSymbol) {
|
package/dist/index.js
CHANGED
|
@@ -4120,19 +4120,6 @@ async function getAPIUsingHeadlessBrowser(url) {
|
|
|
4120
4120
|
|
|
4121
4121
|
// src/modules/harvests.ts
|
|
4122
4122
|
var import_starknet9 = require("starknet");
|
|
4123
|
-
|
|
4124
|
-
// src/strategies/constants.ts
|
|
4125
|
-
var COMMON_CONTRACTS = [{
|
|
4126
|
-
address: ContractAddr.from("0x0636a3f51cc37f5729e4da4b1de6a8549a28f3c0d5bf3b17f150971e451ff9c2"),
|
|
4127
|
-
name: "Access Controller",
|
|
4128
|
-
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
|
|
4129
|
-
}];
|
|
4130
|
-
var ENDPOINTS = {
|
|
4131
|
-
VESU_BASE: "https://proxy.api.troves.fi/vesu",
|
|
4132
|
-
VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
|
|
4133
|
-
};
|
|
4134
|
-
|
|
4135
|
-
// src/modules/harvests.ts
|
|
4136
4123
|
var Harvests = class _Harvests {
|
|
4137
4124
|
constructor(config) {
|
|
4138
4125
|
this.config = config;
|
|
@@ -4189,17 +4176,19 @@ var EkuboHarvests = class extends Harvests {
|
|
|
4189
4176
|
}
|
|
4190
4177
|
};
|
|
4191
4178
|
var VESU_REWARDS_CONTRACT = ContractAddr.from("0x0387f3eb1d98632fbe3440a9f1385Aec9d87b6172491d3Dd81f1c35A7c61048F");
|
|
4179
|
+
var VESU_REWARDS_ENDPOINT = "https://staging.api.vesu.xyz";
|
|
4192
4180
|
var VesuHarvests = class _VesuHarvests extends Harvests {
|
|
4193
|
-
async getHarvests(addr) {
|
|
4194
|
-
const result = await fetch(`${
|
|
4195
|
-
const
|
|
4181
|
+
async getHarvests(addr, endpoint = VESU_REWARDS_ENDPOINT) {
|
|
4182
|
+
const result = await fetch(`${endpoint}/users/${addr.address}/rewards/calldata`);
|
|
4183
|
+
const _data = await result.json();
|
|
4196
4184
|
const rewardsContract = VESU_REWARDS_CONTRACT;
|
|
4197
4185
|
const cls = await this.config.provider.getClassAt(rewardsContract.address);
|
|
4198
4186
|
const contract = new import_starknet9.Contract({ abi: cls.abi, address: rewardsContract.address, providerOrAccount: this.config.provider });
|
|
4199
4187
|
const _claimed_amount = await contract.call("amount_already_claimed", [addr.address]);
|
|
4200
4188
|
const claimed_amount = Web3Number.fromWei(_claimed_amount.toString(), 18);
|
|
4201
4189
|
logger.verbose(`${_VesuHarvests.name}: claimed_amount: ${claimed_amount.toString()}`);
|
|
4202
|
-
const
|
|
4190
|
+
const data = _data.data["defiSpring"];
|
|
4191
|
+
const actualReward = Web3Number.fromWei(data.amount, 18).minus(claimed_amount);
|
|
4203
4192
|
logger.verbose(`${_VesuHarvests.name}: actualReward: ${actualReward.toString()}`);
|
|
4204
4193
|
return [{
|
|
4205
4194
|
rewardsContract,
|
|
@@ -4208,15 +4197,15 @@ var VesuHarvests = class _VesuHarvests extends Harvests {
|
|
|
4208
4197
|
endDate: /* @__PURE__ */ new Date(0),
|
|
4209
4198
|
claim: {
|
|
4210
4199
|
id: 0,
|
|
4211
|
-
amount: Web3Number.fromWei(import_starknet9.num.getDecimalString(data.
|
|
4200
|
+
amount: Web3Number.fromWei(import_starknet9.num.getDecimalString(data.amount), 18),
|
|
4212
4201
|
claimee: addr
|
|
4213
4202
|
},
|
|
4214
4203
|
actualReward,
|
|
4215
|
-
proof: data.
|
|
4204
|
+
proof: data.proof
|
|
4216
4205
|
}];
|
|
4217
4206
|
}
|
|
4218
|
-
async getUnHarvestedRewards(addr) {
|
|
4219
|
-
return await this.getHarvests(addr);
|
|
4207
|
+
async getUnHarvestedRewards(addr, endpoint = VESU_REWARDS_ENDPOINT) {
|
|
4208
|
+
return await this.getHarvests(addr, endpoint);
|
|
4220
4209
|
}
|
|
4221
4210
|
};
|
|
4222
4211
|
|
|
@@ -9669,6 +9658,17 @@ var vesu_pools_default = {
|
|
|
9669
9658
|
]
|
|
9670
9659
|
};
|
|
9671
9660
|
|
|
9661
|
+
// src/strategies/constants.ts
|
|
9662
|
+
var COMMON_CONTRACTS = [{
|
|
9663
|
+
address: ContractAddr.from("0x0636a3f51cc37f5729e4da4b1de6a8549a28f3c0d5bf3b17f150971e451ff9c2"),
|
|
9664
|
+
name: "Access Controller",
|
|
9665
|
+
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
|
|
9666
|
+
}];
|
|
9667
|
+
var ENDPOINTS = {
|
|
9668
|
+
VESU_BASE: "https://proxy.api.troves.fi/vesu",
|
|
9669
|
+
VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
|
|
9670
|
+
};
|
|
9671
|
+
|
|
9672
9672
|
// src/strategies/vesu-rebalance.tsx
|
|
9673
9673
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
9674
9674
|
var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
@@ -31002,7 +31002,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
|
|
|
31002
31002
|
* @param params
|
|
31003
31003
|
*/
|
|
31004
31004
|
async getVesuMultiplyCall(params) {
|
|
31005
|
-
const
|
|
31005
|
+
const vesuAdapter1 = this.getVesuSameTokenAdapter();
|
|
31006
31006
|
const legLTV = await vesuAdapter1.getLTVConfig(this.config);
|
|
31007
31007
|
logger.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
|
|
31008
31008
|
if (!params.isDeposit) {
|
|
@@ -31478,7 +31478,7 @@ var hyperxtBTC = {
|
|
|
31478
31478
|
adapters: [],
|
|
31479
31479
|
targetHealthFactor: 1.1,
|
|
31480
31480
|
minHealthFactor: 1.05,
|
|
31481
|
-
borrowable_assets:
|
|
31481
|
+
borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "tBTC" || token.symbol === "WBTC"),
|
|
31482
31482
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "tBTC")
|
|
31483
31483
|
};
|
|
31484
31484
|
var hyperxsBTC = {
|
|
@@ -31491,7 +31491,7 @@ var hyperxsBTC = {
|
|
|
31491
31491
|
adapters: [],
|
|
31492
31492
|
targetHealthFactor: 1.1,
|
|
31493
31493
|
minHealthFactor: 1.05,
|
|
31494
|
-
borrowable_assets:
|
|
31494
|
+
borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "solvBTC"),
|
|
31495
31495
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "solvBTC")
|
|
31496
31496
|
};
|
|
31497
31497
|
var hyperxLBTC = {
|
|
@@ -31504,7 +31504,7 @@ var hyperxLBTC = {
|
|
|
31504
31504
|
adapters: [],
|
|
31505
31505
|
targetHealthFactor: 1.1,
|
|
31506
31506
|
minHealthFactor: 1.05,
|
|
31507
|
-
borrowable_assets:
|
|
31507
|
+
borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "LBTC"),
|
|
31508
31508
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "LBTC")
|
|
31509
31509
|
};
|
|
31510
31510
|
function getInvestmentSteps(lstSymbol, underlyingSymbol) {
|
package/dist/index.mjs
CHANGED
|
@@ -4014,19 +4014,6 @@ async function getAPIUsingHeadlessBrowser(url) {
|
|
|
4014
4014
|
|
|
4015
4015
|
// src/modules/harvests.ts
|
|
4016
4016
|
import { Contract as Contract4, num as num3 } from "starknet";
|
|
4017
|
-
|
|
4018
|
-
// src/strategies/constants.ts
|
|
4019
|
-
var COMMON_CONTRACTS = [{
|
|
4020
|
-
address: ContractAddr.from("0x0636a3f51cc37f5729e4da4b1de6a8549a28f3c0d5bf3b17f150971e451ff9c2"),
|
|
4021
|
-
name: "Access Controller",
|
|
4022
|
-
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
|
|
4023
|
-
}];
|
|
4024
|
-
var ENDPOINTS = {
|
|
4025
|
-
VESU_BASE: "https://proxy.api.troves.fi/vesu",
|
|
4026
|
-
VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
|
|
4027
|
-
};
|
|
4028
|
-
|
|
4029
|
-
// src/modules/harvests.ts
|
|
4030
4017
|
var Harvests = class _Harvests {
|
|
4031
4018
|
constructor(config) {
|
|
4032
4019
|
this.config = config;
|
|
@@ -4083,17 +4070,19 @@ var EkuboHarvests = class extends Harvests {
|
|
|
4083
4070
|
}
|
|
4084
4071
|
};
|
|
4085
4072
|
var VESU_REWARDS_CONTRACT = ContractAddr.from("0x0387f3eb1d98632fbe3440a9f1385Aec9d87b6172491d3Dd81f1c35A7c61048F");
|
|
4073
|
+
var VESU_REWARDS_ENDPOINT = "https://staging.api.vesu.xyz";
|
|
4086
4074
|
var VesuHarvests = class _VesuHarvests extends Harvests {
|
|
4087
|
-
async getHarvests(addr) {
|
|
4088
|
-
const result = await fetch(`${
|
|
4089
|
-
const
|
|
4075
|
+
async getHarvests(addr, endpoint = VESU_REWARDS_ENDPOINT) {
|
|
4076
|
+
const result = await fetch(`${endpoint}/users/${addr.address}/rewards/calldata`);
|
|
4077
|
+
const _data = await result.json();
|
|
4090
4078
|
const rewardsContract = VESU_REWARDS_CONTRACT;
|
|
4091
4079
|
const cls = await this.config.provider.getClassAt(rewardsContract.address);
|
|
4092
4080
|
const contract = new Contract4({ abi: cls.abi, address: rewardsContract.address, providerOrAccount: this.config.provider });
|
|
4093
4081
|
const _claimed_amount = await contract.call("amount_already_claimed", [addr.address]);
|
|
4094
4082
|
const claimed_amount = Web3Number.fromWei(_claimed_amount.toString(), 18);
|
|
4095
4083
|
logger.verbose(`${_VesuHarvests.name}: claimed_amount: ${claimed_amount.toString()}`);
|
|
4096
|
-
const
|
|
4084
|
+
const data = _data.data["defiSpring"];
|
|
4085
|
+
const actualReward = Web3Number.fromWei(data.amount, 18).minus(claimed_amount);
|
|
4097
4086
|
logger.verbose(`${_VesuHarvests.name}: actualReward: ${actualReward.toString()}`);
|
|
4098
4087
|
return [{
|
|
4099
4088
|
rewardsContract,
|
|
@@ -4102,15 +4091,15 @@ var VesuHarvests = class _VesuHarvests extends Harvests {
|
|
|
4102
4091
|
endDate: /* @__PURE__ */ new Date(0),
|
|
4103
4092
|
claim: {
|
|
4104
4093
|
id: 0,
|
|
4105
|
-
amount: Web3Number.fromWei(num3.getDecimalString(data.
|
|
4094
|
+
amount: Web3Number.fromWei(num3.getDecimalString(data.amount), 18),
|
|
4106
4095
|
claimee: addr
|
|
4107
4096
|
},
|
|
4108
4097
|
actualReward,
|
|
4109
|
-
proof: data.
|
|
4098
|
+
proof: data.proof
|
|
4110
4099
|
}];
|
|
4111
4100
|
}
|
|
4112
|
-
async getUnHarvestedRewards(addr) {
|
|
4113
|
-
return await this.getHarvests(addr);
|
|
4101
|
+
async getUnHarvestedRewards(addr, endpoint = VESU_REWARDS_ENDPOINT) {
|
|
4102
|
+
return await this.getHarvests(addr, endpoint);
|
|
4114
4103
|
}
|
|
4115
4104
|
};
|
|
4116
4105
|
|
|
@@ -9563,6 +9552,17 @@ var vesu_pools_default = {
|
|
|
9563
9552
|
]
|
|
9564
9553
|
};
|
|
9565
9554
|
|
|
9555
|
+
// src/strategies/constants.ts
|
|
9556
|
+
var COMMON_CONTRACTS = [{
|
|
9557
|
+
address: ContractAddr.from("0x0636a3f51cc37f5729e4da4b1de6a8549a28f3c0d5bf3b17f150971e451ff9c2"),
|
|
9558
|
+
name: "Access Controller",
|
|
9559
|
+
sourceCodeUrl: "https://github.com/strkfarm/strkfarm-contracts/blob/main/src/components/accessControl.cairo"
|
|
9560
|
+
}];
|
|
9561
|
+
var ENDPOINTS = {
|
|
9562
|
+
VESU_BASE: "https://proxy.api.troves.fi/vesu",
|
|
9563
|
+
VESU_BASE_STAGING: "https://proxy.api.troves.fi/vesu-staging"
|
|
9564
|
+
};
|
|
9565
|
+
|
|
9566
9566
|
// src/strategies/vesu-rebalance.tsx
|
|
9567
9567
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
9568
9568
|
var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
@@ -30900,7 +30900,7 @@ var UniversalLstMultiplierStrategy = class _UniversalLstMultiplierStrategy exten
|
|
|
30900
30900
|
* @param params
|
|
30901
30901
|
*/
|
|
30902
30902
|
async getVesuMultiplyCall(params) {
|
|
30903
|
-
const
|
|
30903
|
+
const vesuAdapter1 = this.getVesuSameTokenAdapter();
|
|
30904
30904
|
const legLTV = await vesuAdapter1.getLTVConfig(this.config);
|
|
30905
30905
|
logger.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
|
|
30906
30906
|
if (!params.isDeposit) {
|
|
@@ -31376,7 +31376,7 @@ var hyperxtBTC = {
|
|
|
31376
31376
|
adapters: [],
|
|
31377
31377
|
targetHealthFactor: 1.1,
|
|
31378
31378
|
minHealthFactor: 1.05,
|
|
31379
|
-
borrowable_assets:
|
|
31379
|
+
borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "tBTC" || token.symbol === "WBTC"),
|
|
31380
31380
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "tBTC")
|
|
31381
31381
|
};
|
|
31382
31382
|
var hyperxsBTC = {
|
|
@@ -31389,7 +31389,7 @@ var hyperxsBTC = {
|
|
|
31389
31389
|
adapters: [],
|
|
31390
31390
|
targetHealthFactor: 1.1,
|
|
31391
31391
|
minHealthFactor: 1.05,
|
|
31392
|
-
borrowable_assets:
|
|
31392
|
+
borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "solvBTC"),
|
|
31393
31393
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "solvBTC")
|
|
31394
31394
|
};
|
|
31395
31395
|
var hyperxLBTC = {
|
|
@@ -31402,7 +31402,7 @@ var hyperxLBTC = {
|
|
|
31402
31402
|
adapters: [],
|
|
31403
31403
|
targetHealthFactor: 1.1,
|
|
31404
31404
|
minHealthFactor: 1.05,
|
|
31405
|
-
borrowable_assets:
|
|
31405
|
+
borrowable_assets: Global.getDefaultTokens().filter((token) => token.symbol === "LBTC"),
|
|
31406
31406
|
underlyingToken: Global.getDefaultTokens().find((token) => token.symbol === "LBTC")
|
|
31407
31407
|
};
|
|
31408
31408
|
function getInvestmentSteps(lstSymbol, underlyingSymbol) {
|
package/package.json
CHANGED
package/src/modules/harvests.ts
CHANGED
|
@@ -86,11 +86,11 @@ export class EkuboHarvests extends Harvests {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
export const VESU_REWARDS_CONTRACT = ContractAddr.from('0x0387f3eb1d98632fbe3440a9f1385Aec9d87b6172491d3Dd81f1c35A7c61048F');
|
|
89
|
-
|
|
89
|
+
export const VESU_REWARDS_ENDPOINT = 'https://staging.api.vesu.xyz';
|
|
90
90
|
export class VesuHarvests extends Harvests {
|
|
91
|
-
async getHarvests(addr: ContractAddr): Promise<HarvestInfo[]> {
|
|
92
|
-
const result = await fetch(`${
|
|
93
|
-
const
|
|
91
|
+
async getHarvests(addr: ContractAddr, endpoint = VESU_REWARDS_ENDPOINT): Promise<HarvestInfo[]> {
|
|
92
|
+
const result = await fetch(`${endpoint}/users/${addr.address}/rewards/calldata`);
|
|
93
|
+
const _data = await result.json();
|
|
94
94
|
const rewardsContract = VESU_REWARDS_CONTRACT;
|
|
95
95
|
|
|
96
96
|
// get already claimed amount
|
|
@@ -100,8 +100,10 @@ export class VesuHarvests extends Harvests {
|
|
|
100
100
|
const claimed_amount = Web3Number.fromWei(_claimed_amount.toString(), 18);
|
|
101
101
|
logger.verbose(`${VesuHarvests.name}: claimed_amount: ${claimed_amount.toString()}`);
|
|
102
102
|
|
|
103
|
+
const data = _data.data['defiSpring'];
|
|
104
|
+
|
|
103
105
|
// get the actual reward
|
|
104
|
-
const actualReward = Web3Number.fromWei(data.
|
|
106
|
+
const actualReward = Web3Number.fromWei(data.amount, 18).minus(claimed_amount);
|
|
105
107
|
logger.verbose(`${VesuHarvests.name}: actualReward: ${actualReward.toString()}`);
|
|
106
108
|
return [{
|
|
107
109
|
rewardsContract,
|
|
@@ -110,15 +112,15 @@ export class VesuHarvests extends Harvests {
|
|
|
110
112
|
endDate: new Date(0),
|
|
111
113
|
claim: {
|
|
112
114
|
id: 0,
|
|
113
|
-
amount: Web3Number.fromWei(num.getDecimalString(data.
|
|
115
|
+
amount: Web3Number.fromWei(num.getDecimalString(data.amount), 18),
|
|
114
116
|
claimee: addr
|
|
115
117
|
},
|
|
116
118
|
actualReward,
|
|
117
|
-
proof: data.
|
|
119
|
+
proof: data.proof
|
|
118
120
|
}]
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
async getUnHarvestedRewards(addr: ContractAddr) {
|
|
122
|
-
return await this.getHarvests(addr);
|
|
123
|
+
async getUnHarvestedRewards(addr: ContractAddr, endpoint = VESU_REWARDS_ENDPOINT) {
|
|
124
|
+
return await this.getHarvests(addr, endpoint);
|
|
123
125
|
}
|
|
124
126
|
}
|
|
@@ -429,7 +429,7 @@ export class UniversalLstMultiplierStrategy extends UniversalStrategy<HyperLSTSt
|
|
|
429
429
|
isDeposit: boolean,
|
|
430
430
|
leg1DepositAmount: Web3Number
|
|
431
431
|
}) {
|
|
432
|
-
const
|
|
432
|
+
const vesuAdapter1 = this.getVesuSameTokenAdapter();
|
|
433
433
|
const legLTV = await vesuAdapter1.getLTVConfig(this.config);
|
|
434
434
|
logger.verbose(`${this.getTag()}::getVesuMultiplyCall legLTV: ${legLTV}`);
|
|
435
435
|
|
|
@@ -1046,7 +1046,7 @@ const hyperxtBTC: HyperLSTStrategySettings = {
|
|
|
1046
1046
|
adapters: [],
|
|
1047
1047
|
targetHealthFactor: 1.1,
|
|
1048
1048
|
minHealthFactor: 1.05,
|
|
1049
|
-
borrowable_assets:
|
|
1049
|
+
borrowable_assets: Global.getDefaultTokens().filter(token => token.symbol === 'tBTC' || token.symbol === 'WBTC'),
|
|
1050
1050
|
underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'tBTC')!,
|
|
1051
1051
|
}
|
|
1052
1052
|
|
|
@@ -1060,7 +1060,7 @@ const hyperxsBTC: HyperLSTStrategySettings = {
|
|
|
1060
1060
|
adapters: [],
|
|
1061
1061
|
targetHealthFactor: 1.1,
|
|
1062
1062
|
minHealthFactor: 1.05,
|
|
1063
|
-
borrowable_assets:
|
|
1063
|
+
borrowable_assets: Global.getDefaultTokens().filter(token => token.symbol === 'solvBTC'),
|
|
1064
1064
|
underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'solvBTC')!,
|
|
1065
1065
|
}
|
|
1066
1066
|
|
|
@@ -1074,7 +1074,7 @@ const hyperxLBTC: HyperLSTStrategySettings = {
|
|
|
1074
1074
|
adapters: [],
|
|
1075
1075
|
targetHealthFactor: 1.1,
|
|
1076
1076
|
minHealthFactor: 1.05,
|
|
1077
|
-
borrowable_assets:
|
|
1077
|
+
borrowable_assets: Global.getDefaultTokens().filter(token => token.symbol === 'LBTC'),
|
|
1078
1078
|
underlyingToken: Global.getDefaultTokens().find(token => token.symbol === 'LBTC')!,
|
|
1079
1079
|
}
|
|
1080
1080
|
|