@sonarwatch/portfolio-plugins 0.11.149 → 0.11.150
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1327 -1323
- package/README.md +3 -3
- package/package.json +2 -2
- package/src/index.js +0 -4
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/flexlend/depositsFetcher.js +63 -4
- package/src/plugins/flexlend/depositsFetcher.js.map +1 -1
- package/src/plugins/flexlend/struct.d.ts +18 -0
- package/src/plugins/flexlend/struct.js +18 -0
- package/src/plugins/flexlend/struct.js.map +1 -0
- package/src/plugins/hawksight/positionsFetcher.js +31 -13
- package/src/plugins/hawksight/positionsFetcher.js.map +1 -1
- package/src/plugins/orca/getWhirlpoolPositions.d.ts +2 -3
- package/src/plugins/orca/getWhirlpoolPositions.js +2 -14
- package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
- package/src/plugins/orca/helpers.d.ts +2 -2
- package/src/plugins/orca/helpers.js +1 -1
- package/src/plugins/orca/helpers.js.map +1 -1
- package/src/plugins/raydium/getRaydiumCLMMPositions.d.ts +2 -3
- package/src/plugins/raydium/getRaydiumCLMMPositions.js +3 -3
- package/src/plugins/raydium/getRaydiumCLMMPositions.js.map +1 -1
- package/src/plugins/raydium/helpers.d.ts +2 -2
- package/src/plugins/raydium/helpers.js +6 -1
- package/src/plugins/raydium/helpers.js.map +1 -1
- package/src/plugins/realms/constants.d.ts +4 -2
- package/src/plugins/realms/constants.js +10 -3
- package/src/plugins/realms/constants.js.map +1 -1
- package/src/plugins/realms/helpers.d.ts +4 -5
- package/src/plugins/realms/helpers.js +20 -28
- package/src/plugins/realms/helpers.js.map +1 -1
- package/src/plugins/realms/index.js +5 -5
- package/src/plugins/realms/index.js.map +1 -1
- package/src/plugins/realms/{depositsFetcher.js → realmsDepositsFetcher.js} +1 -1
- package/src/plugins/realms/realmsDepositsFetcher.js.map +1 -0
- package/src/plugins/realms/{programsJob.js → realmsProgramsJob.js} +4 -4
- package/src/plugins/realms/realmsProgramsJob.js.map +1 -0
- package/src/plugins/realms/types.d.ts +1 -1
- package/src/plugins/solend/constants.d.ts +1 -0
- package/src/plugins/solend/constants.js +2 -1
- package/src/plugins/solend/constants.js.map +1 -1
- package/src/plugins/solend/helpers.d.ts +6 -0
- package/src/plugins/solend/helpers.js +132 -1
- package/src/plugins/solend/helpers.js.map +1 -1
- package/src/plugins/solend/marketsJob.js +6 -0
- package/src/plugins/solend/marketsJob.js.map +1 -1
- package/src/plugins/solend/obligationsFetcher.js +27 -156
- package/src/plugins/solend/obligationsFetcher.js.map +1 -1
- package/src/plugins/solend/reservesJob.js +15 -6
- package/src/plugins/solend/reservesJob.js.map +1 -1
- package/src/plugins/solend/types.d.ts +1 -1
- package/src/plugins/suilend/obligationsFetcher.js +2 -0
- package/src/plugins/suilend/obligationsFetcher.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/tokens/fetchers/solana-nfts-underlyings.js +25 -14
- package/src/plugins/tokens/fetchers/solana-nfts-underlyings.js.map +1 -1
- package/src/plugins/tokens/fetchers/solana.js +3 -1
- package/src/plugins/tokens/fetchers/solana.js.map +1 -1
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/solana/das/getAssetsByOwnerDas.d.ts +2 -2
- package/src/utils/solana/das/getAssetsByOwnerDas.js +3 -9
- package/src/utils/solana/das/getAssetsByOwnerDas.js.map +1 -1
- package/src/utils/solana/das/getDisplayOptions.d.ts +2 -0
- package/src/utils/solana/das/getDisplayOptions.js +16 -0
- package/src/utils/solana/das/getDisplayOptions.js.map +1 -0
- package/src/utils/solana/das/types.d.ts +8 -0
- package/src/plugins/phoenix/constants.d.ts +0 -7
- package/src/plugins/phoenix/constants.js +0 -17
- package/src/plugins/phoenix/constants.js.map +0 -1
- package/src/plugins/phoenix/helpers.d.ts +0 -6
- package/src/plugins/phoenix/helpers.js +0 -46
- package/src/plugins/phoenix/helpers.js.map +0 -1
- package/src/plugins/phoenix/helpers2.d.ts +0 -0
- package/src/plugins/phoenix/helpers2.js +0 -179
- package/src/plugins/phoenix/helpers2.js.map +0 -1
- package/src/plugins/phoenix/index.d.ts +0 -6
- package/src/plugins/phoenix/index.js +0 -10
- package/src/plugins/phoenix/index.js.map +0 -1
- package/src/plugins/phoenix/marketsJob.js +0 -39
- package/src/plugins/phoenix/marketsJob.js.map +0 -1
- package/src/plugins/phoenix/positionsFetcher.js +0 -64
- package/src/plugins/phoenix/positionsFetcher.js.map +0 -1
- package/src/plugins/phoenix/structs.d.ts +0 -67
- package/src/plugins/phoenix/structs.js +0 -82
- package/src/plugins/phoenix/structs.js.map +0 -1
- package/src/plugins/phoenix/types.d.ts +0 -29
- package/src/plugins/phoenix/types.js +0 -3
- package/src/plugins/phoenix/types.js.map +0 -1
- package/src/plugins/realms/depositsFetcher.d.ts +0 -3
- package/src/plugins/realms/depositsFetcher.js.map +0 -1
- package/src/plugins/realms/programsJob.d.ts +0 -3
- package/src/plugins/realms/programsJob.js.map +0 -1
- /package/src/plugins/{phoenix/positionsFetcher.d.ts → realms/realmsDepositsFetcher.d.ts} +0 -0
- /package/src/plugins/{phoenix/marketsJob.d.ts → realms/realmsProgramsJob.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
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.150",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -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.150"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
package/src/index.js
CHANGED
@@ -96,7 +96,6 @@ const kai_1 = require("./plugins/kai");
|
|
96
96
|
const suilend_1 = require("./plugins/suilend");
|
97
97
|
const symmetry_1 = require("./plugins/symmetry");
|
98
98
|
const staratlas_1 = require("./plugins/staratlas");
|
99
|
-
const phoenix_1 = require("./plugins/phoenix");
|
100
99
|
var constants_1 = require("./plugins/tokens/constants");
|
101
100
|
Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
|
102
101
|
Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
|
@@ -186,7 +185,6 @@ exports.platforms = [
|
|
186
185
|
...suilend_1.platforms,
|
187
186
|
...symmetry_1.platforms,
|
188
187
|
...staratlas_1.platforms,
|
189
|
-
...phoenix_1.platforms,
|
190
188
|
];
|
191
189
|
// JOBS //
|
192
190
|
exports.jobs = [
|
@@ -259,7 +257,6 @@ exports.jobs = [
|
|
259
257
|
...suilend_1.jobs,
|
260
258
|
...symmetry_1.jobs,
|
261
259
|
...staratlas_1.jobs,
|
262
|
-
...phoenix_1.jobs,
|
263
260
|
];
|
264
261
|
// FETCHERS //
|
265
262
|
exports.fetchers = [
|
@@ -334,7 +331,6 @@ exports.fetchers = [
|
|
334
331
|
...suilend_1.fetchers,
|
335
332
|
...symmetry_1.fetchers,
|
336
333
|
...staratlas_1.fetchers,
|
337
|
-
...phoenix_1.fetchers,
|
338
334
|
];
|
339
335
|
exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
|
340
336
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED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GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,qBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,cAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,qBAAkB;IACrB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,sBAAmB;IACtB,GAAG,yBAAsB;IACzB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,2BAAsB;IACzB,GAAG,sBAAkB;IACrB,GAAG,eAAY;IACf,GAAG,cAAW;IACd,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;CACrB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,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;
|
@@ -13,23 +13,82 @@ 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 web3_js_1 = require("@solana/web3.js");
|
16
17
|
const constants_1 = require("./constants");
|
17
18
|
const helpers_1 = require("./helpers");
|
18
|
-
const obligationsFetcher_1 = __importDefault(require("../solend/obligationsFetcher"));
|
19
19
|
const deposits_1 = __importDefault(require("../drift/deposits"));
|
20
20
|
const lendsFetcher_1 = __importDefault(require("../kamino/lendsFetcher"));
|
21
21
|
const collateralFetcher_1 = __importDefault(require("../mango/collateralFetcher"));
|
22
22
|
const index_1 = require("../marginfi/index");
|
23
23
|
const constants_2 = require("../tokens/constants");
|
24
|
+
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
25
|
+
const clients_1 = require("../../utils/clients");
|
26
|
+
const struct_1 = require("./struct");
|
27
|
+
const structs_1 = require("../solend/structs");
|
28
|
+
const constants_3 = require("../solend/constants");
|
29
|
+
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
30
|
+
const helpers_2 = require("../solend/helpers");
|
24
31
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
32
|
+
const client = (0, clients_1.getClientSolana)();
|
25
33
|
const pda = (0, helpers_1.getDerivedAccount)(owner);
|
26
|
-
const
|
34
|
+
const userAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, struct_1.userAccountStruct, new web3_js_1.PublicKey(pda));
|
35
|
+
if (!userAccount)
|
36
|
+
return [];
|
37
|
+
const portfolioElements = [];
|
38
|
+
const [marginElements, driftElements, kaminoElements, mangoElements, solendObligation,] = yield Promise.all([
|
27
39
|
index_1.fetchers[0].executor(pda, cache),
|
28
|
-
obligationsFetcher_1.default.executor(pda, cache),
|
29
40
|
deposits_1.default.executor(pda, cache),
|
30
41
|
lendsFetcher_1.default.executor(pda, cache),
|
31
42
|
collateralFetcher_1.default.executor(pda, cache),
|
32
|
-
|
43
|
+
(0, getParsedAccountInfo_1.getParsedAccountInfo)(client, structs_1.obligationStruct, userAccount.solend_obligation),
|
44
|
+
]);
|
45
|
+
portfolioElements.push(...[
|
46
|
+
...marginElements,
|
47
|
+
...driftElements,
|
48
|
+
...kaminoElements,
|
49
|
+
...mangoElements,
|
50
|
+
]);
|
51
|
+
if (solendObligation) {
|
52
|
+
const mainMarketInfo = yield cache.getItem(constants_3.mainMarket, {
|
53
|
+
prefix: constants_3.marketsPrefix,
|
54
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
55
|
+
});
|
56
|
+
if (mainMarketInfo) {
|
57
|
+
const reserveAddresses = new Set();
|
58
|
+
mainMarketInfo.reserves.forEach((reserve) => {
|
59
|
+
reserveAddresses.add(reserve.address);
|
60
|
+
});
|
61
|
+
const reservesInfos = yield cache.getItems(Array.from(reserveAddresses), {
|
62
|
+
prefix: constants_3.reservesPrefix,
|
63
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
64
|
+
});
|
65
|
+
if (reservesInfos.length !== 0) {
|
66
|
+
const mints = [];
|
67
|
+
const pythAddresses = [];
|
68
|
+
const reserveByAddress = new Map();
|
69
|
+
reservesInfos.forEach((reserve) => {
|
70
|
+
if (!reserve)
|
71
|
+
return;
|
72
|
+
pythAddresses.push(new web3_js_1.PublicKey(reserve.reserve.liquidity.pythOracle));
|
73
|
+
mints.push(reserve.reserve.liquidity.mintPubkey);
|
74
|
+
reserveByAddress.set(reserve.pubkey, reserve);
|
75
|
+
});
|
76
|
+
const [pythAccounts, tokenPriceByAddress] = yield Promise.all([
|
77
|
+
(0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(client, pythAddresses),
|
78
|
+
cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.solana),
|
79
|
+
]);
|
80
|
+
const pythAccByAddress = new Map();
|
81
|
+
for (let i = 0; i < pythAddresses.length; i++) {
|
82
|
+
const account = pythAccounts[i];
|
83
|
+
if (account === null)
|
84
|
+
continue;
|
85
|
+
pythAccByAddress.set(pythAddresses[i].toString(), account);
|
86
|
+
}
|
87
|
+
const solendElements = (0, helpers_2.getElementsFromObligations)([solendObligation], reserveByAddress, new Map([[constants_3.mainMarket, mainMarketInfo]]), tokenPriceByAddress, pythAccByAddress);
|
88
|
+
portfolioElements.push(...solendElements);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
33
92
|
if (portfolioElements.length === 0)
|
34
93
|
return [];
|
35
94
|
const elements = [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources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AC,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"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@metaplex-foundation/js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export type PromotionSeed = {
|
6
|
+
bump: BigNumber;
|
7
|
+
};
|
8
|
+
export type UserAccount = {
|
9
|
+
buffer: Buffer;
|
10
|
+
bump: number;
|
11
|
+
_padding: number[];
|
12
|
+
owner: PublicKey;
|
13
|
+
mfi_account: PublicKey;
|
14
|
+
solend_obligation: PublicKey;
|
15
|
+
promotion_seeds: PromotionSeed[];
|
16
|
+
_padding2: BigNumber[];
|
17
|
+
};
|
18
|
+
export declare const userAccountStruct: BeetStruct<UserAccount, Partial<UserAccount>>;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.userAccountStruct = 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
|
+
const promotionSeedStruct = new beet_1.BeetStruct([['bump', solana_1.u64]], (args) => args);
|
8
|
+
exports.userAccountStruct = new beet_1.BeetStruct([
|
9
|
+
['buffer', (0, solana_1.blob)(8)],
|
10
|
+
['bump', beet_1.u8],
|
11
|
+
['_padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 7)],
|
12
|
+
['owner', beet_solana_1.publicKey],
|
13
|
+
['mfi_account', beet_solana_1.publicKey],
|
14
|
+
['solend_obligation', beet_solana_1.publicKey],
|
15
|
+
['promotion_seeds', (0, beet_1.uniformFixedSizeArray)(promotionSeedStruct, 4)],
|
16
|
+
['_padding2', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 12)],
|
17
|
+
], (args) => args);
|
18
|
+
//# sourceMappingURL=struct.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flexlend/struct.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AACnC,kEAA6D;AAG7D,+CAA+C;AAM/C,MAAM,mBAAmB,GAAG,IAAI,iBAAU,CACxC,CAAC,CAAC,MAAM,EAAE,YAAG,CAAC,CAAC,EACf,CAAC,IAAI,EAAE,EAAE,CAAC,IAAqB,CAChC,CAAC;AAaW,QAAA,iBAAiB,GAAG,IAAI,iBAAU,CAC7C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,iBAAiB,EAAE,IAAA,4BAAqB,EAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC,WAAW,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,EAAE,CAAC,CAAC;CAC9C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAmB,CAC9B,CAAC"}
|
@@ -18,27 +18,38 @@ const constants_1 = require("./constants");
|
|
18
18
|
const helper_1 = require("./helper");
|
19
19
|
const obligationsFetcher_1 = __importDefault(require("../solend/obligationsFetcher"));
|
20
20
|
const solana_1 = __importDefault(require("../tokens/fetchers/solana"));
|
21
|
-
const clients_1 = require("../../utils/clients");
|
22
21
|
const getWhirlpoolPositions_1 = require("../orca/getWhirlpoolPositions");
|
23
|
-
const solana_2 = require("../../utils/solana");
|
24
22
|
const constants_2 = require("../tokens/constants");
|
23
|
+
const getSolanaDasEndpoint_1 = __importDefault(require("../../utils/clients/getSolanaDasEndpoint"));
|
24
|
+
const getAssetsByOwnerDas_1 = require("../../utils/solana/das/getAssetsByOwnerDas");
|
25
|
+
const heliusAssetToAssetCollectible_1 = require("../../utils/solana/das/heliusAssetToAssetCollectible");
|
25
26
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
26
|
-
const
|
27
|
+
const dasUrl = (0, getSolanaDasEndpoint_1.default)();
|
27
28
|
const derivedAddresses = (0, helper_1.getHawksightUserPdas)(new web3_js_1.PublicKey(owner));
|
28
|
-
const
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
29
|
+
const displayOptions = {
|
30
|
+
showCollectionMetadata: true,
|
31
|
+
showUnverifiedCollections: true,
|
32
|
+
showInscription: false,
|
33
|
+
showNativeBalance: false,
|
34
|
+
showGrandTotal: false,
|
35
|
+
showFungible: true,
|
36
|
+
};
|
37
|
+
const heliusAssets = (yield Promise.all([
|
38
|
+
(0, getAssetsByOwnerDas_1.getAssetsByOwnerDas)(dasUrl, derivedAddresses[0].toString(), displayOptions),
|
39
|
+
(0, getAssetsByOwnerDas_1.getAssetsByOwnerDas)(dasUrl, derivedAddresses[1].toString(), displayOptions),
|
40
|
+
])).flat();
|
41
|
+
const collectibles = [];
|
42
|
+
heliusAssets.forEach((asset) => {
|
43
|
+
const collectible = (0, heliusAssetToAssetCollectible_1.heliusAssetToAssetCollectible)(asset);
|
44
|
+
if (collectible)
|
45
|
+
collectibles.push(collectible);
|
46
|
+
});
|
36
47
|
const portfolioElements = (yield Promise.all([
|
37
48
|
// This handles Kamino, Saber, Marinade
|
38
49
|
solana_1.default.executor(derivedAddresses[0].toString(), cache),
|
39
50
|
solana_1.default.executor(derivedAddresses[1].toString(), cache),
|
40
51
|
// This handles Orca
|
41
|
-
(0, getWhirlpoolPositions_1.getWhirlpoolPositions)(cache,
|
52
|
+
(0, getWhirlpoolPositions_1.getWhirlpoolPositions)(cache, collectibles),
|
42
53
|
// This handles Solend
|
43
54
|
obligationsFetcher_1.default.executor(derivedAddresses[0].toString(), cache),
|
44
55
|
obligationsFetcher_1.default.executor(derivedAddresses[1].toString(), cache),
|
@@ -50,7 +61,14 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
50
61
|
for (const element of portfolioElements) {
|
51
62
|
if (element.platformId === constants_2.walletTokensPlatform.id &&
|
52
63
|
element.type === portfolio_core_1.PortfolioElementType.multiple) {
|
53
|
-
|
64
|
+
element.data.assets.forEach((token) => {
|
65
|
+
if (token.type === 'token' &&
|
66
|
+
token.data.address === 'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So') {
|
67
|
+
tokens.push(token);
|
68
|
+
return;
|
69
|
+
}
|
70
|
+
tokens.push(Object.assign(Object.assign({}, token), { attributes: { isClaimable: true } }));
|
71
|
+
});
|
54
72
|
}
|
55
73
|
element.name =
|
56
74
|
element.platformId.slice(0, 1).toUpperCase() +
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hawksight/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hawksight/positionsFetcher.ts"],"names":[],"mappings":";;;;;;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K,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE;gBAC5C,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAE9B,IACE,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,aAAa,CAAC;YAChD,OAAO,CAAC,UAAU,KAAK,eAAe;YAEtC,SAAS;QAEX,OAAO,CAAC,UAAU,GAAG,sBAAU,CAAC;QAChC,QAAQ,CAAC,IAAI,mBACR,OAAO,EACV,CAAC;IACL,CAAC;IACD,MAAM,KAAK,GAAG,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACzD,IAAI,KAAK,KAAK,CAAC;QACb,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK;YACL,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;SACzB,CAAC,CAAC;IAEL,OAAO,QAAQ,CAAC;AAClB,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"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { PortfolioElement } from '@sonarwatch/portfolio-core';
|
2
|
-
import { FindNftsByOwnerOutput } from '@metaplex-foundation/js';
|
1
|
+
import { PortfolioAssetCollectible, PortfolioElement } from '@sonarwatch/portfolio-core';
|
3
2
|
import { Cache } from '../../Cache';
|
4
|
-
export declare function getWhirlpoolPositions(cache: Cache, nfts:
|
3
|
+
export declare function getWhirlpoolPositions(cache: Cache, nfts: PortfolioAssetCollectible[]): Promise<PortfolioElement[]>;
|
@@ -22,28 +22,16 @@ const whirlpool_1 = require("./structs/whirlpool");
|
|
22
22
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
23
23
|
const runInBatch_1 = __importDefault(require("../../utils/misc/runInBatch"));
|
24
24
|
const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
|
25
|
-
function getWhirlpoolPositions(cache, nfts
|
25
|
+
function getWhirlpoolPositions(cache, nfts) {
|
26
26
|
return __awaiter(this, void 0, void 0, function* () {
|
27
27
|
const client = (0, clients_1.getClientSolana)();
|
28
28
|
const positionsProgramAddress = [];
|
29
29
|
nfts.forEach((nft) => {
|
30
|
-
const address = nft.
|
31
|
-
? new web3_js_1.PublicKey(nft.mintAddress.toString())
|
32
|
-
: new web3_js_1.PublicKey(nft.mint.address.toString());
|
30
|
+
const address = new web3_js_1.PublicKey(nft.data.address);
|
33
31
|
const positionSeed = [Buffer.from('position'), address.toBuffer()];
|
34
32
|
const [programAddress] = web3_js_1.PublicKey.findProgramAddressSync(positionSeed, constants_1.whirlpoolProgram);
|
35
33
|
positionsProgramAddress.push(programAddress);
|
36
34
|
});
|
37
|
-
if (additionalAccounts) {
|
38
|
-
for (const account of additionalAccounts) {
|
39
|
-
const positionSeed = [
|
40
|
-
Buffer.from('position'),
|
41
|
-
new web3_js_1.PublicKey(account).toBuffer(),
|
42
|
-
];
|
43
|
-
const [programAddress] = web3_js_1.PublicKey.findProgramAddressSync(positionSeed, constants_1.whirlpoolProgram);
|
44
|
-
positionsProgramAddress.push(programAddress);
|
45
|
-
}
|
46
|
-
}
|
47
35
|
if (positionsProgramAddress.length === 0)
|
48
36
|
return [];
|
49
37
|
const positionsInfo = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, whirlpool_1.positionStruct, positionsProgramAddress);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getWhirlpoolPositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/getWhirlpoolPositions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"getWhirlpoolPositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/getWhirlpoolPositions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAC5C,2CAA4E;AAC5E,iDAAsD;AACtD,+CAG4B;AAE5B,mDAAgE;AAChE,qGAA6E;AAC7E,6EAAqD;AACrD,wFAAyF;AAEzF,SAAsB,qBAAqB,CACzC,KAAY,EACZ,IAAiC;;QAEjC,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;QACjC,MAAM,uBAAuB,GAAgB,EAAE,CAAC;QAEhD,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,OAAO,GAAG,IAAI,mBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEhD,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;YAEnE,MAAM,CAAC,cAAc,CAAC,GAAG,mBAAS,CAAC,sBAAsB,CACvD,YAAY,EACZ,4BAAgB,CACjB,CAAC;YACF,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAEpD,MAAM,aAAa,GAAG,MAAM,IAAA,sCAA6B,EACvD,MAAM,EACN,0BAAc,EACd,uBAAuB,CACxB,CAAC;QACF,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAE5D,MAAM,kBAAkB,GAAgB,IAAI,GAAG,EAAE,CAAC;QAClD,aAAa,CAA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pB;aACF;SACF,CAAC;IACJ,CAAC;CAAA;AA3ID,sDA2IC"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
2
2
|
import BN from 'bn.js';
|
3
3
|
import Decimal from 'decimal.js';
|
4
|
-
import {
|
5
|
-
export declare function isAnOrcaPosition(nft:
|
4
|
+
import { PortfolioAssetCollectible } from '@sonarwatch/portfolio-core';
|
5
|
+
export declare function isAnOrcaPosition(nft: PortfolioAssetCollectible): boolean;
|
6
6
|
export declare function signedShiftRight(n0: BN, shiftBy: number, bitWidth: number): BN;
|
7
7
|
export declare function tickIndexToSqrtPricePositive(tick: number): BN;
|
8
8
|
export declare function tickIndexToSqrtPriceNegative(tickIndex: number): BN;
|
@@ -10,7 +10,7 @@ const bn_js_1 = __importDefault(require("bn.js"));
|
|
10
10
|
const decimal_js_1 = __importDefault(require("decimal.js"));
|
11
11
|
const constants_1 = require("./constants");
|
12
12
|
function isAnOrcaPosition(nft) {
|
13
|
-
return nft
|
13
|
+
return nft.data.name === constants_1.positionsIdentifier;
|
14
14
|
}
|
15
15
|
exports.isAnOrcaPosition = isAnOrcaPosition;
|
16
16
|
function signedShiftRight(n0, shiftBy, bitWidth) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA+B;AAC/B,gEAAqC;AACrC,kDAAuB;AACvB,4DAAiC;AAGjC,2CAAkD;AAElD,SAAgB,gBAAgB,CAAC,
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA+B;AAC/B,gEAAqC;AACrC,kDAAuB;AACvB,4DAAiC;AAGjC,2CAAkD;AAElD,SAAgB,gBAAgB,CAAC,GAA8B;IAC7D,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,KA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CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxD,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,oBAAO,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;AACjD,CAAC;AARD,kDAQC"}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { PortfolioElement } from '@sonarwatch/portfolio-core';
|
2
|
-
import { FindNftsByOwnerOutput } from '@metaplex-foundation/js';
|
1
|
+
import { PortfolioAssetCollectible, PortfolioElement } from '@sonarwatch/portfolio-core';
|
3
2
|
import { Cache } from '../../Cache';
|
4
|
-
export declare function getRaydiumCLMMPositions(cache: Cache, nfts:
|
3
|
+
export declare function getRaydiumCLMMPositions(cache: Cache, nfts: PortfolioAssetCollectible[]): Promise<PortfolioElement[]>;
|
@@ -26,9 +26,7 @@ function getRaydiumCLMMPositions(cache, nfts) {
|
|
26
26
|
const client = (0, clients_1.getClientSolana)();
|
27
27
|
const positionsProgramAddress = [];
|
28
28
|
nfts.forEach((nft) => {
|
29
|
-
const address = nft.
|
30
|
-
? new web3_js_1.PublicKey(nft.mintAddress.toString())
|
31
|
-
: new web3_js_1.PublicKey(nft.mint.address.toString());
|
29
|
+
const address = new web3_js_1.PublicKey(nft.data.address);
|
32
30
|
const positionSeed = [Buffer.from('position'), address.toBuffer()];
|
33
31
|
const [programAddress] = web3_js_1.PublicKey.findProgramAddressSync(positionSeed, constants_1.raydiumProgram);
|
34
32
|
positionsProgramAddress.push(programAddress);
|
@@ -83,6 +81,8 @@ function getRaydiumCLMMPositions(cache, nfts) {
|
|
83
81
|
});
|
84
82
|
totalLiquidityValue += value;
|
85
83
|
}
|
84
|
+
if (assets.length === 0)
|
85
|
+
return [];
|
86
86
|
const elements = [];
|
87
87
|
elements.push({
|
88
88
|
type: portfolio_core_1.PortfolioElementType.liquidity,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getRaydiumCLMMPositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/getRaydiumCLMMPositions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"getRaydiumCLMMPositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/getRaydiumCLMMPositions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAC5C,2CAA2E;AAC3E,qGAA6E;AAC7E,+CAAmE;AACnE,iDAAsD;AACtD,2CAAyE;AAEzE,wFAAyF;AAEzF,SAAsB,uBAAuB,CAC3C,KAAY,EACZ,IAAiC;;QAEjC,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;QAEjC,MAAM,uBAAuB,GAAgB,EAAE,CAAC;QAChD,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,OAAO,GAAG,IAAI,mBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEhD,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;YAEnE,MAAM,CAAC,cAAc,CAAC,GAAG,mBAAS,CAAC,sBAAsB,CACvD,YAAY,EACZ,0BAAc,CACf,CAAC;YACF,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAEpD,MAAM,qBAAqB,GAAG,MAAM,IAAA,sCAA6B,EAC/D,MAAM,EACN,mCAA2B,EAC3B,uBAAuB,CACxB,CAAC;QACF,IAAI,CAAC,qBAAqB,IAAI,qBAAqB,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAE5E,MAAM,QAAQ,GAAa,qBAAqB,CAAC,OAAO,CAAC,CAAC,QAA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C,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM;aACpB;SACF,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA;AArHD,0DAqHC"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { Metadata, Nft, Sft } from '@metaplex-foundation/js';
|
2
1
|
import BigNumber from 'bignumber.js';
|
3
2
|
import BN from 'bn.js';
|
4
|
-
|
3
|
+
import { PortfolioAssetCollectible } from '@sonarwatch/portfolio-core';
|
4
|
+
export declare function isARaydiumPosition(nft: PortfolioAssetCollectible): boolean;
|
5
5
|
export declare function raydiumTickToPriceX64(tick: number): BN;
|
6
6
|
export declare function getRaydiumTokenAmountsFromLiquidity(sqrtPriceCurrentX64: BigNumber, sqrtPriceX64A: BigNumber, sqrtPriceX64B: BigNumber, liquidity: BigNumber, roundUp: boolean): {
|
7
7
|
tokenAmountA: BigNumber;
|
@@ -4,11 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.getRaydiumTokenAmountsFromLiquidity = exports.raydiumTickToPriceX64 = exports.isARaydiumPosition = void 0;
|
7
|
+
/* eslint-disable eqeqeq */
|
8
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
9
|
+
/* eslint-disable no-underscore-dangle */
|
10
|
+
/* eslint-disable no-param-reassign */
|
11
|
+
/* eslint-disable no-bitwise */
|
7
12
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
8
13
|
const bn_js_1 = __importDefault(require("bn.js"));
|
9
14
|
const constants_1 = require("./constants");
|
10
15
|
function isARaydiumPosition(nft) {
|
11
|
-
return nft
|
16
|
+
return nft.data.name === constants_1.positionsIdentifier;
|
12
17
|
}
|
13
18
|
exports.isARaydiumPosition = isARaydiumPosition;
|
14
19
|
const ZERO = new bn_js_1.default(0);
|