@sonarwatch/portfolio-plugins 0.12.35 → 0.12.37
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +10 -2
- package/package.json +1 -1
- package/src/index.js +8 -0
- package/src/index.js.map +1 -1
- package/src/orphanPlatorms.js +0 -8
- package/src/orphanPlatorms.js.map +1 -1
- package/src/plugins/01/depostisFetcher.js +1 -1
- package/src/plugins/01/depostisFetcher.js.map +1 -1
- package/src/plugins/aave/helpers.js +6 -1
- package/src/plugins/aave/helpers.js.map +1 -1
- package/src/plugins/allbridge/constants.d.ts +11 -0
- package/src/plugins/allbridge/constants.js +25 -0
- package/src/plugins/allbridge/constants.js.map +1 -0
- package/src/plugins/allbridge/helpers.d.ts +5 -0
- package/src/plugins/allbridge/helpers.js +25 -0
- package/src/plugins/allbridge/helpers.js.map +1 -0
- package/src/plugins/allbridge/idl.d.ts +58 -0
- package/src/plugins/allbridge/idl.js +476 -0
- package/src/plugins/allbridge/idl.js.map +1 -0
- package/src/plugins/allbridge/index.d.ts +6 -0
- package/src/plugins/allbridge/index.js +13 -0
- package/src/plugins/allbridge/index.js.map +1 -0
- package/src/plugins/allbridge/poolsJob.d.ts +3 -0
- package/src/plugins/allbridge/poolsJob.js +40 -0
- package/src/plugins/allbridge/poolsJob.js.map +1 -0
- package/src/plugins/allbridge/positionsFetcher.js +92 -0
- package/src/plugins/allbridge/positionsFetcher.js.map +1 -0
- package/src/plugins/allbridge/types.d.ts +38 -0
- package/src/plugins/allbridge/types.js +3 -0
- package/src/plugins/allbridge/types.js.map +1 -0
- package/src/plugins/aptin/depositsFetcher.js +6 -1
- package/src/plugins/aptin/depositsFetcher.js.map +1 -1
- package/src/plugins/aries/depositsFetcher.js +7 -1
- package/src/plugins/aries/depositsFetcher.js.map +1 -1
- package/src/plugins/banx/constants.d.ts +0 -1
- package/src/plugins/banx/constants.js +1 -2
- package/src/plugins/banx/constants.js.map +1 -1
- package/src/plugins/banx/{calculateLoanRepayValue.d.ts → helpers.d.ts} +1 -0
- package/src/plugins/banx/{calculateLoanRepayValue.js → helpers.js} +29 -2
- package/src/plugins/banx/helpers.js.map +1 -0
- package/src/plugins/banx/idl.d.ts +15 -7
- package/src/plugins/banx/idl.js +199 -268
- package/src/plugins/banx/idl.js.map +1 -1
- package/src/plugins/banx/loansFetcher.js +33 -28
- package/src/plugins/banx/loansFetcher.js.map +1 -1
- package/src/plugins/banx/offersFetcher.js +15 -16
- package/src/plugins/banx/offersFetcher.js.map +1 -1
- package/src/plugins/bucket/collateralFetcher.js +1 -1
- package/src/plugins/bucket/collateralFetcher.js.map +1 -1
- package/src/plugins/citrus/collectionsJob.js.map +1 -1
- package/src/plugins/citrus/constants.d.ts +0 -1
- package/src/plugins/citrus/constants.js +1 -2
- package/src/plugins/citrus/constants.js.map +1 -1
- package/src/plugins/citrus/loansFetcher.js +18 -20
- package/src/plugins/citrus/loansFetcher.js.map +1 -1
- package/src/plugins/clone/depositsFetcher.js +2 -2
- package/src/plugins/clone/depositsFetcher.js.map +1 -1
- package/src/plugins/compound/getPositionsV2Fetcher.js +1 -1
- package/src/plugins/compound/getPositionsV2Fetcher.js.map +1 -1
- package/src/plugins/compound/getPositionsV3Fetcher.js +5 -1
- package/src/plugins/compound/getPositionsV3Fetcher.js.map +1 -1
- package/src/plugins/drift/depositsFetcher.d.ts +3 -0
- package/src/plugins/drift/{deposits.js → depositsFetcher.js} +4 -4
- package/src/plugins/drift/depositsFetcher.js.map +1 -0
- package/src/plugins/drift/index.js +2 -2
- package/src/plugins/drift/index.js.map +1 -1
- package/src/plugins/flash/perpetualFetcher.js +1 -1
- package/src/plugins/flash/perpetualFetcher.js.map +1 -1
- package/src/plugins/flexlend/depositsFetcher.js +2 -2
- package/src/plugins/flexlend/depositsFetcher.js.map +1 -1
- package/src/plugins/jupiter/exchange/constants.d.ts +1 -0
- package/src/plugins/jupiter/exchange/constants.js +2 -1
- package/src/plugins/jupiter/exchange/constants.js.map +1 -1
- package/src/plugins/jupiter/exchange/limitFetcher.js +9 -6
- package/src/plugins/jupiter/exchange/limitFetcher.js.map +1 -1
- package/src/plugins/jupiter/exchange/perpetualFetcher.js +8 -8
- package/src/plugins/jupiter/exchange/perpetualFetcher.js.map +1 -1
- package/src/plugins/jupiter/exchange/structs.d.ts +21 -0
- package/src/plugins/jupiter/exchange/structs.js +21 -1
- package/src/plugins/jupiter/exchange/structs.js.map +1 -1
- package/src/plugins/jupiter/pricingJob.js +7 -22
- package/src/plugins/jupiter/pricingJob.js.map +1 -1
- package/src/plugins/kamino/lendsFetcher.js +21 -3
- package/src/plugins/kamino/lendsFetcher.js.map +1 -1
- package/src/plugins/maker/vaultsFetcher.js +1 -1
- package/src/plugins/maker/vaultsFetcher.js.map +1 -1
- package/src/plugins/mango/boostFetcher.js +1 -1
- package/src/plugins/mango/boostFetcher.js.map +1 -1
- package/src/plugins/mango/collateralFetcher.js +1 -1
- package/src/plugins/mango/collateralFetcher.js.map +1 -1
- package/src/plugins/mango/redeemFetcher.js +1 -1
- package/src/plugins/mango/redeemFetcher.js.map +1 -1
- package/src/plugins/maple/ethereumFetcher.js +1 -1
- package/src/plugins/maple/ethereumFetcher.js.map +1 -1
- package/src/plugins/marginfi/helpers.js +7 -1
- package/src/plugins/marginfi/helpers.js.map +1 -1
- package/src/plugins/mole/farmsFetcher.js +5 -1
- package/src/plugins/mole/farmsFetcher.js.map +1 -1
- package/src/plugins/morpho/aaveV3CollateralFetcher.js +1 -1
- package/src/plugins/morpho/aaveV3CollateralFetcher.js.map +1 -1
- package/src/plugins/native-stake/solana/solanaFetcher.js +2 -0
- package/src/plugins/native-stake/solana/solanaFetcher.js.map +1 -1
- package/src/plugins/navi/collateralFetcher.js +6 -1
- package/src/plugins/navi/collateralFetcher.js.map +1 -1
- package/src/plugins/nosana/stakingFetcher.js +8 -2
- package/src/plugins/nosana/stakingFetcher.js.map +1 -1
- package/src/plugins/port/obligationsFetcher.js +1 -1
- package/src/plugins/port/obligationsFetcher.js.map +1 -1
- package/src/plugins/rain/collectionsJob.js +6 -10
- package/src/plugins/rain/collectionsJob.js.map +1 -1
- package/src/plugins/rain/helpers.js +3 -1
- package/src/plugins/rain/helpers.js.map +1 -1
- package/src/plugins/rain/index.js +2 -1
- package/src/plugins/rain/index.js.map +1 -1
- package/src/plugins/rain/loansFetcher.js +61 -26
- package/src/plugins/rain/loansFetcher.js.map +1 -1
- package/src/plugins/rain/poolsFetcher.js +1 -1
- package/src/plugins/rain/poolsFetcher.js.map +1 -1
- package/src/plugins/rain/types.d.ts +3 -0
- package/src/plugins/sanctum/constants.d.ts +4 -0
- package/src/plugins/sanctum/constants.js +14 -0
- package/src/plugins/sanctum/constants.js.map +1 -0
- package/src/plugins/sanctum/index.d.ts +6 -0
- package/src/plugins/sanctum/index.js +12 -0
- package/src/plugins/sanctum/index.js.map +1 -0
- package/src/plugins/sanctum/lstsJob.d.ts +3 -0
- package/src/plugins/sanctum/lstsJob.js +36 -0
- package/src/plugins/sanctum/lstsJob.js.map +1 -0
- package/src/plugins/scallop/lendingsFetcher.js +1 -1
- package/src/plugins/scallop/lendingsFetcher.js.map +1 -1
- package/src/plugins/scallop/obligationsFetcher.js +1 -1
- package/src/plugins/scallop/obligationsFetcher.js.map +1 -1
- package/src/plugins/sharky/constants.d.ts +0 -1
- package/src/plugins/sharky/constants.js +3 -4
- package/src/plugins/sharky/constants.js.map +1 -1
- package/src/plugins/sharky/loansFetcher.js +21 -20
- package/src/plugins/sharky/loansFetcher.js.map +1 -1
- package/src/plugins/solend/helpers.js +7 -1
- package/src/plugins/solend/helpers.js.map +1 -1
- package/src/plugins/suilend/obligationsFetcher.js +7 -1
- package/src/plugins/suilend/obligationsFetcher.js.map +1 -1
- package/src/plugins/thala/vaultsFetcher.js +1 -1
- package/src/plugins/thala/vaultsFetcher.js.map +1 -1
- package/src/plugins/zeta/airdropFetcher.d.ts +3 -0
- package/src/plugins/zeta/airdropFetcher.js +105 -0
- package/src/plugins/zeta/airdropFetcher.js.map +1 -0
- package/src/plugins/zeta/constants.d.ts +3 -0
- package/src/plugins/zeta/constants.js +4 -1
- package/src/plugins/zeta/constants.js.map +1 -1
- package/src/plugins/zeta/index.js +2 -1
- package/src/plugins/zeta/index.js.map +1 -1
- package/src/plugins/zeta/types.d.ts +14 -0
- package/src/plugins/zeta/types.js +3 -0
- package/src/plugins/zeta/types.js.map +1 -0
- package/src/utils/misc/MemoizedCache.d.ts +12 -0
- package/src/utils/misc/MemoizedCache.js +35 -0
- package/src/utils/misc/MemoizedCache.js.map +1 -0
- package/src/utils/misc/arrayToMap.d.ts +1 -0
- package/src/utils/misc/arrayToMap.js +12 -0
- package/src/utils/misc/arrayToMap.js.map +1 -0
- package/src/utils/misc/pick.d.ts +2 -0
- package/src/utils/misc/pick.js +16 -0
- package/src/utils/misc/pick.js.map +1 -0
- package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js +8 -3
- package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js.map +1 -1
- package/src/plugins/banx/calculateLoanRepayValue.js.map +0 -1
- package/src/plugins/drift/deposits.js.map +0 -1
- /package/src/plugins/{drift/deposits.d.ts → allbridge/positionsFetcher.d.ts} +0 -0
@@ -120,7 +120,11 @@ function getPositionsV3Fetcher(networkId) {
|
|
120
120
|
suppliedAssets.length === 0 &&
|
121
121
|
rewardAssets.length === 0)
|
122
122
|
continue;
|
123
|
-
const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(
|
123
|
+
const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({
|
124
|
+
suppliedAssets,
|
125
|
+
borrowedAssets,
|
126
|
+
rewardAssets,
|
127
|
+
});
|
124
128
|
elements.push({
|
125
129
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
126
130
|
networkId,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getPositionsV3Fetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/compound/getPositionsV3Fetcher.ts"],"names":[],"m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YACX,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EAAC,cAAc,
|
1
|
+
{"version":3,"file":"getPositionsV3Fetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/compound/getPositionsV3Fetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAErC,2CAIqB;AAErB,iDAAmD;AACnD,iCAAmC;AAEnC,0DAAwD;AACxD,qGAA6E;AAC7E,uDAA6D;AAE7D,SAAwB,qBAAqB,CAC3C,SAA2B;IAE3B,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;QACtE,MAAM,OAAO,GAAG,yBAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO;YAAE,OAAO,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,IAAA,sBAAY,EAAC,SAAS,CAAC,CAAC;QAEvC,SAAS;QACT,MAAM,uBAAuB,GAAG,OAAO;aACpC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACT,CAAC,CAAC,MAAM,CAAC,GAAG,CACV,CAAC,KAAK,EAAE,EAAE,CACR,CAAC;YACC,GAAG,EAAE,gBAAS;YACd,OAAO,EAAE,CAAC,CAAC,YAAY;YACvB,YAAY,EAAE,gBAAgB;YAC9B,IAAI,EAAE,CAAC,KAAsB,EAAE,KAAK,CAAC,OAAO,CAAC;SACpC,CAAA,CACd,CACF;aACA,IAAI,EAAE,CAAC;QAEV,MAAM,2BAA2B,GAAG,OAAO,CAAC,GAAG,CAC7C,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC;YACC,GAAG,EAAE,4BAAiB;YACtB,YAAY,EAAE,WAAW;YACzB,OAAO,EAAE,CAAC,CAAC,YAAY;YACvB,IAAI,EAAE,CAAC,KAAsB,CAAC;SACrB,CAAA,CACd,CAAC;QACF,M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S,CAAC,CAAC;oBAC/B,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC;YAED,IACE,cAAc,CAAC,MAAM,KAAK,CAAC;gBAC3B,cAAc,CAAC,MAAM,KAAK,CAAC;gBAC3B,YAAY,CAAC,MAAM,KAAK,CAAC;gBAEzB,SAAS;YACX,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EAAC;gBACtB,cAAc;gBACd,cAAc;gBACd,YAAY;aACb,CAAC,CAAC;YACL,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,qCAAoB,CAAC,UAAU;gBACrC,SAAS;gBACT,UAAU,EAAV,sBAAU;gBACV,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,aAAa;gBACnB,KAAK;gBACL,IAAI,EAAE;oBACJ,cAAc;oBACd,aAAa;oBACb,cAAc;oBACd,cAAc;oBACd,aAAa;oBACb,cAAc;oBACd,WAAW;oBACX,YAAY;oBACZ,WAAW;oBACX,KAAK;iBACN;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAA,CAAC;IAEF,OAAO;QACL,EAAE,EAAE,GAAG,sBAAU,IAAI,SAAS,eAAe;QAC7C,SAAS;QACT,QAAQ;KACT,CAAC;AACJ,CAAC;AA5LD,wCA4LC"}
|
@@ -133,15 +133,15 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
133
133
|
.toNumber(), portfolio_core_1.NetworkId.solana, tokenPrice));
|
134
134
|
borrowedYields.push([
|
135
135
|
{
|
136
|
-
apr: spotMarket.borrowApr,
|
137
|
-
apy: (0, portfolio_core_1.aprToApy)(spotMarket.borrowApr),
|
136
|
+
apr: -spotMarket.borrowApr,
|
137
|
+
apy: -(0, portfolio_core_1.aprToApy)(spotMarket.borrowApr),
|
138
138
|
},
|
139
139
|
]);
|
140
140
|
}
|
141
141
|
}
|
142
142
|
if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
|
143
143
|
continue;
|
144
|
-
const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
|
144
|
+
const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({ suppliedAssets, borrowedAssets, rewardAssets });
|
145
145
|
elements.push({
|
146
146
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
147
147
|
networkId: portfolio_core_1.NetworkId.solana,
|
@@ -171,4 +171,4 @@ const fetcher = {
|
|
171
171
|
executor,
|
172
172
|
};
|
173
173
|
exports.default = fetcher;
|
174
|
-
//# sourceMappingURL=
|
174
|
+
//# sourceMappingURL=depositsFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAUoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,2CAA0E;AAC1E,qCAIkB;AAClB,uCAMmB;AAEnB,+CAG4B;AAC5B,iDAAsD;AACtD,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,WAAW,CAAqB;QACnE,MAAM,EAAE,6BAAiB;QACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IAEH,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE7C,MAAM,iBAAiB,GAAoC,IAAI,GAAG,EAAE,CAAC;IACrE,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,MAA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E,CAAC,UAAU,CAAC,SAAS;wBAC1B,GAAG,EAAE,CAAC,IAAA,yBAAQ,EAAC,UAAU,CAAC,SAAS,CAAC;qBACrC;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAEzE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EAAC,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CAAC;QAE5E,QAAQ,CAAC,IAAI,CAAC;YACZ,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,YAAY;gBACZ,WAAW;gBACX,WAAW;gBACX,KAAK;aACN;YACD,IAAI,EAAE,IAAA,wBAAe,EAAC,WAAW,CAAC,IAAI,CAAC;SACxC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,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"}
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.airdropFetcher = exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
7
|
const constants_1 = require("./constants");
|
8
8
|
const spotMarketsJob_1 = __importDefault(require("./spotMarketsJob"));
|
9
|
-
const
|
9
|
+
const depositsFetcher_1 = __importDefault(require("./depositsFetcher"));
|
10
10
|
const premarketJob_1 = __importDefault(require("./premarketJob"));
|
11
11
|
const airdropFetcher_1 = __importDefault(require("./airdropFetcher"));
|
12
12
|
exports.platforms = [constants_1.platform];
|
13
13
|
exports.jobs = [spotMarketsJob_1.default, premarketJob_1.default];
|
14
|
-
exports.fetchers = [
|
14
|
+
exports.fetchers = [depositsFetcher_1.default, airdropFetcher_1.default];
|
15
15
|
var helpersAirdrop_1 = require("./helpersAirdrop");
|
16
16
|
Object.defineProperty(exports, "airdropFetcher", { enumerable: true, get: function () { return helpersAirdrop_1.airdropFetcher; } });
|
17
17
|
//# 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,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;AAC9C,wEAAgD;AAChD,kEAA0C;AAC1C,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,wBAAc,EAAE,sBAAY,CAAC,CAAC;AAC7C,QAAA,QAAQ,GAAc,CAAC,yBAAe,EAAE,wBAAc,CAAC,CAAC;AACrE,mDAAkD;AAAzC,gHAAA,cAAc,OAAA"}
|
@@ -130,7 +130,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
130
130
|
// });
|
131
131
|
if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
|
132
132
|
continue;
|
133
|
-
const { borrowedValue, suppliedValue, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
|
133
|
+
const { borrowedValue, suppliedValue, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({ suppliedAssets, borrowedAssets, rewardAssets });
|
134
134
|
const value = collateralUsd.dividedBy(usdFactor).plus(pnl).toNumber();
|
135
135
|
const side = isLong ? 'Long' : 'Short';
|
136
136
|
elements.push({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flash/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,2CAA+D;AAC/D,iDAAsD;AACtD,+CAA8D;AAC9D,6DAAqE;AACrE,mDAA8D;AAC9D,uCAAsD;AACtD,uCAA2C;AAE3C,yDAAmD;AAEnD,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC,CAAC;AACzC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,mBAAmB,GAAG,MAAM,IAAA,iCAAwB,EACxD,MAAM,EACN,wBAAc,EACd,oBAAQ,EACR,IAAA,mCAAyB,EAAC,KAAK,CAAC,CACjC,CAAC;IACF,IACE,mBAAmB,CAAC,MAAM,KAAK,CAAC;QAChC,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAElE,OAAO,EAAE,CAAC;IAEZ,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,OAAO,CAAe,sBAAU,EAAE;QACjE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAE7B,MAAM,cAAc,GAAgB,EAAE,CAAC;IACvC,MAAM,UAAU,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,UAAU,EAAE,EAAE;YACd,IAAI,EAAE;gBACJ,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;gBAC/B,OAAO,EAAE,aAAa,CAAC,IAAI;gBAC3B,KAAK,EAAE,WAAW;aACnB;SACF,CAAC,CAAC;QACH,YAAY,CAAC,IAAI,CAAC;YAChB,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,KAAK,EAAE,GAAG;YACV,UAAU,EAAE,EAAE;YACd,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE;SACpD,CAAC,CAAC;QACH,sBAAsB;QACtB,qBAAqB;QACrB,iCAAiC;QACjC,iBAAiB;QACjB,oBAAoB;QACpB,kDAAkD;QAClD,MAAM;QAEN,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAEzE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,GAC9D,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flash/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,2CAA+D;AAC/D,iDAAsD;AACtD,+CAA8D;AAC9D,6DAAqE;AACrE,mDAA8D;AAC9D,uCAAsD;AACtD,uCAA2C;AAE3C,yDAAmD;AAEnD,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC,CAAC;AACzC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IA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AAE,WAAW,EAAE,GAC9D,IAAA,wCAAuB,EAAC,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CAAC;QAE5E,MAAM,KAAK,GAAG,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;QACtE,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QAEvC,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,UAAU;YACjB,KAAK;YACL,IAAI,EAAE,GAAG,UAAU,IAAI,IAAI,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG;YAC3D,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,YAAY;gBACZ,WAAW;gBACX,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,aAAa;IAC9B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -16,7 +16,7 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
16
16
|
const web3_js_1 = require("@solana/web3.js");
|
17
17
|
const constants_1 = require("./constants");
|
18
18
|
const helpers_1 = require("./helpers");
|
19
|
-
const
|
19
|
+
const depositsFetcher_1 = __importDefault(require("../drift/depositsFetcher"));
|
20
20
|
const lendsFetcher_1 = __importDefault(require("../kamino/lendsFetcher"));
|
21
21
|
const collateralFetcher_1 = __importDefault(require("../mango/collateralFetcher"));
|
22
22
|
const constants_2 = require("../tokens/constants");
|
@@ -44,7 +44,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
44
44
|
isMarginFiActivated
|
45
45
|
? (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, MarginfiAccount_1.marginfiAccountStruct, userAccount.mfi_account)
|
46
46
|
: undefined,
|
47
|
-
|
47
|
+
depositsFetcher_1.default.executor(pda, cache),
|
48
48
|
lendsFetcher_1.default.executor(pda, cache),
|
49
49
|
collateralFetcher_1.default.executor(pda, cache),
|
50
50
|
isSolendActivated
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAAyD;AAGzD,2CAAyC;AACzC,uCAA8C;AAC9C
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/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,+CAAqD;AACrD,mDAAgF;AAEhF,gGAA6F;AAC7F,+CAA+D;AAC/D,yEAA4E;AAG5E,qDAA2D;AAC3D,iDAA4D;AAE5D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,GAAG,GAAG,IAAA,2BAAiB,EAAC,KAAK,CAAC,CAAC;IAErC,MAAM,WAAW,GAAG,MAAM,IAAA,2CAAoB,EAC5C,MAAM,EACN,0BAAiB,EACjB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AC,mBAAmB,CACpD,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,EAC3B,0BAAS,CAAC,MAAM,CACjB,CAAC;YAEF,MAAM,OAAO,GAAG,IAAA,+BAAqB,EACnC,eAAe,EACf,kBAAkB,EAClB,cAAc,CACf,CAAC;YACF,IAAI,OAAO;gBAAE,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE9C,MAAM,QAAQ,GAAuB,EAAE,CAAC;IACxC,KAAK,MAAM,OAAO,IAAI,iBAAiB,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,OAAO,CAAC;QAC3B,UAAU,CAAC,IAAI;YACb,UAAU,CAAC,UAAU,KAAK,gCAAoB,CAAC,EAAE;gBAC/C,CAAC,CAAC,gBAAgB;gBAClB,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE;oBAC/C,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrC,UAAU,CAAC,UAAU,GAAG,sBAAU,CAAC;QACnC,QAAQ,CAAC,IAAI,mBACR,UAAU,EACb,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,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"}
|
@@ -5,6 +5,7 @@ export declare const platform: Platform;
|
|
5
5
|
export declare const perpsProgramId: PublicKey;
|
6
6
|
export declare const valueAverageProgramId: PublicKey;
|
7
7
|
export declare const limitProgramId: PublicKey;
|
8
|
+
export declare const limitV2ProgramId: PublicKey;
|
8
9
|
export declare const dcaProgramId: PublicKey;
|
9
10
|
export declare const jlpPool: PublicKey;
|
10
11
|
export declare const jlpToken: PublicKey;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.perpPoolsKey = exports.custodiesKey = exports.jlpToken = exports.jlpPool = exports.dcaProgramId = exports.limitProgramId = exports.valueAverageProgramId = exports.perpsProgramId = exports.platform = exports.platformId = void 0;
|
3
|
+
exports.perpPoolsKey = exports.custodiesKey = exports.jlpToken = exports.jlpPool = exports.dcaProgramId = exports.limitV2ProgramId = exports.limitProgramId = exports.valueAverageProgramId = exports.perpsProgramId = exports.platform = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'jupiter-exchange';
|
6
6
|
exports.platform = {
|
@@ -14,6 +14,7 @@ exports.platform = {
|
|
14
14
|
exports.perpsProgramId = new web3_js_1.PublicKey('PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu');
|
15
15
|
exports.valueAverageProgramId = new web3_js_1.PublicKey('JVAp1DSLnM4Qh8qM1QasQ8x56ccb9S3DhbyEckybTF9');
|
16
16
|
exports.limitProgramId = new web3_js_1.PublicKey('jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu');
|
17
|
+
exports.limitV2ProgramId = new web3_js_1.PublicKey('j1o2qRpjcyUwEvwtcfhEQefh773ZgjxcVRry7LDqg5X');
|
17
18
|
exports.dcaProgramId = new web3_js_1.PublicKey('DCA265Vj8a9CEuX1eb1LWRnDT7uK6q1xMipnNyatn23M');
|
18
19
|
exports.jlpPool = new web3_js_1.PublicKey('5BUwFW4nRbftYTDMbgxykoFWqWHPzahFSNAaaaJtVKsq');
|
19
20
|
exports.jlpToken = new web3_js_1.PublicKey('27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,UAAU,GAAG,kBAAkB,CAAC;AAChC,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,qBAAqB,GAAG,IAAI,mBAAS,CAChD,6CAA6C,CAC9C,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,8CAA8C,CAC/C,CAAC;AACW,QAAA,YAAY,GAAG,WAAW,CAAC;AAC3B,QAAA,YAAY,GAAG,WAAW,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,UAAU,GAAG,kBAAkB,CAAC;AAChC,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,qBAAqB,GAAG,IAAI,mBAAS,CAChD,6CAA6C,CAC9C,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,gBAAgB,GAAG,IAAI,mBAAS,CAC3C,6CAA6C,CAC9C,CAAC;AACW,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,8CAA8C,CAC/C,CAAC;AACW,QAAA,YAAY,GAAG,WAAW,CAAC;AAC3B,QAAA,YAAY,GAAG,WAAW,CAAC"}
|
@@ -21,15 +21,18 @@ const structs_1 = require("./structs");
|
|
21
21
|
const filters_1 = require("./filters");
|
22
22
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
23
|
const client = (0, clients_1.getClientSolana)();
|
24
|
-
const
|
25
|
-
|
24
|
+
const allAccounts = (yield Promise.all([
|
25
|
+
(0, solana_1.getParsedProgramAccounts)(client, structs_1.limitOrderStruct, constants_1.limitProgramId, (0, filters_1.limitFilters)(owner)),
|
26
|
+
(0, solana_1.getParsedProgramAccounts)(client, structs_1.limitOrderV2Struct, constants_1.limitV2ProgramId, (0, filters_1.limitFilters)(owner)),
|
27
|
+
])).flat();
|
28
|
+
if (allAccounts.length === 0)
|
26
29
|
return [];
|
27
30
|
const mints = new Set();
|
28
|
-
|
31
|
+
allAccounts.forEach((account) => mints.add(account.inputMint.toString()));
|
29
32
|
const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
|
30
33
|
const rawAmountByMint = new Map();
|
31
|
-
for (let i = 0; i <
|
32
|
-
const limOrder =
|
34
|
+
for (let i = 0; i < allAccounts.length; i += 1) {
|
35
|
+
const limOrder = allAccounts[i];
|
33
36
|
const mint = limOrder.inputMint.toString();
|
34
37
|
const amountLeftInOrder = limOrder.makingAmount;
|
35
38
|
const totalAmount = rawAmountByMint.get(mint);
|
@@ -56,7 +59,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
56
59
|
platformId: constants_1.platformId,
|
57
60
|
value,
|
58
61
|
label: 'Deposit',
|
59
|
-
name: `Limit Orders (${
|
62
|
+
name: `Limit Orders (${allAccounts.length})`,
|
60
63
|
data: { assets },
|
61
64
|
};
|
62
65
|
return [element];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"limitFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/limitFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAIpC,oDAAyD;AACzD,kDAAiE;AACjE,wGAAgF;AAChF,
|
1
|
+
{"version":3,"file":"limitFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/limitFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAIpC,oDAAyD;AACzD,kDAAiE;AACjE,wGAAgF;AAChF,2CAA2E;AAC3E,uCAAiE;AACjE,uCAAyC;AAEzC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,WAAW,GAAG,CAClB,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,IAAA,iCAAwB,EACtB,MAAM,EACN,0BAAgB,EAChB,0BAAc,EACd,IAAA,sBAAY,EAAC,KAAK,CAAC,CACpB;QACD,IAAA,iCAAwB,EACtB,MAAM,EACN,4BAAkB,EAClB,4BAAgB,EAChB,IAAA,sBAAY,EAAC,KAAK,CAAC,CACpB;KACF,CAAC,CACH,CAAC,IAAI,EAAE,CAAC;IACT,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAExC,MAAM,KAAK,GAAgB,IAAI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ACzE,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,IAAI,EACJ,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,MAAM,OAAO,GAA6B;QACxC,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,UAAU,EAAV,sBAAU;QACV,KAAK;QACL,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,iBAAiB,WAAW,CAAC,MAAM,GAAG;QAC5C,IAAI,EAAE,EAAE,MAAM,EAAE;KACjB,CAAC;IAEF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -55,7 +55,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
55
55
|
const tokensDetailsById = new Map();
|
56
56
|
const tokensDetails = yield cache.getItems(custodiesAccounts.map((acc) => acc.mint), { prefix: constants_1.tokenListsDetailsPrefix, networkId: portfolio_core_1.NetworkId.solana });
|
57
57
|
tokensDetails.forEach((tD) => tD ? tokensDetailsById.set(tD.address, tD) : undefined);
|
58
|
-
const
|
58
|
+
const levPositions = [];
|
59
59
|
for (const position of positionAccounts) {
|
60
60
|
const { collateralUsd, sizeUsd, price, side, cumulativeInterestSnapshot, lockedAmount, } = position;
|
61
61
|
if (sizeUsd.isLessThanOrEqualTo(0))
|
@@ -96,7 +96,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
96
96
|
const rawPnlValue = priceVar.times(collateralValue).times(leverage);
|
97
97
|
const netPnlValue = rawPnlValue.minus(fees);
|
98
98
|
const value = collateralValue.plus(netPnlValue);
|
99
|
-
|
99
|
+
levPositions.push({
|
100
100
|
address: custody.mint,
|
101
101
|
side: isLong ? portfolio_core_1.LeverageSide.long : portfolio_core_1.LeverageSide.short,
|
102
102
|
leverage: leverage.toNumber(),
|
@@ -108,18 +108,18 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
108
108
|
value: value.toNumber(),
|
109
109
|
});
|
110
110
|
}
|
111
|
-
if (
|
111
|
+
if (levPositions.length === 0)
|
112
112
|
return [];
|
113
|
-
const value = (0, portfolio_core_1.getUsdValueSum)(
|
113
|
+
const value = (0, portfolio_core_1.getUsdValueSum)(levPositions.map((a) => a.value));
|
114
114
|
return [
|
115
115
|
{
|
116
116
|
type: portfolio_core_1.PortfolioElementType.leverage,
|
117
117
|
data: {
|
118
|
-
|
119
|
-
|
118
|
+
levPositions,
|
119
|
+
levValue: value,
|
120
120
|
value,
|
121
|
-
|
122
|
-
|
121
|
+
rewardAssets: [],
|
122
|
+
rewardValue: 0,
|
123
123
|
},
|
124
124
|
label: 'Leverage',
|
125
125
|
networkId: portfolio_core_1.NetworkId.solana,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,oDAAyD;AACzD,kDAAgF;AAChF,wCAAuD;AAEvD,gEAAwE;AACxE,sDAAiE;AACjE,2CAKqB;AACrB,uCAAiD;AAEjD,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAA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IAAI,mBAAS,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;QAC3D,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,MAAM,mBAAmB,GAAG,MAAM,IAAA,4BAAkB,EAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAE7E,MAAM,iBAAiB,GAA8B,IAAI,GAAG,EAAE,CAAC;IAC/D,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,QAAQ,CACxC,iBAAiB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EACxC,EAAE,MAAM,EAAE,mCAAuB,EAAE,SAAS,EAAE,0BAAS,CAAC,MAAM,EAAE,CACjE,CAAC;IACF,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAC3B,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CACvD,CAAC;IAEF,MAAM,
|
1
|
+
{"version":3,"file":"perpetualFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/perpetualFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,oDAAyD;AACzD,kDAAgF;AAChF,wCAAuD;AAEvD,gEAAwE;AACxE,sDAAiE;AACjE,2CAKqB;AACrB,uCAAiD;AAEjD,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC,CAAC;AACzC,MAAM,QAAQ,GAAoB,CAChC,KAAa,EACb,KAAY,EACyB,EAAE;IACvC,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,gBAAgB,GAAG,MAAM,I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,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/D,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,IAAI,EAAE;gBACJ,YAAY;gBACZ,QAAQ,EAAE,KAAK;gBACf,KAAK;gBACL,YAAY,EAAE,EAAE;gBAChB,WAAW,EAAE,CAAC;aACf;YACD,KAAK,EAAE,UAAU;YACjB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK;SACN;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -21,6 +21,27 @@ export type LimitOrder = {
|
|
21
21
|
referral: PublicKey;
|
22
22
|
};
|
23
23
|
export declare const limitOrderStruct: BeetStruct<LimitOrder, Partial<LimitOrder>>;
|
24
|
+
export type LimitOrderV2 = {
|
25
|
+
buffer: Buffer;
|
26
|
+
maker: PublicKey;
|
27
|
+
inputMint: PublicKey;
|
28
|
+
outputMint: PublicKey;
|
29
|
+
inputTokenProgram: PublicKey;
|
30
|
+
outputTokenProgram: PublicKey;
|
31
|
+
uniqueId: boolean;
|
32
|
+
oriMakingAmount: BigNumber;
|
33
|
+
oriTakingAmount: BigNumber;
|
34
|
+
makingAmount: BigNumber;
|
35
|
+
takingAmount: BigNumber;
|
36
|
+
borrowMakingAmount: BigNumber;
|
37
|
+
expiredAt: BigNumber;
|
38
|
+
feeBps: number;
|
39
|
+
feeAccount: PublicKey;
|
40
|
+
createdAt: BigNumber;
|
41
|
+
updatedAt: BigNumber;
|
42
|
+
bump: number;
|
43
|
+
};
|
44
|
+
export declare const limitOrderV2Struct: BeetStruct<LimitOrderV2, Partial<LimitOrderV2>>;
|
24
45
|
export type DCA = {
|
25
46
|
buffer: Buffer;
|
26
47
|
user: PublicKey;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.positionStruct = exports.Side = exports.custodyStruct = exports.fundingRateStateStruct = exports.assetsStruct = exports.permissionsStruct = exports.pricingParamsStruct = exports.oracleParamsStruct = exports.OracleType = exports.perpetualPoolStruct = exports.feesStruct = exports.poolAprStruct = exports.limitStruct = exports.valueAverageStruct = exports.dcaStruct = exports.limitOrderStruct = void 0;
|
3
|
+
exports.positionStruct = exports.Side = exports.custodyStruct = exports.fundingRateStateStruct = exports.assetsStruct = exports.permissionsStruct = exports.pricingParamsStruct = exports.oracleParamsStruct = exports.OracleType = exports.perpetualPoolStruct = exports.feesStruct = exports.poolAprStruct = exports.limitStruct = exports.valueAverageStruct = exports.dcaStruct = exports.limitOrderV2Struct = exports.limitOrderStruct = void 0;
|
4
4
|
const beet_1 = require("@metaplex-foundation/beet");
|
5
5
|
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
6
|
const solana_1 = require("../../../utils/solana");
|
@@ -22,6 +22,26 @@ exports.limitOrderStruct = new beet_1.BeetStruct([
|
|
22
22
|
['base', beet_solana_1.publicKey],
|
23
23
|
['referral', beet_solana_1.publicKey],
|
24
24
|
], (args) => args);
|
25
|
+
exports.limitOrderV2Struct = new beet_1.BeetStruct([
|
26
|
+
['buffer', (0, solana_1.blob)(8)],
|
27
|
+
['maker', beet_solana_1.publicKey],
|
28
|
+
['inputMint', beet_solana_1.publicKey],
|
29
|
+
['outputMint', beet_solana_1.publicKey],
|
30
|
+
['inputTokenProgram', beet_solana_1.publicKey],
|
31
|
+
['outputTokenProgram', beet_solana_1.publicKey],
|
32
|
+
['uniqueId', solana_1.u64],
|
33
|
+
['oriMakingAmount', solana_1.u64],
|
34
|
+
['oriTakingAmount', solana_1.u64],
|
35
|
+
['makingAmount', solana_1.u64],
|
36
|
+
['takingAmount', solana_1.u64],
|
37
|
+
['borrowMakingAmount', solana_1.u64],
|
38
|
+
['expiredAt', solana_1.i64],
|
39
|
+
['feeBps', beet_1.u16],
|
40
|
+
['feeAccount', beet_solana_1.publicKey],
|
41
|
+
['createdAt', solana_1.i64],
|
42
|
+
['updatedAt', solana_1.i64],
|
43
|
+
['bump', beet_1.u8],
|
44
|
+
], (args) => args);
|
25
45
|
exports.dcaStruct = new beet_1.BeetStruct([
|
26
46
|
['buffer', (0, solana_1.blob)(8)],
|
27
47
|
['user', beet_solana_1.publicKey],
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/structs.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/structs.ts"],"names":[],"mappings":";;;AAAA,oDAQmC;AACnC,kEAA6D;AAG7D,kDAA6D;AAqBhD,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,SAAS,EAAE,WAAI,CAAC;IACjB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,oBAAoB,EAAE,uBAAS,CAAC;IACjC,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,KAAK,EAAE,YAAG,CAAC;IACZ,CAAC,WAAW,EAAE,YAAG,CA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G,CAAC;IACvB,CAAC,4BAA4B,EAAE,aAAI,CAAC;IACpC,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,MAAM,EAAE,SAAE,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC"}
|
@@ -16,6 +16,7 @@ const helpers_1 = require("./helpers");
|
|
16
16
|
const constants_2 = require("../tokens/constants");
|
17
17
|
const getMultipleDecimalsAsMap_1 = require("../../utils/solana/getMultipleDecimalsAsMap");
|
18
18
|
const clients_1 = require("../../utils/clients");
|
19
|
+
const constants_3 = require("../sanctum/constants");
|
19
20
|
const mints = [
|
20
21
|
'xLfNTYy76B8Tiix3hA51Jyvc1kMSFV4sPdR7szTZsRu', // xLifinity
|
21
22
|
'BANXbTpN8U2cU41FjPxe2Ti37PiT5cCxLUKDQZuJeMMR', // Banx
|
@@ -38,36 +39,20 @@ const mints = [
|
|
38
39
|
'FCqfQSujuPxy6V42UvafBhsysWtEq1vhjfMN1PUbgaxA', // USD Coin (Wormhole from BSC)
|
39
40
|
'8qJSyQprMC57TWKaYEmetUR3UUiTP2M3hXdcvFhkZdmv', // Tether USD (Wormhole from BSC)
|
40
41
|
'UPTx1d24aBWuRgwxVnFmX4gNraj3QGFzL3QqBgxtWQG', // UPT
|
41
|
-
// Sanctum / LSTs
|
42
|
-
'HUBsveNpjo5pWqNkH57QzxjQASdTVXcSK7bVKTSZtcSX',
|
43
|
-
'pWrSoLAhue6jUxUkbWgmEy5rD9VJzkFmvfTDV5KgNuu',
|
44
|
-
'st8QujHLPsX3d6HG9uQg9kJ91jFxUgruwsb1hyYXSNd',
|
45
|
-
'strng7mqqc1MBJJV6vMzYbEqnwVGvKKGKedeCvtktWA',
|
46
|
-
'suPer8CPwxoJPQ7zksGMwFvjBQhjAHwUMmPV4FVatBw',
|
47
|
-
'vSoLxydx6akxyMD9XEcPvGYNGq6Nn66oqVb3UkGkei7',
|
48
|
-
'Zippybh3S5xYYam2nvL6hVJKz1got6ShgV4DyD1XQYF',
|
49
|
-
'CgnTSoL3DgY9SFHxcLj6CgCgKKoTBr6tp4CPAEWy25DE',
|
50
|
-
'GRJQtWwdJmp5LLpy8JWjPgn5FnLyqSJGNhn5ZnCTFUwM',
|
51
|
-
'edge86g9cVz87xcpKpy3J77vbp4wYd9idEV562CCntt',
|
52
|
-
'he1iusmfkpAdwvxLNGV8Y1iSbj4rUy6yMhEA3fotn9A',
|
53
|
-
'pathdXw4He1Xk3eX84pDdDZnGKEme3GivBamGCVPZ5a',
|
54
|
-
'7Q2afV64in6N6SeZsAAB81TJzwDoD6zpqmHkzi9Dcavn',
|
55
|
-
'jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v',
|
56
|
-
'LnTRntk2kTfWEY6cVB8K9649pgJbt6dJLS1Ns1GZCWg',
|
57
|
-
'phaseZSfPxTDBpiVb96H4XFSD8xHeHxZre5HerehBJG',
|
58
|
-
'picobAEvs6w7QEknPce34wAE4gknZA9v5tTonnmHYdX',
|
59
|
-
'pumpkinsEq8xENVZE6QgTS93EN4r9iKvNxNALS1ooyp',
|
60
|
-
'WensoLXxZJnev2YvihHFchn1dVVFnFLYvgomXWvvwRu',
|
61
|
-
'HausGKcq9G9zM3azwNmgZyzUvYeeqR8h8663PmZpxuDj',
|
62
|
-
'Fi5GayacZzUrfaCRCJtBz2vSYkGF56xjgCceZx5SbXwq',
|
63
42
|
];
|
64
43
|
const vsToken = portfolio_core_1.solanaNativeWrappedAddress;
|
65
44
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
45
|
+
const sanctumMints = yield cache.getItem(constants_3.lstsKey, {
|
46
|
+
prefix: constants_3.platformId,
|
47
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
48
|
+
});
|
66
49
|
const connection = (0, clients_1.getClientSolana)();
|
67
50
|
const solTokenPrice = yield cache.getTokenPrice(vsToken, portfolio_core_1.NetworkId.solana);
|
68
51
|
if (!solTokenPrice)
|
69
52
|
return;
|
70
53
|
const mintsPk = mints.map((m) => new web3_js_1.PublicKey(m));
|
54
|
+
if (sanctumMints)
|
55
|
+
mintsPk.push(...sanctumMints.map((m) => new web3_js_1.PublicKey(m)));
|
71
56
|
const prices = yield (0, helpers_1.getJupiterPrices)(mintsPk, new web3_js_1.PublicKey(vsToken));
|
72
57
|
const decimalsMap = yield (0, getMultipleDecimalsAsMap_1.getMultipleDecimalsAsMap)(connection, mintsPk);
|
73
58
|
const sources = [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pricingJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/pricingJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAIoC;AACpC,6CAA4C;AAG5C,oDAAkD;AAClD,uCAA6C;AAC7C,mDAA2D;AAC3D,0FAAuF;AACvF,iDAAsD;
|
1
|
+
{"version":3,"file":"pricingJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/pricingJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAIoC;AACpC,6CAA4C;AAG5C,oDAAkD;AAClD,uCAA6C;AAC7C,mDAA2D;AAC3D,0FAAuF;AACvF,iDAAsD;AACtD,oDAAgF;AAEhF,MAAM,KAAK,GAAG;IACZ,6CAA6C,EAAE,YAAY;IAC3D,8CAA8C,EAAE,OAAO;IACvD,8CAA8C,EAAE,QAAQ;IACxD,6CAA6C,EAAE,QAAQ;IACvD,6CAA6C,EAAE,SAAS;IACxD,8CAA8C,EAAE,yCAAyC;IACzF,6CAA6C,EAAE,wCAAwC;IACvF,8CAA8C,EAAE,0CAA0C;IAC1F,8CAA8C,EAAE,iCAAiC;IACjF,6CAA6C,EAAE,iCAAiC;IAChF,8CAA8C,EAAE,oBAAoB;IACpE,8CAA8C,EAAE,QAAQ;IACxD,8CAA8C,EAAE,yCAAyC;IACzF,8CAA8C,EAAE,0CAA0C;IAC1F,8CAA8C,EAAE,oCAAoC;IACpF,8CAA8C,E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;QACvC,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,MAAM,MAAM,GAAqB;YAC/B,OAAO,EAAE,IAAI;YACb,QAAQ;YACR,EAAE,EAAE,aAAa;YACjB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,KAAK,EAAE,aAAa,CAAC,KAAK,GAAG,KAAK;YAClC,UAAU,EAAE,gCAAoB,CAAC,EAAE;YACnC,MAAM,EAAE,GAAG;SACZ,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IACH,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,WAAW;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -106,7 +106,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
106
106
|
]);
|
107
107
|
}
|
108
108
|
if (suppliedAssets.length !== 0 || borrowedAssets.length !== 0) {
|
109
|
-
const { borrowedValue, suppliedValue, value, healthRatio, rewardValue, } = (0, portfolio_core_1.getElementLendingValues)(
|
109
|
+
const { borrowedValue, suppliedValue, value, healthRatio, rewardValue, } = (0, portfolio_core_1.getElementLendingValues)({
|
110
|
+
suppliedAssets,
|
111
|
+
borrowedAssets,
|
112
|
+
rewardAssets,
|
113
|
+
suppliedLtvs,
|
114
|
+
borrowedWeights,
|
115
|
+
});
|
110
116
|
elements.push({
|
111
117
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
112
118
|
networkId,
|
@@ -188,7 +194,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
188
194
|
]);
|
189
195
|
}
|
190
196
|
if (suppliedAssets.length !== 0 || borrowedAssets.length !== 0) {
|
191
|
-
const { borrowedValue, suppliedValue, value, rewardValue, healthRatio, } = (0, portfolio_core_1.getElementLendingValues)(
|
197
|
+
const { borrowedValue, suppliedValue, value, rewardValue, healthRatio, } = (0, portfolio_core_1.getElementLendingValues)({
|
198
|
+
suppliedAssets,
|
199
|
+
borrowedAssets,
|
200
|
+
rewardAssets,
|
201
|
+
suppliedLtvs,
|
202
|
+
borrowedWeights,
|
203
|
+
});
|
192
204
|
elements.push({
|
193
205
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
194
206
|
networkId,
|
@@ -264,7 +276,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
264
276
|
]);
|
265
277
|
}
|
266
278
|
if (suppliedAssets.length !== 0 || borrowedAssets.length !== 0) {
|
267
|
-
const { borrowedValue, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(
|
279
|
+
const { borrowedValue, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({
|
280
|
+
suppliedAssets,
|
281
|
+
borrowedAssets,
|
282
|
+
rewardAssets,
|
283
|
+
suppliedLtvs,
|
284
|
+
borrowedWeights,
|
285
|
+
});
|
268
286
|
elements.push({
|
269
287
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
270
288
|
networkId,
|