@sonarwatch/portfolio-plugins 0.12.164 → 0.12.166
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/index.js +4 -4
- package/src/index.js.map +1 -1
- package/src/plugins/abex/types.d.ts +5 -12
- package/src/plugins/aftermath/types.d.ts +2 -6
- package/src/plugins/alphafi/types.d.ts +1 -3
- package/src/plugins/bucket/types.d.ts +2 -3
- package/src/plugins/cetus/clmmsFetcher.js +3 -3
- package/src/plugins/cetus/clmmsFetcher.js.map +1 -1
- package/src/plugins/cetus/constants.d.ts +2 -0
- package/src/plugins/cetus/constants.js +5 -1
- package/src/plugins/cetus/constants.js.map +1 -1
- package/src/plugins/cetus/farmsFetcher.js +118 -0
- package/src/plugins/cetus/farmsFetcher.js.map +1 -0
- package/src/plugins/cetus/helpers.js +3 -2
- package/src/plugins/cetus/helpers.js.map +1 -1
- package/src/plugins/cetus/index.js +4 -2
- package/src/plugins/cetus/index.js.map +1 -1
- package/src/plugins/cetus/types.d.ts +92 -3
- package/src/plugins/cetus/types.js.map +1 -1
- package/src/plugins/cetus/vaultsJob.d.ts +3 -0
- package/src/plugins/cetus/vaultsJob.js +101 -0
- package/src/plugins/cetus/vaultsJob.js.map +1 -0
- package/src/plugins/drift/index.js +2 -1
- package/src/plugins/drift/index.js.map +1 -1
- package/src/plugins/flowx/stakingPoolV3Fetcher.js +2 -2
- package/src/plugins/flowx/stakingPoolV3Fetcher.js.map +1 -1
- package/src/plugins/flowx/types.d.ts +2 -3
- package/src/plugins/haedal/types.d.ts +1 -3
- package/src/plugins/jewel/types.d.ts +1 -3
- package/src/plugins/kai/types.d.ts +3 -6
- package/src/plugins/kriya/types.d.ts +1 -3
- package/src/plugins/kriya/types.js.map +1 -1
- package/src/plugins/{flexlend → lulo}/constants.d.ts +1 -1
- package/src/plugins/{flexlend → lulo}/constants.js +2 -2
- package/src/plugins/lulo/constants.js.map +1 -0
- package/src/plugins/lulo/depositsFetcher.js.map +1 -0
- package/src/plugins/{flexlend → lulo}/helpers.js +1 -1
- package/src/plugins/lulo/helpers.js.map +1 -0
- package/src/plugins/{flexlend → lulo}/index.js +6 -1
- package/src/plugins/lulo/index.js.map +1 -0
- package/src/plugins/lulo/liftFetcher.d.ts +3 -0
- package/src/plugins/{flexlend → lulo}/liftFetcher.js +1 -1
- package/src/plugins/lulo/liftFetcher.js.map +1 -0
- package/src/plugins/lulo/rewardsFetcher.d.ts +3 -0
- package/src/plugins/lulo/rewardsFetcher.js +38 -0
- package/src/plugins/lulo/rewardsFetcher.js.map +1 -0
- package/src/plugins/lulo/struct.js.map +1 -0
- package/src/plugins/navi/types.d.ts +4 -9
- package/src/plugins/scallop/types/basic.d.ts +2 -3
- package/src/plugins/scallop/types/data.d.ts +1 -3
- package/src/plugins/tokens/fetchers/sui.js +1 -8
- package/src/plugins/tokens/fetchers/sui.js.map +1 -1
- package/src/plugins/tradeport/types.d.ts +1 -4
- package/src/plugins/turbos/clmmVaultFetcher.js +2 -2
- package/src/plugins/turbos/clmmVaultFetcher.js.map +1 -1
- package/src/plugins/turbos/clmmsPositionsFetcher.js +2 -1
- package/src/plugins/turbos/clmmsPositionsFetcher.js.map +1 -1
- package/src/plugins/turbos/helper.d.ts +0 -1
- package/src/plugins/turbos/helper.js +1 -6
- package/src/plugins/turbos/helper.js.map +1 -1
- package/src/plugins/turbos/types.d.ts +2 -6
- package/src/plugins/typus/constants.d.ts +8 -0
- package/src/plugins/typus/constants.js +12 -1
- package/src/plugins/typus/constants.js.map +1 -1
- package/src/plugins/typus/index.js +4 -2
- package/src/plugins/typus/index.js.map +1 -1
- package/src/plugins/typus/safuFetcher.d.ts +3 -0
- package/src/plugins/typus/safuFetcher.js +97 -0
- package/src/plugins/typus/safuFetcher.js.map +1 -0
- package/src/plugins/typus/safuVaultsJob.d.ts +3 -0
- package/src/plugins/typus/safuVaultsJob.js +30 -0
- package/src/plugins/typus/safuVaultsJob.js.map +1 -0
- package/src/plugins/typus/safu_helpers.d.ts +8 -0
- package/src/plugins/typus/safu_helpers.js +205 -0
- package/src/plugins/typus/safu_helpers.js.map +1 -0
- package/src/plugins/typus/safu_types.d.ts +55 -0
- package/src/plugins/typus/safu_types.js +3 -0
- package/src/plugins/typus/safu_types.js.map +1 -0
- package/src/plugins/typus/types.d.ts +1 -3
- package/src/utils/name-service/services/aptos.js +1 -1
- package/src/utils/name-service/services/aptos.js.map +1 -1
- package/src/utils/name-service/services/bonfida.js +1 -1
- package/src/utils/name-service/services/bonfida.js.map +1 -1
- package/src/utils/name-service/services/sui.js +4 -2
- package/src/utils/name-service/services/sui.js.map +1 -1
- package/src/utils/sui/bitsToNumber.d.ts +1 -0
- package/src/utils/sui/bitsToNumber.js +11 -0
- package/src/utils/sui/bitsToNumber.js.map +1 -0
- package/src/utils/sui/structs/id.d.ts +3 -0
- package/src/utils/sui/structs/id.js +3 -0
- package/src/utils/sui/structs/id.js.map +1 -0
- package/src/utils/sui/structs/nft.d.ts +2 -3
- package/src/utils/sui/types.d.ts +2 -3
- package/src/plugins/flexlend/constants.js.map +0 -1
- package/src/plugins/flexlend/depositsFetcher.js.map +0 -1
- package/src/plugins/flexlend/helpers.js.map +0 -1
- package/src/plugins/flexlend/index.js.map +0 -1
- package/src/plugins/flexlend/liftFetcher.js.map +0 -1
- package/src/plugins/flexlend/struct.js.map +0 -1
- /package/src/plugins/{flexlend/depositsFetcher.d.ts → cetus/farmsFetcher.d.ts} +0 -0
- /package/src/plugins/{flexlend/liftFetcher.d.ts → lulo/depositsFetcher.d.ts} +0 -0
- /package/src/plugins/{flexlend → lulo}/depositsFetcher.js +0 -0
- /package/src/plugins/{flexlend → lulo}/helpers.d.ts +0 -0
- /package/src/plugins/{flexlend → lulo}/index.d.ts +0 -0
- /package/src/plugins/{flexlend → lulo}/struct.d.ts +0 -0
- /package/src/plugins/{flexlend → lulo}/struct.js +0 -0
@@ -0,0 +1,101 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
|
+
const clients_1 = require("../../utils/clients");
|
18
|
+
const constants_1 = require("./constants");
|
19
|
+
const helpers_1 = require("./helpers");
|
20
|
+
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
21
|
+
const getDynamicFieldObjects_1 = require("../../utils/sui/getDynamicFieldObjects");
|
22
|
+
const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
|
23
|
+
const bitsToNumber_1 = require("../../utils/sui/bitsToNumber");
|
24
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
25
|
+
var _a;
|
26
|
+
const client = (0, clients_1.getClientSui)();
|
27
|
+
const vaultToPoolMapItems = yield (0, getDynamicFieldObjects_1.getDynamicFieldObjects)(client, constants_1.vaultManagerMap);
|
28
|
+
const vaults = yield (0, multiGetObjects_1.multiGetObjects)(client, vaultToPoolMapItems
|
29
|
+
.map((vaultToPoolMapItem) => { var _a, _b; return (_b = (_a = vaultToPoolMapItem.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.name; })
|
30
|
+
.filter((v) => v !== null));
|
31
|
+
const pools = (yield cache.getItems(vaults
|
32
|
+
.map((v) => { var _a, _b; return (_b = (_a = v.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.pool; })
|
33
|
+
.filter((s) => s !== null), {
|
34
|
+
prefix: constants_1.clmmPoolsPrefix,
|
35
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
36
|
+
})).filter((p) => p !== null);
|
37
|
+
const tokenPriceSources = [];
|
38
|
+
for (const vault of vaults) {
|
39
|
+
if (!((_a = vault.data) === null || _a === void 0 ? void 0 : _a.content))
|
40
|
+
continue;
|
41
|
+
const pool = pools.find((p) => { var _a, _b; return p.poolAddress === ((_b = (_a = vault.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.pool); });
|
42
|
+
if (!pool)
|
43
|
+
continue;
|
44
|
+
const { type_arguments: typeArgs } = (0, helpers_1.extractStructTagFromType)(vault.data.type);
|
45
|
+
const [lpToken] = typeArgs;
|
46
|
+
const totalSupply = new bignumber_js_1.default(vault.data.content.fields.lp_token_treasury.fields.total_supply.fields.value);
|
47
|
+
const balances = {};
|
48
|
+
vault.data.content.fields.positions.forEach((position) => {
|
49
|
+
const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(position.fields.clmm_postion.fields.liquidity), pool.current_tick_index, (0, bitsToNumber_1.bitsToNumber)(position.fields.clmm_postion.fields.tick_lower_index.fields.bits), (0, bitsToNumber_1.bitsToNumber)(position.fields.clmm_postion.fields.tick_upper_index.fields.bits), false);
|
50
|
+
const coinTypeA = (0, portfolio_core_1.formatMoveTokenAddress)(pool.coinTypeA);
|
51
|
+
const coinTypeB = (0, portfolio_core_1.formatMoveTokenAddress)(pool.coinTypeB);
|
52
|
+
if (tokenAmountA.isGreaterThan(0)) {
|
53
|
+
balances[coinTypeA] = (balances[coinTypeA] || new bignumber_js_1.default(0)).plus(tokenAmountA);
|
54
|
+
}
|
55
|
+
if (tokenAmountB.isGreaterThan(0)) {
|
56
|
+
balances[coinTypeB] = (balances[coinTypeB] || new bignumber_js_1.default(0)).plus(tokenAmountB);
|
57
|
+
}
|
58
|
+
});
|
59
|
+
const coinMetadata = yield client.getCoinMetadata({ coinType: lpToken });
|
60
|
+
if (!coinMetadata)
|
61
|
+
continue;
|
62
|
+
const tokenPrices = yield cache.getTokenPricesAsMap(Object.keys(balances).map((c) => c), portfolio_core_1.NetworkId.sui);
|
63
|
+
const underlyings = Object.keys(balances)
|
64
|
+
.map((address) => {
|
65
|
+
const balance = balances[address];
|
66
|
+
const tokenPrice = tokenPrices.get(address);
|
67
|
+
if (!tokenPrice)
|
68
|
+
return null;
|
69
|
+
const amountPerLp = balance
|
70
|
+
.dividedBy(Math.pow(10, tokenPrice.decimals))
|
71
|
+
.dividedBy(totalSupply.dividedBy(Math.pow(10, coinMetadata.decimals)));
|
72
|
+
return {
|
73
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
74
|
+
address: tokenPrice.address,
|
75
|
+
price: tokenPrice.price,
|
76
|
+
decimals: tokenPrice.decimals,
|
77
|
+
amountPerLp: amountPerLp.toNumber(),
|
78
|
+
};
|
79
|
+
})
|
80
|
+
.filter((u) => u !== null);
|
81
|
+
tokenPriceSources.push({
|
82
|
+
id: vault.data.content.fields.id.id,
|
83
|
+
weight: 1,
|
84
|
+
address: (0, portfolio_core_1.formatMoveTokenAddress)(lpToken),
|
85
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
86
|
+
platformId: constants_1.platformId,
|
87
|
+
decimals: coinMetadata.decimals,
|
88
|
+
price: underlyings.reduce((acc, u) => u.price * u.amountPerLp + acc, 0),
|
89
|
+
underlyings,
|
90
|
+
timestamp: Date.now(),
|
91
|
+
});
|
92
|
+
}
|
93
|
+
yield cache.setTokenPriceSources(tokenPriceSources);
|
94
|
+
});
|
95
|
+
const job = {
|
96
|
+
id: `${constants_1.platformId}-vaults`,
|
97
|
+
executor,
|
98
|
+
label: 'normal',
|
99
|
+
};
|
100
|
+
exports.default = job;
|
101
|
+
//# sourceMappingURL=vaultsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"vaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cetus/vaultsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAGrC,iDAAmD;AACnD,2CAA2E;AAC3E,uCAAqD;AAErD,qEAAkE;AAClE,mFAAgF;AAChF,wFAAyF;AACzF,+DAA4D;AAE5D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,mBAAmB,GAAG,MAAM,IAAA,+CAAsB,EACtD,MAAM,EACN,2BAAe,CAChB,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAe,EAClC,MAAM,EACN,mBAAmB;SAChB,GAAG,CACF,CAAC,kBAAkB,EAAE,EAAE,eAAC,OAAA,MAAA,MAAA,kBAAkB,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,IAAI,CAAA,EAAA,CACtE;SACA,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAa,CACzC,CAAC;IAEF,MAAM,KAAK,GAAG,CACZ,MAAM,KAAK,CAAC,QAAQ,CAClB,MAAM;SACH,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,eAAC,OAAA,MAAA,MAAA,CAAC,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,IAAI,CAAA,EAAA,CAAC;SACxC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAa,EACxC;QACE,MAAM,EAAE,2BAAe;QACvB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CACF,CACF,CAAC,MA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tD,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -10,9 +10,10 @@ const prepMarketsJob_1 = __importDefault(require("./prepMarketsJob"));
|
|
10
10
|
const depositsFetcher_1 = __importDefault(require("./depositsFetcher"));
|
11
11
|
const premarketJob_1 = __importDefault(require("./premarketJob"));
|
12
12
|
// import airdropFetcher from './airdropFetcher';
|
13
|
+
const airdropFetcher_1 = __importDefault(require("./airdropFetcher"));
|
13
14
|
exports.platforms = [constants_1.platform];
|
14
15
|
exports.jobs = [spotMarketsJob_1.default, premarketJob_1.default, prepMarketsJob_1.default];
|
15
|
-
exports.fetchers = [depositsFetcher_1.default];
|
16
|
+
exports.fetchers = [depositsFetcher_1.default, airdropFetcher_1.default];
|
16
17
|
var helpersAirdrop_1 = require("./helpersAirdrop");
|
17
18
|
Object.defineProperty(exports, "airdropFetcher", { enumerable: true, get: function () { return helpersAirdrop_1.airdropFetcher; } });
|
18
19
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;AAC9C,sEAA8C;AAC9C,wEAAgD;AAChD,kEAA0C;AAC1C,iDAAiD;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;AAC9C,sEAA8C;AAC9C,wEAAgD;AAChD,kEAA0C;AAC1C,iDAAiD;AACjD,sEAAmD;AAEtC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,wBAAc,EAAE,sBAAY,EAAE,wBAAc,CAAC,CAAC;AAC7D,QAAA,QAAQ,GAAc,CAAC,yBAAe,EAAE,wBAAmB,CAAC,CAAC;AAC1E,mDAAkD;AAAzC,gHAAA,cAAc,OAAA"}
|
@@ -20,7 +20,7 @@ const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
|
|
20
20
|
const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
|
21
21
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
22
|
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
23
|
-
const
|
23
|
+
const bitsToNumber_1 = require("../../utils/sui/bitsToNumber");
|
24
24
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
25
25
|
const client = (0, clients_1.getClientSui)();
|
26
26
|
const positions = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
|
@@ -59,7 +59,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
59
59
|
const tokenPriceY = tokenPrices.get((0, portfolio_core_1.formatMoveTokenAddress)(position.data.content.fields.coin_type_y.fields.name));
|
60
60
|
if (!tokenPriceX || !tokenPriceY)
|
61
61
|
return;
|
62
|
-
const tokenAmounts = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default((_h = (_g = position.data) === null || _g === void 0 ? void 0 : _g.content) === null || _h === void 0 ? void 0 : _h.fields.liquidity), (0,
|
62
|
+
const tokenAmounts = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default((_h = (_g = position.data) === null || _g === void 0 ? void 0 : _g.content) === null || _h === void 0 ? void 0 : _h.fields.liquidity), (0, bitsToNumber_1.bitsToNumber)((_k = (_j = pool === null || pool === void 0 ? void 0 : pool.data) === null || _j === void 0 ? void 0 : _j.content) === null || _k === void 0 ? void 0 : _k.fields.tick_index.fields.bits), (0, bitsToNumber_1.bitsToNumber)((_m = (_l = position.data) === null || _l === void 0 ? void 0 : _l.content) === null || _m === void 0 ? void 0 : _m.fields.tick_lower_index.fields.bits), (0, bitsToNumber_1.bitsToNumber)((_p = (_o = position.data) === null || _o === void 0 ? void 0 : _o.content) === null || _p === void 0 ? void 0 : _p.fields.tick_upper_index.fields.bits), false);
|
63
63
|
const assetX = (0, tokenPriceToAssetToken_1.default)(tokenPriceX.address, tokenAmounts.tokenAmountA
|
64
64
|
.dividedBy(Math.pow(10, tokenPriceX.decimals))
|
65
65
|
.toNumber(), portfolio_core_1.NetworkId.sui, tokenPriceX);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingPoolV3Fetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowx/stakingPoolV3Fetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAGrC,2CAAsD;AACtD,iDAAmD;AAEnD,qEAAkE;AAClE,wFAAyF;AACzF,qGAA6E;AAC7E,qEAAkE;AAClE
|
1
|
+
{"version":3,"file":"stakingPoolV3Fetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowx/stakingPoolV3Fetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAGrC,2CAAsD;AACtD,iDAAmD;AAEnD,qEAAkE;AAClE,wFAAyF;AACzF,qGAA6E;AAC7E,qEAAkE;AAClE,+DAA4D;AAE5D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,SAAS,GAAG,MAAM,IAAA,iCAAe,EAAmB,MAAM,EAAE,KAAK,EAAE;QACvE,MAAM,EAAE;YACN,UAAU,EAAE,GAAG,uBAAW,sBAAsB;SACjD;KACF,CAAC,CAAC;IACH,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE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EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACtD,IAAI,EAAE;gBACJ,WAAW;aACZ;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,kBAAkB;IACnC,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { ID } from '../../utils/sui/structs/id';
|
1
2
|
export type StakingPosition = {
|
2
3
|
id: {
|
3
4
|
id: string;
|
@@ -20,9 +21,7 @@ export type UnstakingPositionObject = {
|
|
20
21
|
export type PositionObject = {
|
21
22
|
amount: string;
|
22
23
|
flx_reward_debt: string;
|
23
|
-
id:
|
24
|
-
id: string;
|
25
|
-
};
|
24
|
+
id: ID;
|
26
25
|
pool_idx: string;
|
27
26
|
token_reward_debt: string;
|
28
27
|
};
|
@@ -1,14 +1,11 @@
|
|
1
|
+
import { ID } from '../../utils/sui/structs/id';
|
1
2
|
export interface Vault {
|
2
3
|
free_balance: string;
|
3
|
-
id:
|
4
|
-
id: string;
|
5
|
-
};
|
4
|
+
id: ID;
|
6
5
|
lp_treasury: {
|
7
6
|
type: string;
|
8
7
|
fields: {
|
9
|
-
id:
|
10
|
-
id: string;
|
11
|
-
};
|
8
|
+
id: ID;
|
12
9
|
total_supply: {
|
13
10
|
type: string;
|
14
11
|
fields: {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { ID } from '../../utils/sui/structs/id';
|
1
2
|
export type VaultInfo = {
|
2
3
|
id: string;
|
3
4
|
underlyingPool: string;
|
@@ -30,9 +31,6 @@ export type Vault = {
|
|
30
31
|
upper_trigger_price: string;
|
31
32
|
upper_trigger_price_scalling: string;
|
32
33
|
};
|
33
|
-
export type ID = {
|
34
|
-
id: string;
|
35
|
-
};
|
36
34
|
export type RewardsBag = {
|
37
35
|
fields: RewardsBagFields;
|
38
36
|
type: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/types.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/types.ts"],"names":[],"mappings":";;;AA8IA,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,wBAAU,CAAA;IACV,6BAAe,CAAA;AACjB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAED,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,wCAA0B,CAAA;IAC1B,6BAAe,CAAA;AACjB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}
|
@@ -2,5 +2,5 @@ import { PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { Platform } from '@sonarwatch/portfolio-core';
|
3
3
|
export declare const platformId = "flexlend";
|
4
4
|
export declare const platform: Platform;
|
5
|
-
export declare const
|
5
|
+
export declare const luloProgramId: PublicKey;
|
6
6
|
export declare const AUTOMATION_PUBLIC_KEY: PublicKey;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.AUTOMATION_PUBLIC_KEY = exports.
|
3
|
+
exports.AUTOMATION_PUBLIC_KEY = exports.luloProgramId = exports.platform = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'flexlend';
|
6
6
|
exports.platform = {
|
@@ -11,6 +11,6 @@ exports.platform = {
|
|
11
11
|
website: 'https://www.lulo.fi',
|
12
12
|
twitter: 'https://twitter.com/uselulo',
|
13
13
|
};
|
14
|
-
exports.
|
14
|
+
exports.luloProgramId = new web3_js_1.PublicKey('FL3X2pRsQ9zHENpZSKDRREtccwJuei8yg9fwDu9UN69Q');
|
15
15
|
exports.AUTOMATION_PUBLIC_KEY = new web3_js_1.PublicKey('8PWR75ppAGonv9dXStjficjXmdsuDKmDoVNcy4oYhAMs');
|
16
16
|
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,6BAA6B;CACvC,CAAC;AAEW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,qBAAqB,GAAG,IAAI,mBAAS,CAChD,8CAA8C,CAC/C,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAAyD;AAGzD,2CAAyC;AACzC,uCAA8C;AAC9C,+EAA4D;AAC5D,0EAA8D;AAC9D,mFAA6D;AAC7D,mDAA2D;AAC3D,kFAA+E;AAC/E,iDAAsD;AACtD,qCAA6C;AAC7C,6CAAmD;AACnD,iDAA8E;AAE9E,gGAA6F;AAC7F,6CAA6D;AAC7D,yEAA4E;AAG5E,qDAA2D;AAC3D,iDAA4D;AAE5D,MAAM,QA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AAEF,kBAAe,OAAO,CAAC"}
|
@@ -4,7 +4,7 @@ exports.isLiftEmpty = exports.getDerivedAccount = void 0;
|
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
const constants_1 = require("./constants");
|
6
6
|
function getDerivedAccount(owner) {
|
7
|
-
return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('flexlend', 'utf8'), new web3_js_1.PublicKey(owner).toBuffer()], constants_1.
|
7
|
+
return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('flexlend', 'utf8'), new web3_js_1.PublicKey(owner).toBuffer()], constants_1.luloProgramId)[0].toString();
|
8
8
|
}
|
9
9
|
exports.getDerivedAccount = getDerivedAccount;
|
10
10
|
function isLiftEmpty(authoritySeed) {
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,2CAA4C;AAE5C,SAAgB,iBAAiB,CAAC,KAAa;IAC7C,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,EAClE,yBAAa,CACd,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAClB,CAAC;AALD,8CAKC;AAED,SAAgB,WAAW,CAAC,aAAuB;IACjD,OAAO,CACL,aAAa,CAAC,QAAQ,EAAE;QACxB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CACrE,CAAC;AACJ,CAAC;AALD,kCAKC"}
|
@@ -7,7 +7,12 @@ exports.fetchers = exports.jobs = exports.platforms = void 0;
|
|
7
7
|
const depositsFetcher_1 = __importDefault(require("./depositsFetcher"));
|
8
8
|
const liftFetcher_1 = __importDefault(require("./liftFetcher"));
|
9
9
|
const constants_1 = require("./constants");
|
10
|
+
const rewardsFetcher_1 = __importDefault(require("./rewardsFetcher"));
|
10
11
|
exports.platforms = [constants_1.platform];
|
11
12
|
exports.jobs = [];
|
12
|
-
exports.fetchers = [
|
13
|
+
exports.fetchers = [
|
14
|
+
depositsFetcher_1.default,
|
15
|
+
liftFetcher_1.default,
|
16
|
+
rewardsFetcher_1.default,
|
17
|
+
];
|
13
18
|
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/index.ts"],"names":[],"mappings":";;;;;;AAGA,wEAAgD;AAChD,gEAAwC;AACxC,2CAAuC;AACvC,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc;IACjC,yBAAe;IACf,qBAAW;IACX,wBAAc;CACf,CAAC"}
|
@@ -31,7 +31,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
31
31
|
if (!validAuthoritySeed)
|
32
32
|
return [];
|
33
33
|
const seedValue = Buffer.from(validAuthoritySeed.authoritySeed).toString('utf8');
|
34
|
-
const authorityAddress = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('promotion_authority'), Buffer.from(seedValue.toString())], constants_1.
|
34
|
+
const authorityAddress = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('promotion_authority'), Buffer.from(seedValue.toString())], constants_1.luloProgramId)[0];
|
35
35
|
const promotionAuthority = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, struct_1.promotionAuthorityStruct, authorityAddress);
|
36
36
|
if (!promotionAuthority)
|
37
37
|
return [];
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"liftFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/liftFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,6CAA4C;AAG5C,2CAAwD;AACxD,uCAA2D;AAC3D,kFAA+E;AAC/E,iDAAsD;AACtD,qCAAuE;AACvE,qGAA6E;AAC7E,+CAAoD;AAEpD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,WAAW,GAAG,IAAA,2BAAiB,EAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,MAAM,IAAA,2CAAoB,EACzC,MAAM,EACN,0BAAiB,EACjB,IAAI,mBAAS,CAAC,WAAW,CAAC,CAC3B,CAAC;IACF,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAEzB,MAAM,kBAAkB,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CACrD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAA,qBAAW,EAAC,CAAC,CAAC,aAAa,CAAC,CACrC,CAAC;IACF,IAAI,CAAC,kBAAkB;QAAE,OAAO,EAAE,CAAC;IAEnC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,QAAQ,CACtE,MAAM,CACP,CAAC;IAEF,MAAM,gBAAgB,GAAG,mBAAS,CAAC,sBAAsB,CACvD,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,EACvE,yBAAa,CACd,CAAC,CAAC,CAAC,CAAC;IACL,MAAM,kBAAkB,GAAG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38 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const constants_1 = require("./constants");
|
17
|
+
const airdropFetcher_1 = __importDefault(require("../drift/airdropFetcher"));
|
18
|
+
const rewardsFetcher_1 = __importDefault(require("../save/rewardsFetcher"));
|
19
|
+
const helpers_1 = require("./helpers");
|
20
|
+
const launchpad_1 = require("../jupiter/launchpad");
|
21
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
+
const pda = (0, helpers_1.getDerivedAccount)(owner);
|
23
|
+
const res = (yield Promise.all([
|
24
|
+
airdropFetcher_1.default.executor(pda, cache),
|
25
|
+
rewardsFetcher_1.default.executor(pda, cache),
|
26
|
+
...launchpad_1.lfgFetchers
|
27
|
+
.filter((fetcher) => fetcher.id.includes('kamino'))
|
28
|
+
.map((fetcher) => fetcher.executor(pda, cache)),
|
29
|
+
])).flat();
|
30
|
+
return res.map((element) => (Object.assign(Object.assign({}, element), { platformId: constants_1.platform.id, label: 'Rewards' })));
|
31
|
+
});
|
32
|
+
const fetcher = {
|
33
|
+
id: `${constants_1.platformId}-rewards`,
|
34
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
35
|
+
executor,
|
36
|
+
};
|
37
|
+
exports.default = fetcher;
|
38
|
+
//# sourceMappingURL=rewardsFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rewardsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/rewardsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,2CAAmD;AACnD,6EAA0D;AAC1D,4EAA0D;AAC1D,uCAA8C;AAG9C,oDAAmD;AAEnD,MAAM,QAAQ,GAAoB,CAChC,KAAa,EACb,KAAY,EACiB,EAAE;IAC/B,MAAM,GAAG,GAAG,IAAA,2BAAiB,EAAC,KAAK,CAAC,CAAC;IAErC,MAAM,GAAG,GAAG,CACV,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,wBAAmB,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC;QACxC,wBAAoB,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC;QACzC,GAAG,uBAAW;aACX,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;aAClD,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KAClD,CAAC,CACH,CAAC,IAAI,EAAE,CAAC;IAET,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,iCACvB,OAAO,KACV,UAAU,EAAE,oBAAQ,CAAC,EAAE,EACvB,KAAK,EAAE,SAAS,IAChB,CAAC,CAAC;AACN,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT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AAU,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;IAC3C,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,CAAC,CAAC,CAAC;CAC5C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAA0B,CACrC,CAAC"}
|
@@ -1,7 +1,6 @@
|
|
1
|
+
import { ID } from '../../utils/sui/structs/id';
|
1
2
|
export type ReserveData = {
|
2
|
-
id:
|
3
|
-
id: string;
|
4
|
-
};
|
3
|
+
id: ID;
|
5
4
|
name: number;
|
6
5
|
value: {
|
7
6
|
type: string;
|
@@ -53,18 +52,14 @@ export type Balance = {
|
|
53
52
|
user_state: {
|
54
53
|
type: string;
|
55
54
|
fields: {
|
56
|
-
id:
|
57
|
-
id: string;
|
58
|
-
};
|
55
|
+
id: ID;
|
59
56
|
size: string;
|
60
57
|
};
|
61
58
|
};
|
62
59
|
};
|
63
60
|
};
|
64
61
|
export type BalanceData = {
|
65
|
-
id:
|
66
|
-
id: string;
|
67
|
-
};
|
62
|
+
id: ID;
|
68
63
|
name: string;
|
69
64
|
value: string;
|
70
65
|
};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
2
2
|
import { CoinTypeMetadata } from './coin';
|
3
3
|
import { sCoinNames } from '../constants';
|
4
|
+
import { ID } from '../../../utils/sui/structs/id';
|
4
5
|
export type UserLending = {
|
5
6
|
coinType: string;
|
6
7
|
amount: BigNumber;
|
@@ -48,9 +49,6 @@ export type Fields = {
|
|
48
49
|
id: ID;
|
49
50
|
size: string;
|
50
51
|
};
|
51
|
-
export type ID = {
|
52
|
-
id: string;
|
53
|
-
};
|
54
52
|
export type ApiResponse = {
|
55
53
|
signature: {
|
56
54
|
[key: string]: number;
|
@@ -21,14 +21,7 @@ const helpers_1 = require("../helpers");
|
|
21
21
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
22
22
|
const client = (0, clients_1.getClientSui)();
|
23
23
|
const coinsBalances = yield client.getAllBalances({ owner });
|
24
|
-
const
|
25
|
-
const tokensPrices = yield cache.getTokenPrices(coinsTypes, portfolio_core_1.NetworkId.sui);
|
26
|
-
const tokenPricesMap = new Map();
|
27
|
-
tokensPrices.forEach((tp) => {
|
28
|
-
if (!tp)
|
29
|
-
return;
|
30
|
-
tokenPricesMap.set(tp.address, tp);
|
31
|
-
});
|
24
|
+
const tokenPricesMap = yield cache.getTokenPricesAsMap([...new Set(coinsBalances.map((cb) => cb.coinType))], portfolio_core_1.NetworkId.sui);
|
32
25
|
const walletTokensAssets = [];
|
33
26
|
const liquiditiesByTag = {};
|
34
27
|
for (let i = 0; i < coinsBalances.length; i++) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sui.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/tokens/fetchers/sui.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"sui.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/tokens/fetchers/sui.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AAIpC,oDAAsD;AACtD,wGAAgF;AAChF,4CAAoD;AACpD,0GAAkF;AAClF,wCAAkD;AAElD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAE7D,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACpD,CAAC,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,C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CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU;YACV,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,eAAe;YACtB,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACtD,IAAI,EAAE;gBACJ,WAAW;aACZ;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,gCAAoB,CAAC,EAAE,MAAM;IACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -18,10 +18,10 @@ const constants_1 = require("./constants");
|
|
18
18
|
const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
|
19
19
|
const clients_1 = require("../../utils/clients");
|
20
20
|
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
21
|
-
const helper_1 = require("./helper");
|
22
21
|
const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
|
23
22
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
24
23
|
const multiDynamicFieldObjects_1 = require("../../utils/sui/multiDynamicFieldObjects");
|
24
|
+
const bitsToNumber_1 = require("../../utils/sui/bitsToNumber");
|
25
25
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
26
26
|
var _a;
|
27
27
|
const client = (0, clients_1.getClientSui)();
|
@@ -137,7 +137,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
137
137
|
const clmmPosition = clmmPositionById.get(vaultInfo.base_clmm_position_id);
|
138
138
|
if (!pool || !clmmPosition)
|
139
139
|
continue;
|
140
|
-
const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0,
|
140
|
+
const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, bitsToNumber_1.bitsToNumber)(vaultInfo.base_last_tick_index.fields.bits), (0, bitsToNumber_1.bitsToNumber)(clmmPosition.tick_lower_index.fields.bits), (0, bitsToNumber_1.bitsToNumber)(clmmPosition.tick_upper_index.fields.bits), false);
|
141
141
|
const coinA = (0, portfolio_core_1.formatMoveTokenAddress)(vaultInfo.coin_a_type_name.fields.name);
|
142
142
|
const coinB = (0, portfolio_core_1.formatMoveTokenAddress)(vaultInfo.coin_b_type_name.fields.name);
|
143
143
|
const tokenPriceA = tokenPriceById.get(coinA);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"clmmVaultFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/clmmVaultFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AAGrC,2CAA0E;AAC1E,qEAAkE;AAClE,iDAAmD;AAQnD,qEAAkE;AAClE,
|
1
|
+
{"version":3,"file":"clmmVaultFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/clmmVaultFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AAGrC,2CAA0E;AAC1E,qEAAkE;AAClE,iDAAmD;AAQnD,qEAAkE;AAClE,wFAAyF;AACzF,qGAA6E;AAC7E,uFAAoF;AACpF,+DAA4D;AAE5D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,uBAAuB,GAAG,MAAM,IAAA,iC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;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -21,6 +21,7 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
|
|
21
21
|
const helper_1 = require("./helper");
|
22
22
|
const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
|
23
23
|
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
24
|
+
const bitsToNumber_1 = require("../../utils/sui/bitsToNumber");
|
24
25
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
25
26
|
var _a, _b;
|
26
27
|
const client = (0, clients_1.getClientSui)();
|
@@ -81,7 +82,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
81
82
|
const pool = poolsById.get(nftPosition.pool_id);
|
82
83
|
if (!pool)
|
83
84
|
continue;
|
84
|
-
const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0,
|
85
|
+
const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, bitsToNumber_1.bitsToNumber)(pool.tick_current_index.fields.bits), (0, bitsToNumber_1.bitsToNumber)(clmmPosition.tick_lower_index.fields.bits), (0, bitsToNumber_1.bitsToNumber)(clmmPosition.tick_upper_index.fields.bits), false);
|
85
86
|
// TODO : améliorer le problème du 0x000002::sui::SUI + manque de 0x
|
86
87
|
const coinA = (0, helper_1.formatForNative)(`0x${nftPosition.coin_type_a.fields.name}`);
|
87
88
|
const coinB = (0, helper_1.formatForNative)(`0x${nftPosition.coin_type_b.fields.name}`);
|