@sonarwatch/portfolio-plugins 0.12.120 → 0.12.121
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +2193 -2189
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +4 -6
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/orca/constants.d.ts +2 -0
- package/src/plugins/orca/constants.js +8 -1
- package/src/plugins/orca/constants.js.map +1 -1
- package/src/plugins/orca/index.js +1 -1
- package/src/plugins/orca/index.js.map +1 -1
- package/src/plugins/orca/lpTokensJob.js +101 -80
- package/src/plugins/orca/lpTokensJob.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- 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/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
@@ -129,7 +129,6 @@ const famousfoxfederation_1 = require("./plugins/famousfoxfederation");
|
|
129
129
|
const nxfinance_1 = require("./plugins/nxfinance");
|
130
130
|
const echelon_1 = require("./plugins/echelon");
|
131
131
|
const solayer_1 = require("./plugins/solayer");
|
132
|
-
const foo_1 = require("./plugins/foo");
|
133
132
|
const picasso_1 = require("./plugins/picasso");
|
134
133
|
var constants_1 = require("./plugins/tokens/constants");
|
135
134
|
Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
|
@@ -471,11 +470,10 @@ exports.fetchers = [
|
|
471
470
|
];
|
472
471
|
exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
|
473
472
|
exports.airdropFetchers = [
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
foo_1.airdropFetcher,
|
473
|
+
...jupiter_1.airdropFetchers,
|
474
|
+
drift_1.airdropFetcher,
|
475
|
+
parcl_1.airdropFetcher,
|
476
|
+
sanctum_1.airdropFetcher,
|
479
477
|
];
|
480
478
|
exports.airdropFetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.airdropFetchers);
|
481
479
|
//# sourceMappingURL=index.js.map
|
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,sEAA8C;AAC9C,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,6CAI0B;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,+CAI2B;AAC3B,2CAIyB;AACzB,2CAIyB;AACzB,uDAI+B;AAC/B,6DAIkC;AAClC,2CAIyB;AACzB,yCAIwB;AACxB,mDAI6B;AAC7B,6CAI0B;AAC1B,iEAIoC;AACpC,6DAIkC;AAClC,yCAIwB;AACxB,uCAIuB;AACvB,+CAI2B;AAC3B,iDAI4B;AAC5B,mDAI6B;AAC7B,2CAIyB;AACzB,+CAI2B;AAC3B,uCAIuB;AACvB,iDAI4B;AAC5B,yCAIwB;AACxB,6CAI0B;AAC1B,yCAIwB;AACxB,mDAI6B;AAC7B,2CAIyB;AACzB,mDAI6B;AAC7B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,2CAIyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,+CAI2B;AAC3B,iDAI4B;AAC5B,yDAIgC;AAChC,iDAI4B;AAC5B,6CAI0B;AAC1B,iDAI4B;AAC5B,+CAI2B;AAC3B,6CAI0B;AAC1B,6CAI0B;AAC1B,+CAK2B;AAC3B,mDAI6B;AAC7B,uEAIuC;AACvC,mDAI6B;AAC7B,+CAI2B;AAC3B,+CAI2B;AAC3B
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,sEAA8C;AAC9C,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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Aa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,uBAAoB;IACvB,GAAG,mBAAgB;IACnB,GAAG,iBAAc;IACjB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,iBAAc;IACjB,GAAG,iBAAc;IACjB,GAAG,kBAAe;IAClB,GAAG,oBAAiB;IACpB,GAAG,8BAA2B;IAC9B,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,kBAAe;CACnB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,GAAG,yBAAsB;IACzB,sBAAmB;IACnB,sBAAmB;IACnB,wBAAqB;CACtB,CAAC;AACW,QAAA,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;
|
@@ -2,6 +2,8 @@ import { PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { Platform } from '@sonarwatch/portfolio-core';
|
3
3
|
export declare const platformId = "orca";
|
4
4
|
export declare const platform: Platform;
|
5
|
+
export declare const orcaStakingPlatformId = "orca-staking";
|
6
|
+
export declare const orcaStakingPlatform: Platform;
|
5
7
|
export declare const poolsProgram: PublicKey;
|
6
8
|
export declare const aquafarmsProgram: PublicKey;
|
7
9
|
export declare const positionsIdentifier = "Orca Whirlpool Position";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.whirlpoolProgram = exports.whirlpoolPrefix = exports.positionsIdentifier = exports.aquafarmsProgram = exports.poolsProgram = exports.platform = exports.platformId = void 0;
|
3
|
+
exports.whirlpoolProgram = exports.whirlpoolPrefix = exports.positionsIdentifier = exports.aquafarmsProgram = exports.poolsProgram = exports.orcaStakingPlatform = exports.orcaStakingPlatformId = exports.platform = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'orca';
|
6
6
|
exports.platform = {
|
@@ -10,6 +10,13 @@ exports.platform = {
|
|
10
10
|
defiLlamaId: 'orca',
|
11
11
|
website: 'https://www.orca.so/',
|
12
12
|
};
|
13
|
+
exports.orcaStakingPlatformId = 'orca-staking';
|
14
|
+
exports.orcaStakingPlatform = {
|
15
|
+
id: exports.orcaStakingPlatformId,
|
16
|
+
name: 'Orca Staking',
|
17
|
+
image: 'https://sonar.watch/img/platforms/orca.webp',
|
18
|
+
website: 'https://v1.orca.so/staking',
|
19
|
+
};
|
13
20
|
exports.poolsProgram = new web3_js_1.PublicKey('9W959DqEETiGZocYWCQPaJ6sBmUzgfxXfqGeTEdp3aQP');
|
14
21
|
exports.aquafarmsProgram = new web3_js_1.PublicKey('82yxjeMsvaURa4MbZZ7WZZHfobirZYkH1zF8fmeGtyaQ');
|
15
22
|
exports.positionsIdentifier = 'Orca Whirlpool Position';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,sBAAsB;CAChC,CAAC;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,sBAAsB;CAChC,CAAC;AAEW,QAAA,qBAAqB,GAAG,cAAc,CAAC;AACvC,QAAA,mBAAmB,GAAa;IAC3C,EAAE,EAAE,6BAAqB;IACzB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,6CAA6C;IACpD,OAAO,EAAE,4BAA4B;CACtC,CAAC;AAEW,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,8CAA8C,CAC/C,CAAC;AACW,QAAA,gBAAgB,GAAG,IAAI,mBAAS,CAC3C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,mBAAmB,GAAG,yBAAyB,CAAC;AAChD,QAAA,eAAe,GAAG,GAAG,kBAAU,YAAY,CAAC;AAC5C,QAAA,gBAAgB,GAAG,IAAI,mBAAS,CAC3C,6CAA6C,CAC9C,CAAC"}
|
@@ -7,7 +7,7 @@ exports.fetchers = exports.jobs = exports.platforms = void 0;
|
|
7
7
|
const lpTokensJob_1 = __importDefault(require("./lpTokensJob"));
|
8
8
|
const whirlpoolsJob_1 = __importDefault(require("./whirlpoolsJob"));
|
9
9
|
const constants_1 = require("./constants");
|
10
|
-
exports.platforms = [constants_1.platform];
|
10
|
+
exports.platforms = [constants_1.platform, constants_1.orcaStakingPlatform];
|
11
11
|
exports.jobs = [whirlpoolsJob_1.default, lpTokensJob_1.default];
|
12
12
|
exports.fetchers = [];
|
13
13
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/index.ts"],"names":[],"mappings":";;;;;;AACA,gEAAkC;AAGlC,oEAA2C;AAC3C,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/index.ts"],"names":[],"mappings":";;;;;;AACA,gEAAkC;AAGlC,oEAA2C;AAC3C,2CAA4D;AAE/C,QAAA,SAAS,GAAe,CAAC,oBAAQ,EAAE,+BAAmB,CAAC,CAAC;AACxD,QAAA,IAAI,GAAU,CAAC,uBAAY,EAAE,qBAAK,CAAC,CAAC;AACpC,QAAA,QAAQ,GAAc,EAAE,CAAC"}
|
@@ -22,41 +22,64 @@ const solana_1 = require("../../utils/solana");
|
|
22
22
|
const fetchTokenSupplyAndDecimals_1 = require("../../utils/solana/fetchTokenSupplyAndDecimals");
|
23
23
|
const runInBatch_1 = __importDefault(require("../../utils/misc/runInBatch"));
|
24
24
|
const computeAndStoreLpPrice_1 = require("../../utils/misc/computeAndStoreLpPrice");
|
25
|
-
const getTokensPricesMap_1 = __importDefault(require("../../utils/misc/getTokensPricesMap"));
|
26
|
-
const getLpUnderlyingTokenSourceOld_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSourceOld"));
|
27
25
|
const getDecimalsForToken_1 = require("../../utils/misc/getDecimalsForToken");
|
28
|
-
const
|
26
|
+
const getLpTokenSource_1 = require("../../utils/misc/getLpTokenSource");
|
29
27
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
30
28
|
const client = (0, clients_1.getClientSolana)();
|
31
|
-
const farmsAccounts = yield
|
32
|
-
|
33
|
-
|
29
|
+
const [farmsAccounts, poolsAccounts] = yield Promise.all([
|
30
|
+
(0, solana_1.getParsedProgramAccounts)(client, oldLiquidities_1.aquafarmStruct, constants_1.aquafarmsProgram, filters_1.aquafarmFilters),
|
31
|
+
(0, solana_1.getParsedProgramAccounts)(client, oldLiquidities_1.poolInfoStruct, constants_1.poolsProgram, filters_1.poolsFilters),
|
32
|
+
]);
|
33
|
+
const mintsSet = new Set();
|
34
34
|
const tokensAccountAddresses = [];
|
35
35
|
farmsAccounts.forEach((farm) => {
|
36
|
-
|
36
|
+
mintsSet.add(farm.baseTokenMint.toString());
|
37
37
|
tokensAccountAddresses.push(farm.baseTokenVault);
|
38
38
|
});
|
39
39
|
poolsAccounts.forEach((pool) => {
|
40
|
-
|
40
|
+
mintsSet.add(pool.mintA.toString());
|
41
|
+
mintsSet.add(pool.mintB.toString());
|
41
42
|
tokensAccountAddresses.push(...[pool.tokenAccountA, pool.tokenAccountB]);
|
42
43
|
});
|
43
|
-
const
|
44
|
-
const tokensAccounts = yield
|
44
|
+
const mints = Array.from(mintsSet);
|
45
|
+
const [tokenPriceById, tokensAccounts, poolsSupplyAndDecimals, farmsSupplyAndDecimals,] = yield Promise.all([
|
46
|
+
cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.solana),
|
47
|
+
(0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, tokensAccountAddresses),
|
48
|
+
(0, runInBatch_1.default)(poolsAccounts.map((pool) => () => (0, fetchTokenSupplyAndDecimals_1.fetchTokenSupplyAndDecimals)(pool.tokenPool, client, 0))),
|
49
|
+
(0, runInBatch_1.default)(farmsAccounts.map((farm) => () => (0, fetchTokenSupplyAndDecimals_1.fetchTokenSupplyAndDecimals)(farm.farmTokenMint, client, 0))),
|
50
|
+
]);
|
51
|
+
const unknownMints = mints.filter((mint) => !tokenPriceById.get(mint));
|
52
|
+
const mintDecimals = yield (0, runInBatch_1.default)(unknownMints.map((mint) => () => (0, getDecimalsForToken_1.getDecimalsForToken)(cache, mint, portfolio_core_1.NetworkId.solana)));
|
45
53
|
const tokenAccountByAddress = new Map();
|
54
|
+
const tokensSupplyAndDecimalsByMint = new Map();
|
55
|
+
const decimalsByMint = new Map();
|
46
56
|
tokensAccounts.forEach((tAccount) => {
|
47
57
|
if (!tAccount)
|
48
58
|
return;
|
49
59
|
tokenAccountByAddress.set(tAccount.pubkey.toString(), tAccount);
|
50
60
|
});
|
51
|
-
|
52
|
-
const poolTokenInfoByAddress = new Map();
|
53
|
-
batchResult.forEach((r, index) => {
|
61
|
+
farmsSupplyAndDecimals.forEach((r, index) => {
|
54
62
|
if (r.status === 'rejected')
|
55
63
|
return;
|
56
64
|
if (!r.value)
|
57
65
|
return;
|
58
|
-
|
66
|
+
tokensSupplyAndDecimalsByMint.set(farmsAccounts[index].farmTokenMint.toString(), r.value);
|
59
67
|
});
|
68
|
+
poolsSupplyAndDecimals.forEach((r, index) => {
|
69
|
+
if (r.status === 'rejected')
|
70
|
+
return;
|
71
|
+
if (!r.value)
|
72
|
+
return;
|
73
|
+
tokensSupplyAndDecimalsByMint.set(poolsAccounts[index].tokenPool.toString(), r.value);
|
74
|
+
});
|
75
|
+
mintDecimals.forEach((r, index) => {
|
76
|
+
if (r.status === 'rejected')
|
77
|
+
return;
|
78
|
+
if (!r.value)
|
79
|
+
return;
|
80
|
+
decimalsByMint.set(mints[index], r.value);
|
81
|
+
});
|
82
|
+
const sources = [];
|
60
83
|
for (const poolAccount of poolsAccounts) {
|
61
84
|
if ([
|
62
85
|
poolAccount.tokenAccountA.toString(),
|
@@ -64,7 +87,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
87
|
].includes('11111111111111111111111111111111'))
|
65
88
|
continue;
|
66
89
|
const lpMint = poolAccount.tokenPool;
|
67
|
-
const lpSupplyAndDecimals =
|
90
|
+
const lpSupplyAndDecimals = tokensSupplyAndDecimalsByMint.get(lpMint.toString());
|
68
91
|
if (!lpSupplyAndDecimals)
|
69
92
|
continue;
|
70
93
|
const lpSupply = new bignumber_js_1.default(lpSupplyAndDecimals.supply).times(Math.pow(10, lpSupplyAndDecimals.decimals));
|
@@ -76,76 +99,53 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
99
|
continue;
|
77
100
|
const mintA = poolAccount.mintA.toString();
|
78
101
|
const mintB = poolAccount.mintB.toString();
|
79
|
-
const tokenPriceA =
|
80
|
-
const tokenPriceB =
|
81
|
-
const [decimalsA, decimalsB] =
|
82
|
-
(0
|
83
|
-
(0
|
84
|
-
]
|
102
|
+
const tokenPriceA = tokenPriceById.get(poolAccount.mintA.toString());
|
103
|
+
const tokenPriceB = tokenPriceById.get(poolAccount.mintB.toString());
|
104
|
+
const [decimalsA, decimalsB] = [
|
105
|
+
(tokenPriceA === null || tokenPriceA === void 0 ? void 0 : tokenPriceA.decimals) || decimalsByMint.get(mintA),
|
106
|
+
(tokenPriceB === null || tokenPriceB === void 0 ? void 0 : tokenPriceB.decimals) || decimalsByMint.get(mintB),
|
107
|
+
];
|
85
108
|
const lpDecimals = lpSupplyAndDecimals.decimals;
|
86
109
|
if (!decimalsA || !decimalsB)
|
87
110
|
continue;
|
88
111
|
const coinAmountWei = new bignumber_js_1.default(poolCoinTokenAccount.amount.toString());
|
89
112
|
const pcAmountWei = new bignumber_js_1.default(poolPcTokenAccount.amount.toString());
|
90
|
-
const
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
weight: 0.5,
|
96
|
-
}, {
|
97
|
-
address: mintB,
|
98
|
-
decimals: decimalsB,
|
99
|
-
reserveAmountRaw: pcAmountWei,
|
100
|
-
tokenPrice: tokenPriceB,
|
101
|
-
weight: 0.5,
|
102
|
-
});
|
103
|
-
if (underlyingSource)
|
104
|
-
yield cache.setTokenPriceSource(underlyingSource);
|
105
|
-
if (!tokenPriceA || !tokenPriceB)
|
106
|
-
continue;
|
107
|
-
const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.solana, lpMint.toString(), constants_1.platformId, { address: lpMint.toString(), decimals: lpDecimals, supplyRaw: lpSupply }, [
|
108
|
-
{
|
109
|
-
address: tokenPriceA.address,
|
110
|
-
decimals: tokenPriceA.decimals,
|
111
|
-
price: tokenPriceA.price,
|
112
|
-
reserveAmountRaw: coinAmountWei,
|
113
|
+
const tokenPriceSources = (0, getLpTokenSource_1.getLpTokenSource)({
|
114
|
+
lpDetails: {
|
115
|
+
address: lpMint.toString(),
|
116
|
+
decimals: lpDecimals,
|
117
|
+
supply: lpSupply.dividedBy(Math.pow(10, lpDecimals)).toNumber(),
|
113
118
|
},
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
119
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
120
|
+
platformId: constants_1.platformId,
|
121
|
+
poolUnderlyings: [
|
122
|
+
{
|
123
|
+
address: mintA,
|
124
|
+
decimals: decimalsA,
|
125
|
+
tokenPrice: tokenPriceA,
|
126
|
+
reserveAmount: coinAmountWei.dividedBy(Math.pow(10, decimalsA)).toNumber(),
|
127
|
+
},
|
128
|
+
{
|
129
|
+
address: mintB,
|
130
|
+
decimals: decimalsB,
|
131
|
+
reserveAmount: pcAmountWei.dividedBy(Math.pow(10, decimalsB)).toNumber(),
|
132
|
+
tokenPrice: tokenPriceB,
|
133
|
+
},
|
134
|
+
],
|
135
|
+
sourceId: lpMint.toString(),
|
136
|
+
elementName: 'Aquafarms (deprecated)',
|
137
|
+
priceUnderlyings: true,
|
138
|
+
});
|
139
|
+
sources.push(...tokenPriceSources);
|
134
140
|
}
|
135
|
-
const tokensSupDecResult = yield (0, runInBatch_1.default)(farmsAccounts.map((farm) => () => (0, fetchTokenSupplyAndDecimals_1.fetchTokenSupplyAndDecimals)(farm.farmTokenMint, client, 0)));
|
136
|
-
const tokensSuppliesAndDecimalsByMint = new Map();
|
137
|
-
tokensSupDecResult.forEach((r, index) => {
|
138
|
-
if (r.status === 'rejected')
|
139
|
-
return;
|
140
|
-
if (!r.value)
|
141
|
-
return;
|
142
|
-
tokensSuppliesAndDecimalsByMint.set(farmsAccounts[index].farmTokenMint.toString(), r.value);
|
143
|
-
});
|
144
141
|
for (let i = 0; i < farmsAccounts.length; i += 1) {
|
145
142
|
const aquafarm = farmsAccounts[i];
|
143
|
+
if (aquafarm.farmTokenMint.toString() !==
|
144
|
+
'DJseRvvLM53GrowUcjjCRYXJSzMH7dN5jrkGWaFAU3fm')
|
145
|
+
continue;
|
146
146
|
const baseMint = aquafarm.baseTokenMint.toString();
|
147
|
-
const
|
148
|
-
if (!
|
147
|
+
const baseTokenPrice = tokenPriceById.get(baseMint);
|
148
|
+
if (!baseTokenPrice)
|
149
149
|
continue;
|
150
150
|
const baseVault = tokenAccountByAddress.get(aquafarm.baseTokenVault.toString());
|
151
151
|
if (!baseVault)
|
@@ -153,18 +153,36 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
153
153
|
if (baseVault.amount.isZero())
|
154
154
|
continue;
|
155
155
|
const farmMint = aquafarm.farmTokenMint.toString();
|
156
|
-
const tokenSupplyRes =
|
156
|
+
const tokenSupplyRes = tokensSupplyAndDecimalsByMint.get(farmMint);
|
157
157
|
if (!tokenSupplyRes)
|
158
158
|
continue;
|
159
159
|
const { decimals: farmDecimals, supply: farmSupply } = tokenSupplyRes;
|
160
160
|
const baseVaultAmount = baseVault.amount
|
161
|
-
.div(Math.pow(10,
|
161
|
+
.div(Math.pow(10, baseTokenPrice.decimals))
|
162
162
|
.toNumber();
|
163
|
-
const baseVaultValue = baseVaultAmount *
|
163
|
+
const baseVaultValue = baseVaultAmount * baseTokenPrice.price;
|
164
164
|
if (baseVaultValue < computeAndStoreLpPrice_1.minimumLiquidity.toNumber())
|
165
165
|
continue;
|
166
166
|
const price = baseVaultValue / farmSupply;
|
167
|
-
|
167
|
+
if (aquafarm.farmTokenMint.toString() ===
|
168
|
+
'DJseRvvLM53GrowUcjjCRYXJSzMH7dN5jrkGWaFAU3fm') {
|
169
|
+
sources.push({
|
170
|
+
id: constants_1.orcaStakingPlatformId,
|
171
|
+
elementName: '(deprecated)',
|
172
|
+
weight: 1,
|
173
|
+
address: farmMint.toString(),
|
174
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
175
|
+
platformId: constants_1.platformId,
|
176
|
+
decimals: farmDecimals,
|
177
|
+
price,
|
178
|
+
underlyings: baseTokenPrice.underlyings || [
|
179
|
+
Object.assign(Object.assign({}, baseTokenPrice), { amountPerLp: 1 }),
|
180
|
+
],
|
181
|
+
timestamp: Date.now(),
|
182
|
+
});
|
183
|
+
continue;
|
184
|
+
}
|
185
|
+
sources.push({
|
168
186
|
id: constants_1.platformId,
|
169
187
|
elementName: 'Aquafarms (deprecated)',
|
170
188
|
weight: 1,
|
@@ -173,10 +191,13 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
173
191
|
platformId: constants_1.platformId,
|
174
192
|
decimals: farmDecimals,
|
175
193
|
price,
|
176
|
-
underlyings:
|
194
|
+
underlyings: baseTokenPrice.underlyings || [
|
195
|
+
Object.assign(Object.assign({}, baseTokenPrice), { amountPerLp: 1 }),
|
196
|
+
],
|
177
197
|
timestamp: Date.now(),
|
178
198
|
});
|
179
199
|
}
|
200
|
+
yield cache.setTokenPriceSources(sources);
|
180
201
|
});
|
181
202
|
const job = {
|
182
203
|
id: `${constants_1.platformId}-lp-tokens`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lpTokensJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/lpTokensJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"lpTokensJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/lpTokensJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,gEAAqC;AAErC,2CAKqB;AACrB,uCAA0D;AAC1D,iDAAsD;AACtD,6DAA0E;AAC1E,+CAK4B;AAC5B,gGAA6F;AAG7F,6EAAqD;AACrD,oFAA2E;AAC3E,8EAA2E;AAC3E,wEAAqE;AAErE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACvD,IAAA,iCAAwB,EACtB,MAAM,EACN,+BAAc,EACd,4BAAgB,EAChB,yBAAe,CAChB;QACD,IAAA,iCAAwB,EACtB,MAAM,EACN,+BAAc,EACd,wBAAY,EACZ,sBAAY,CACb;KACF,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAgB,IAAI,GAAG,EAAE,CAAC;IACxC,MAAM,sBAAsB,GAAgB,EAAE,CAAC;IAE/C,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC7B,QAA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AE,cAAc,CAAC,WAAW,IAAI;gDACpC,cAAc,KAAE,WAAW,EAAE,CAAC;aACpC;YACD,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,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;
|
@@ -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;
|
@@ -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;
|