@strkfarm/sdk 1.0.30 → 1.0.32
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/cli.js +11 -4
- package/dist/cli.mjs +11 -4
- package/dist/index.browser.global.js +16493 -7655
- package/dist/index.browser.mjs +18 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.js +18 -6
- package/dist/index.mjs +18 -6
- package/package.json +5 -1
- package/src/interfaces/common.ts +2 -1
- package/src/strategies/{ekubo-cl-vault.ts → ekubo-cl-vault.tsx} +7 -1
- package/src/strategies/{vesu-rebalance.ts → vesu-rebalance.tsx} +7 -2
package/dist/index.browser.mjs
CHANGED
|
@@ -2089,7 +2089,7 @@ var AutoCompounderSTRK = class {
|
|
|
2089
2089
|
}
|
|
2090
2090
|
};
|
|
2091
2091
|
|
|
2092
|
-
// src/strategies/vesu-rebalance.
|
|
2092
|
+
// src/strategies/vesu-rebalance.tsx
|
|
2093
2093
|
import { CairoCustomEnum, Contract as Contract5, num as num3, uint256 as uint2563 } from "starknet";
|
|
2094
2094
|
|
|
2095
2095
|
// src/data/vesu-rebalance.abi.json
|
|
@@ -12697,7 +12697,7 @@ var vesu_pools_default = {
|
|
|
12697
12697
|
]
|
|
12698
12698
|
};
|
|
12699
12699
|
|
|
12700
|
-
// src/strategies/vesu-rebalance.
|
|
12700
|
+
// src/strategies/vesu-rebalance.tsx
|
|
12701
12701
|
var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
12702
12702
|
// 10000 bps = 100%
|
|
12703
12703
|
/**
|
|
@@ -12824,6 +12824,11 @@ var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
|
12824
12824
|
let vTokenContract = new Contract5(vesu_rebalance_abi_default, p.v_token.address, this.config.provider);
|
|
12825
12825
|
const bal = await vTokenContract.balanceOf(this.address.address);
|
|
12826
12826
|
const assets = await vTokenContract.convert_to_assets(uint2563.bnToUint256(bal.toString()));
|
|
12827
|
+
logger.verbose(`Collateral: ${JSON.stringify(vesuPosition?.collateral)}`);
|
|
12828
|
+
logger.verbose(`supplyApy: ${JSON.stringify(assetInfo?.stats.supplyApy)}`);
|
|
12829
|
+
logger.verbose(`defiSpringSupplyApr: ${JSON.stringify(assetInfo?.stats.defiSpringSupplyApr)}`);
|
|
12830
|
+
logger.verbose(`currentUtilization: ${JSON.stringify(assetInfo?.stats.currentUtilization)}`);
|
|
12831
|
+
logger.verbose(`maxUtilization: ${JSON.stringify(assetInfo?.config.maxUtilization)}`);
|
|
12827
12832
|
const item = {
|
|
12828
12833
|
pool_id: p.pool_id,
|
|
12829
12834
|
pool_name: _pool?.name,
|
|
@@ -12838,7 +12843,7 @@ var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
|
12838
12843
|
netApy: 0
|
|
12839
12844
|
} : {
|
|
12840
12845
|
baseApy: Number(Web3Number.fromWei(assetInfo.stats.supplyApy.value, assetInfo.stats.supplyApy.decimals).toFixed(6)),
|
|
12841
|
-
defiSpringApy: Number(Web3Number.fromWei(assetInfo.stats.defiSpringSupplyApr.value, assetInfo.stats.defiSpringSupplyApr.decimals).toFixed(6)),
|
|
12846
|
+
defiSpringApy: assetInfo.stats.defiSpringSupplyApr ? Number(Web3Number.fromWei(assetInfo.stats.defiSpringSupplyApr.value, assetInfo.stats.defiSpringSupplyApr.decimals).toFixed(6)) : 0,
|
|
12842
12847
|
netApy: 0
|
|
12843
12848
|
},
|
|
12844
12849
|
currentUtilization: isErrorPoolsAPI || !assetInfo ? 0 : Number(Web3Number.fromWei(assetInfo.stats.currentUtilization.value, assetInfo.stats.currentUtilization.decimals).toFixed(6)),
|
|
@@ -13193,7 +13198,7 @@ var VesuRebalanceStrategies = [{
|
|
|
13193
13198
|
// },
|
|
13194
13199
|
}];
|
|
13195
13200
|
|
|
13196
|
-
// src/strategies/ekubo-cl-vault.
|
|
13201
|
+
// src/strategies/ekubo-cl-vault.tsx
|
|
13197
13202
|
import { Contract as Contract6, num as num4, uint256 as uint2564 } from "starknet";
|
|
13198
13203
|
|
|
13199
13204
|
// src/data/cl-vault.abi.json
|
|
@@ -18095,7 +18100,8 @@ var erc4626_abi_default = [
|
|
|
18095
18100
|
}
|
|
18096
18101
|
];
|
|
18097
18102
|
|
|
18098
|
-
// src/strategies/ekubo-cl-vault.
|
|
18103
|
+
// src/strategies/ekubo-cl-vault.tsx
|
|
18104
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18099
18105
|
var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
|
|
18100
18106
|
/**
|
|
18101
18107
|
* Creates a new VesuRebalance strategy instance.
|
|
@@ -18809,7 +18815,13 @@ var _riskFactor2 = [
|
|
|
18809
18815
|
var AUDIT_URL2 = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
|
|
18810
18816
|
var EkuboCLVaultStrategies = [{
|
|
18811
18817
|
name: "Ekubo xSTRK/STRK",
|
|
18812
|
-
description:
|
|
18818
|
+
description: /* @__PURE__ */ jsxs("div", { children: [
|
|
18819
|
+
/* @__PURE__ */ jsx("p", { children: _description2.replace("{{POOL_NAME}}", "xSTRK/STRK") }),
|
|
18820
|
+
/* @__PURE__ */ jsxs("ul", { style: { marginLeft: "20px", listStyle: "circle", fontSize: "12px" }, children: [
|
|
18821
|
+
/* @__PURE__ */ jsx("li", { style: { marginTop: "10px" }, children: "During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices." }),
|
|
18822
|
+
/* @__PURE__ */ jsx("li", { style: { marginTop: "10px" }, children: "Sometimes you might see a negative APY \u2014 this is usually not a big deal. It happens when xSTRK's price drops on DEXes, but things typically bounce back within a few days or a week." })
|
|
18823
|
+
] })
|
|
18824
|
+
] }),
|
|
18813
18825
|
address: ContractAddr.from("0x01f083b98674bc21effee29ef443a00c7b9a500fd92cf30341a3da12c73f2324"),
|
|
18814
18826
|
type: "Other",
|
|
18815
18827
|
// must be same order as poolKey token0 and token1
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
2
|
import * as starknet from 'starknet';
|
|
3
3
|
import { RpcProvider, BlockIdentifier, Contract, Uint256, Call, Account } from 'starknet';
|
|
4
|
+
import React from 'react';
|
|
4
5
|
import { Quote } from '@avnu/avnu-sdk';
|
|
5
6
|
import * as util from 'util';
|
|
6
7
|
import TelegramBot from 'node-telegram-bot-api';
|
|
@@ -90,7 +91,7 @@ declare enum FlowChartColors {
|
|
|
90
91
|
*/
|
|
91
92
|
interface IStrategyMetadata<T> {
|
|
92
93
|
name: string;
|
|
93
|
-
description: string;
|
|
94
|
+
description: string | React.ReactNode;
|
|
94
95
|
address: ContractAddr;
|
|
95
96
|
type: 'ERC4626' | 'ERC721' | 'Other';
|
|
96
97
|
depositTokens: TokenInfo[];
|
package/dist/index.js
CHANGED
|
@@ -2178,7 +2178,7 @@ var AutoCompounderSTRK = class {
|
|
|
2178
2178
|
}
|
|
2179
2179
|
};
|
|
2180
2180
|
|
|
2181
|
-
// src/strategies/vesu-rebalance.
|
|
2181
|
+
// src/strategies/vesu-rebalance.tsx
|
|
2182
2182
|
var import_starknet8 = require("starknet");
|
|
2183
2183
|
|
|
2184
2184
|
// src/data/vesu-rebalance.abi.json
|
|
@@ -12786,7 +12786,7 @@ var vesu_pools_default = {
|
|
|
12786
12786
|
]
|
|
12787
12787
|
};
|
|
12788
12788
|
|
|
12789
|
-
// src/strategies/vesu-rebalance.
|
|
12789
|
+
// src/strategies/vesu-rebalance.tsx
|
|
12790
12790
|
var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
12791
12791
|
// 10000 bps = 100%
|
|
12792
12792
|
/**
|
|
@@ -12913,6 +12913,11 @@ var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
|
12913
12913
|
let vTokenContract = new import_starknet8.Contract(vesu_rebalance_abi_default, p.v_token.address, this.config.provider);
|
|
12914
12914
|
const bal = await vTokenContract.balanceOf(this.address.address);
|
|
12915
12915
|
const assets = await vTokenContract.convert_to_assets(import_starknet8.uint256.bnToUint256(bal.toString()));
|
|
12916
|
+
logger.verbose(`Collateral: ${JSON.stringify(vesuPosition?.collateral)}`);
|
|
12917
|
+
logger.verbose(`supplyApy: ${JSON.stringify(assetInfo?.stats.supplyApy)}`);
|
|
12918
|
+
logger.verbose(`defiSpringSupplyApr: ${JSON.stringify(assetInfo?.stats.defiSpringSupplyApr)}`);
|
|
12919
|
+
logger.verbose(`currentUtilization: ${JSON.stringify(assetInfo?.stats.currentUtilization)}`);
|
|
12920
|
+
logger.verbose(`maxUtilization: ${JSON.stringify(assetInfo?.config.maxUtilization)}`);
|
|
12916
12921
|
const item = {
|
|
12917
12922
|
pool_id: p.pool_id,
|
|
12918
12923
|
pool_name: _pool?.name,
|
|
@@ -12927,7 +12932,7 @@ var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
|
12927
12932
|
netApy: 0
|
|
12928
12933
|
} : {
|
|
12929
12934
|
baseApy: Number(Web3Number.fromWei(assetInfo.stats.supplyApy.value, assetInfo.stats.supplyApy.decimals).toFixed(6)),
|
|
12930
|
-
defiSpringApy: Number(Web3Number.fromWei(assetInfo.stats.defiSpringSupplyApr.value, assetInfo.stats.defiSpringSupplyApr.decimals).toFixed(6)),
|
|
12935
|
+
defiSpringApy: assetInfo.stats.defiSpringSupplyApr ? Number(Web3Number.fromWei(assetInfo.stats.defiSpringSupplyApr.value, assetInfo.stats.defiSpringSupplyApr.decimals).toFixed(6)) : 0,
|
|
12931
12936
|
netApy: 0
|
|
12932
12937
|
},
|
|
12933
12938
|
currentUtilization: isErrorPoolsAPI || !assetInfo ? 0 : Number(Web3Number.fromWei(assetInfo.stats.currentUtilization.value, assetInfo.stats.currentUtilization.decimals).toFixed(6)),
|
|
@@ -13282,7 +13287,7 @@ var VesuRebalanceStrategies = [{
|
|
|
13282
13287
|
// },
|
|
13283
13288
|
}];
|
|
13284
13289
|
|
|
13285
|
-
// src/strategies/ekubo-cl-vault.
|
|
13290
|
+
// src/strategies/ekubo-cl-vault.tsx
|
|
13286
13291
|
var import_starknet9 = require("starknet");
|
|
13287
13292
|
|
|
13288
13293
|
// src/data/cl-vault.abi.json
|
|
@@ -18184,7 +18189,8 @@ var erc4626_abi_default = [
|
|
|
18184
18189
|
}
|
|
18185
18190
|
];
|
|
18186
18191
|
|
|
18187
|
-
// src/strategies/ekubo-cl-vault.
|
|
18192
|
+
// src/strategies/ekubo-cl-vault.tsx
|
|
18193
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
18188
18194
|
var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
|
|
18189
18195
|
/**
|
|
18190
18196
|
* Creates a new VesuRebalance strategy instance.
|
|
@@ -18898,7 +18904,13 @@ var _riskFactor2 = [
|
|
|
18898
18904
|
var AUDIT_URL2 = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
|
|
18899
18905
|
var EkuboCLVaultStrategies = [{
|
|
18900
18906
|
name: "Ekubo xSTRK/STRK",
|
|
18901
|
-
description:
|
|
18907
|
+
description: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
18908
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: _description2.replace("{{POOL_NAME}}", "xSTRK/STRK") }),
|
|
18909
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ul", { style: { marginLeft: "20px", listStyle: "circle", fontSize: "12px" }, children: [
|
|
18910
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { style: { marginTop: "10px" }, children: "During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices." }),
|
|
18911
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { style: { marginTop: "10px" }, children: "Sometimes you might see a negative APY \u2014 this is usually not a big deal. It happens when xSTRK's price drops on DEXes, but things typically bounce back within a few days or a week." })
|
|
18912
|
+
] })
|
|
18913
|
+
] }),
|
|
18902
18914
|
address: ContractAddr.from("0x01f083b98674bc21effee29ef443a00c7b9a500fd92cf30341a3da12c73f2324"),
|
|
18903
18915
|
type: "Other",
|
|
18904
18916
|
// must be same order as poolKey token0 and token1
|
package/dist/index.mjs
CHANGED
|
@@ -2109,7 +2109,7 @@ var AutoCompounderSTRK = class {
|
|
|
2109
2109
|
}
|
|
2110
2110
|
};
|
|
2111
2111
|
|
|
2112
|
-
// src/strategies/vesu-rebalance.
|
|
2112
|
+
// src/strategies/vesu-rebalance.tsx
|
|
2113
2113
|
import { CairoCustomEnum, Contract as Contract5, num as num3, uint256 as uint2563 } from "starknet";
|
|
2114
2114
|
|
|
2115
2115
|
// src/data/vesu-rebalance.abi.json
|
|
@@ -12717,7 +12717,7 @@ var vesu_pools_default = {
|
|
|
12717
12717
|
]
|
|
12718
12718
|
};
|
|
12719
12719
|
|
|
12720
|
-
// src/strategies/vesu-rebalance.
|
|
12720
|
+
// src/strategies/vesu-rebalance.tsx
|
|
12721
12721
|
var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
12722
12722
|
// 10000 bps = 100%
|
|
12723
12723
|
/**
|
|
@@ -12844,6 +12844,11 @@ var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
|
12844
12844
|
let vTokenContract = new Contract5(vesu_rebalance_abi_default, p.v_token.address, this.config.provider);
|
|
12845
12845
|
const bal = await vTokenContract.balanceOf(this.address.address);
|
|
12846
12846
|
const assets = await vTokenContract.convert_to_assets(uint2563.bnToUint256(bal.toString()));
|
|
12847
|
+
logger.verbose(`Collateral: ${JSON.stringify(vesuPosition?.collateral)}`);
|
|
12848
|
+
logger.verbose(`supplyApy: ${JSON.stringify(assetInfo?.stats.supplyApy)}`);
|
|
12849
|
+
logger.verbose(`defiSpringSupplyApr: ${JSON.stringify(assetInfo?.stats.defiSpringSupplyApr)}`);
|
|
12850
|
+
logger.verbose(`currentUtilization: ${JSON.stringify(assetInfo?.stats.currentUtilization)}`);
|
|
12851
|
+
logger.verbose(`maxUtilization: ${JSON.stringify(assetInfo?.config.maxUtilization)}`);
|
|
12847
12852
|
const item = {
|
|
12848
12853
|
pool_id: p.pool_id,
|
|
12849
12854
|
pool_name: _pool?.name,
|
|
@@ -12858,7 +12863,7 @@ var VesuRebalance = class _VesuRebalance extends BaseStrategy {
|
|
|
12858
12863
|
netApy: 0
|
|
12859
12864
|
} : {
|
|
12860
12865
|
baseApy: Number(Web3Number.fromWei(assetInfo.stats.supplyApy.value, assetInfo.stats.supplyApy.decimals).toFixed(6)),
|
|
12861
|
-
defiSpringApy: Number(Web3Number.fromWei(assetInfo.stats.defiSpringSupplyApr.value, assetInfo.stats.defiSpringSupplyApr.decimals).toFixed(6)),
|
|
12866
|
+
defiSpringApy: assetInfo.stats.defiSpringSupplyApr ? Number(Web3Number.fromWei(assetInfo.stats.defiSpringSupplyApr.value, assetInfo.stats.defiSpringSupplyApr.decimals).toFixed(6)) : 0,
|
|
12862
12867
|
netApy: 0
|
|
12863
12868
|
},
|
|
12864
12869
|
currentUtilization: isErrorPoolsAPI || !assetInfo ? 0 : Number(Web3Number.fromWei(assetInfo.stats.currentUtilization.value, assetInfo.stats.currentUtilization.decimals).toFixed(6)),
|
|
@@ -13213,7 +13218,7 @@ var VesuRebalanceStrategies = [{
|
|
|
13213
13218
|
// },
|
|
13214
13219
|
}];
|
|
13215
13220
|
|
|
13216
|
-
// src/strategies/ekubo-cl-vault.
|
|
13221
|
+
// src/strategies/ekubo-cl-vault.tsx
|
|
13217
13222
|
import { Contract as Contract6, num as num4, uint256 as uint2564 } from "starknet";
|
|
13218
13223
|
|
|
13219
13224
|
// src/data/cl-vault.abi.json
|
|
@@ -18115,7 +18120,8 @@ var erc4626_abi_default = [
|
|
|
18115
18120
|
}
|
|
18116
18121
|
];
|
|
18117
18122
|
|
|
18118
|
-
// src/strategies/ekubo-cl-vault.
|
|
18123
|
+
// src/strategies/ekubo-cl-vault.tsx
|
|
18124
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18119
18125
|
var EkuboCLVault = class _EkuboCLVault extends BaseStrategy {
|
|
18120
18126
|
/**
|
|
18121
18127
|
* Creates a new VesuRebalance strategy instance.
|
|
@@ -18829,7 +18835,13 @@ var _riskFactor2 = [
|
|
|
18829
18835
|
var AUDIT_URL2 = "https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ekubo_strats.pdf";
|
|
18830
18836
|
var EkuboCLVaultStrategies = [{
|
|
18831
18837
|
name: "Ekubo xSTRK/STRK",
|
|
18832
|
-
description:
|
|
18838
|
+
description: /* @__PURE__ */ jsxs("div", { children: [
|
|
18839
|
+
/* @__PURE__ */ jsx("p", { children: _description2.replace("{{POOL_NAME}}", "xSTRK/STRK") }),
|
|
18840
|
+
/* @__PURE__ */ jsxs("ul", { style: { marginLeft: "20px", listStyle: "circle", fontSize: "12px" }, children: [
|
|
18841
|
+
/* @__PURE__ */ jsx("li", { style: { marginTop: "10px" }, children: "During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices." }),
|
|
18842
|
+
/* @__PURE__ */ jsx("li", { style: { marginTop: "10px" }, children: "Sometimes you might see a negative APY \u2014 this is usually not a big deal. It happens when xSTRK's price drops on DEXes, but things typically bounce back within a few days or a week." })
|
|
18843
|
+
] })
|
|
18844
|
+
] }),
|
|
18833
18845
|
address: ContractAddr.from("0x01f083b98674bc21effee29ef443a00c7b9a500fd92cf30341a3da12c73f2324"),
|
|
18834
18846
|
type: "Other",
|
|
18835
18847
|
// must be same order as poolKey token0 and token1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strkfarm/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.32",
|
|
4
4
|
"description": "STRKFarm TS SDK (Meant for our internal use, but feel free to use it)",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/jest": "^29.5.12",
|
|
43
43
|
"@types/node-telegram-bot-api": "^0.64.7",
|
|
44
|
+
"@types/react": "^19.1.2",
|
|
44
45
|
"jest": "^29.7.0",
|
|
45
46
|
"jest-environment-jsdom": "^29.7.0",
|
|
46
47
|
"ts-jest": "^29.1.5",
|
|
@@ -49,6 +50,9 @@
|
|
|
49
50
|
"typedoc": "^0.26.3",
|
|
50
51
|
"typescript": "^5.5.3"
|
|
51
52
|
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"react": "19.1.0"
|
|
55
|
+
},
|
|
52
56
|
"dependencies": {
|
|
53
57
|
"@avnu/avnu-sdk": "^3.0.2",
|
|
54
58
|
"axios": "^1.7.2",
|
package/src/interfaces/common.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ContractAddr, Web3Number } from "@/dataTypes"
|
|
2
2
|
import { BlockIdentifier, RpcProvider } from "starknet"
|
|
3
|
+
import React from 'react';
|
|
3
4
|
|
|
4
5
|
export enum RiskType {
|
|
5
6
|
MARKET_RISK = 'Market Risk',
|
|
@@ -62,7 +63,7 @@ export enum FlowChartColors {
|
|
|
62
63
|
*/
|
|
63
64
|
export interface IStrategyMetadata<T> {
|
|
64
65
|
name: string,
|
|
65
|
-
description: string,
|
|
66
|
+
description: string | React.ReactNode,
|
|
66
67
|
address: ContractAddr,
|
|
67
68
|
type: 'ERC4626' | 'ERC721' | 'Other',
|
|
68
69
|
depositTokens: TokenInfo[],
|
|
@@ -933,7 +933,13 @@ const AUDIT_URL = 'https://assets.strkfarm.com/strkfarm/audit_report_vesu_and_ek
|
|
|
933
933
|
*/
|
|
934
934
|
export const EkuboCLVaultStrategies: IStrategyMetadata<CLVaultStrategySettings>[] = [{
|
|
935
935
|
name: 'Ekubo xSTRK/STRK',
|
|
936
|
-
description:
|
|
936
|
+
description: <div>
|
|
937
|
+
<p>{_description.replace('{{POOL_NAME}}', 'xSTRK/STRK')}</p>
|
|
938
|
+
<ul style={{marginLeft: '20px', listStyle: 'circle', fontSize: '12px'}}>
|
|
939
|
+
<li style={{marginTop: '10px'}}>During withdrawal, you may receive either or both tokens depending on market conditions and prevailing prices.</li>
|
|
940
|
+
<li style={{marginTop: '10px'}}>Sometimes you might see a negative APY — this is usually not a big deal. It happens when xSTRK's price drops on DEXes, but things typically bounce back within a few days or a week.</li>
|
|
941
|
+
</ul>
|
|
942
|
+
</div>,
|
|
937
943
|
address: ContractAddr.from('0x01f083b98674bc21effee29ef443a00c7b9a500fd92cf30341a3da12c73f2324'),
|
|
938
944
|
type: 'Other',
|
|
939
945
|
// must be same order as poolKey token0 and token1
|
|
@@ -203,6 +203,11 @@ export class VesuRebalance extends BaseStrategy<SingleTokenInfo, SingleActionAmo
|
|
|
203
203
|
let vTokenContract = new Contract(VesuRebalanceAbi, p.v_token.address, this.config.provider);
|
|
204
204
|
const bal = await vTokenContract.balanceOf(this.address.address);
|
|
205
205
|
const assets = await vTokenContract.convert_to_assets(uint256.bnToUint256(bal.toString()));
|
|
206
|
+
logger.verbose(`Collateral: ${JSON.stringify(vesuPosition?.collateral)}`);
|
|
207
|
+
logger.verbose(`supplyApy: ${JSON.stringify(assetInfo?.stats.supplyApy)}`);
|
|
208
|
+
logger.verbose(`defiSpringSupplyApr: ${JSON.stringify(assetInfo?.stats.defiSpringSupplyApr)}`);
|
|
209
|
+
logger.verbose(`currentUtilization: ${JSON.stringify(assetInfo?.stats.currentUtilization)}`);
|
|
210
|
+
logger.verbose(`maxUtilization: ${JSON.stringify(assetInfo?.config.maxUtilization)}`);
|
|
206
211
|
const item = {
|
|
207
212
|
pool_id: p.pool_id,
|
|
208
213
|
pool_name: _pool?.name,
|
|
@@ -217,7 +222,7 @@ export class VesuRebalance extends BaseStrategy<SingleTokenInfo, SingleActionAmo
|
|
|
217
222
|
netApy: 0,
|
|
218
223
|
} : {
|
|
219
224
|
baseApy: Number(Web3Number.fromWei(assetInfo.stats.supplyApy.value, assetInfo.stats.supplyApy.decimals).toFixed(6)),
|
|
220
|
-
defiSpringApy: Number(Web3Number.fromWei(assetInfo.stats.defiSpringSupplyApr.value, assetInfo.stats.defiSpringSupplyApr.decimals).toFixed(6)),
|
|
225
|
+
defiSpringApy: assetInfo.stats.defiSpringSupplyApr ? Number(Web3Number.fromWei(assetInfo.stats.defiSpringSupplyApr.value, assetInfo.stats.defiSpringSupplyApr.decimals).toFixed(6)) : 0,
|
|
221
226
|
netApy: 0,
|
|
222
227
|
},
|
|
223
228
|
currentUtilization: isErrorPoolsAPI || !assetInfo ? 0 : Number(Web3Number.fromWei(assetInfo.stats.currentUtilization.value, assetInfo.stats.currentUtilization.decimals).toFixed(6)),
|
|
@@ -562,7 +567,7 @@ export class VesuRebalance extends BaseStrategy<SingleTokenInfo, SingleActionAmo
|
|
|
562
567
|
}
|
|
563
568
|
}
|
|
564
569
|
|
|
565
|
-
const _description =
|
|
570
|
+
const _description = "Automatically diversify {{TOKEN}} holdings into different Vesu pools while reducing risk and maximizing yield. Defi spring STRK Rewards are auto-compounded as well."
|
|
566
571
|
const _protocol: IProtocol = {name: 'Vesu', logo: 'https://static-assets-8zct.onrender.com/integrations/vesu/logo.png'}
|
|
567
572
|
// need to fine tune better
|
|
568
573
|
const _riskFactor: RiskFactor[] = [
|