@sonarwatch/portfolio-plugins 0.12.159 → 0.12.161
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1446 -1434
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +4 -4
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/banx/loansFetcher.js +3 -2
- package/src/plugins/banx/loansFetcher.js.map +1 -1
- package/src/plugins/drift-market-maker-vault/constants.d.ts +9 -0
- package/src/plugins/drift-market-maker-vault/constants.js +29 -0
- package/src/plugins/drift-market-maker-vault/constants.js.map +1 -0
- package/src/plugins/{circuit → drift-market-maker-vault}/depositsFetcher.js +7 -6
- package/src/plugins/drift-market-maker-vault/depositsFetcher.js.map +1 -0
- package/src/plugins/drift-market-maker-vault/filters.js.map +1 -0
- package/src/plugins/{circuit → drift-market-maker-vault}/index.js +1 -1
- package/src/plugins/drift-market-maker-vault/index.js.map +1 -0
- package/src/plugins/drift-market-maker-vault/structs.js.map +1 -0
- package/src/plugins/{circuit → drift-market-maker-vault}/types.d.ts +1 -0
- package/src/plugins/drift-market-maker-vault/types.js.map +1 -0
- package/src/plugins/{circuit → drift-market-maker-vault}/vaultsJob.js +9 -3
- package/src/plugins/drift-market-maker-vault/vaultsJob.js.map +1 -0
- package/src/plugins/loopscale/constants.d.ts +5 -0
- package/src/plugins/loopscale/constants.js +17 -0
- package/src/plugins/loopscale/constants.js.map +1 -0
- package/src/plugins/loopscale/index.d.ts +6 -0
- package/src/plugins/loopscale/index.js +13 -0
- package/src/plugins/loopscale/index.js.map +1 -0
- package/src/plugins/loopscale/marketsJob.d.ts +3 -0
- package/src/plugins/loopscale/marketsJob.js +26 -0
- package/src/plugins/loopscale/marketsJob.js.map +1 -0
- package/src/plugins/loopscale/positionsFetcher.d.ts +3 -0
- package/src/plugins/loopscale/positionsFetcher.js +68 -0
- package/src/plugins/loopscale/positionsFetcher.js.map +1 -0
- package/src/plugins/loopscale/structs.d.ts +19 -0
- package/src/plugins/loopscale/structs.js +22 -0
- package/src/plugins/loopscale/structs.js.map +1 -0
- package/src/plugins/raydium/getRaydiumCLMMPositions.js +21 -22
- package/src/plugins/raydium/getRaydiumCLMMPositions.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/plugins/circuit/constants.d.ts +0 -7
- package/src/plugins/circuit/constants.js +0 -17
- package/src/plugins/circuit/constants.js.map +0 -1
- package/src/plugins/circuit/depositsFetcher.js.map +0 -1
- package/src/plugins/circuit/filters.js.map +0 -1
- package/src/plugins/circuit/index.js.map +0 -1
- package/src/plugins/circuit/structs.js.map +0 -1
- package/src/plugins/circuit/types.js.map +0 -1
- package/src/plugins/circuit/vaultsJob.js.map +0 -1
- /package/src/plugins/{circuit → drift-market-maker-vault}/depositsFetcher.d.ts +0 -0
- /package/src/plugins/{circuit → drift-market-maker-vault}/filters.d.ts +0 -0
- /package/src/plugins/{circuit → drift-market-maker-vault}/filters.js +0 -0
- /package/src/plugins/{circuit → drift-market-maker-vault}/index.d.ts +0 -0
- /package/src/plugins/{circuit → drift-market-maker-vault}/structs.d.ts +0 -0
- /package/src/plugins/{circuit → drift-market-maker-vault}/structs.js +0 -0
- /package/src/plugins/{circuit → drift-market-maker-vault}/types.js +0 -0
- /package/src/plugins/{circuit → drift-market-maker-vault}/vaultsJob.d.ts +0 -0
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
package/src/index.js
CHANGED
@@ -82,7 +82,7 @@ const streamflow_1 = require("./plugins/streamflow");
|
|
82
82
|
const benqi_1 = require("./plugins/benqi");
|
83
83
|
const parcl_1 = require("./plugins/parcl");
|
84
84
|
const pyth_1 = require("./plugins/pyth");
|
85
|
-
const
|
85
|
+
const drift_market_maker_vault_1 = require("./plugins/drift-market-maker-vault");
|
86
86
|
const aries_1 = require("./plugins/aries");
|
87
87
|
const flash_1 = require("./plugins/flash");
|
88
88
|
const bonkrewards_1 = require("./plugins/bonkrewards");
|
@@ -213,7 +213,7 @@ exports.platforms = [
|
|
213
213
|
...parcl_1.platforms,
|
214
214
|
...pyth_1.platforms,
|
215
215
|
...jupiter_1.platforms,
|
216
|
-
...
|
216
|
+
...drift_market_maker_vault_1.platforms,
|
217
217
|
...aries_1.platforms,
|
218
218
|
...flash_1.platforms,
|
219
219
|
...bonkrewards_1.platforms,
|
@@ -326,7 +326,7 @@ exports.jobs = [
|
|
326
326
|
...benqi_1.jobs,
|
327
327
|
...parcl_1.jobs,
|
328
328
|
...pyth_1.jobs,
|
329
|
-
...
|
329
|
+
...drift_market_maker_vault_1.jobs,
|
330
330
|
...aries_1.jobs,
|
331
331
|
...flash_1.jobs,
|
332
332
|
...bonkrewards_1.jobs,
|
@@ -443,7 +443,7 @@ exports.fetchers = [
|
|
443
443
|
...benqi_1.fetchers,
|
444
444
|
...parcl_1.fetchers,
|
445
445
|
...pyth_1.fetchers,
|
446
|
-
...
|
446
|
+
...drift_market_maker_vault_1.fetchers,
|
447
447
|
...aries_1.fetchers,
|
448
448
|
...flash_1.fetchers,
|
449
449
|
...bonkrewards_1.fetchers,
|
package/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,wEAAgD;AAChD,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAKyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEAIsC;AACtC,uDAI+B;AAC/B,mDAI6B;AAC7B,qDAG8B;AAC9B,uDAG+B;AAC/B,2CAIyB;AACzB,6CAK0B;AAC1B,6CAG0B;AAC1B,yCAIwB;AACxB,+CAI2B;AAC3B,uDAG+B;AAC/B,yCAGwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,6CAI0B;AAC1B,+CAI2B;AAC3B,qDAG8B;AAC9B,iDAI4B;AAC5B,iDAI4B;AAC5B,mDAG6B;AAC7B,yCAIwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,+CAK2B;AAC3B,yCAIwB;AACxB,2CAIyB;AACzB,mDAI6B;AAC7B,2CAIyB;AACzB,2CAIyB;AACzB,sCAIsB;AACtB,+CAI2B;AAC3B,yCAIwB;AACxB,iDAI4B;AAC5B,yCAIwB;AACxB,mDAI6B;AAC7B,qDAI8B;AAC9B,2CAIyB;AACzB,2CAKyB;AACzB,yCAIwB;AACxB
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,wEAAgD;AAChD,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAKy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8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,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;
|
@@ -38,11 +38,12 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
38
38
|
(0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.banxIdlItem, (0, filters_1.loanFiltersB)(owner)),
|
39
39
|
]))
|
40
40
|
.flat()
|
41
|
-
.filter((acc) => acc.bondTradeTransactionState.perpetualActive ||
|
41
|
+
.filter((acc) => (acc.bondTradeTransactionState.perpetualActive ||
|
42
42
|
acc.bondTradeTransactionState.perpetualPartialRepaid ||
|
43
43
|
acc.bondTradeTransactionState.perpetualRefinancedActive ||
|
44
44
|
acc.bondTradeTransactionState.perpetualManualTerminating ||
|
45
|
-
acc.bondTradeTransactionState.active)
|
45
|
+
acc.bondTradeTransactionState.active) &&
|
46
|
+
acc.redeemedAt === '0');
|
46
47
|
if (accounts.length === 0)
|
47
48
|
return [];
|
48
49
|
const [tokenPrices, fbondTokenMints, bondOffers, collections] = yield Promise.all([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/banx/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,6CAA4C;AAC5C,gEAAqC;AAGrC,iDAAsD;AACtD,oGAA4E;AAC5E,+CAK4B;AAC5B,8EAAgF;AAChF,wGAAqG;AACrG,qGAA6E;AAC7E,2CAKqB;AAOrB,uCAAwE;AACxE,uCAAuD;AACvD,kEAA+D;AAC/D,4DAAyD;AAEzD,MAAM,eAAe,GAAG,IAAI,6BAAa,CAIvC,+BAAmB,EACnB;IACE,MAAM,EAAE,uBAAW;IACnB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,uBAAU,EAAC,GAAG,IAAI,EAAE,EAAE,cAAc,CAAC,CAC/C,CAAC;AAEF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,MAAM,GAAG,IAAA,8BAAoB,GAAE,CAAC;IAEtC,MAAM,QAAQ,GAAG,CACf,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,IAAA,qCAA4B,EAC1B,UAAU,EACV,uBAAW,EACX,IAAA,sBAAY,EAAC,KAAK,CAAC,CACpB;QACD,IAAA,qCAA4B,EAC1B,UAAU,EACV,uBAAW,EACX,IAAA,sBAAY,EAAC,KAAK,CAAC,CACpB;KACF,CAAC,CACH;SACE,IAAI,EAAE;SACN,MAAM,CACL,CAAC,GAAG,EAAE,EAAE,CACN,GAAG,CAAC,yBAAyB,CAAC,eAAe;
|
1
|
+
{"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/banx/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,6CAA4C;AAC5C,gEAAqC;AAGrC,iDAAsD;AACtD,oGAA4E;AAC5E,+CAK4B;AAC5B,8EAAgF;AAChF,wGAAqG;AACrG,qGAA6E;AAC7E,2CAKqB;AAOrB,uCAAwE;AACxE,uCAAuD;AACvD,kEAA+D;AAC/D,4DAAyD;AAEzD,MAAM,eAAe,GAAG,IAAI,6BAAa,CAIvC,+BAAmB,EACnB;IACE,MAAM,EAAE,uBAAW;IACnB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,uBAAU,EAAC,GAAG,IAAI,EAAE,EAAE,cAAc,CAAC,CAC/C,CAAC;AAEF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,MAAM,GAAG,IAAA,8BAAoB,GAAE,CAAC;IAEtC,MAAM,QAAQ,GAAG,CACf,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,IAAA,qCAA4B,EAC1B,UAAU,EACV,uBAAW,EACX,IAAA,sBAAY,EAAC,KAAK,CAAC,CACpB;QACD,IAAA,qCAA4B,EAC1B,UAAU,EACV,uBAAW,EACX,IAAA,sBAAY,EAAC,KAAK,CAAC,CACpB;KACF,CAAC,CACH;SACE,IAAI,EAAE;SACN,MAAM,CACL,CAAC,GAAG,EAAE,EAAE,CACN,CAAC,G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1,9 @@
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
2
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
3
|
+
export declare const circuitPlatformId = "circuit";
|
4
|
+
export declare const circuitPlatform: Platform;
|
5
|
+
export declare const moosePlatformId = "moose";
|
6
|
+
export declare const moosePlatform: Platform;
|
7
|
+
export declare const vaultsPid: PublicKey;
|
8
|
+
export declare const prefixVaults = "circuitVaults";
|
9
|
+
export declare const platformIdByVaultManager: Map<string, string>;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.platformIdByVaultManager = exports.prefixVaults = exports.vaultsPid = exports.moosePlatform = exports.moosePlatformId = exports.circuitPlatform = exports.circuitPlatformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
exports.circuitPlatformId = 'circuit';
|
6
|
+
exports.circuitPlatform = {
|
7
|
+
id: exports.circuitPlatformId,
|
8
|
+
name: 'Circuit',
|
9
|
+
image: 'https://sonar.watch/img/platforms/circuit.webp',
|
10
|
+
// defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
11
|
+
website: 'https://app.circuit.trade/',
|
12
|
+
twitter: 'https://twitter.com/CircuitTrading_',
|
13
|
+
};
|
14
|
+
exports.moosePlatformId = 'moose';
|
15
|
+
exports.moosePlatform = {
|
16
|
+
id: exports.moosePlatformId,
|
17
|
+
name: 'Moose Market',
|
18
|
+
image: 'https://sonar.watch/img/platforms/moose.webp',
|
19
|
+
// defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
20
|
+
website: 'https://moose.market/',
|
21
|
+
twitter: 'https://twitter.com/moose_market',
|
22
|
+
};
|
23
|
+
exports.vaultsPid = new web3_js_1.PublicKey('vAuLTsyrvSfZRuRB3XgvkPwNGgYSs9YRYymVebLKoxR');
|
24
|
+
exports.prefixVaults = 'circuitVaults';
|
25
|
+
exports.platformIdByVaultManager = new Map([
|
26
|
+
['GT3RSBy5nS2ACpT3LCkycHWm9CVJCSuqErAgf4sE33Qu', exports.circuitPlatformId],
|
27
|
+
['En8nqJqCE9D2Bsqetw4p89VgZTh8QK8SfCAn5sSyL4PM', exports.moosePlatformId],
|
28
|
+
]);
|
29
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,iBAAiB,GAAG,SAAS,CAAC;AAC9B,QAAA,eAAe,GAAa;IACvC,EAAE,EAAE,yBAAiB;IACrB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,qEAAqE;IACrE,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,eAAe,GAAG,OAAO,CAAC;AAC1B,QAAA,aAAa,GAAa;IACrC,EAAE,EAAE,uBAAe;IACnB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,8CAA8C;IACrD,qEAAqE;IACrE,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AACW,QAAA,YAAY,GAAG,eAAe,CAAC;AAE/B,QAAA,wBAAwB,GAAwB,IAAI,GAAG,CAAC;IACnE,CAAC,8CAA8C,EAAE,yBAAiB,CAAC;IACnE,CAAC,8CAA8C,EAAE,uBAAe,CAAC;CAClE,CAAC,CAAC"}
|
@@ -13,7 +13,8 @@ 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 constants_1 = require("
|
16
|
+
const constants_1 = require("../drift/constants");
|
17
|
+
const constants_2 = require("./constants");
|
17
18
|
const clients_1 = require("../../utils/clients");
|
18
19
|
const solana_1 = require("../../utils/solana");
|
19
20
|
const structs_1 = require("./structs");
|
@@ -22,10 +23,10 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
|
|
22
23
|
const stakingFetcher_1 = require("../goosefx/stakingFetcher");
|
23
24
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
25
|
const client = (0, clients_1.getClientSolana)();
|
25
|
-
const depositAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.vaultDepositorStruct,
|
26
|
+
const depositAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.vaultDepositorStruct, constants_2.vaultsPid, (0, filters_1.vaultDepositorFilter)(owner));
|
26
27
|
if (depositAccounts.length === 0)
|
27
28
|
return [];
|
28
|
-
const vaultsInfo = yield cache.getItems(depositAccounts.map((deposit) => deposit.vault.toString()), { prefix:
|
29
|
+
const vaultsInfo = yield cache.getItems(depositAccounts.map((deposit) => deposit.vault.toString()), { prefix: constants_2.prefixVaults, networkId: portfolio_core_1.NetworkId.solana });
|
29
30
|
const vaultById = new Map();
|
30
31
|
for (const vaultInfo of vaultsInfo) {
|
31
32
|
if (vaultInfo)
|
@@ -43,7 +44,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
43
44
|
const vaultInfo = vaultById.get(depositAccount.vault.toString());
|
44
45
|
if (!vaultInfo)
|
45
46
|
continue;
|
46
|
-
const { decimals, name, mint } = vaultInfo;
|
47
|
+
const { decimals, name, mint, platformId } = vaultInfo;
|
47
48
|
const tokenPrice = tokenPriceById.get(mint);
|
48
49
|
let amountLeft = depositAccount.netDeposits.plus(depositAccount.cumulativeProfitShareAmount);
|
49
50
|
if (!depositAccount.lastWithdrawRequest.value.isZero()) {
|
@@ -62,7 +63,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
62
63
|
continue;
|
63
64
|
elements.push({
|
64
65
|
networkId: portfolio_core_1.NetworkId.solana,
|
65
|
-
platformId
|
66
|
+
platformId,
|
66
67
|
label: 'Deposit',
|
67
68
|
type: portfolio_core_1.PortfolioElementType.multiple,
|
68
69
|
name,
|
@@ -73,7 +74,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
73
74
|
return elements;
|
74
75
|
});
|
75
76
|
const fetcher = {
|
76
|
-
id: `${constants_1.platformId}-deposits`,
|
77
|
+
id: `${constants_1.platformId}-mm-vaults-deposits`,
|
77
78
|
networkId: portfolio_core_1.NetworkId.solana,
|
78
79
|
executor,
|
79
80
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AAGpC,kDAAmE;AACnE,2CAAsD;AACtD,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAiD;AACjD,uCAAiD;AACjD,qGAA6E;AAC7E,8DAAsD;AAGtD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,eAAe,GAAG,MAAM,IAAA,iCAAwB,EACpD,MAAM,EACN,8BAAoB,EACpB,qBAAS,EACT,IAAA,8BAAoB,EAAC,KAAK,CAAC,CAC5B,CAAC;IAEF,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE5C,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,QAAQ,CACrC,eAAe,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAC1D,EAAE,MAAM,EAAE,wBAAY,EAAE,SAAS,EAAE,0BAAS,CAAC,MAAM,EAAE,C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AC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAe,qBAAqB;IAC3C,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/filters.ts"],"names":[],"mappings":";;;AACA,uCAA8D;AAEjD,QAAA,YAAY,GAA+B;IACtD,EAAE,QAAQ,EAAE,qBAAW,CAAC,QAAQ,EAAE;CACnC,CAAC;AAEK,MAAM,oBAAoB,GAAG,CAClC,KAAa,EACe,EAAE,CAAC;IAC/B,EAAE,QAAQ,EAAE,8BAAoB,CAAC,QAAQ,EAAE;IAC3C;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;CACF,CAAC;AAVW,QAAA,oBAAoB,wBAU/B;AAEW,QAAA,WAAW,GAA+B;IACrD,EAAE,QAAQ,EAAE,qBAAW,CAAC,QAAQ,EAAE;CACnC,CAAC"}
|
@@ -7,7 +7,7 @@ exports.fetchers = exports.jobs = exports.platforms = void 0;
|
|
7
7
|
const constants_1 = require("./constants");
|
8
8
|
const depositsFetcher_1 = __importDefault(require("./depositsFetcher"));
|
9
9
|
const vaultsJob_1 = __importDefault(require("./vaultsJob"));
|
10
|
-
exports.platforms = [constants_1.
|
10
|
+
exports.platforms = [constants_1.circuitPlatform, constants_1.moosePlatform];
|
11
11
|
exports.jobs = [vaultsJob_1.default];
|
12
12
|
exports.fetchers = [depositsFetcher_1.default];
|
13
13
|
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAA6D;AAC7D,wEAAgD;AAChD,4DAAoC;AAEvB,QAAA,SAAS,GAAe,CAAC,2BAAe,EAAE,yBAAa,CAAC,CAAC;AACzD,QAAA,IAAI,GAAU,CAAC,mBAAS,CAAC,CAAC;AAC1B,QAAA,QAAQ,GAAc,CAAC,yBAAe,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/structs.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AACnC,kEAA6D;AAG7D,+CAA0D;AAQ7C,QAAA,qBAAqB,GAAG,IAAI,iBAAU,CACjD;IACE,CAAC,QAAQ,EAAE,aAAI,CAAC;IAChB,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,IAAI,EAAE,YAAG,CAAC;CACZ,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAuB,CAClC,CAAC;AAoBW,QAAA,oBAAoB,GAAG,IAAI,iBAAU,CAChD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,aAAa,EAAE,aAAI,CAAC;IACrB,CAAC,qBAAqB,EAAE,6BAAqB,CAAC;IAC9C,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,6BAA6B,EAAE,YAAG,CAAC;IACpC,CAAC,oBAAoB,EAAE,YAAG,CAAC;IAC3B,CAAC,iBAAiB,EAAE,UAAG,CAAC;IACxB,CAAC,UAAU,EAAE,UAAG,CAAC;IACjB,CAAC,SAAS,EAAE,I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AC;IACzB,CAAC,4BAA4B,EAAE,6BAAqB,CAAC;IACrD,CAAC,YAAY,EAAE,UAAG,CAAC;IACnB,CAAC,aAAa,EAAE,UAAG,CAAC;IACpB,CAAC,YAAY,EAAE,UAAG,CAAC;IACnB,CAAC,iBAAiB,EAAE,UAAG,CAAC;IACxB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,cAAc,EAAE,WAAI,CAAC;IACtB,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,CAAC,CAAC,CAAC;CAC3C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/types.ts"],"names":[],"mappings":""}
|
@@ -19,7 +19,7 @@ const structs_1 = require("./structs");
|
|
19
19
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
20
20
|
const client = (0, clients_1.getClientSolana)();
|
21
21
|
const [vaults, spotMarkets] = yield Promise.all([
|
22
|
-
(0, solana_1.getParsedProgramAccounts)(client, structs_1.vaultStruct, constants_2.
|
22
|
+
(0, solana_1.getParsedProgramAccounts)(client, structs_1.vaultStruct, constants_2.vaultsPid, filters_1.vaultFilter),
|
23
23
|
cache.getItem(constants_1.keySpotMarkets, {
|
24
24
|
prefix: constants_1.platformId,
|
25
25
|
networkId: portfolio_core_1.NetworkId.solana,
|
@@ -36,7 +36,13 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
36
|
const mint = spotMarket.mint.toString();
|
37
37
|
const { decimals } = spotMarket;
|
38
38
|
const pubkey = vault.pubkey.toString();
|
39
|
-
|
39
|
+
const vaultPlatformId = constants_2.platformIdByVaultManager.get(vault.manager.toString());
|
40
|
+
if (!vaultPlatformId)
|
41
|
+
continue;
|
42
|
+
cachedItems.push({
|
43
|
+
key: pubkey,
|
44
|
+
value: { pubkey, platformId: vaultPlatformId, name, mint, decimals },
|
45
|
+
});
|
40
46
|
}
|
41
47
|
yield cache.setItems(cachedItems, {
|
42
48
|
prefix: constants_2.prefixVaults,
|
@@ -44,7 +50,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
50
|
});
|
45
51
|
});
|
46
52
|
const job = {
|
47
|
-
id: `${
|
53
|
+
id: `${constants_1.platformId}-market-maker-vaults`,
|
48
54
|
executor,
|
49
55
|
label: 'normal',
|
50
56
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"vaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift-market-maker-vault/vaultsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAsD;AACtD,+CAA+E;AAC/E,kDAI4B;AAC5B,2CAAgF;AAChF,uCAAwC;AACxC,uCAAwC;AAIxC,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC9C,IAAA,iCAAwB,EAAC,MAAM,EAAE,qBAAW,EAAE,qBAAS,EAAE,qBAAW,CAAC;QACrE,KAAK,CAAC,OAAO,CAAuB,0BAAc,EAAE;YAClD,MAAM,EAAE,sBAAe;YACvB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC;KACH,CAAC,CAAC;IAEH,IAAI,CAAC,WAAW;QAAE,OAAO;IAEzB,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,IAAA,wBAAe,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CACjC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,KAAK,KAAK,CAAC,eAAe,CACjD,CAAC;QACF,IAAI,CAAC,UAAU;YAAE,SAAS;QAE1B,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC;QAChC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACvC,MAAM,eAAe,GAAG,oCAAwB,CAAC,GAAG,CAClD,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CACzB,CAAC;QACF,IAAI,CAAC,eAAe;YAAE,SAAS;QAE/B,WAAW,CAAC,IAAI,CAAC;YACf,GAAG,EAAE,MAAM;YACX,KAAK,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;SACrE,CAAC,CAAC;IACL,CAAC;IAED,MAAM,KAAK,CAAC,QAAQ,CAAY,WAAW,EAAE;QAC3C,MAAM,EAAE,wBAAY;QACpB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,sBAAsB;IACvC,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
export declare const platformId = "loopscale";
|
3
|
+
export declare const platform: Platform;
|
4
|
+
export declare const marketsCachePrefix = "loopscale-markets";
|
5
|
+
export declare const programId = "abfcSQac2vK2Pa6UAJb37DzarVxF15bDTdphJzAqYYp";
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.programId = exports.marketsCachePrefix = exports.platform = exports.platformId = void 0;
|
4
|
+
exports.platformId = 'loopscale';
|
5
|
+
exports.platform = {
|
6
|
+
id: exports.platformId,
|
7
|
+
name: 'Loopscale',
|
8
|
+
image: 'https://sonar.watch/img/platforms/loopscale.webp',
|
9
|
+
website: 'https://app.loopscale.com/',
|
10
|
+
twitter: 'https://x.com/LoopscaleLabs',
|
11
|
+
// defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
12
|
+
};
|
13
|
+
exports.marketsCachePrefix = `${exports.platformId}-markets`;
|
14
|
+
exports.programId = 'abfcSQac2vK2Pa6UAJb37DzarVxF15bDTdphJzAqYYp';
|
15
|
+
// borrow tx : https://solana.fm/tx/3Fb3JYbPwJvWsgcE8ihdyuDuBeXiPe8ELJVed5VG9U9cjyEqDZuTWoboacaSawVPRGaCR4b5DSP2Grs8EHYq7tgu?cluster=mainnet-alpha
|
16
|
+
// deposit lend tx : https://solana.fm/tx/2dRBwkQX3QArnMdEocYhRs3Drni2LR1cWDonsLKX3ks4dvjRXLSDzSx5T4ar5fTU1CjZDJT8kSJq5ADHyn7kRySM?cluster=mainnet-alpha
|
17
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,6BAA6B;IACtC,qEAAqE;CACtE,CAAC;AACW,QAAA,kBAAkB,GAAG,GAAG,kBAAU,UAAU,CAAC;AAE7C,QAAA,SAAS,GAAG,6CAA6C,CAAC;AAEvE,kJAAkJ;AAClJ,wJAAwJ"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const marketsJob_1 = __importDefault(require("./marketsJob"));
|
9
|
+
const positionsFetcher_1 = __importDefault(require("./positionsFetcher"));
|
10
|
+
exports.platforms = [constants_1.platform];
|
11
|
+
exports.jobs = [marketsJob_1.default];
|
12
|
+
exports.fetchers = [positionsFetcher_1.default];
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,8DAAsC;AACtC,0EAAkD;AAErC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,oBAAU,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAc,CAAC,0BAAgB,CAAC,CAAC"}
|
@@ -0,0 +1,26 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const constants_1 = require("./constants");
|
14
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
15
|
+
yield cache.setItem('market_id', 'market_object', {
|
16
|
+
prefix: constants_1.marketsCachePrefix,
|
17
|
+
networkId: portfolio_core_1.NetworkId.ethereum,
|
18
|
+
});
|
19
|
+
});
|
20
|
+
const job = {
|
21
|
+
id: `${constants_1.platformId}-markets`,
|
22
|
+
executor,
|
23
|
+
label: 'normal',
|
24
|
+
};
|
25
|
+
exports.default = job;
|
26
|
+
//# sourceMappingURL=marketsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAA6D;AAE7D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,eAAe,EAAE;QAChD,MAAM,EAAE,8BAAkB;QAC1B,SAAS,EAAE,0BAAS,CAAC,QAAQ;KAC9B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,68 @@
|
|
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 web3_js_1 = require("@solana/web3.js");
|
17
|
+
const constants_1 = require("./constants");
|
18
|
+
const clients_1 = require("../../utils/clients");
|
19
|
+
const solana_1 = require("../../utils/solana");
|
20
|
+
const structs_1 = require("./structs");
|
21
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const connection = (0, clients_1.getClientSolana)();
|
24
|
+
const accounts = yield (0, solana_1.getParsedProgramAccounts)(connection, structs_1.liquidityStruct, new web3_js_1.PublicKey('pid'), [
|
25
|
+
{
|
26
|
+
dataSize: structs_1.liquidityStruct.byteSize,
|
27
|
+
},
|
28
|
+
{
|
29
|
+
memcmp: {
|
30
|
+
bytes: owner,
|
31
|
+
offset: 40,
|
32
|
+
},
|
33
|
+
},
|
34
|
+
]);
|
35
|
+
if (accounts.length === 0)
|
36
|
+
return [];
|
37
|
+
const solTokenPrice = yield cache.getTokenPrice(portfolio_core_1.solanaNativeAddress, portfolio_core_1.NetworkId.solana);
|
38
|
+
const assets = [];
|
39
|
+
accounts.forEach((acc) => {
|
40
|
+
if (acc.amountDeposited.isZero())
|
41
|
+
return;
|
42
|
+
const amount = acc.amountDeposited
|
43
|
+
.div(Math.pow(10, portfolio_core_1.solanaNativeDecimals))
|
44
|
+
.toNumber();
|
45
|
+
const asset = (0, tokenPriceToAssetToken_1.default)(portfolio_core_1.solanaNativeAddress, amount, portfolio_core_1.NetworkId.solana, solTokenPrice);
|
46
|
+
assets.push(asset);
|
47
|
+
});
|
48
|
+
if (assets.length === 0)
|
49
|
+
return [];
|
50
|
+
const element = {
|
51
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
52
|
+
label: 'Deposit',
|
53
|
+
platformId: constants_1.platformId,
|
54
|
+
type: portfolio_core_1.PortfolioElementType.multiple,
|
55
|
+
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
|
56
|
+
data: {
|
57
|
+
assets,
|
58
|
+
},
|
59
|
+
};
|
60
|
+
return [element];
|
61
|
+
});
|
62
|
+
const fetcher = {
|
63
|
+
id: `${constants_1.platformId}-solana`,
|
64
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
65
|
+
executor,
|
66
|
+
};
|
67
|
+
exports.default = fetcher;
|
68
|
+
//# sourceMappingURL=positionsFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,6CAA4C;AAE5C,2CAAyC;AAEzC,iDAAsD;AACtD,+CAA8D;AAC9D,uCAA4C;AAC5C,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,UAAU,EACV,yBAAe,EACf,IAAI,mBAAS,CAAC,KAAK,CAAC,EACpB;QACE;YACE,QAAQ,EAAE,yBAAe,CAAC,QAAQ;SACnC;QACD;YACE,MAAM,EAAE;gBACN,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,EAAE;aACX;SACF;KACF,CACF,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,aAAa,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4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export declare enum State {
|
6
|
+
Uninitialized = 0,
|
7
|
+
StakePool = 1,
|
8
|
+
InactiveStakePool = 2,
|
9
|
+
StakeAccount = 3
|
10
|
+
}
|
11
|
+
export type Liquidity = {
|
12
|
+
buffer: Buffer;
|
13
|
+
state: State;
|
14
|
+
mint: PublicKey;
|
15
|
+
owner: PublicKey;
|
16
|
+
amountDeposited: BigNumber;
|
17
|
+
space: number[];
|
18
|
+
};
|
19
|
+
export declare const liquidityStruct: BeetStruct<Liquidity, Partial<Liquidity>>;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.liquidityStruct = exports.State = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
+
const solana_1 = require("../../utils/solana");
|
7
|
+
var State;
|
8
|
+
(function (State) {
|
9
|
+
State[State["Uninitialized"] = 0] = "Uninitialized";
|
10
|
+
State[State["StakePool"] = 1] = "StakePool";
|
11
|
+
State[State["InactiveStakePool"] = 2] = "InactiveStakePool";
|
12
|
+
State[State["StakeAccount"] = 3] = "StakeAccount";
|
13
|
+
})(State || (exports.State = State = {}));
|
14
|
+
exports.liquidityStruct = new beet_1.BeetStruct([
|
15
|
+
['buffer', (0, solana_1.blob)(8)],
|
16
|
+
['state', beet_1.u8],
|
17
|
+
['mint', beet_solana_1.publicKey],
|
18
|
+
['owner', beet_solana_1.publicKey],
|
19
|
+
['amountDeposited', solana_1.u64],
|
20
|
+
['space', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 128)],
|
21
|
+
], (args) => args);
|
22
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/structs.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AACnC,kEAA6D;AAG7D,+CAA+C;AAE/C,IAAY,KAKX;AALD,WAAY,KAAK;IACf,mDAAa,CAAA;IACb,2CAAS,CAAA;IACT,2DAAiB,CAAA;IACjB,iDAAY,CAAA;AACd,CAAC,EALW,KAAK,qBAAL,KAAK,QAKhB;AAWY,QAAA,eAAe,GAAG,IAAI,iBAAU,CAC3C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,SAAE,CAAC;IACb,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,OAAO,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,GAAG,CAAC,CAAC;CAC1C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC"}
|