@sonarwatch/portfolio-plugins 0.11.97 → 0.11.99
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1095 -1087
- package/README.md +3 -3
- package/package.json +3 -3
- package/src/plugins/01/depostisFetcher.js +2 -1
- package/src/plugins/01/depostisFetcher.js.map +1 -1
- package/src/plugins/aave/helpers.js +2 -1
- package/src/plugins/aave/helpers.js.map +1 -1
- package/src/plugins/aftermath/poolsJob.js +22 -20
- package/src/plugins/aftermath/poolsJob.js.map +1 -1
- package/src/plugins/aptin/depositsFetcher.js +2 -1
- package/src/plugins/aptin/depositsFetcher.js.map +1 -1
- package/src/plugins/aries/depositsFetcher.js +2 -1
- package/src/plugins/aries/depositsFetcher.js.map +1 -1
- package/src/plugins/aurory/helpers.d.ts +1 -1
- package/src/plugins/aurory/helpers.js +1 -12
- package/src/plugins/aurory/helpers.js.map +1 -1
- package/src/plugins/aurory/stakingFetcher.js +1 -1
- package/src/plugins/aurory/stakingFetcher.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/bucket/collateralFetcher.js +7 -9
- package/src/plugins/bucket/collateralFetcher.js.map +1 -1
- package/src/plugins/cetus/clmmsFetcher.js +5 -5
- package/src/plugins/cetus/clmmsFetcher.js.map +1 -1
- package/src/plugins/cetus/helpers.d.ts +4 -4
- package/src/plugins/cetus/helpers.js +23 -12
- package/src/plugins/cetus/helpers.js.map +1 -1
- package/src/plugins/cetus/poolsJob.js +5 -10
- package/src/plugins/cetus/poolsJob.js.map +1 -1
- package/src/plugins/compound/getPositionsV2Fetcher.js +2 -1
- package/src/plugins/compound/getPositionsV2Fetcher.js.map +1 -1
- package/src/plugins/compound/getPositionsV3Fetcher.js +2 -1
- package/src/plugins/compound/getPositionsV3Fetcher.js.map +1 -1
- package/src/plugins/drift/deposits.js +2 -1
- package/src/plugins/drift/deposits.js.map +1 -1
- package/src/plugins/flash/perpetualFetcher.js +2 -1
- package/src/plugins/flash/perpetualFetcher.js.map +1 -1
- package/src/plugins/flowmatic/stakingFetcher.js +2 -0
- package/src/plugins/flowmatic/stakingFetcher.js.map +1 -1
- package/src/plugins/genesysgo/stakingFetcher.js +2 -0
- package/src/plugins/genesysgo/stakingFetcher.js.map +1 -1
- package/src/plugins/jupiter/perpetualFetcher.js +2 -1
- package/src/plugins/jupiter/perpetualFetcher.js.map +1 -1
- package/src/plugins/kamino/lendsFetcher.js +6 -3
- package/src/plugins/kamino/lendsFetcher.js.map +1 -1
- package/src/plugins/maker/vaultsFetcher.js +2 -1
- package/src/plugins/maker/vaultsFetcher.js.map +1 -1
- package/src/plugins/mango/boostFetcher.js +2 -1
- package/src/plugins/mango/boostFetcher.js.map +1 -1
- package/src/plugins/mango/collateralFetcher.js +2 -1
- package/src/plugins/mango/collateralFetcher.js.map +1 -1
- package/src/plugins/mango/redeemFetcher.js +2 -1
- package/src/plugins/mango/redeemFetcher.js.map +1 -1
- package/src/plugins/maple/ethereumFetcher.js +2 -1
- package/src/plugins/maple/ethereumFetcher.js.map +1 -1
- package/src/plugins/marginfi/fetcherExecutor.js +2 -1
- package/src/plugins/marginfi/fetcherExecutor.js.map +1 -1
- package/src/plugins/morpho/aaveV3CollateralFetcher.js +2 -1
- package/src/plugins/morpho/aaveV3CollateralFetcher.js.map +1 -1
- package/src/plugins/navi/collateralFetcher.js +10 -8
- package/src/plugins/navi/collateralFetcher.js.map +1 -1
- package/src/plugins/navi/reservesJob.js +5 -4
- package/src/plugins/navi/reservesJob.js.map +1 -1
- package/src/plugins/port/obligationsFetcher.js +2 -1
- package/src/plugins/port/obligationsFetcher.js.map +1 -1
- package/src/plugins/scallop/helpers.d.ts +0 -49
- package/src/plugins/scallop/helpers.js +1 -39
- package/src/plugins/scallop/helpers.js.map +1 -1
- package/src/plugins/scallop/lendingsFetcher.js +19 -15
- package/src/plugins/scallop/lendingsFetcher.js.map +1 -1
- package/src/plugins/scallop/marketJob.js +16 -16
- package/src/plugins/scallop/marketJob.js.map +1 -1
- package/src/plugins/scallop/obligationsFetcher.js +27 -22
- package/src/plugins/scallop/obligationsFetcher.js.map +1 -1
- package/src/plugins/scallop/poolsJob.js +7 -12
- package/src/plugins/scallop/poolsJob.js.map +1 -1
- package/src/plugins/scallop/spoolsMarketJob.js +8 -15
- package/src/plugins/scallop/spoolsMarketJob.js.map +1 -1
- package/src/plugins/scallop/types/coin.d.ts +1 -1
- package/src/plugins/scallop/types/market.d.ts +3 -4
- package/src/plugins/scallop/types/market.js.map +1 -1
- package/src/plugins/solend/obligationsFetcher.js +2 -1
- package/src/plugins/solend/obligationsFetcher.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/thala/vaultsFetcher.js +2 -1
- package/src/plugins/thala/vaultsFetcher.js.map +1 -1
- package/src/plugins/tokens/fetchers/sui-nfts.js +47 -107
- package/src/plugins/tokens/fetchers/sui-nfts.js.map +1 -1
- package/src/plugins/tokens/types.d.ts +0 -48
- package/src/plugins/turbos/clmmsPositionsFetcher.js +18 -16
- package/src/plugins/turbos/clmmsPositionsFetcher.js.map +1 -1
- package/src/plugins/turbos/helper.d.ts +3 -3
- package/src/plugins/turbos/helper.js +6 -4
- package/src/plugins/turbos/helper.js.map +1 -1
- package/src/plugins/turbos/poolsJob.js +10 -10
- package/src/plugins/turbos/poolsJob.js.map +1 -1
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/clients/getClientSui.d.ts +2 -2
- package/src/utils/clients/getClientSui.js +8 -3
- package/src/utils/clients/getClientSui.js.map +1 -1
- package/src/utils/clients/types.d.ts +2 -0
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/sui/getDynamicFieldObject.d.ts +4 -0
- package/src/utils/sui/{getMultipleObjectsSafe.js → getDynamicFieldObject.js} +9 -13
- package/src/utils/sui/getDynamicFieldObject.js.map +1 -0
- package/src/utils/sui/getDynamicFields.d.ts +3 -0
- package/src/utils/sui/getDynamicFields.js +38 -0
- package/src/utils/sui/getDynamicFields.js.map +1 -0
- package/src/utils/sui/getObject.d.ts +4 -0
- package/src/utils/sui/{getDynamicFieldsSafe.js → getObject.js} +8 -16
- package/src/utils/sui/getObject.js.map +1 -0
- package/src/utils/sui/getObjectDeletedResponse.d.ts +3 -0
- package/src/utils/sui/getObjectDeletedResponse.js +19 -0
- package/src/utils/sui/getObjectDeletedResponse.js.map +1 -0
- package/src/utils/sui/getObjectNotExistsResponse.d.ts +2 -0
- package/src/utils/sui/getObjectNotExistsResponse.js +14 -0
- package/src/utils/sui/getObjectNotExistsResponse.js.map +1 -0
- package/src/utils/sui/getOwnedObjects.d.ts +4 -0
- package/src/utils/sui/getOwnedObjects.js +36 -0
- package/src/utils/sui/getOwnedObjects.js.map +1 -0
- package/src/utils/sui/multiGetObjects.d.ts +4 -0
- package/src/utils/sui/multiGetObjects.js +32 -0
- package/src/utils/sui/multiGetObjects.js.map +1 -0
- package/src/utils/sui/queryEvents.d.ts +4 -0
- package/src/utils/sui/{queryEventSafe.js → queryEvents.js} +16 -12
- package/src/utils/sui/queryEvents.js.map +1 -0
- package/src/utils/sui/structs/kiosk.d.ts +7 -0
- package/src/utils/sui/structs/kiosk.js +3 -0
- package/src/utils/sui/structs/kiosk.js.map +1 -0
- package/src/utils/sui/structs/nft.d.ts +41 -0
- package/src/utils/sui/structs/nft.js +3 -0
- package/src/utils/sui/structs/nft.js.map +1 -0
- package/src/utils/sui/types.d.ts +23 -0
- package/src/utils/sui/types.js +3 -0
- package/src/utils/sui/types.js.map +1 -0
- package/src/utils/sui/getDynamicFieldsSafe.d.ts +0 -13
- package/src/utils/sui/getDynamicFieldsSafe.js.map +0 -1
- package/src/utils/sui/getFormattedCollectionNameAndId.d.ts +0 -4
- package/src/utils/sui/getFormattedCollectionNameAndId.js +0 -19
- package/src/utils/sui/getFormattedCollectionNameAndId.js.map +0 -1
- package/src/utils/sui/getMultipleObjectsSafe.d.ts +0 -67
- package/src/utils/sui/getMultipleObjectsSafe.js.map +0 -1
- package/src/utils/sui/queryEventSafe.d.ts +0 -14
- package/src/utils/sui/queryEventSafe.js.map +0 -1
package/README.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
# @sonarwatch/portfolio-plugins
|
2
|
-
|
3
|
-
This library is @sonarwatch/portfolio-plugins
|
1
|
+
# @sonarwatch/portfolio-plugins
|
2
|
+
|
3
|
+
This library is @sonarwatch/portfolio-plugins
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.99",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"@metaplex-foundation/beet-solana": "^0.4.0",
|
19
19
|
"@metaplex-foundation/js": "^0.19.4",
|
20
20
|
"@metaplex-foundation/umi-serializers-encodings": "^0.8.9",
|
21
|
-
"@mysten/sui.js": "^0.
|
21
|
+
"@mysten/sui.js": "^0.50.1",
|
22
22
|
"@onsol/tldparser": "^0.6.1",
|
23
23
|
"@sei-js/core": "^3.0.1",
|
24
24
|
"@sei-js/proto": "^3.0.1",
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"web3-v1": "npm:web3@^1.5.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
44
|
-
"@sonarwatch/portfolio-core": "0.11.
|
44
|
+
"@sonarwatch/portfolio-core": "0.11.102"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
@@ -53,7 +53,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
53
53
|
const elements = [];
|
54
54
|
if (suppliedAssets.length === 0)
|
55
55
|
return [];
|
56
|
-
const { borrowedValue, suppliedValue, value, healthRatio } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
|
56
|
+
const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
|
57
57
|
elements.push();
|
58
58
|
return [
|
59
59
|
{
|
@@ -71,6 +71,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
71
71
|
suppliedYields,
|
72
72
|
collateralRatio: null,
|
73
73
|
rewardAssets,
|
74
|
+
rewardValue,
|
74
75
|
healthRatio,
|
75
76
|
value,
|
76
77
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depostisFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/01/depostisFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAG5C,2CAAgD;AAChD,uCAAmC;AACnC,kFAA+E;AAC/E,qCAAwC;AACxC,iDAAsD;AACtD,iDAA+D;AAC/D,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,GAAG,GAAG,IAAA,gBAAM,EAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,MAAM,IAAA,2CAAoB,EAAC,MAAM,EAAE,qBAAY,EAAE,GAAG,CAAC,CAAC;IAEtE,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,YAAY,GAAqB,EAAE,CAAC;IAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACnD,MAAM,UA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AA,gCAAsB,EACpB,IAAI,EACJ,MAAM,CAAC,QAAQ,EAAE,EACjB,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CACF,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAuB,EAAE,CAAC;IAExC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE3C,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;IACxE,QAAQ,CAAC,IAAI,EAAE,CAAC;IAChB,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK;YACL,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,eAAe,EAAE,IAAI;gBAErB,YAAY;gBACZ,WAAW;gBACX,WAAW;gBACX,KAAK;aACN;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -237,9 +237,10 @@ function getElementLendingData(networkId, userSummary) {
|
|
237
237
|
}
|
238
238
|
}
|
239
239
|
const rewardAssets = getRewardAssets(networkId, calculatedUserIncentives);
|
240
|
-
const { borrowedValue, suppliedValue, healthRatio, value } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs);
|
240
|
+
const { borrowedValue, suppliedValue, healthRatio, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs);
|
241
241
|
const elementData = {
|
242
242
|
rewardAssets,
|
243
|
+
rewardValue,
|
243
244
|
borrowedAssets,
|
244
245
|
borrowedValue,
|
245
246
|
borrowedYields,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aave/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAcoC;AACpC,6DAGgC;AAChC,wDAAiE;AACjE,iDAG0B;AAS1B,6DAA+D;AAC/D,2CAAyC;AAE5B,QAAA,kBAAkB,GAAG,mBAAmB,CAAC;AAEtD,SAAsB,sBAAsB,CAC1C,OAAe,EACf,SAAwB,EACxB,OAAwB,EACxB,KAAY,EACZ,SAAqB;;;QAErB,MAAM,QAAQ,GAAiC,EAAE,CAAC;QAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,CAAC,MAAM;gBAAE,SAAS;YACtB,MAAM,EACJ,0BAA0B,EAC1B,yBAAyB,EACzB,8BAA8B,GAC/B,GAAG,MAAM,CAAC;YACX,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,OAAO,CACrC,0BAA0B,EAC1B;gBACE,MAAM,EAAE,0BAAkB;gBAC1B,SAAS;aACV,CACF,CAAC;YACF,IAAI,CAAC,WAAW;gBAAE,SAAS;YAE3B,MAAM,WAAW,GAAG,IAAA,0BAAc,EAAC,SAAS,CAAC,CAAC;YAC9C,MAAM,IAAI,GAAG,MAAA,WAAW,CAAC,SAAS,0CAAE,QAAQ,CAAC;YAC7C,MAAM,QAAQ,GAAG,MAAA,WAAW,CAAC,SAAS,0CAAE,QAAQ,CAAC;YACjD,MAAM,QAAQ,GAAG,IAAI,iCAAqB,CACxC;gBACE,GAAG,EA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,mBAAmB;QACnB,IAAI,eAAe,CAAC,eAAe,KAAK,GAAG,EAAE,CAAC;YAC5C,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,GAAG,yBAAyB,CACjE,SAAS,EACT,eAAe,CAChB,CAAC;YACF,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5B,cAAc,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAC7C,CAAC;QAED,WAAW;QACX,IAAI,eAAe,CAAC,iBAAiB,KAAK,GAAG,EAAE,CAAC;YAC9C,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,gBAAgB,CACrD,SAAS,EACT,eAAe,CAChB,CAAC;YACF,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvB,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5B,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IACD,MAAM,YAAY,GAAG,eAAe,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC;IAC1E,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aave/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAcoC;AACpC,6DAGgC;AAChC,wDAAiE;AACjE,iDAG0B;AAS1B,6DAA+D;AAC/D,2CAAyC;AAE5B,QAAA,kBAAkB,GAAG,mBAAmB,CAAC;AAEtD,SAAsB,sBAAsB,CAC1C,OAAe,EACf,SAAwB,EACxB,OAAwB,EACxB,KAAY,EACZ,SAAqB;;;QAErB,MAAM,QAAQ,GAAiC,EAAE,CAAC;QAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,MAAM,MAAM,G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AE,wBAAwB,CAAC,CAAC;IAC1E,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EACrB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,CACb,CAAC;IAEJ,MAAM,WAAW,GAAmC;QAClD,YAAY;QACZ,WAAW;QACX,cAAc;QACd,aAAa;QACb,cAAc;QACd,eAAe,EAAE,IAAI;QACrB,WAAW;QACX,cAAc;QACd,aAAa;QACb,cAAc;QACd,KAAK;KACN,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC;AAnED,sDAmEC"}
|
@@ -12,33 +12,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
const sui_js_1 = require("@mysten/sui.js");
|
16
15
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
16
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
18
17
|
const clients_1 = require("../../utils/clients");
|
19
18
|
const constants_1 = require("./constants");
|
20
19
|
const computeAndStoreLpPrice_1 = require("../../utils/misc/computeAndStoreLpPrice");
|
21
|
-
const getMultipleObjectsSafe_1 = __importDefault(require("../../utils/sui/getMultipleObjectsSafe"));
|
22
|
-
const getDynamicFieldsSafe_1 = __importDefault(require("../../utils/sui/getDynamicFieldsSafe"));
|
23
20
|
const aptos_1 = require("../../utils/aptos");
|
24
21
|
const getTokensPricesMap_1 = __importDefault(require("../../utils/misc/getTokensPricesMap"));
|
25
22
|
const getLpUnderlyingTokenSource_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSource"));
|
26
23
|
const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
|
24
|
+
const getDynamicFields_1 = require("../../utils/sui/getDynamicFields");
|
25
|
+
const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
|
27
26
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
28
|
-
var _a;
|
27
|
+
var _a, _b, _c, _d, _e;
|
29
28
|
const client = (0, clients_1.getClientSui)();
|
30
29
|
const networkId = portfolio_core_1.NetworkId.sui;
|
31
|
-
const coinsTableFields = yield (0,
|
32
|
-
const poolFactoryIds = coinsTableFields.map(
|
30
|
+
const coinsTableFields = yield (0, getDynamicFields_1.getDynamicFields)(client, constants_1.lpCoinsTable);
|
31
|
+
const poolFactoryIds = coinsTableFields.map((f) => f.objectId);
|
33
32
|
if (!poolFactoryIds.length)
|
34
33
|
return;
|
35
|
-
const pObjects = yield (0,
|
36
|
-
showContent: true,
|
37
|
-
});
|
34
|
+
const pObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, poolFactoryIds);
|
38
35
|
const poolsIds = pObjects
|
39
36
|
.map((poolObject) => {
|
40
|
-
|
41
|
-
|
37
|
+
var _a, _b, _c, _d;
|
38
|
+
if ((_b = (_a = poolObject.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields) {
|
39
|
+
const fields = (_d = (_c = poolObject.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields;
|
42
40
|
if (fields.value)
|
43
41
|
return fields.value;
|
44
42
|
}
|
@@ -47,17 +45,20 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
45
|
.flat();
|
48
46
|
if (!poolsIds.length)
|
49
47
|
return;
|
50
|
-
const poolsInfo = yield (0,
|
51
|
-
showContent: true,
|
52
|
-
});
|
48
|
+
const poolsInfo = yield (0, multiGetObjects_1.multiGetObjects)(client, poolsIds);
|
53
49
|
const tokenPriceById = yield (0, getTokensPricesMap_1.default)(poolsInfo
|
54
|
-
.map((pool) =>
|
50
|
+
.map((pool) => {
|
51
|
+
var _a, _b, _c, _d;
|
52
|
+
return ((_b = (_a = pool.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields)
|
53
|
+
? ((_d = (_c = pool.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields).type_names
|
54
|
+
: [];
|
55
|
+
})
|
55
56
|
.flat()
|
56
57
|
.map((type) => `0x${type}`), networkId, cache);
|
57
58
|
for (const pool of poolsInfo) {
|
58
|
-
if (!pool.data ||
|
59
|
+
if (!((_b = (_a = pool.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields))
|
59
60
|
continue;
|
60
|
-
const poolInfo = (0
|
61
|
+
const poolInfo = (_d = (_c = pool.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields;
|
61
62
|
if (poolInfo.lp_supply.fields.value === '0')
|
62
63
|
continue;
|
63
64
|
const moveType = (0, aptos_1.parseTypeString)(poolInfo.lp_supply.type);
|
@@ -73,7 +74,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
74
|
const tokensPrices = rawTokensPrices.filter((tokenPrice) => tokenPrice !== undefined);
|
74
75
|
if (tokensPrices.length === 0)
|
75
76
|
continue;
|
76
|
-
const tokenPriceRef = (
|
77
|
+
const tokenPriceRef = (_e = tokensPrices[0]) === null || _e === void 0 ? void 0 : _e.price;
|
77
78
|
if (!tokenPriceRef)
|
78
79
|
continue;
|
79
80
|
const decimals = poolInfo.lp_decimals;
|
@@ -99,7 +100,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
99
100
|
if (totalLiquidity.isLessThan(computeAndStoreLpPrice_1.minimumLiquidity))
|
100
101
|
continue;
|
101
102
|
const price = totalLiquidity.dividedBy(poolSupply).toNumber();
|
102
|
-
|
103
|
+
const tokenPriceSoure = {
|
103
104
|
id: constants_1.platformId,
|
104
105
|
weight: 1,
|
105
106
|
address,
|
@@ -109,7 +110,8 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
109
110
|
price,
|
110
111
|
underlyings,
|
111
112
|
timestamp: Date.now(),
|
112
|
-
}
|
113
|
+
};
|
114
|
+
yield cache.setTokenPriceSource(tokenPriceSoure);
|
113
115
|
}
|
114
116
|
else {
|
115
117
|
const tokenPriceA = tokenPriceById.get(`0x${poolInfo.type_names[0]}`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aftermath/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aftermath/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAIoC;AAGpC,iDAAmD;AACnD,2CAAuD;AAEvD,oFAA2E;AAC3E,6CAAoD;AACpD,6FAAoE;AACpE,6GAAqF;AACrF,+FAAuE;AACvE,uEAAoE;AACpE,qEAAkE;AAElE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,0BAAS,CAAC,GAAG,CAAC;IAChC,MAAM,gBAAgB,GAAG,MAAM,IAAA,mCAAgB,EAAC,MAAM,EAAE,wBAAY,CAAC,CAAC;IAEtE,MAAM,cAAc,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC/D,IAAI,CAAC,cAAc,CAAC,MAAM;QAAE,OAAO;IAEnC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAe,EAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,QAAQ;SACtB,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;;QAClB,IAAI,MAAA,MAAA,UAAU,CAAC,IAAI,0CAAE,OAAO,0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C1D,EACD;gBACE;oBACE,OAAO,EAAE,WAAW,CAAC,OAAO;oBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;oBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;oBACxB,gBAAgB,EAAE,iBAAiB;iBACpC;gBACD;oBACE,OAAO,EAAE,WAAW,CAAC,OAAO;oBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;oBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;oBACxB,gBAAgB,EAAE,iBAAiB;iBACpC;aACF,CACF,CAAC;YAEF,MAAM,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -83,7 +83,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
83
83
|
borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(coinType, amount, portfolio_core_1.NetworkId.aptos, tokenPrices[address] || undefined));
|
84
84
|
borrowedYields.push([]);
|
85
85
|
}
|
86
|
-
const { borrowedValue, healthRatio, suppliedValue, value } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs);
|
86
|
+
const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs);
|
87
87
|
const element = {
|
88
88
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
89
89
|
networkId: portfolio_core_1.NetworkId.aptos,
|
@@ -100,6 +100,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
100
100
|
collateralRatio: null,
|
101
101
|
healthRatio,
|
102
102
|
rewardAssets,
|
103
|
+
rewardValue,
|
103
104
|
value,
|
104
105
|
},
|
105
106
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aptin/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAA6E;AAO7E,qGAA6E;AAC7E,iDAAqD;AACrD,6CAA4E;AAE5E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAEhC,MAAM,aAAa,GAAG,MAAM,IAAA,0BAAkB,EAC5C,MAAM,EACN,KAAK,EACL,6BAAiB,CAClB,CAAC;IACF,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAC9B,IACE,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAC5C,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAE5C,OAAO,EAAE,CAAC;IAEZ,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,OAAO,CAAe,2BAAe,EAAE;QACtE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,KAAK;KAC3B,CAAC,CAAC;IACH,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAE7B,MAAM,eAAe,GACnB,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAC1C,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,MAAM,IAAA,2BAAmB,EACvB,MAAM,EACN,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EACzC,aAAa,CAAC,IAAI,CAAC,YAAY,EAC/B,qBAAqB,EACrB,0FAA0F,CAC3F,CAAC;IACR,MAAM,eAAe,GACnB,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,C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,EAAE,CAAC;QAEd,cAAc,CAAC,IAAI,CACjB,IAAA,gCAAsB,EACpB,QAAQ,EACR,MAAM,EACN,0BAAS,CAAC,KAAK,EACf,WAAW,CAAC,OAAO,CAAC,IAAI,SAAS,CAClC,CACF,CAAC;QACF,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aptin/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAA6E;AAO7E,qGAA6E;AAC7E,iDAAqD;AACrD,6CAA4E;AAE5E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAEhC,MAAM,aAAa,GAAG,MAAM,IAAA,0BAAkB,EAC5C,MAAM,EACN,KAAK,EACL,6BAAiB,CAClB,CAAC;IACF,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAC9B,IACE,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAC5C,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAE5C,OAAO,EAAE,CAAC;IAEZ,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,OAAO,CAAe,2BAAe,EAAE;QACtE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,KAAK;KAC3B,CAAC,CAAC;IACH,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAE7B,MAAM,eAAe,GACnB,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAC1C,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,MAAM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
if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
|
86
86
|
continue;
|
87
|
-
const { borrowedValue, suppliedValue, value } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
|
87
|
+
const { borrowedValue, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
|
88
88
|
elements.push({
|
89
89
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
90
90
|
networkId: portfolio_core_1.NetworkId.aptos,
|
@@ -102,6 +102,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
102
102
|
collateralRatio: null,
|
103
103
|
healthRatio: 1 - new bignumber_js_1.default(profile.riskFactor).toNumber(),
|
104
104
|
rewardAssets,
|
105
|
+
rewardValue,
|
105
106
|
value,
|
106
107
|
},
|
107
108
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,kDAA6C;AAC7C,gEAAqC;AAGrC,2CAAiD;AAEjD,uCAAoC;AACpC,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAA0C,MAAM,eAAK;SAClE,GAAG,CAAC,GAAG,kBAAM,gCAAgC,KAAK,IAAI,CAAC;SACvD,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACrB,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAE/C,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAEjD,MAAM,QAAQ,GAAgB,IAAI,GAAG,EAAE,CAAC;IACxC,KAAK,MAAM,WAAW,I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SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC,CAAC,QAAQ,EAAE,EACtD,0BAAS,CAAC,KAAK,EACf,UAAU,CACX,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;YAED,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;gBAAE,SAAS;YAEzE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,GACxD,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;YAExE,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,qCAAoB,CAAC,UAAU;gBACrC,SAAS,EAAE,0BAAS,CAAC,KAAK;gBAC1B,UAAU,EAAV,sBAAU;gBACV,KAAK,EAAE,SAAS;gBAChB,KAAK;gBACL,IAAI;gBACJ,IAAI,EAAE;oBACJ,cAAc;oBACd,aAAa;oBACb,cAAc;oBACd,cAAc;oBACd,aAAa;oBACb,cAAc;oBACd,eAAe,EAAE,IAAI;oBACrB,WAAW,EAAE,CAAC,GAAG,IAAI,sBAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;oBAC7D,YAAY;oBACZ,WAAW;oBACX,KAAK;iBACN;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,KAAK;IAC1B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
2
|
-
export declare function getStakingAccountAddress(owner: string):
|
2
|
+
export declare function getStakingAccountAddress(owner: string): PublicKey;
|
@@ -1,21 +1,10 @@
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
3
|
exports.getStakingAccountAddress = void 0;
|
13
4
|
const web3_js_1 = require("@solana/web3.js");
|
14
5
|
const constants_1 = require("./constants");
|
15
6
|
function getStakingAccountAddress(owner) {
|
16
|
-
return
|
17
|
-
return web3_js_1.PublicKey.findProgramAddressSync([new web3_js_1.PublicKey(owner).toBuffer()], constants_1.programId)[0];
|
18
|
-
});
|
7
|
+
return web3_js_1.PublicKey.findProgramAddressSync([new web3_js_1.PublicKey(owner).toBuffer()], constants_1.programId)[0];
|
19
8
|
}
|
20
9
|
exports.getStakingAccountAddress = getStakingAccountAddress;
|
21
10
|
//# sourceMappingURL=helpers.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aurory/helpers.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aurory/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,2CAAwC;AAExC,SAAgB,wBAAwB,CAAC,KAAa;IACpD,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,EACjC,qBAAS,CACV,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AALD,4DAKC"}
|
@@ -21,7 +21,7 @@ const structs_1 = require("./structs");
|
|
21
21
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
22
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
23
|
const client = (0, clients_1.getClientSolana)();
|
24
|
-
const stakingAccountAddress =
|
24
|
+
const stakingAccountAddress = (0, helpers_1.getStakingAccountAddress)(owner);
|
25
25
|
const stakingAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, structs_1.UserStakingAccountStruct, stakingAccountAddress);
|
26
26
|
if (!stakingAccount)
|
27
27
|
return [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aurory/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAAoE;AACpE,iDAAsD;AACtD,uCAAqD;AACrD,kFAA+E;AAC/E,uCAAqD;AACrD,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,qBAAqB,GAAG,
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aurory/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAAoE;AACpE,iDAAsD;AACtD,uCAAqD;AACrD,kFAA+E;AAC/E,uCAAqD;AACrD,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,qBAAqB,GAAG,IAAA,kCAAwB,EAAC,KAAK,CAAC,CAAC;IAE9D,MAAM,cAAc,GAAG,MAAM,IAAA,2CAAoB,EAC/C,MAAM,EACN,kCAAwB,EACxB,qBAAqB,CACtB,CAAC;IAEF,IAAI,CAAC,cAAc;QAAE,OAAO,EAAE,CAAC;IAE/B,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,qBAAS,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IAE1E,MAAM,KAAK,GAAmB,IAAA,gCAAsB,EAClD,qBAAS,EACT,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,oBAAQ,CAAA,CAAC,CAAC,QAAQ,EAAE,EAC1D,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CAAC;IACF,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAE,4BAAgB;YAC5B,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE;YACzB,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,4BAAgB,UAAU;IACjC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -36,27 +36,27 @@ exports.getBalancerPoolsV2 = void 0;
|
|
36
36
|
const graphql_request_1 = __importStar(require("graphql-request"));
|
37
37
|
function getBalancerPoolsV2(url) {
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
39
|
-
const query = (0, graphql_request_1.gql) `
|
40
|
-
query pools {
|
41
|
-
pools(
|
42
|
-
first: 1000
|
43
|
-
orderBy: totalLiquidity
|
44
|
-
orderDirection: desc
|
45
|
-
where: { totalLiquidity_gt: "500" }
|
46
|
-
) {
|
47
|
-
id
|
48
|
-
address
|
49
|
-
symbol
|
50
|
-
totalLiquidity
|
51
|
-
totalShares
|
52
|
-
tokens {
|
53
|
-
balance
|
54
|
-
decimals
|
55
|
-
symbol
|
56
|
-
address
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
39
|
+
const query = (0, graphql_request_1.gql) `
|
40
|
+
query pools {
|
41
|
+
pools(
|
42
|
+
first: 1000
|
43
|
+
orderBy: totalLiquidity
|
44
|
+
orderDirection: desc
|
45
|
+
where: { totalLiquidity_gt: "500" }
|
46
|
+
) {
|
47
|
+
id
|
48
|
+
address
|
49
|
+
symbol
|
50
|
+
totalLiquidity
|
51
|
+
totalShares
|
52
|
+
tokens {
|
53
|
+
balance
|
54
|
+
decimals
|
55
|
+
symbol
|
56
|
+
address
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
60
|
`;
|
61
61
|
const res = yield (0, graphql_request_1.default)(url, query);
|
62
62
|
const pools = res.pools;
|
@@ -13,12 +13,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
15
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
-
const sui_js_1 = require("@mysten/sui.js");
|
17
16
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
18
17
|
const constants_1 = require("./constants");
|
19
18
|
const clients_1 = require("../../utils/clients");
|
20
19
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
20
|
+
const getDynamicFieldObject_1 = require("../../utils/sui/getDynamicFieldObject");
|
21
21
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
+
var _a;
|
22
23
|
const client = (0, clients_1.getClientSui)();
|
23
24
|
const buckPrice = yield cache.getTokenPrice(constants_1.buckId, portfolio_core_1.NetworkId.sui);
|
24
25
|
if (!buckPrice)
|
@@ -37,19 +38,15 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
37
38
|
value: owner,
|
38
39
|
},
|
39
40
|
};
|
40
|
-
const positionData = yield
|
41
|
+
const positionData = yield (0, getDynamicFieldObject_1.getDynamicFieldObject)(client, input);
|
41
42
|
if (!positionData.data)
|
42
43
|
continue;
|
43
44
|
const tokenPrice = yield cache.getTokenPrice(collateral.tokenId, portfolio_core_1.NetworkId.sui);
|
44
45
|
if (!tokenPrice)
|
45
46
|
continue;
|
46
|
-
const
|
47
|
-
if (!
|
48
|
-
!collateralFields.value.fields ||
|
49
|
-
!collateralFields.value.fields.value ||
|
50
|
-
!collateralFields.value.fields.value.fields)
|
47
|
+
const collateralInfo = (_a = positionData.data.content) === null || _a === void 0 ? void 0 : _a.fields.value.fields.value.fields;
|
48
|
+
if (!collateralInfo)
|
51
49
|
continue;
|
52
|
-
const collateralInfo = collateralFields.value.fields.value.fields;
|
53
50
|
const suppliedQuantity = new bignumber_js_1.default(collateralInfo.collateral_amount)
|
54
51
|
.dividedBy(Math.pow(10, tokenPrice.decimals))
|
55
52
|
.toNumber();
|
@@ -60,7 +57,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
60
57
|
.toNumber();
|
61
58
|
borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(constants_1.buckId, borrowedQuantity, portfolio_core_1.NetworkId.sui, buckPrice));
|
62
59
|
suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(collateral.tokenId, suppliedQuantity, portfolio_core_1.NetworkId.sui, tokenPrice));
|
63
|
-
const { borrowedValue, healthRatio, suppliedValue, value } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
|
60
|
+
const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
|
64
61
|
const element = {
|
65
62
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
66
63
|
networkId: portfolio_core_1.NetworkId.sui,
|
@@ -77,6 +74,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
77
74
|
collateralRatio: null,
|
78
75
|
healthRatio,
|
79
76
|
rewardAssets,
|
77
|
+
rewardValue,
|
80
78
|
value,
|
81
79
|
},
|
82
80
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"collateralFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bucket/collateralFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,
|
1
|
+
{"version":3,"file":"collateralFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bucket/collateralFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,gEAAqC;AAGrC,2CAA8D;AAC9D,iDAAmD;AAEnD,qGAA6E;AAC7E,iFAA8E;AAE9E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,kBAAM,EAAE,0BAAS,CAAC,GAAG,CAAC,CAAC;IACnE,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC1B,MAAM,QAAQ,GAAuB,EAAE,CAAC;IAExC,KAAK,MAAM,UAAU,IAAI,uBAAW,EAAE,CAAC;QACrC,MAAM,cAAc,GAAqB,EAAE,CAAC;QAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;QACrC,MAAM,cAAc,GAAqB,EAAE,CAAC;QAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;QACrC,MAAM,YAAY,GAAqB,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAG;YACZ,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,KAAK;aACb;SACF,CAAC;QACF,MAAM,YAAY,G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,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK;YACL,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,eAAe,EAAE,IAAI;gBAErB,WAAW;gBACX,YAAY;gBACZ,WAAW;gBACX,KAAK;aACN;SACF,CAAC;QACF,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,aAAa;IAC9B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -19,10 +19,10 @@ const clients_1 = require("../../utils/clients");
|
|
19
19
|
const helpers_1 = require("./helpers");
|
20
20
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
21
21
|
const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
|
22
|
+
const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
|
22
23
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
24
|
const client = (0, clients_1.getClientSui)();
|
24
|
-
const ownerRes = yield
|
25
|
-
owner,
|
25
|
+
const ownerRes = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
|
26
26
|
options: {
|
27
27
|
showType: true,
|
28
28
|
showContent: true,
|
@@ -31,11 +31,11 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
31
31
|
},
|
32
32
|
filter: { Package: constants_1.clmmPoolPackageId },
|
33
33
|
});
|
34
|
-
if (
|
34
|
+
if (ownerRes.length === 0)
|
35
35
|
return [];
|
36
36
|
const clmmPositions = [];
|
37
|
-
for (let i = 0; i < ownerRes.
|
38
|
-
const clmmPositionRes = ownerRes
|
37
|
+
for (let i = 0; i < ownerRes.length; i++) {
|
38
|
+
const clmmPositionRes = ownerRes[i];
|
39
39
|
if (!clmmPositionRes.data || !clmmPositionRes.data.type)
|
40
40
|
continue;
|
41
41
|
const type = (0, helpers_1.extractStructTagFromType)(clmmPositionRes.data.type);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"clmmsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cetus/clmmsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AACnD,uCAAoE;AAGpE,qGAA6E;AAC7E,wFAAyF;
|
1
|
+
{"version":3,"file":"clmmsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cetus/clmmsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AACnD,uCAAoE;AAGpE,qGAA6E;AAC7E,wFAAyF;AACzF,qEAAkE;AAElE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAe,EAAC,MAAM,EAAE,KAAK,EAAE;QACpD,OAAO,EAAE;YACP,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,IAAI;SAChB;QACD,MAAM,EAAE,EAAE,OAAO,EAAE,6BAAiB,EAAE;KACvC,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,aAAa,GAAe,EAAE,CAAC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KAAK,GAAG,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;QACpD,MAAM,CAAC,IAAI,CAAC;YACV,MAAM,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;YAClC,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,CAAC;YACpB,KAAK;YACL,MAAM,EAAE,EAAE;SACX,CAAC,CAAC;QACH,mBAAmB,IAAI,KAAK,CAAC;IAC/B,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,CAAC,cAAc,CAAC;YACtB,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM;aACpB;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { SuiObjectResponse } from '@mysten/sui.js';
|
2
1
|
import Decimal from 'decimal.js';
|
3
2
|
import BigNumber from 'bignumber.js';
|
4
3
|
import { NFT, Pool, Position, SuiAddressType, SuiStructTag } from './types';
|
4
|
+
import { ObjectResponse } from '../../utils/sui/types';
|
5
5
|
export declare function fromX64(num: BigNumber): Decimal;
|
6
6
|
export declare function composeType(address: string, generics: SuiAddressType[]): SuiAddressType;
|
7
7
|
export declare function composeType(address: string, struct: string, generics?: SuiAddressType[]): SuiAddressType;
|
@@ -11,6 +11,6 @@ export declare function isSuiCoin(coinAddress: SuiAddressType): boolean;
|
|
11
11
|
export declare function buildPoolName(coin_type_a: string, coin_type_b: string, tick_spacing: string): string;
|
12
12
|
export declare function normalizeCoinType(coinType: string): string;
|
13
13
|
export declare function asIntN(int: bigint, bits?: number): number;
|
14
|
-
export declare function getPoolFromObject(object:
|
15
|
-
export declare function buildPosition(objects:
|
16
|
-
export declare function buildNFT(objects:
|
14
|
+
export declare function getPoolFromObject(object: ObjectResponse<unknown>): Pool;
|
15
|
+
export declare function buildPosition(objects: ObjectResponse<unknown>): Position;
|
16
|
+
export declare function buildNFT(objects: ObjectResponse<unknown>): NFT;
|