@suilend/sdk 1.1.93 → 1.1.95
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/lib/initialize.js +6 -5
- package/lib/strategyOwnerCap.d.ts +1 -1
- package/lib/strategyOwnerCap.js +8 -8
- package/package.json +1 -1
- package/strategies.js +11 -11
package/lib/initialize.js
CHANGED
|
@@ -80,7 +80,8 @@ exports.RESERVES_CUSTOM_ORDER = {
|
|
|
80
80
|
sui_fe_1.NORMALIZED_wUSDT_COINTYPE,
|
|
81
81
|
sui_fe_1.NORMALIZED_AUSD_COINTYPE,
|
|
82
82
|
sui_fe_1.NORMALIZED_LBTC_COINTYPE,
|
|
83
|
-
sui_fe_1.
|
|
83
|
+
sui_fe_1.NORMALIZED_suiWBTC_COINTYPE,
|
|
84
|
+
sui_fe_1.NORMALIZED_WBTC_COINTYPE,
|
|
84
85
|
sui_fe_1.NORMALIZED_xBTC_COINTYPE,
|
|
85
86
|
sui_fe_1.NORMALIZED_suiETH_COINTYPE,
|
|
86
87
|
sui_fe_1.NORMALIZED_WETH_COINTYPE,
|
|
@@ -106,10 +107,10 @@ exports.RESERVES_CUSTOM_ORDER = {
|
|
|
106
107
|
sui_fe_1.NORMALIZED_XAUm_COINTYPE,
|
|
107
108
|
sui_fe_1.NORMALIZED_USDC_COINTYPE,
|
|
108
109
|
],
|
|
109
|
-
"0xc1549fd5db74c3aad37a260c9fd251d93d6f2f3ccfacc277398a57718c275a17": [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
],
|
|
110
|
+
// "0xc1549fd5db74c3aad37a260c9fd251d93d6f2f3ccfacc277398a57718c275a17": [
|
|
111
|
+
// NORMALIZED_SEND_COINTYPE,
|
|
112
|
+
// NORMALIZED_USDC_COINTYPE,
|
|
113
|
+
// ],
|
|
113
114
|
"0x0d3a7f758d19d11e8526f66cca43403a99da16862c570c43efe0f8c4a500f7f2": [
|
|
114
115
|
sui_fe_1.NORMALIZED_sdeUSD_COINTYPE,
|
|
115
116
|
sui_fe_1.NORMALIZED_USDC_COINTYPE,
|
|
@@ -10,7 +10,7 @@ export declare enum StrategyType {
|
|
|
10
10
|
USDC_sSUI_SUI_LOOPING = "3",
|
|
11
11
|
AUSD_sSUI_SUI_LOOPING = "4",
|
|
12
12
|
xBTC_sSUI_SUI_LOOPING = "100",// Used to be for Slush Strategies #0
|
|
13
|
-
|
|
13
|
+
xBTC_suiWBTC_LOOPING = "101",// Used to be for Slush Strategies #1
|
|
14
14
|
suiUSDT_sSUI_SUI_LOOPING = "5",
|
|
15
15
|
AUSD_USDC_LOOPING = "6",
|
|
16
16
|
AUSD_suiUSDT_LOOPING = "7",
|
package/lib/strategyOwnerCap.js
CHANGED
|
@@ -28,7 +28,7 @@ var StrategyType;
|
|
|
28
28
|
StrategyType["USDC_sSUI_SUI_LOOPING"] = "3";
|
|
29
29
|
StrategyType["AUSD_sSUI_SUI_LOOPING"] = "4";
|
|
30
30
|
StrategyType["xBTC_sSUI_SUI_LOOPING"] = "100";
|
|
31
|
-
StrategyType["
|
|
31
|
+
StrategyType["xBTC_suiWBTC_LOOPING"] = "101";
|
|
32
32
|
StrategyType["suiUSDT_sSUI_SUI_LOOPING"] = "5";
|
|
33
33
|
StrategyType["AUSD_USDC_LOOPING"] = "6";
|
|
34
34
|
StrategyType["AUSD_suiUSDT_LOOPING"] = "7";
|
|
@@ -105,18 +105,18 @@ exports.STRATEGY_TYPE_INFO_MAP = {
|
|
|
105
105
|
currencyCoinTypes: [sui_fe_1.NORMALIZED_xBTC_COINTYPE],
|
|
106
106
|
defaultCurrencyCoinType: sui_fe_1.NORMALIZED_xBTC_COINTYPE,
|
|
107
107
|
},
|
|
108
|
-
[StrategyType.
|
|
109
|
-
queryParam: "xBTC-
|
|
108
|
+
[StrategyType.xBTC_suiWBTC_LOOPING]: {
|
|
109
|
+
queryParam: "xBTC-suiWBTC-looping",
|
|
110
110
|
header: {
|
|
111
|
-
coinTypes: [sui_fe_1.NORMALIZED_xBTC_COINTYPE, sui_fe_1.
|
|
112
|
-
title: "xBTC/
|
|
113
|
-
tooltip: "Sets up an xBTC/
|
|
111
|
+
coinTypes: [sui_fe_1.NORMALIZED_xBTC_COINTYPE, sui_fe_1.NORMALIZED_suiWBTC_COINTYPE],
|
|
112
|
+
title: "xBTC/suiWBTC",
|
|
113
|
+
tooltip: "Sets up an xBTC/suiWBTC Looping strategy by depositing xBTC and borrowing suiWBTC to the desired leverage",
|
|
114
114
|
type: "Looping",
|
|
115
115
|
},
|
|
116
116
|
depositBaseCoinType: sui_fe_1.NORMALIZED_xBTC_COINTYPE,
|
|
117
117
|
depositLstCoinType: undefined,
|
|
118
|
-
borrowCoinType: sui_fe_1.
|
|
119
|
-
currencyCoinTypes: [sui_fe_1.NORMALIZED_xBTC_COINTYPE, sui_fe_1.
|
|
118
|
+
borrowCoinType: sui_fe_1.NORMALIZED_suiWBTC_COINTYPE,
|
|
119
|
+
currencyCoinTypes: [sui_fe_1.NORMALIZED_xBTC_COINTYPE, sui_fe_1.NORMALIZED_suiWBTC_COINTYPE],
|
|
120
120
|
defaultCurrencyCoinType: sui_fe_1.NORMALIZED_xBTC_COINTYPE,
|
|
121
121
|
},
|
|
122
122
|
[StrategyType.suiUSDT_sSUI_SUI_LOOPING]: {
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/sdk","version":"1.1.
|
|
1
|
+
{"name":"@suilend/sdk","version":"1.1.95","private":false,"description":"A TypeScript SDK for interacting with the Suilend program","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./client":"./client.js","./mmt":"./mmt.js","./strategies":"./strategies.js","./api/events":"./api/events.js","./api":"./api/index.js","./lib/constants":"./lib/constants.js","./lib":"./lib/index.js","./lib/initialize":"./lib/initialize.js","./lib/liquidityMining":"./lib/liquidityMining.js","./lib/pyth":"./lib/pyth.js","./lib/strategyOwnerCap":"./lib/strategyOwnerCap.js","./lib/transactions":"./lib/transactions.js","./lib/types":"./lib/types.js","./parsers/apiReserveAssetDataEvent":"./parsers/apiReserveAssetDataEvent.js","./parsers":"./parsers/index.js","./parsers/lendingMarket":"./parsers/lendingMarket.js","./parsers/obligation":"./parsers/obligation.js","./parsers/rateLimiter":"./parsers/rateLimiter.js","./parsers/reserve":"./parsers/reserve.js","./swap":"./swap/index.js","./swap/quote":"./swap/quote.js","./swap/transaction":"./swap/transaction.js","./utils/events":"./utils/events.js","./utils":"./utils/index.js","./utils/obligation":"./utils/obligation.js","./utils/simulate":"./utils/simulate.js","./_generated/_framework/reified":"./_generated/_framework/reified.js","./_generated/_framework/util":"./_generated/_framework/util.js","./_generated/_framework/vector":"./_generated/_framework/vector.js","./_generated/suilend":"./_generated/suilend/index.js","./_generated/suilend/cell/structs":"./_generated/suilend/cell/structs.js","./_generated/suilend/decimal/structs":"./_generated/suilend/decimal/structs.js","./_generated/suilend/lending-market/functions":"./_generated/suilend/lending-market/functions.js","./_generated/suilend/lending-market/structs":"./_generated/suilend/lending-market/structs.js","./_generated/suilend/lending-market-registry/functions":"./_generated/suilend/lending-market-registry/functions.js","./_generated/suilend/liquidity-mining/structs":"./_generated/suilend/liquidity-mining/structs.js","./_generated/suilend/obligation/structs":"./_generated/suilend/obligation/structs.js","./_generated/suilend/rate-limiter/functions":"./_generated/suilend/rate-limiter/functions.js","./_generated/suilend/rate-limiter/structs":"./_generated/suilend/rate-limiter/structs.js","./_generated/suilend/reserve/structs":"./_generated/suilend/reserve/structs.js","./_generated/suilend/reserve-config/functions":"./_generated/suilend/reserve-config/functions.js","./_generated/suilend/reserve-config/structs":"./_generated/suilend/reserve-config/structs.js","./_generated/_dependencies/source/0x1":"./_generated/_dependencies/source/0x1/index.js","./_generated/_dependencies/source/0x2":"./_generated/_dependencies/source/0x2/index.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/index.js","./_generated/_dependencies/source/0x1/ascii/structs":"./_generated/_dependencies/source/0x1/ascii/structs.js","./_generated/_dependencies/source/0x1/option/structs":"./_generated/_dependencies/source/0x1/option/structs.js","./_generated/_dependencies/source/0x1/type-name/structs":"./_generated/_dependencies/source/0x1/type-name/structs.js","./_generated/_dependencies/source/0x2/bag/structs":"./_generated/_dependencies/source/0x2/bag/structs.js","./_generated/_dependencies/source/0x2/balance/structs":"./_generated/_dependencies/source/0x2/balance/structs.js","./_generated/_dependencies/source/0x2/object/structs":"./_generated/_dependencies/source/0x2/object/structs.js","./_generated/_dependencies/source/0x2/object-table/structs":"./_generated/_dependencies/source/0x2/object-table/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/i64/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-feed/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-identifier/structs.js","./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs":"./_generated/_dependencies/source/0x8d97f1cd6ac663735be08d1d2b6d02a159e711586461306ce60a2b7a6a565a9e/price-info/structs.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix \"./src/**/*.ts\"","prettier":"prettier --write \"./src/**/*\"","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ts-node ./release.ts && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/suilend/suilend-fe-public.git"},"bugs":{"url":"https://github.com/suilend/suilend-fe-public/issues"},"dependencies":{"@7kprotocol/sdk-ts":"^3.5.0","@cetusprotocol/aggregator-sdk":"^1.4.2","@flowx-finance/sdk":"^1.14.0","@suilend/springsui-sdk":"^1.0.27","aftermath-ts-sdk":"^1.3.24","bignumber.js":"^9.1.2","bn.js":"^5.2.2","crypto-js":"^4.2.0","lodash":"^4.17.21","p-limit":"3.1.0","uuid":"^11.0.3"},"devDependencies":{"@types/bn.js":"^5.2.0","@types/lodash":"^4.17.20","ts-node":"^10.9.2"},"peerDependencies":{"@mysten/bcs":"1.8.1","@mysten/sui":"1.42.0","@suilend/sui-fe":"^0.3.44","@pythnetwork/pyth-sui-js":"^2.2.0"},"overrides":{"chalk":"5.3.0","strip-ansi":"7.1.0","color-convert":"2.0.1","color-name":"1.1.4","is-core-module":"2.13.1","error-ex":"1.3.2","has-ansi":"5.0.1"}}
|
package/strategies.js
CHANGED
|
@@ -67,17 +67,17 @@ exports.STRATEGY_TYPE_FLASH_LOAN_OBJ_MAP = {
|
|
|
67
67
|
},
|
|
68
68
|
[strategyOwnerCap_1.StrategyType.xBTC_sSUI_SUI_LOOPING]: {
|
|
69
69
|
provider: StrategyFlashLoanProvider.MMT,
|
|
70
|
-
poolId: "0x57a662791cea065610455797dfd2751a3c10d929455d3ea88154a2b40cf6614e", // xBTC-
|
|
70
|
+
poolId: "0x57a662791cea065610455797dfd2751a3c10d929455d3ea88154a2b40cf6614e", // xBTC-suiWBTC 0.01% https://app.mmt.finance/liquidity/0x57a662791cea065610455797dfd2751a3c10d929455d3ea88154a2b40cf6614e
|
|
71
71
|
coinTypeA: sui_fe_1.NORMALIZED_xBTC_COINTYPE,
|
|
72
|
-
coinTypeB: sui_fe_1.
|
|
72
|
+
coinTypeB: sui_fe_1.NORMALIZED_suiWBTC_COINTYPE,
|
|
73
73
|
borrowA: true,
|
|
74
74
|
feePercent: 0.01,
|
|
75
75
|
},
|
|
76
|
-
[strategyOwnerCap_1.StrategyType.
|
|
76
|
+
[strategyOwnerCap_1.StrategyType.xBTC_suiWBTC_LOOPING]: {
|
|
77
77
|
provider: StrategyFlashLoanProvider.MMT,
|
|
78
|
-
poolId: "0x57a662791cea065610455797dfd2751a3c10d929455d3ea88154a2b40cf6614e", // xBTC-
|
|
78
|
+
poolId: "0x57a662791cea065610455797dfd2751a3c10d929455d3ea88154a2b40cf6614e", // xBTC-suiWBTC 0.01% https://app.mmt.finance/liquidity/0x57a662791cea065610455797dfd2751a3c10d929455d3ea88154a2b40cf6614e
|
|
79
79
|
coinTypeA: sui_fe_1.NORMALIZED_xBTC_COINTYPE,
|
|
80
|
-
coinTypeB: sui_fe_1.
|
|
80
|
+
coinTypeB: sui_fe_1.NORMALIZED_suiWBTC_COINTYPE,
|
|
81
81
|
borrowA: true,
|
|
82
82
|
feePercent: 0.01,
|
|
83
83
|
},
|
|
@@ -246,7 +246,7 @@ exports.STRATEGY_TYPE_EXPOSURE_MAP = {
|
|
|
246
246
|
max: new bignumber_js_1.default(2.5), // Actual max: 1 + (xBTC Open LTV %) * (1 / (1 - (sSUI Open LTV %))) = 3x, where xBTC Open LTV % = 60% and sSUI Open LTV % = 70%
|
|
247
247
|
default: new bignumber_js_1.default(2.5),
|
|
248
248
|
},
|
|
249
|
-
[strategyOwnerCap_1.StrategyType.
|
|
249
|
+
[strategyOwnerCap_1.StrategyType.xBTC_suiWBTC_LOOPING]: {
|
|
250
250
|
min: new bignumber_js_1.default(1),
|
|
251
251
|
max: new bignumber_js_1.default(2.2), // Actual max: 1 / (1 - (xBTC Open LTV %)) = 2.5x, where xBTC Open LTV % = 60%
|
|
252
252
|
default: new bignumber_js_1.default(2.2),
|
|
@@ -1436,7 +1436,7 @@ transaction, dryRunTransaction) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
1436
1436
|
if (lstDeposit.depositedAmount.lte(exports.STRATEGY_E)) {
|
|
1437
1437
|
// 1. MAX withdraws LST (transferred to user as SUI)
|
|
1438
1438
|
// 2. Withdraws base to cover borrows
|
|
1439
|
-
// - Leftover transferred to user as borrow coinType, e.g. SUI or
|
|
1439
|
+
// - Leftover transferred to user as borrow coinType, e.g. SUI or suiWBTC
|
|
1440
1440
|
yield fullyRepayBorrowsUsingBase();
|
|
1441
1441
|
break;
|
|
1442
1442
|
}
|
|
@@ -1444,7 +1444,7 @@ transaction, dryRunTransaction) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
1444
1444
|
if (pendingBorrowedAmount.lte(exports.STRATEGY_E)) {
|
|
1445
1445
|
try {
|
|
1446
1446
|
// 1. Withdraws LST to cover borrows
|
|
1447
|
-
// - Leftover transferred to user as borrow coinType, e.g. SUI or
|
|
1447
|
+
// - Leftover transferred to user as borrow coinType, e.g. SUI or suiWBTC
|
|
1448
1448
|
// 2. MAX withdraws remaining LST and redeposits as base
|
|
1449
1449
|
yield fullyRepayBorrowsUsingLst(true);
|
|
1450
1450
|
break;
|
|
@@ -1454,7 +1454,7 @@ transaction, dryRunTransaction) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
1454
1454
|
}
|
|
1455
1455
|
// 1. MAX withdraws LST (transferred to user as SUI)
|
|
1456
1456
|
// 2. Withdraws base to cover borrows
|
|
1457
|
-
// - Leftover transferred to user as borrow coinType, e.g. SUI or
|
|
1457
|
+
// - Leftover transferred to user as borrow coinType, e.g. SUI or suiWBTC
|
|
1458
1458
|
yield fullyRepayBorrowsUsingBase();
|
|
1459
1459
|
break;
|
|
1460
1460
|
}
|
|
@@ -1463,7 +1463,7 @@ transaction, dryRunTransaction) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
1463
1463
|
// Borrows almost fully repaid
|
|
1464
1464
|
if (pendingBorrowedAmount.lte(exports.STRATEGY_E)) {
|
|
1465
1465
|
// 1. Withdraws LST to cover borrows
|
|
1466
|
-
// - Leftover transferred to user as borrow coinType, e.g. SUI or
|
|
1466
|
+
// - Leftover transferred to user as borrow coinType, e.g. SUI or suiWBTC
|
|
1467
1467
|
yield fullyRepayBorrowsUsingLst(false);
|
|
1468
1468
|
break;
|
|
1469
1469
|
}
|
|
@@ -1566,7 +1566,7 @@ transaction, dryRunTransaction) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
1566
1566
|
// Borrows almost fully repaid
|
|
1567
1567
|
if (pendingBorrowedAmount.lte(exports.STRATEGY_E)) {
|
|
1568
1568
|
// 1. Withdraws base to cover borrows
|
|
1569
|
-
// - Leftover transferred to user as borrow coinType, e.g. SUI or
|
|
1569
|
+
// - Leftover transferred to user as borrow coinType, e.g. SUI or suiWBTC
|
|
1570
1570
|
yield fullyRepayBorrowsUsingBase();
|
|
1571
1571
|
break;
|
|
1572
1572
|
}
|