@sonarwatch/portfolio-plugins 0.14.174 → 0.14.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2330 -2317
- package/README.md +3 -3
- package/package.json +3 -3
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/nirvana/depositFetcher.js +2 -0
- package/src/plugins/nirvana/depositFetcher.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/yearn/getVaultsJob.js +1 -1
- package/src/plugins/yearn/getVaultsJob.js.map +1 -1
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- 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
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.14.
|
3
|
+
"version": "0.14.176",
|
4
4
|
"type": "commonjs",
|
5
5
|
"types": "./src/index.d.ts",
|
6
6
|
"peerDependencies": {
|
@@ -12,8 +12,8 @@
|
|
12
12
|
"@aptos-labs/ts-sdk": "^1.19.0",
|
13
13
|
"@bonfida/spl-name-service": "^3.0.8",
|
14
14
|
"@cosmjs/cosmwasm-stargate": "^0.31.1",
|
15
|
-
"@drift-labs/sdk": "^2.118.0-beta.
|
16
|
-
"@drift-labs/vaults-sdk": "^0.6.
|
15
|
+
"@drift-labs/sdk": "^2.118.0-beta.7",
|
16
|
+
"@drift-labs/vaults-sdk": "^0.6.29",
|
17
17
|
"@ethersproject/bignumber": "^5.7.0",
|
18
18
|
"@ethersproject/constants": "^5.7.0",
|
19
19
|
"@ethersproject/providers": "^5.7.2",
|
@@ -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;
|
@@ -20,6 +20,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
20
20
|
const connection = (0, clients_1.getClientSolana)();
|
21
21
|
const personalAccounts = yield ParsedGpa_1.ParsedGpa.build(connection, structs_1.personalAccountStruct, constants_1.pid)
|
22
22
|
.addFilter('owner', new web3_js_1.PublicKey(owner))
|
23
|
+
// the only real USDC accounts
|
24
|
+
.addFilter('tenant', new web3_js_1.PublicKey('BcAoCEdkzV2J21gAjCCEokBw5iMnAe96SbYo9F6QmKWV'))
|
23
25
|
.addDataSizeFilter(272)
|
24
26
|
.run();
|
25
27
|
if (personalAccounts.length === 0)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nirvana/depositFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAE5C,2CASqB;AAErB,iDAAsD;AACtD,gFAA6E;AAC7E,uCAAkD;AAClD,kEAA+D;AAE/D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,gBAAgB,GAAG,MAAM,qBAAS,CAAC,KAAK,CAC5C,UAAU,EACV,+BAAqB,EACrB,eAAG,CACJ;SACE,SAAS,CAAC,OAAO,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nirvana/depositFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAE5C,2CASqB;AAErB,iDAAsD;AACtD,gFAA6E;AAC7E,uCAAkD;AAClD,kEAA+D;AAE/D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,gBAAgB,GAAG,MAAM,qBAAS,CAAC,KAAK,CAC5C,UAAU,EACV,+BAAqB,EACrB,eAAG,CACJ;SACE,SAAS,CAAC,OAAO,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC;QACzC,8BAA8B;SAC7B,SAAS,CACR,QAAQ,EACR,IAAI,mBAAS,CAA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OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -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 +1 @@
|
|
1
|
-
{"version":3,"file":"getVaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/getVaultsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAwE;AAGxE,2CAAwC;AACxC,uCAAsC;AAEtC,SAAwB,YAAY,CAClC,SAA2B,EAC3B,UAAkB;IAElB,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;QACn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AS;QACvC,MAAM,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC;KACrC,CAAC;AACJ,CAAC;AApBD,+BAoBC"}
|
@@ -40,20 +40,20 @@ const clients_1 = require("../../utils/clients");
|
|
40
40
|
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
41
41
|
const helpers_1 = require("./helpers");
|
42
42
|
const AirdropFetcher_1 = require("../../AirdropFetcher");
|
43
|
-
const query = (0, graphql_request_1.gql) `
|
44
|
-
query GetAirdropFinalFrontend($authority: String!) {
|
45
|
-
getAirdropFinalFrontend(authority: $authority) {
|
46
|
-
authority
|
47
|
-
community_allocation
|
48
|
-
eligibility
|
49
|
-
main_allocation
|
50
|
-
og_allocation
|
51
|
-
s1_allocation
|
52
|
-
s2_allocation
|
53
|
-
total_allocation
|
54
|
-
__typename
|
55
|
-
}
|
56
|
-
}
|
43
|
+
const query = (0, graphql_request_1.gql) `
|
44
|
+
query GetAirdropFinalFrontend($authority: String!) {
|
45
|
+
getAirdropFinalFrontend(authority: $authority) {
|
46
|
+
authority
|
47
|
+
community_allocation
|
48
|
+
eligibility
|
49
|
+
main_allocation
|
50
|
+
og_allocation
|
51
|
+
s1_allocation
|
52
|
+
s2_allocation
|
53
|
+
total_allocation
|
54
|
+
__typename
|
55
|
+
}
|
56
|
+
}
|
57
57
|
`;
|
58
58
|
const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
|
59
59
|
const res = yield (0, graphql_request_1.default)(constants_1.graphqlApi, query, {
|
@@ -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;
|