@sonarwatch/portfolio-plugins 0.11.233 → 0.11.234
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1670 -1666
- package/README.md +3 -3
- package/package.json +2 -3
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/pyth/index.js +2 -1
- package/src/plugins/pyth/index.js.map +1 -1
- package/src/plugins/pyth/pricingJob.d.ts +3 -0
- package/src/plugins/pyth/pricingJob.js +33 -0
- package/src/plugins/pyth/pricingJob.js.map +1 -0
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/switchboard/pricingJob.js +1 -1
- package/src/plugins/switchboard/pricingJob.js.map +1 -1
- package/src/plugins/symmetry/basketsJob.js +17 -12
- package/src/plugins/symmetry/basketsJob.js.map +1 -1
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/misc/getLpTokenSource.js +3 -1
- package/src/utils/misc/getLpTokenSource.js.map +1 -1
- package/src/utils/misc/getLpTokenSourceRaw.d.ts +1 -1
- package/src/utils/misc/getLpUnderlyingTokenSource.d.ts +1 -1
- package/src/utils/misc/getLpUnderlyingTokenSource.js +7 -3
- package/src/utils/misc/getLpUnderlyingTokenSource.js.map +1 -1
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/solana/pyth/helpers.d.ts +3 -2
- package/src/utils/solana/pyth/helpers.js +20 -20
- package/src/utils/solana/pyth/helpers.js.map +1 -1
package/README.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
# @sonarwatch/portfolio-plugins
|
2
|
-
|
3
|
-
This library is @sonarwatch/portfolio-plugins
|
1
|
+
# @sonarwatch/portfolio-plugins
|
2
|
+
|
3
|
+
This library is @sonarwatch/portfolio-plugins
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.234",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -20,7 +20,6 @@
|
|
20
20
|
"@metaplex-foundation/js": "^0.19.4",
|
21
21
|
"@metaplex-foundation/umi-serializers-encodings": "^0.8.9",
|
22
22
|
"@mysten/bcs": "^0.11.1",
|
23
|
-
"@mysten/sui.js": "^0.50.1",
|
24
23
|
"@onsol/tldparser": "^0.6.1",
|
25
24
|
"@sei-js/core": "^3.0.1",
|
26
25
|
"@sei-js/proto": "^3.0.1",
|
@@ -42,7 +41,7 @@
|
|
42
41
|
"web3-v1": "npm:web3@^1.5.0"
|
43
42
|
},
|
44
43
|
"peerDependencies": {
|
45
|
-
"@sonarwatch/portfolio-core": "0.11.
|
44
|
+
"@sonarwatch/portfolio-core": "0.11.234"
|
46
45
|
},
|
47
46
|
"main": "./src/index.js",
|
48
47
|
"types": "./src/index.d.ts"
|
@@ -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;
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
7
|
const constants_1 = require("./constants");
|
8
8
|
const stakingFetcher_1 = __importDefault(require("./stakingFetcher"));
|
9
|
+
const pricingJob_1 = __importDefault(require("./pricingJob"));
|
9
10
|
exports.platforms = [constants_1.platform];
|
10
|
-
exports.jobs = [];
|
11
|
+
exports.jobs = [pricingJob_1.default];
|
11
12
|
exports.fetchers = [stakingFetcher_1.default];
|
12
13
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/pyth/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/pyth/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;AAC9C,8DAAsC;AAEzB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,oBAAU,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
|
@@ -0,0 +1,33 @@
|
|
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 web3_js_1 = require("@solana/web3.js");
|
13
|
+
const constants_1 = require("./constants");
|
14
|
+
const clients_1 = require("../../utils/clients");
|
15
|
+
const helpers_1 = require("../../utils/solana/pyth/helpers");
|
16
|
+
const feedsToFetch = [
|
17
|
+
{
|
18
|
+
feed: new web3_js_1.PublicKey('8QFEAwdamHFFRnj3Swnv1CkVNZBeFiVzraC548xhmpT5'),
|
19
|
+
mint: new web3_js_1.PublicKey('ZScHuTtqZukUrtZS43teTKGs2VqkKL8k4QCouR2n6Uo'),
|
20
|
+
},
|
21
|
+
];
|
22
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const connection = (0, clients_1.getClientSolana)();
|
24
|
+
const sources = yield (0, helpers_1.getPythTokenPriceSources)(connection, feedsToFetch);
|
25
|
+
yield cache.setTokenPriceSources(sources);
|
26
|
+
});
|
27
|
+
const job = {
|
28
|
+
id: `${constants_1.platformId}-pricing`,
|
29
|
+
executor,
|
30
|
+
label: 'coingecko',
|
31
|
+
};
|
32
|
+
exports.default = job;
|
33
|
+
//# sourceMappingURL=pricingJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pricingJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/pyth/pricingJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6CAA4C;AAG5C,2CAAyC;AACzC,iDAAsD;AACtD,6DAA2E;AAE3E,MAAM,YAAY,GAAG;IACnB;QACE,IAAI,EAAE,IAAI,mBAAS,CAAC,8CAA8C,CAAC;QACnE,IAAI,EAAE,IAAI,mBAAS,CAAC,6CAA6C,CAAC;KACnE;CACF,CAAC;AAEF,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,OAAO,GAAG,MAAM,IAAA,kCAAwB,EAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IACzE,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"}
|
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
|
|
54
54
|
}
|
55
55
|
function getV3PairsAddresses(url, length = 300) {
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const query = (0, graphql_request_1.gql) `
|
58
|
-
{
|
59
|
-
pools(
|
60
|
-
orderBy: totalValueLockedUSD
|
61
|
-
first: ${length}
|
62
|
-
orderDirection: desc
|
63
|
-
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
-
) {
|
65
|
-
id
|
66
|
-
token0Price
|
67
|
-
token1Price
|
68
|
-
liquidity
|
69
|
-
token0 {
|
70
|
-
id
|
71
|
-
totalSupply
|
72
|
-
decimals
|
73
|
-
}
|
74
|
-
token1 {
|
75
|
-
id
|
76
|
-
totalSupply
|
77
|
-
decimals
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
57
|
+
const query = (0, graphql_request_1.gql) `
|
58
|
+
{
|
59
|
+
pools(
|
60
|
+
orderBy: totalValueLockedUSD
|
61
|
+
first: ${length}
|
62
|
+
orderDirection: desc
|
63
|
+
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
+
) {
|
65
|
+
id
|
66
|
+
token0Price
|
67
|
+
token1Price
|
68
|
+
liquidity
|
69
|
+
token0 {
|
70
|
+
id
|
71
|
+
totalSupply
|
72
|
+
decimals
|
73
|
+
}
|
74
|
+
token1 {
|
75
|
+
id
|
76
|
+
totalSupply
|
77
|
+
decimals
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
81
|
`;
|
82
82
|
const res = yield (0, graphql_request_1.default)(url, query);
|
83
83
|
const pools = res.pools;
|
@@ -37,7 +37,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
37
|
const source = {
|
38
38
|
address: feedToFetch.mintAddress,
|
39
39
|
decimals,
|
40
|
-
id:
|
40
|
+
id: `${constants_1.platformId}-feed-${feedToFetch.feedAddress.toString()}`,
|
41
41
|
networkId: portfolio_core_1.NetworkId.solana,
|
42
42
|
platformId: constants_2.walletTokensPlatform.id,
|
43
43
|
weight: 0.5,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pricingJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/switchboard/pricingJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAA4C;AAG5C,2CAAyC;AACzC,iDAAsD;AACtD,yEAAsE;AACtE,0FAAuF;AACvF,mDAA2D;AAE3D,MAAM,YAAY,GAAG;IACnB;QACE,WAAW,EAAE,IAAI,mBAAS,CAAC,8CAA8C,CAAC;QAC1E,WAAW,EAAE,6CAA6C;KAC3D;CACF,CAAC;AAEF,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,MAAM,GAAG,MAAM,IAAA,2CAAoB,EACvC,UAAU,EACV,YAAY,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,CACrD,CAAC;IACF,MAAM,WAAW,GAAG,MAAM,IAAA,mDAAwB,EAChD,UAAU,EACV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EAAE,EAAE,CAAC,IAAI,mBAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CACpE,CAAC;IAEF,MAAM,OAAO,GAAuB,EAAE,CAAC;IACvC,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,MAAM,MAAM,GAAqB;YAC/B,OAAO,EAAE,WAAW,CAAC,WAAW;YAChC,QAAQ;YACR,EAAE,EAAE,GAAG,sBAAU,SAAS,WAAW,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE;YAC9D,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAE,gCAAoB,CAAC,EAAE;YACnC,MAAM,EAAE,GAAG;YACX,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,KAAK;SACN,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,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"}
|
@@ -8,9 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
9
|
});
|
10
10
|
};
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
-
};
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
12
|
/* eslint-disable no-labels */
|
16
13
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
@@ -21,8 +18,8 @@ const structs_1 = require("./structs");
|
|
21
18
|
const filters_1 = require("./filters");
|
22
19
|
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
23
20
|
const helpers_1 = require("./helpers");
|
24
|
-
const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
|
25
21
|
const helpers_2 = require("../../utils/solana/pyth/helpers");
|
22
|
+
const getLpTokenSourceRaw_1 = require("../../utils/misc/getLpTokenSourceRaw");
|
26
23
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
27
24
|
const connection = (0, clients_1.getClientSolana)();
|
28
25
|
const tokenListRes = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(connection, structs_1.tokenListStruct, constants_1.tokenListAddress);
|
@@ -34,7 +31,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
31
|
.filter((ts) => ts.oracleType === structs_1.OracleType.Pyth)
|
35
32
|
.map((ts) => ({
|
36
33
|
mint: ts.tokenMint,
|
37
|
-
|
34
|
+
feed: ts.oracleAccount,
|
38
35
|
})));
|
39
36
|
yield cache.setTokenPriceSources(pythSources);
|
40
37
|
const tokenPrices = yield cache.getTokenPrices(tokenSettings.map((ts) => ts.tokenMint.toString()), portfolio_core_1.NetworkId.solana);
|
@@ -56,18 +53,26 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
53
|
poolUnderlyingRaw.push({
|
57
54
|
address: tokenPrice.address,
|
58
55
|
decimals: tokenPrice.decimals,
|
59
|
-
|
56
|
+
tokenPrice,
|
60
57
|
reserveAmountRaw,
|
61
58
|
});
|
62
59
|
}
|
63
60
|
if (poolUnderlyingRaw.length === 0)
|
64
61
|
continue;
|
65
|
-
const lpSource = (0,
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
62
|
+
const lpSource = (0, getLpTokenSourceRaw_1.getLpTokenSourceRaw)({
|
63
|
+
platformId: constants_1.platformId,
|
64
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
65
|
+
lpDetails: {
|
66
|
+
address: account.fundToken.toString(),
|
67
|
+
decimals: 6,
|
68
|
+
supplyRaw: account.supplyOutstanding,
|
69
|
+
},
|
70
|
+
poolUnderlyingsRaw: poolUnderlyingRaw,
|
71
|
+
sourceId: constants_1.platformId,
|
72
|
+
elementName: 'Basket',
|
73
|
+
liquidityName: (0, helpers_1.getSymbol)(account),
|
74
|
+
});
|
75
|
+
lpSources.push(...lpSource);
|
71
76
|
}
|
72
77
|
yield cache.setTokenPriceSources(lpSources);
|
73
78
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"basketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/symmetry/basketsJob.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"basketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/symmetry/basketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,8BAA8B;AAC9B,+DAAyE;AAGzE,2CAA4E;AAC5E,+CAA8D;AAC9D,iDAAsD;AACtD,uCAAoE;AACpE,uCAAwC;AACxC,kFAA+E;AAC/E,uCAAsC;AACtC,6DAA2E;AAC3E,8EAG8C;AAE9C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,YAAY,GAAG,MAAM,IAAA,2CAAoB,EAC7C,UAAU,EACV,yBAAe,EACf,4BAAgB,CACjB,CAAC;IACF,IAAI,CAAC,YAAY;QAAE,OAAO;IAC1B,MAAM,aAAa,GAAG,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,KAAK,CAChD,CAAC,EACD,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|
41
41
|
function getPairsV2FromTheGraph(url, length = 300) {
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
43
|
-
const query = (0, graphql_request_1.gql) `
|
44
|
-
{
|
45
|
-
pairs(
|
46
|
-
orderBy: reserveUSD
|
47
|
-
first: ${length}
|
48
|
-
orderDirection: desc
|
49
|
-
where: { trackedReserveETH_not: "0" }
|
50
|
-
) {
|
51
|
-
id
|
52
|
-
reserve0
|
53
|
-
reserve1
|
54
|
-
totalSupply
|
55
|
-
token0 {
|
56
|
-
id
|
57
|
-
decimals
|
58
|
-
}
|
59
|
-
token1 {
|
60
|
-
id
|
61
|
-
decimals
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
43
|
+
const query = (0, graphql_request_1.gql) `
|
44
|
+
{
|
45
|
+
pairs(
|
46
|
+
orderBy: reserveUSD
|
47
|
+
first: ${length}
|
48
|
+
orderDirection: desc
|
49
|
+
where: { trackedReserveETH_not: "0" }
|
50
|
+
) {
|
51
|
+
id
|
52
|
+
reserve0
|
53
|
+
reserve1
|
54
|
+
totalSupply
|
55
|
+
token0 {
|
56
|
+
id
|
57
|
+
decimals
|
58
|
+
}
|
59
|
+
token1 {
|
60
|
+
id
|
61
|
+
decimals
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
65
|
`;
|
66
66
|
const res = yield (0, graphql_request_1.default)(url, query);
|
67
67
|
const pairs = res.pairs;
|
@@ -7,7 +7,9 @@ function getLpTokenSource(params) {
|
|
7
7
|
const { poolUnderlyings, liquidityName, elementName, lpDetails, platformId, sourceId, networkId, priceUnderlyings, } = params;
|
8
8
|
const sources = [];
|
9
9
|
// Verify underlyings weights
|
10
|
-
|
10
|
+
let totalWeight = poolUnderlyings.reduce((partialSum, p) => partialSum + (p.weight || 0), 0);
|
11
|
+
if (totalWeight === 0)
|
12
|
+
totalWeight = 1;
|
11
13
|
if (totalWeight > 1.01)
|
12
14
|
throw new Error(`Weights are greater than 1: ${totalWeight}`);
|
13
15
|
if (totalWeight < 0.99)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getLpTokenSource.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getLpTokenSource.ts"],"names":[],"mappings":";;;AAAA,+DAIoC;AACpC,6EAGsC;AAmBtC,SAAgB,gBAAgB,CAC9B,MAA8B;IAE9B,MAAM,EACJ,eAAe,EACf,aAAa,EACb,WAAW,EACX,SAAS,EACT,UAAU,EACV,QAAQ,EACR,SAAS,EACT,gBAAgB,GACjB,GAAG,MAAM,CAAC;IACX,MAAM,OAAO,GAAuB,EAAE,CAAC;IAEvC,6BAA6B;IAC7B,
|
1
|
+
{"version":3,"file":"getLpTokenSource.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getLpTokenSource.ts"],"names":[],"mappings":";;;AAAA,+DAIoC;AACpC,6EAGsC;AAmBtC,SAAgB,gBAAgB,CAC9B,MAA8B;IAE9B,MAAM,EACJ,eAAe,EACf,aAAa,EACb,WAAW,EACX,SAAS,EACT,UAAU,EACV,QAAQ,EACR,SAAS,EACT,gBAAgB,GACjB,GAAG,MAAM,CAAC;IACX,MAAM,OAAO,GAAuB,EAAE,CAAC;IAEvC,6BAA6B;IAC7B,IAAI,WAAW,GAAG,eAAe,CAAC,MAAM,CACtC,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,EAC/C,CAAC,CACF,CAAC;IACF,IAAI,WAAW,KAAK,CAAC;QAAE,WAAW,GAAG,CAAC,CAAC;IACvC,IAAI,WAAW,GAAG,IAAI;QACpB,MAAM,IAAI,KAAK,CAAC,+BAA+B,WAAW,EAAE,CAAC,CAAC;IAChE,IAAI,WAAW,GAAG,IAAI;QACpB,MAAM,IAAI,KAAK,CAAC,+BAA+B,WAAW,EAAE,CAAC,CAAC;IAEhE,oBAAoB;IACpB,IAAI,gBAAgB,EAAE,CAAC;QACrB,MAAM,QAAQ,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AC;AACjB,CAAC;AAlED,4CAkEC"}
|
@@ -57,7 +57,9 @@ function getLpUnderlyingTokenSource(params) {
|
|
57
57
|
if (!minReserveValue)
|
58
58
|
minReserveValue = 2500;
|
59
59
|
// Verify underlyings weights
|
60
|
-
|
60
|
+
let totalWeight = poolUnderlyings.reduce((partialSum, p) => partialSum + (p.weight || 0), 0);
|
61
|
+
if (totalWeight === 0)
|
62
|
+
totalWeight = 1;
|
61
63
|
if (totalWeight > 1.01)
|
62
64
|
throw new Error(`Weights are greater than 1: ${totalWeight}`);
|
63
65
|
if (totalWeight < 0.99)
|
@@ -94,8 +96,10 @@ function getLpUnderlyingTokenSource(params) {
|
|
94
96
|
if (u.tokenPrice &&
|
95
97
|
u.tokenPrice.sources.some((s) => s.id === portfolio_core_1.coingeckoSourceId))
|
96
98
|
continue;
|
97
|
-
|
98
|
-
|
99
|
+
let weightFactor = 1;
|
100
|
+
if (u.weight && knownUnderlying.weight)
|
101
|
+
weightFactor = u.weight / knownUnderlying.weight;
|
102
|
+
const price = (weightFactor * knownReserveValue) / u.reserveAmount;
|
99
103
|
const source = {
|
100
104
|
id: sourceId,
|
101
105
|
networkId,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getLpUnderlyingTokenSource.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getLpUnderlyingTokenSource.ts"],"names":[],"mappings":";;;;;;AAAA,+DAYoC;AACpC,8DAAsE;AACtE,wEAAgD;AAEnC,QAAA,oBAAoB,GAAG,IAAI,GAAG,CAA0B;IACnE;QACE,0BAAS,CAAC,GAAG;QACb;YACE,iCAAgB;YAChB,sEAAsE,EAAE,OAAO;YAC/E,qHAAqH,EAAE,SAAS;SACjI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,mCAAkB,EAAC,CAAC,EAAE,0BAAS,CAAC,GAAG,CAAC,CAAC;KACnD;IACD;QACE,0BAAS,CAAC,MAAM;QAChB;YACE,oCAAmB;YAC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
|
1
|
+
{"version":3,"file":"getLpUnderlyingTokenSource.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getLpUnderlyingTokenSource.ts"],"names":[],"mappings":";;;;;;AAAA,+DAYoC;AACpC,8DAAsE;AACtE,wEAAgD;AAEnC,QAAA,oBAAoB,GAAG,IAAI,GAAG,CAA0B;IACnE;QACE,0BAAS,CAAC,GAAG;QACb;YACE,iCAAgB;YAChB,sEAAsE,EAAE,OAAO;YAC/E,qHAAqH,EAAE,SAAS;SACjI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,mCAAkB,EAAC,CAAC,EAAE,0BAAS,CAAC,GAAG,CAAC,CAAC;KACnD;IACD;QACE,0BAAS,CAAC,MAAM;QAChB;YACE,oCAAmB;YACnB,2CAA0B;YAC1B,8CAA8C,EAAE,OAAO;YACvD,8CAA8C,EAAE,OAAO;SACxD,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,mCAAkB,EAAC,CAAC,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;KACtD;IACD;QACE,0BAAS,CAAC,KAAK;QACf;YACE,mCAAkB;YAClB,6EAA6E,EAAE,SAAS;YACxF,mFAAmF,EAAE,oBAAoB;SAC1G,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,mCAAkB,EAAC,CAAC,EAAE,0BAAS,CAAC,KAAK,CAAC,CAAC;KACrD;IACD;QACE,0BAAS,CAAC,GAAG;QACb;YACE,iCAAgB;YAChB,eAAe;YACf,gFAAgF,EAAE,SAAS;YAC3F,gFAAgF,EAAE,SAAS;SAC5F,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,mCAAkB,EAAC,CAAC,EAAE,0BAAS,CAAC,GAAG,CAAC,CAAC;KACnD;CACF,CAAC,CAAC;AAyBH,SAAgB,0BAA0B,CACxC,MAAwC;IAExC,IAAI,EAAE,UAAU,EAAE,a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M,GAAG,eAAe,CAAC,MAAM,CAAC;QACnD,MAAM,KAAK,GAAG,CAAC,YAAY,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC;QAEnE,MAAM,MAAM,GAAqB;YAC/B,EAAE,EAAE,QAAQ;YACZ,SAAS;YACT,UAAU,EAAE,gCAAoB,CAAC,EAAE;YACnC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;YACtB,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,KAAK;YACL,MAAM,EAAE,IAAA,yBAAe,EAAC,iBAAiB,CAAC;YAC1C,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,aAAa;YACb,WAAW;SACZ,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAnFD,gEAmFC"}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
|
4
|
-
exports.infoQueryMsg = JSON.parse(`{
|
5
|
-
"info": {}
|
4
|
+
exports.infoQueryMsg = JSON.parse(`{
|
5
|
+
"info": {}
|
6
6
|
}`);
|
7
|
-
exports.tokenInfoQueryMsg = JSON.parse(`{
|
8
|
-
"token_info": {}
|
7
|
+
exports.tokenInfoQueryMsg = JSON.parse(`{
|
8
|
+
"token_info": {}
|
9
9
|
}`);
|
10
|
-
exports.minterQueryMsg = JSON.parse(`{
|
11
|
-
"minter": {}
|
10
|
+
exports.minterQueryMsg = JSON.parse(`{
|
11
|
+
"minter": {}
|
12
12
|
}`);
|
13
|
-
exports.poolQueryMsg = JSON.parse(`{
|
14
|
-
"pool": {}
|
13
|
+
exports.poolQueryMsg = JSON.parse(`{
|
14
|
+
"pool": {}
|
15
15
|
}`);
|
16
16
|
//# sourceMappingURL=constants.js.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
function getQueryBalanceByOwner(owner) {
|
4
|
-
return JSON.parse(`{
|
5
|
-
"balance": {
|
6
|
-
"address": "${owner}"
|
7
|
-
}
|
4
|
+
return JSON.parse(`{
|
5
|
+
"balance": {
|
6
|
+
"address": "${owner}"
|
7
|
+
}
|
8
8
|
}`);
|
9
9
|
}
|
10
10
|
exports.default = getQueryBalanceByOwner;
|
@@ -13,9 +13,10 @@ export declare const parseMappingData: (data: Buffer) => MappingData;
|
|
13
13
|
export declare const parsePriceData: (data: Buffer, currentSlot?: number) => PriceData;
|
14
14
|
export declare const parsePermissionData: (data: Buffer) => PermissionData;
|
15
15
|
export declare function getPythPricesDatasMap(pubkeys: PublicKey[], accounts: (AccountInfo<Buffer> | null)[]): Map<string, PriceData>;
|
16
|
-
export declare function getPythPrices(connection: SolanaClient,
|
16
|
+
export declare function getPythPrices(connection: SolanaClient, feedAddresses: PublicKey[]): Promise<(number | null)[]>;
|
17
|
+
export declare function getPythPrice(connection: SolanaClient, feedAddress: PublicKey): Promise<number | null>;
|
17
18
|
export declare function getPythTokenPriceSources(connection: SolanaClient, params: {
|
18
19
|
mint: PublicKey;
|
19
|
-
|
20
|
+
feed: PublicKey;
|
20
21
|
platformId?: string;
|
21
22
|
}[]): Promise<(TokenPriceSource | null)[]>;
|
@@ -9,15 +9,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
9
9
|
});
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.getPythTokenPriceSources = exports.getPythPrices = exports.getPythPricesDatasMap = exports.parsePermissionData = exports.parsePriceData = exports.parseMappingData = exports.parseBaseData = exports.MAX_SLOT_DIFFERENCE = exports.Version = exports.Version2 = exports.Magic = void 0;
|
12
|
+
exports.getPythTokenPriceSources = exports.getPythPrice = exports.getPythPrices = exports.getPythPricesDatasMap = exports.parsePermissionData = exports.parsePriceData = exports.parseMappingData = exports.parseBaseData = exports.MAX_SLOT_DIFFERENCE = exports.Version = exports.Version2 = exports.Magic = void 0;
|
13
13
|
const web3_js_1 = require("@solana/web3.js");
|
14
14
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
15
15
|
const structs_1 = require("./structs");
|
16
16
|
const readBig_1 = require("./readBig");
|
17
17
|
const getMultipleAccountsInfoSafe_1 = require("../getMultipleAccountsInfoSafe");
|
18
|
-
const structs_2 = require("../structs");
|
19
|
-
const getParsedMultipleAccountsInfo_1 = require("../getParsedMultipleAccountsInfo");
|
20
18
|
const constants_1 = require("../../../plugins/tokens/constants");
|
19
|
+
const getMultipleDecimalsAsMap_1 = require("../getMultipleDecimalsAsMap");
|
21
20
|
exports.Magic = 0xa1b2c3d4;
|
22
21
|
exports.Version2 = 2;
|
23
22
|
exports.Version = exports.Version2;
|
@@ -250,10 +249,10 @@ function getPythPricesDatasMap(pubkeys, accounts) {
|
|
250
249
|
return priceMap;
|
251
250
|
}
|
252
251
|
exports.getPythPricesDatasMap = getPythPricesDatasMap;
|
253
|
-
function getPythPrices(connection,
|
252
|
+
function getPythPrices(connection, feedAddresses) {
|
254
253
|
return __awaiter(this, void 0, void 0, function* () {
|
255
|
-
const
|
256
|
-
return
|
254
|
+
const accounts = yield (0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(connection, feedAddresses);
|
255
|
+
return accounts.map((acc) => {
|
257
256
|
if (!acc)
|
258
257
|
return null;
|
259
258
|
return ((0, exports.parsePriceData)(acc.data).price || (0, exports.parsePriceData)(acc.data).previousPrice);
|
@@ -261,29 +260,30 @@ function getPythPrices(connection, oracleAddresses) {
|
|
261
260
|
});
|
262
261
|
}
|
263
262
|
exports.getPythPrices = getPythPrices;
|
263
|
+
function getPythPrice(connection, feedAddress) {
|
264
|
+
return __awaiter(this, void 0, void 0, function* () {
|
265
|
+
return (yield getPythPrices(connection, [feedAddress]))[0];
|
266
|
+
});
|
267
|
+
}
|
268
|
+
exports.getPythPrice = getPythPrice;
|
264
269
|
function getPythTokenPriceSources(connection, params) {
|
265
270
|
return __awaiter(this, void 0, void 0, function* () {
|
266
|
-
const prices = yield getPythPrices(connection, params.map((p) => p.
|
267
|
-
const
|
268
|
-
return
|
269
|
-
|
270
|
-
if (price === null)
|
271
|
+
const prices = yield getPythPrices(connection, params.map((p) => p.feed));
|
272
|
+
const decimalsMap = yield (0, getMultipleDecimalsAsMap_1.getMultipleDecimalsAsMap)(connection, params.map((p) => p.mint));
|
273
|
+
return params.map((param, i) => {
|
274
|
+
const price = prices.at(i);
|
275
|
+
if (price === null || price === undefined)
|
271
276
|
return null;
|
272
|
-
const
|
277
|
+
const address = param.mint.toString();
|
278
|
+
const decimals = decimalsMap.get(address);
|
273
279
|
if (!decimals)
|
274
280
|
return null;
|
275
|
-
const cparams = params.at(i);
|
276
|
-
if (!cparams)
|
277
|
-
return null;
|
278
|
-
const address = cparams.mint.toString();
|
279
|
-
const oracle = cparams.oracle.toString();
|
280
|
-
const platformId = cparams.platformId || constants_1.walletTokensPlatform.id;
|
281
281
|
return {
|
282
282
|
address,
|
283
|
-
id:
|
283
|
+
id: `pyth-feed-${param.feed.toString()}`,
|
284
284
|
decimals,
|
285
285
|
networkId: portfolio_core_1.NetworkId.solana,
|
286
|
-
platformId,
|
286
|
+
platformId: param.platformId || constants_1.walletTokensPlatform.id,
|
287
287
|
price,
|
288
288
|
timestamp: Date.now(),
|
289
289
|
weight: 1,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils/solana/pyth/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAyD;AACzD,+DAAyE;AACzE,uCAYmB;AACnB,uCAA4D;AAE5D,gFAA6E;AAC7E,
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/utils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