@sonarwatch/portfolio-plugins 0.12.147 → 0.12.148

Sign up to get free protection for your applications and to get access to all the features.
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.12.147",
3
+ "version": "0.12.148",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -30,21 +30,31 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
30
30
  const pObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, poolFactoryIds);
31
31
  const poolsIds = pObjects
32
32
  .map((poolObject) => {
33
- var _a, _b, _c, _d;
34
- if ((_b = (_a = poolObject.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields) {
35
- const fields = (_d = (_c = poolObject.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields;
36
- if (fields.value)
37
- return fields.value;
38
- }
39
- return [];
33
+ var _a, _b;
34
+ return ((_b = (_a = poolObject.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields)
35
+ ? poolObject.data.content.fields.value
36
+ : [];
40
37
  })
41
38
  .flat();
42
39
  if (!poolsIds.length)
43
40
  return;
44
41
  const poolsInfo = yield (0, multiGetObjects_1.multiGetObjects)(client, poolsIds);
45
- const tokenPriceById = yield cache.getTokenPricesAsMap(poolsInfo
46
- .map((pool) => { var _a, _b, _c; return ((_c = (_b = (_a = pool.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields) === null || _c === void 0 ? void 0 : _c.type_names) || []; })
47
- .flat(), networkId);
42
+ const mints = poolsInfo
43
+ .map((pool) => {
44
+ var _a, _b, _c, _d, _e, _f;
45
+ return ((_c = (_b = (_a = pool.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields) === null || _c === void 0 ? void 0 : _c.type_names)
46
+ ? (_f = (_e = (_d = pool.data) === null || _d === void 0 ? void 0 : _d.content) === null || _e === void 0 ? void 0 : _e.fields) === null || _f === void 0 ? void 0 : _f.type_names.map((type) => {
47
+ try {
48
+ return (0, portfolio_core_1.formatMoveTokenAddress)(type);
49
+ }
50
+ catch (e) {
51
+ return [];
52
+ }
53
+ }).flat()
54
+ : [];
55
+ })
56
+ .flat();
57
+ const tokenPriceById = yield cache.getTokenPricesAsMap(mints, networkId);
48
58
  const sources = [];
49
59
  for (const pool of poolsInfo) {
50
60
  if (!((_b = (_a = pool.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields))
@@ -58,14 +68,22 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
58
68
  const lpAddress = moveType.keys[0].type;
59
69
  const poolUnderlyingsRaw = [];
60
70
  poolInfo.normalized_balances.forEach((nBalance, i) => {
61
- const caddress = (0, portfolio_core_1.formatTokenAddress)(`0x${poolInfo.type_names[i]}`, networkId);
62
- const tokenPrice = tokenPriceById.get(caddress);
71
+ let cAddress;
72
+ try {
73
+ cAddress = (0, portfolio_core_1.formatTokenAddress)(poolInfo.type_names[i], networkId);
74
+ }
75
+ catch (e) {
76
+ return;
77
+ }
78
+ if (!cAddress)
79
+ return;
80
+ const tokenPrice = tokenPriceById.get(cAddress);
63
81
  if (!tokenPrice || !poolInfo.coin_decimals)
64
82
  return;
65
83
  poolUnderlyingsRaw.push({
66
- address: caddress,
84
+ address: cAddress,
67
85
  decimals: poolInfo.coin_decimals[i],
68
- reserveAmountRaw: new bignumber_js_1.default(poolInfo.normalized_balances[i]).dividedBy(poolInfo.decimal_scalars[i]),
86
+ reserveAmountRaw: new bignumber_js_1.default(nBalance).dividedBy(poolInfo.decimal_scalars[i]),
69
87
  tokenPrice,
70
88
  weight: new bignumber_js_1.default(poolInfo.weights[i]).div(Math.pow(10, 18)).toNumber(),
71
89
  });
@@ -1 +1 @@
1
- {"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aftermath/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAIoC;AAGpC,iDAAmD;AACnD,2CAAuD;AAEvD,uEAAoE;AACpE,qEAAkE;AAClE,8EAG8C;AAE9C,MAAM,SAAS,GAAG,0BAAS,CAAC,GAAG,CAAC;AAEhC,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,gBAAgB,GAAG,MAAM,IAAA,mCAAgB,EAAC,MAAM,EAAE,wBAAY,CAAC,CAAC;IAEtE,MAAM,cAAc,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC/D,IAAI,CAAC,cAAc,CAAC,MAAM;QAAE,OAAO;IAEnC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAe,EAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,QAAQ;SACtB,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;;QAClB,IAAI,MAAA,MAAA,UAAU,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,EAAE,CAAC;YACrC,MAAM,MAAM,GAAG,MAAA,MAAA,UAAU,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAIxC,CAAC;YACF,IAAI,MAAM,CAAC,KAAK;gBAAE,OAAO,MAAM,CAAC,KAAK,CAAC;QACxC,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;SACD,IAAI,EAAE,CAAC;IACV,IAAI,CAAC,QAAQ,CAAC,MAAM;QAAE,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AC,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"}
@@ -48,3 +48,10 @@ export type StakingPosition = {
48
48
  export type ID = {
49
49
  id: string;
50
50
  };
51
+ export type PoolFactory = {
52
+ id: {
53
+ id: string;
54
+ };
55
+ name: string;
56
+ value: string;
57
+ };
@@ -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,38 +20,38 @@ const helpers_1 = require("./helpers");
20
20
  const tokenPricesFromSqrt_1 = __importDefault(require("../../utils/clmm/tokenPricesFromSqrt"));
21
21
  const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
22
22
  const queryEvents_1 = require("../../utils/sui/queryEvents");
23
- let lastFetchTime;
24
23
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
25
24
  var _a;
26
25
  const client = (0, clients_1.getClientSui)();
26
+ const promises = [];
27
+ const cacheItems = [];
27
28
  const eventsData = yield (0, queryEvents_1.queryEvents)(client, {
28
29
  MoveEventType: constants_1.createPoolEvent,
29
- TimeRange: lastFetchTime
30
- ? {
31
- startTime: lastFetchTime.toString(),
32
- endTime: Date.now().toString(),
33
- }
34
- : undefined,
35
30
  });
36
- lastFetchTime = Date.now();
37
- const poolsAddresses = eventsData
38
- .map((eventData) => eventData.parsedJson ? eventData.parsedJson.pool_id : [])
39
- .flat();
40
- const poolsObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, poolsAddresses);
41
- const promises = [];
42
- const cacheItems = [];
43
- for (let i = 0; i < poolsObjects.length; i++) {
44
- const poolId = (_a = poolsObjects[i].data) === null || _a === void 0 ? void 0 : _a.objectId;
45
- if (!poolId)
46
- continue;
47
- const pool = (0, helpers_1.getPoolFromObject)(poolsObjects[i]);
48
- if (!pool)
49
- continue;
50
- promises.push((0, tokenPricesFromSqrt_1.default)(cache, portfolio_core_1.NetworkId.sui, pool.poolAddress, new bignumber_js_1.default(pool.coinAmountA), new bignumber_js_1.default(pool.coinAmountB), new bignumber_js_1.default(pool.current_sqrt_price), pool.coinTypeA, pool.coinTypeB));
51
- cacheItems.push({
52
- key: poolId,
53
- value: pool,
54
- });
31
+ let poolsAddresses;
32
+ let poolsObjects;
33
+ let sliceEvents;
34
+ for (let t = 0; t < eventsData.length; t += 50) {
35
+ sliceEvents = eventsData.slice(t, t + 50);
36
+ poolsAddresses = sliceEvents
37
+ .map((eventData) => eventData.parsedJson ? eventData.parsedJson.pool_id : [])
38
+ .flat();
39
+ poolsObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, poolsAddresses);
40
+ let poolId;
41
+ let pool;
42
+ for (let i = 0; i < poolsObjects.length; i++) {
43
+ poolId = (_a = poolsObjects[i].data) === null || _a === void 0 ? void 0 : _a.objectId;
44
+ if (!poolId)
45
+ continue;
46
+ pool = (0, helpers_1.getPoolFromObject)(poolsObjects[i]);
47
+ if (!pool)
48
+ continue;
49
+ promises.push((0, tokenPricesFromSqrt_1.default)(cache, portfolio_core_1.NetworkId.sui, pool.poolAddress, new bignumber_js_1.default(pool.coinAmountA), new bignumber_js_1.default(pool.coinAmountB), new bignumber_js_1.default(pool.current_sqrt_price), pool.coinTypeA, pool.coinTypeB));
50
+ cacheItems.push({
51
+ key: poolId,
52
+ value: pool,
53
+ });
54
+ }
55
55
  }
56
56
  yield cache.setItems(cacheItems, {
57
57
  prefix: constants_1.clmmPoolsPrefix,
@@ -1 +1 @@
1
- {"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cetus/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEAAqC;AAGrC,iDAAmD;AACnD,2CAA2E;AAC3E,uCAA8C;AAC9C,+FAA4E;AAE5E,qEAAkE;AAClE,6DAA0D;AAE1D,IAAI,aAAiC,CAAC;AAEtC,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,UAAU,GAAG,MAAM,IAAA,yBAAW,EAAkB,MAAM,EAAE;QAC5D,aAAa,EAAE,2BAAe;QAC9B,SAAS,EAAE,aAAa;YACtB,CAAC,CAAC;gBACE,SAAS,EAAE,aAAa,CAAC,QAAQ,EAAE;gBACnC,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;aAC/B;YACH,CAAC,CAAC,SAAS;KACd,CAAC,CAAC;IACH,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE3B,MAAM,cAAc,GAAG,UAAU;SAC9B,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CACjB,SAA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,IAAI,IAAI,CAAC;QACT,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,MAAM,GAAG,MAAA,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,0CAAE,QAAQ,CAAC;YACxC,IAAI,CAAC,MAAM;gBAAE,SAAS;YAEtB,IAAI,GAAG,IAAA,2BAAiB,EAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1C,IAAI,CAAC,IAAI;gBAAE,SAAS;YAEpB,QAAQ,CAAC,IAAI,CACX,IAAA,6BAAwB,EACtB,KAAK,EACL,0BAAS,CAAC,GAAG,EACb,IAAI,CAAC,WAAW,EAChB,IAAI,sBAAS,CAAC,IAAI,CAAC,WAAW,CAAC,EAC/B,IAAI,sBAAS,CAAC,IAAI,CAAC,WAAW,CAAC,EAC/B,IAAI,sBAAS,CAAC,IAAI,CAAC,kBAAkB,CAAC,EACtC,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,SAAS,CACf,CACF,CAAC;YACF,UAAU,CAAC,IAAI,CAAC;gBACd,GAAG,EAAE,MAAM;gBACX,KAAK,EAAE,IAAI;aACZ,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE;QAC/B,MAAM,EAAE,2BAAe;QACvB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;IAEH,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC9B,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"}
@@ -5,7 +5,7 @@ export declare const addressPrefix = "scallop-address";
5
5
  export declare const marketPrefix = "scallop-market";
6
6
  export declare const poolsPrefix = "scallop-pools";
7
7
  export declare const spoolsPrefix = "scallop-spoolsmarket";
8
- export declare const addressEndpoint = "https://sui.api.scallop.io/addresses/6462a088a7ace142bb6d7e9b";
8
+ export declare const addressEndpoint = "https://sui.apis.scallop.io/addresses/664dfe22898c36c159e28bc8";
9
9
  export declare const addressKey = "scallop-address-key";
10
10
  export declare const marketKey = "scallop-market-key";
11
11
  export declare const poolsKey = "scallop-pools-key";
@@ -13,7 +13,7 @@ exports.addressPrefix = `${exports.platformId}-address`;
13
13
  exports.marketPrefix = `${exports.platformId}-market`;
14
14
  exports.poolsPrefix = `${exports.platformId}-pools`;
15
15
  exports.spoolsPrefix = `${exports.platformId}-spoolsmarket`;
16
- exports.addressEndpoint = 'https://sui.api.scallop.io/addresses/6462a088a7ace142bb6d7e9b';
16
+ exports.addressEndpoint = 'https://sui.apis.scallop.io/addresses/664dfe22898c36c159e28bc8';
17
17
  exports.addressKey = 'scallop-address-key';
18
18
  exports.marketKey = 'scallop-market-key';
19
19
  exports.poolsKey = 'scallop-pools-key';
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/scallop/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,qCAAqC,kBAAU,OAAO;IAC7D,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,yBAAyB;CACnC,CAAC;AAEW,QAAA,aAAa,GAAG,GAAG,kBAAU,UAAU,CAAC;AACxC,QAAA,YAAY,GAAG,GAAG,kBAAU,SAAS,CAAC;AACtC,QAAA,WAAW,GAAG,GAAG,kBAAU,QAAQ,CAAC;AACpC,QAAA,YAAY,GAAG,GAAG,kBAAU,eAAe,CAAC;AAE5C,QAAA,eAAe,GAC1B,+DAA+D,CAAC;AACrD,QAAA,UAAU,GAAG,qBAAqB,CAAC;AACnC,QAAA,SAAS,GAAG,oBAAoB,CAAC;AACjC,QAAA,QAAQ,GAAG,mBAAmB,CAAC;AAC/B,QAAA,SAAS,GAAG,0BAA0B,CAAC;AAEvC,QAAA,qBAAqB,GAAG,iGAAiG,CAAC;AACvI,MAAM,kBAAkB,GACtB,oEAAoE,CAAC;AAC1D,QAAA,mBAAmB,GAAG,GAAG,kBAAkB,uBAAuB,CAAC;AACnE,QAAA,sBAAsB,GAAG,GAAG,kBAAkB,6BAA6B,CAAC;AAC5E,QAAA,aAAa,GAAG,UAAa,CAAC;AAC9B,QAAA,UAAU,GACrB,8EAA8E,CAAC;AACpE,QAAA,WAAW,GAAG,CAAC,CAAC;AAEhB,QAAA,OAAO,GAClB,oEAAoE,CAAC;AAC1D,QAAA,UAAU,GACrB,+DAA+D,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/scallop/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,qCAAqC,kBAAU,OAAO;IAC7D,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,yBAAyB;CACnC,CAAC;AAEW,QAAA,aAAa,GAAG,GAAG,kBAAU,UAAU,CAAC;AACxC,QAAA,YAAY,GAAG,GAAG,kBAAU,SAAS,CAAC;AACtC,QAAA,WAAW,GAAG,GAAG,kBAAU,QAAQ,CAAC;AACpC,QAAA,YAAY,GAAG,GAAG,kBAAU,eAAe,CAAC;AAE5C,QAAA,eAAe,GAC1B,gEAAgE,CAAC;AACtD,QAAA,UAAU,GAAG,qBAAqB,CAAC;AACnC,QAAA,SAAS,GAAG,oBAAoB,CAAC;AACjC,QAAA,QAAQ,GAAG,mBAAmB,CAAC;AAC/B,QAAA,SAAS,GAAG,0BAA0B,CAAC;AAEvC,QAAA,qBAAqB,GAAG,iGAAiG,CAAC;AACvI,MAAM,kBAAkB,GACtB,oEAAoE,CAAC;AAC1D,QAAA,mBAAmB,GAAG,GAAG,kBAAkB,uBAAuB,CAAC;AACnE,QAAA,sBAAsB,GAAG,GAAG,kBAAkB,6BAA6B,CAAC;AAC5E,QAAA,aAAa,GAAG,UAAa,CAAC;AAC9B,QAAA,UAAU,GACrB,8EAA8E,CAAC;AACpE,QAAA,WAAW,GAAG,CAAC,CAAC;AAEhB,QAAA,OAAO,GAClB,oEAAoE,CAAC;AAC1D,QAAA,UAAU,GACrB,+DAA+D,CAAC"}
@@ -132,13 +132,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
132
132
  }));
133
133
  yield (0, runInBatch_1.default)(debtsAndCollateralCalculationPromises, 5); // run in batch of size 2, calculate 5 obligation account per batch
134
134
  const tokenAddresses = ctmValues.map((value) => value.coinType);
135
- const tokenPriceResult = yield cache.getTokenPrices(tokenAddresses, portfolio_core_1.NetworkId.sui);
136
- const tokenPrices = new Map();
137
- tokenPriceResult.forEach((r) => {
138
- if (!r)
139
- return;
140
- tokenPrices.set(r.address, r);
141
- });
135
+ const tokenPrices = yield cache.getTokenPricesAsMap(tokenAddresses, portfolio_core_1.NetworkId.sui);
142
136
  for (const account of Object.keys(userObligations)) {
143
137
  const borrowedAssets = [];
144
138
  const borrowedYields = [];
@@ -1 +1 @@
1
- {"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/scallop/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAUoC;AACpC,gDAA0D;AAC1D,gEAAqC;AAIrC,2CAOqB;AAQrB,uCAA2C;AAC3C,iDAAmD;AACnD,qGAA6E;AAC7E,6EAAqD;AAErD,qEAAkE;AAClE,yDAAsD;AACtD,iFAA8E;AAE9E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GA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EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CAAC;QAC5E,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,GAAG,IAAA,wBAAc,EAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,cAAc;YACpD,KAAK;YACL,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,WAAW;gBACX,YAAY;gBACZ,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/scallop/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gDAA0D;AAC1D,gEAAqC;AAIrC,2CAOqB;AAQrB,uCAA2C;AAC3C,iDAAmD;AACnD,qGAA6E;AAC7E,6EAAqD;AAErD,qEAAkE;AAClE,yDAAsD;AACtD,iFAA8E;AAE9E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,QAAQ,GAAuB,EAAE,CAAC;IACxC,MAAM,YAAY,GAAqB,EAAE,CAAC;IAE1C,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,OAAO,CAAQ,oBAAQ,EAAE;QAC5D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gBACZ,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,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;
@@ -42,20 +42,20 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
42
42
  const clients_1 = require("../../utils/clients");
43
43
  const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
44
44
  const helpers_1 = require("./helpers");
45
- const query = (0, graphql_request_1.gql) `
46
- query GetAirdropFinalFrontend($authority: String!) {
47
- getAirdropFinalFrontend(authority: $authority) {
48
- authority
49
- community_allocation
50
- eligibility
51
- main_allocation
52
- og_allocation
53
- s1_allocation
54
- s2_allocation
55
- total_allocation
56
- __typename
57
- }
58
- }
45
+ const query = (0, graphql_request_1.gql) `
46
+ query GetAirdropFinalFrontend($authority: String!) {
47
+ getAirdropFinalFrontend(authority: $authority) {
48
+ authority
49
+ community_allocation
50
+ eligibility
51
+ main_allocation
52
+ og_allocation
53
+ s1_allocation
54
+ s2_allocation
55
+ total_allocation
56
+ __typename
57
+ }
58
+ }
59
59
  `;
60
60
  const networkId = portfolio_core_1.NetworkId.solana;
61
61
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
@@ -66,10 +66,10 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
66
66
  referrer: 'https://token.zeta.markets/',
67
67
  'X-Api-Key': 'da2-rrupjjccivdndc6rvltixlmsma',
68
68
  }).catch(() => null);
69
- if (!res)
69
+ if (!res || !res.getAirdropFinalFrontend)
70
70
  return [];
71
71
  const amount = res.getAirdropFinalFrontend.total_allocation;
72
- if (amount === 0)
72
+ if (!amount || amount === 0)
73
73
  return [];
74
74
  const claimStatuses = (0, helpers_1.deriveZetaClaimStatuses)(owner, constants_1.distributors);
75
75
  const client = (0, clients_1.getClientSolana)();
@@ -1 +1 @@
1
- {"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAuE;AACvE,mEAA+C;AAG/C,2CAA4E;AAE5E,qGAA6E;AAC7E,iDAAsD;AACtD,gGAA6F;AAC7F,uCAAoD;AAEpD,MAAM,KAAK,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;CAchB,CAAC;AAEF,MAAM,SAAS,GAAG,0BAAS,CAAC,MAAM,CAAC;AAEnC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,GAAG,GAAG,MAAM,IAAA,yBAAO,EACvB,sBAAU,EACV,KAAK,EACL;QACE,SAAS,EAAE,KAAK;KACjB,EACD;QACE,MAAM,EAAE,4BAA4B;QACpC,QAAQ,EAAE,6BAA6B;QACvC,WAAW,EAAE,gCAAgC;KAC9C,CACF,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAEpB,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IAEpB,MAAM,MAAM,GAAG,GAAG,CAAC,uBAAuB,CAAC,gBAAgB,CAAC;IAE5D,IAAI,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE5B,MAAM,aAAa,GAAG,IAAA,iCAAuB,EAAC,KAAK,EAAE,wBAAY,CAAC,CAAC;IAEnE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,oBAAoB,GAAG,MAAM,IAAA,yDAA2B,EAC5D,MAAM,EACN,aAAa,CACd,CAAC;IAEF,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IAE/D,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,mBAAO,EAAE,SAAS,CAAC,CAAC;IACjE,MAAM,KAAK,GAAmB,UAAU;QACtC,CAAC,CAAC,IAAA,gCAAsB,EACpB,UAAU,CAAC,OAAO,EAClB,MAAM,EACN,SAAS,EACT,UAAU,EACV,SAAS,EACT,EAAE,WAAW,EAAE,aAAa,EAAE,CAC/B;QACH,CAAC,CAAC;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EACN,8HAA8H;YAChI,IAAI,EAAE,KAAK;YACX,IAAI,EAAE;gBACJ,OAAO,EAAE,mBAAO;gBAChB,MAAM;gBACN,KAAK,EAAE,IAAI;aACZ;YACD,KAAK,EAAE,IAAI;YACX,SAAS;YACT,UAAU,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE;SAC3C,CAAC;IAEN,OAAO;QACL;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,SAAS;YACT,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;YACD,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS;IACT,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AsB,EACpB,UAAU,CAAC,OAAO,EAClB,MAAM,EACN,SAAS,EACT,UAAU,EACV,SAAS,EACT,EAAE,WAAW,EAAE,aAAa,EAAE,CAC/B;QACH,CAAC,CAAC;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EACN,8HAA8H;YAChI,IAAI,EAAE,KAAK;YACX,IAAI,EAAE;gBACJ,OAAO,EAAE,mBAAO;gBAChB,MAAM;gBACN,KAAK,EAAE,IAAI;aACZ;YACD,KAAK,EAAE,IAAI;YACX,SAAS;YACT,UAAU,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE;SAC3C,CAAC;IAEN,OAAO;QACL;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,SAAS;YACT,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;YACD,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS;IACT,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -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;
@@ -15,10 +15,12 @@ function queryEvents(client, query) {
15
15
  let hasNextPage = true;
16
16
  let cursor;
17
17
  const objects = [];
18
+ let res;
18
19
  do {
19
- const res = yield client.queryEvents({
20
+ res = yield client.queryEvents({
20
21
  cursor,
21
22
  query,
23
+ limit: 50,
22
24
  });
23
25
  objects.push(...res.data);
24
26
  cursor = res.nextCursor;
@@ -1 +1 @@
1
- {"version":3,"file":"queryEvents.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/sui/queryEvents.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,SAAsB,WAAW,CAAI,MAAiB,EAAE,KAAqB;;QAC3E,IAAI,WAAW,GAAG,IAAI,CAAC;QACvB,IAAI,MAAkC,CAAC;QAEvC,MAAM,OAAO,GAAG,EAAE,CAAC;QAEnB,GAAG,CAAC;YACF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC;gBACnC,MAAM;gBACN,KAAK;aACN,CAAC,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;YAC1B,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC;YACxB,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;QAChC,CAAC,QAAQ,WAAW,EAAE;QACtB,OAAO,OAAqB,CAAC;IAC/B,CAAC;CAAA;AAhBD,kCAgBC"}
1
+ {"version":3,"file":"queryEvents.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/sui/queryEvents.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,SAAsB,WAAW,CAAI,MAAiB,EAAE,KAAqB;;QAC3E,IAAI,WAAW,GAAG,IAAI,CAAC;QACvB,IAAI,MAAkC,CAAC;QAEvC,MAAM,OAAO,GAAG,EAAE,CAAC;QAEnB,IAAI,GAAG,CAAC;QACR,GAAG,CAAC;YACF,GAAG,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC;gBAC7B,MAAM;gBACN,KAAK;gBACL,KAAK,EAAE,EAAE;aACV,CAAC,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;YAC1B,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC;YACxB,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;QAChC,CAAC,QAAQ,WAAW,EAAE;QACtB,OAAO,OAAqB,CAAC;IAC/B,CAAC;CAAA;AAlBD,kCAkBC"}
@@ -16,9 +16,10 @@ function queryEventsSafe(client, query) {
16
16
  let page = 0;
17
17
  let hasNextPage = true;
18
18
  let cursor;
19
+ let res;
19
20
  const objects = [];
20
21
  do {
21
- const res = yield client.queryEvents({
22
+ res = yield client.queryEvents({
22
23
  cursor,
23
24
  query,
24
25
  });
@@ -1 +1 @@
1
- {"version":3,"file":"queryEventsSafe.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/sui/queryEventsSafe.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,MAAM,OAAO,GAAG,EAAE,CAAC;AAEnB,SAAsB,eAAe,CACnC,MAAiB,EACjB,KAAqB;;QAErB,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,IAAI,WAAW,GAAG,IAAI,CAAC;QACvB,IAAI,MAAkC,CAAC;QAEvC,MAAM,OAAO,GAAG,EAAE,CAAC;QAEnB,GAAG,CAAC;YACF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC;gBACnC,MAAM;gBACN,KAAK;aACN,CAAC,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,GAAI,GAAG,CAAC,IAAmB,CAAC,CAAC;YAC1C,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC;YACxB,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;YAC9B,IAAI,IAAI,CAAC,CAAC;QACZ,CAAC,QAAQ,WAAW,IAAI,IAAI,IAAI,OAAO,EAAE;QACzC,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA;AArBD,0CAqBC"}
1
+ {"version":3,"file":"queryEventsSafe.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/sui/queryEventsSafe.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,MAAM,OAAO,GAAG,EAAE,CAAC;AAEnB,SAAsB,eAAe,CACnC,MAAiB,EACjB,KAAqB;;QAErB,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,IAAI,WAAW,GAAG,IAAI,CAAC;QACvB,IAAI,MAAkC,CAAC;QACvC,IAAI,GAAG,CAAC;QACR,MAAM,OAAO,GAAG,EAAE,CAAC;QAEnB,GAAG,CAAC;YACF,GAAG,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC;gBAC7B,MAAM;gBACN,KAAK;aACN,CAAC,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,GAAI,GAAG,CAAC,IAAmB,CAAC,CAAC;YAC1C,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC;YACxB,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;YAC9B,IAAI,IAAI,CAAC,CAAC;QACZ,CAAC,QAAQ,WAAW,IAAI,IAAI,IAAI,OAAO,EAAE;QACzC,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA;AArBD,0CAqBC"}