@sonarwatch/portfolio-plugins 0.12.111 → 0.12.112
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +2160 -2156
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/plugins/aftermath/poolsJob.js +1 -1
- package/src/plugins/aftermath/poolsJob.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/raydium/farmsFetcher.js +29 -6
- package/src/plugins/raydium/farmsFetcher.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
@@ -61,7 +61,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
61
|
poolInfo.normalized_balances.forEach((nBalance, i) => {
|
62
62
|
const caddress = (0, portfolio_core_1.formatTokenAddress)(`0x${poolInfo.type_names[i]}`, networkId);
|
63
63
|
const tokenPrice = tokenPriceById.get(caddress);
|
64
|
-
if (!tokenPrice)
|
64
|
+
if (!tokenPrice || !poolInfo.coin_decimals)
|
65
65
|
return;
|
66
66
|
poolUnderlyingsRaw.push({
|
67
67
|
address: caddress,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aftermath/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAA2E;AAG3E,iDAAmD;AACnD,2CAAuD;AAEvD,6CAAoD;AACpD,uEAAoE;AACpE,qEAAkE;AAClE,8EAG8C;AAE9C,MAAM,SAAS,GAAG,0B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S,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAA,EAAE,EAAI,EAAE,CAAA,CAAC,CAAC,QAAQ,EAAE;aACpE,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,IAAI,kBAAkB,CAAC,MAAM,KAAK,QAAQ,CAAC,mBAAmB,CAAC,MAAM;YACnE,SAAS;QACX,MAAM,SAAS,GAAG,IAAA,yCAAmB,EAAC;YACpC,SAAS;YACT,UAAU,EAAV,sBAAU;YACV,SAAS,EAAE;gBACT,OAAO,EAAE,SAAS;gBAClB,QAAQ,EAAE,QAAQ,CAAC,WAAW;gBAC9B,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK;aAC3C;YACD,QAAQ,EAAE,SAAS;YACnB,kBAAkB;YAClB,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IAC7B,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -36,27 +36,27 @@ exports.getBalancerPoolsV2 = void 0;
|
|
36
36
|
const graphql_request_1 = __importStar(require("graphql-request"));
|
37
37
|
function getBalancerPoolsV2(url) {
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
39
|
-
const query = (0, graphql_request_1.gql) `
|
40
|
-
query pools {
|
41
|
-
pools(
|
42
|
-
first: 1000
|
43
|
-
orderBy: totalLiquidity
|
44
|
-
orderDirection: desc
|
45
|
-
where: { totalLiquidity_gt: "500" }
|
46
|
-
) {
|
47
|
-
id
|
48
|
-
address
|
49
|
-
symbol
|
50
|
-
totalLiquidity
|
51
|
-
totalShares
|
52
|
-
tokens {
|
53
|
-
balance
|
54
|
-
decimals
|
55
|
-
symbol
|
56
|
-
address
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
39
|
+
const query = (0, graphql_request_1.gql) `
|
40
|
+
query pools {
|
41
|
+
pools(
|
42
|
+
first: 1000
|
43
|
+
orderBy: totalLiquidity
|
44
|
+
orderDirection: desc
|
45
|
+
where: { totalLiquidity_gt: "500" }
|
46
|
+
) {
|
47
|
+
id
|
48
|
+
address
|
49
|
+
symbol
|
50
|
+
totalLiquidity
|
51
|
+
totalShares
|
52
|
+
tokens {
|
53
|
+
balance
|
54
|
+
decimals
|
55
|
+
symbol
|
56
|
+
address
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
60
|
`;
|
61
61
|
const res = yield (0, graphql_request_1.default)(url, query);
|
62
62
|
const pools = res.pools;
|
@@ -38,7 +38,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
38
38
|
farmsInfo.forEach((farmInfo) => farmInfo
|
39
39
|
? farmsInfoMap.set(farmInfo.account.pubkey.toString(), farmInfo)
|
40
40
|
: undefined);
|
41
|
-
const
|
41
|
+
const liquiditiesWithoutRewards = [];
|
42
|
+
const elementsWithRewards = [];
|
42
43
|
for (let i = 0; i < userFarmAccounts.length; i += 1) {
|
43
44
|
const rewardAssets = [];
|
44
45
|
const assets = [];
|
@@ -79,7 +80,18 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
79
80
|
const value = (0, portfolio_core_1.getUsdValueSum)([assetsValue, rewardAssetsValue]);
|
80
81
|
if (value === 0)
|
81
82
|
continue;
|
82
|
-
|
83
|
+
if (rewardAssets.length === 0) {
|
84
|
+
liquiditiesWithoutRewards.push({
|
85
|
+
assets,
|
86
|
+
assetsValue,
|
87
|
+
rewardAssets: [],
|
88
|
+
rewardAssetsValue: null,
|
89
|
+
value: assetsValue,
|
90
|
+
yields: [],
|
91
|
+
});
|
92
|
+
continue;
|
93
|
+
}
|
94
|
+
const liquidityWithRewards = {
|
83
95
|
value,
|
84
96
|
assets,
|
85
97
|
assetsValue,
|
@@ -87,19 +99,30 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
87
99
|
rewardAssetsValue,
|
88
100
|
yields: [],
|
89
101
|
};
|
90
|
-
|
102
|
+
elementsWithRewards.push({
|
103
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
104
|
+
platformId: constants_1.platformId,
|
105
|
+
type: portfolio_core_1.PortfolioElementType.liquidity,
|
106
|
+
label: 'Farming',
|
107
|
+
value: liquidityWithRewards.value,
|
108
|
+
data: {
|
109
|
+
liquidities: [liquidityWithRewards],
|
110
|
+
},
|
111
|
+
});
|
91
112
|
}
|
92
|
-
if (
|
113
|
+
if (liquiditiesWithoutRewards.length === 0 &&
|
114
|
+
elementsWithRewards.length === 0)
|
93
115
|
return [];
|
94
116
|
return [
|
117
|
+
...elementsWithRewards,
|
95
118
|
{
|
96
119
|
networkId: portfolio_core_1.NetworkId.solana,
|
97
120
|
platformId: constants_1.platformId,
|
98
121
|
type: portfolio_core_1.PortfolioElementType.liquidity,
|
99
122
|
label: 'Farming',
|
100
|
-
value: (0, portfolio_core_1.getUsdValueSum)(
|
123
|
+
value: (0, portfolio_core_1.getUsdValueSum)(liquiditiesWithoutRewards.map((l) => l.value)),
|
101
124
|
data: {
|
102
|
-
liquidities,
|
125
|
+
liquidities: liquiditiesWithoutRewards,
|
103
126
|
},
|
104
127
|
},
|
105
128
|
];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"farmsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/farmsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"farmsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/farmsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DA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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;
|