@sonarwatch/portfolio-plugins 0.11.232 → 0.11.234
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1674 -1666
- package/README.md +3 -3
- package/package.json +2 -3
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/futarchy/daosJob.js +8 -6
- package/src/plugins/futarchy/daosJob.js.map +1 -1
- 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;
|
@@ -92,9 +92,10 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
92
92
|
const daoName = constants_1.daoNameById.get(dao.pubkey.toString());
|
93
93
|
const elementName = `${daoName} Proposal : ${(0, helpers_1.shortenAddress)(proposal.pubkey.toString())} (${structs_1.ProposalState[proposal.state]})`;
|
94
94
|
const usdReserveAccount = tokenAccountById.get(quoteVault.underlyingTokenAccount.toString());
|
95
|
-
const [usdTokenPrice, baseUnderlyingTokenPrice, baseUnderlyingTokenDetail] = [
|
95
|
+
const [usdTokenPrice, baseUnderlyingTokenPrice, usdUnderlyingTokenDetail, baseUnderlyingTokenDetail,] = [
|
96
96
|
underlyingTokenPriceById.get(quoteVault.underlyingTokenMint.toString()),
|
97
97
|
underlyingTokenPriceById.get(baseVault.underlyingTokenMint.toString()),
|
98
|
+
tokensDetailsById.get(quoteVault.underlyingTokenMint.toString()),
|
98
99
|
tokensDetailsById.get(baseVault.underlyingTokenMint.toString()),
|
99
100
|
];
|
100
101
|
// Price the pUSD and fUSD of this proposal
|
@@ -118,6 +119,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
118
119
|
const fUSDPrice = underlyingValue
|
119
120
|
.dividedBy(fUSDMintAccount.supply.dividedBy(Math.pow(10, fUSDMintAccount.decimals)))
|
120
121
|
.dividedBy(2);
|
122
|
+
const symbol = usdUnderlyingTokenDetail === null || usdUnderlyingTokenDetail === void 0 ? void 0 : usdUnderlyingTokenDetail.symbol;
|
121
123
|
const fUSDSource = {
|
122
124
|
address: fUSDMint,
|
123
125
|
decimals: fUSDMintAccount.decimals,
|
@@ -136,7 +138,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
136
138
|
networkId: portfolio_core_1.NetworkId.solana,
|
137
139
|
},
|
138
140
|
],
|
139
|
-
liquidityName: `fUSD
|
141
|
+
liquidityName: symbol ? `f${symbol}` : 'fUSD',
|
140
142
|
elementName,
|
141
143
|
};
|
142
144
|
const pUSDSource = {
|
@@ -157,7 +159,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
157
159
|
networkId: portfolio_core_1.NetworkId.solana,
|
158
160
|
},
|
159
161
|
],
|
160
|
-
liquidityName: `pUSD
|
162
|
+
liquidityName: symbol ? `p${symbol}` : 'pUSD',
|
161
163
|
elementName,
|
162
164
|
};
|
163
165
|
// If the Proposal has passed, fUSD will not be redeemable (price = 0)
|
@@ -186,7 +188,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
186
188
|
amm.quoteMint.toString(),
|
187
189
|
];
|
188
190
|
const [quoteSource, lpMintAccount] = [
|
189
|
-
usdSourceById.get(
|
191
|
+
usdSourceById.get(quoteMint),
|
190
192
|
mintAccountById.get(lpMint),
|
191
193
|
];
|
192
194
|
if (!quoteSource ||
|
@@ -240,7 +242,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
240
242
|
platformId: constants_1.platformId,
|
241
243
|
poolUnderlyings: [
|
242
244
|
{
|
243
|
-
address:
|
245
|
+
address: baseUnderlyingTokenPrice.address,
|
244
246
|
decimals: amm.baseMintDecimals,
|
245
247
|
reserveAmount: amm.baseAmount
|
246
248
|
.dividedBy(Math.pow(10, amm.baseMintDecimals))
|
@@ -249,7 +251,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
249
251
|
tokenPrice: baseTokenPrice,
|
250
252
|
},
|
251
253
|
{
|
252
|
-
address: quoteMint,
|
254
|
+
address: usdTokenPrice ? usdTokenPrice.address : quoteMint,
|
253
255
|
decimals: amm.quoteMintDecimals,
|
254
256
|
reserveAmount: amm.quoteAmount
|
255
257
|
.dividedBy(Math.pow(10, amm.quoteMintDecimals))
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"daosJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/futarchy/daosJob.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,+DAKoC;AAGpC,iDAAsD;AACtD,+CAQ4B;AAC5B,wDAA4D;AAC5D,2CAA8D;AAC9D,uCASmB;AACnB,gDAAoD;AACpD,wEAAqE;AACrE,mDAA8D;AAE9D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,IAAI,GAAG,MAAM,IAAA,iCAAwB,EACzC,MAAM,EACN,mBAAS,EACT,kBAAM,EACN,IAAA,wBAAc,EAAC,GAAG,CAAC,CACpB,CAAC;IAEF,MAAM,OAAO,GAAoC,IAAI,GAAG,EAAE,CAAC;IAC3D,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;IAE/D,MAAM,SAAS,GAAG,MAAM,IAAA,iCAAwB,EAC9C,MAAM,EACN,wBAAc,EACd,kBAAM,EACN,IAAA,wBAAc,EAAC,IAAI,CAAC,CACrB,CAAC;IAEF,MAAM,IAAI,GAAgB,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,CAAC,IAAI,CA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AC,CAAC,EAAE,CAAC;gBACnB,+GAA+G;gBAC/G,+GAA+G;gBAC/G,IACE,CAAC,QAAQ,CAAC,KAAK,KAAK,uBAAa,CAAC,MAAM,IAAI,SAAS,CAAC;oBACtD,CAAC,QAAQ,CAAC,KAAK,KAAK,uBAAa,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC;oBAEvD,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;YAC1B,CAAC;YACD,iBAAiB,CAAC,IAAI,CAAC,GAAG,QAAQ,EAAE,oBAAoB,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AACtD,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -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,YAAY,CAAC,GAAG,CAAC,CAAC,QAAQ,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,
|
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;CAC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,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,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C,CAAC;QACH,SAAS,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;IAC9B,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;AAC9C,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"}
|
@@ -40,28 +40,28 @@ function getPairKey(version) {
|
|
40
40
|
exports.getPairKey = getPairKey;
|
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,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IAAA,mCAAkB,EAAC,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC;YACjD,oEAAoE;YACpE,KAAK,EAAE,CAAC,CAAC,UAAW,CAAC,KAAK;YAC1B,WAAW,EAAE,CAAC,CAAC,aAAa,GAAG,SAAS,CAAC,MAAM;YAC/C,QAAQ,EAAE,CAAC,CAAC,QAAQ;SACrB,CAAC,CAAC;QACH,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;KACtB,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,OAAO,OAAO,CAAC;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,+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CAAC;IACT,IAAI,CAAC,UAAU;QAAE,UAAU,GAAG,gCAAoB,CAAC,EAAE,CAAC;IACtD,IAAI,CAAC,aAAa;QAAE,aAAa,GAAG,4BAAoB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACxE,IAAI,aAAa,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAC3C,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAC1C,IAAI,CAAC,eAAe;QAAE,eAAe,GAAG,IAAI,CAAC;IAE7C,6BAA6B;IAC7B,
|
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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AI,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAAE,SAAS;QACpD,IACE,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,kCAAiB,CAAC;YAE5D,SAAS;QAEX,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,CAAC,MAAM,IAAI,eAAe,CAAC,MAAM;YACpC,YAAY,GAAG,CAAC,CAAC,MAAM,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)[]>;
|