@sonarwatch/portfolio-plugins 0.11.219 → 0.11.221

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +2 -2
  3. package/src/index.js +8 -0
  4. package/src/index.js.map +1 -1
  5. package/src/plugins/cropper/clmmJob.d.ts +3 -0
  6. package/src/plugins/cropper/clmmJob.js +15 -0
  7. package/src/plugins/cropper/clmmJob.js.map +1 -0
  8. package/src/plugins/cropper/constants.d.ts +5 -0
  9. package/src/plugins/cropper/constants.js +15 -0
  10. package/src/plugins/cropper/constants.js.map +1 -0
  11. package/src/plugins/cropper/helpers.d.ts +2 -0
  12. package/src/plugins/cropper/helpers.js +9 -0
  13. package/src/plugins/cropper/helpers.js.map +1 -0
  14. package/src/plugins/cropper/index.d.ts +6 -0
  15. package/src/plugins/cropper/index.js +12 -0
  16. package/src/plugins/cropper/index.js.map +1 -0
  17. package/src/plugins/hedgehog/ammJob.d.ts +3 -0
  18. package/src/plugins/hedgehog/ammJob.js +119 -0
  19. package/src/plugins/hedgehog/ammJob.js.map +1 -0
  20. package/src/plugins/hedgehog/constants.d.ts +6 -0
  21. package/src/plugins/hedgehog/constants.js +16 -0
  22. package/src/plugins/hedgehog/constants.js.map +1 -0
  23. package/src/plugins/hedgehog/index.d.ts +6 -0
  24. package/src/plugins/hedgehog/index.js +12 -0
  25. package/src/plugins/hedgehog/index.js.map +1 -0
  26. package/src/plugins/hedgehog/structs.d.ts +40 -0
  27. package/src/plugins/hedgehog/structs.js +41 -0
  28. package/src/plugins/hedgehog/structs.js.map +1 -0
  29. package/src/plugins/navi/collateralFetcher.js +7 -5
  30. package/src/plugins/navi/collateralFetcher.js.map +1 -1
  31. package/src/plugins/orca/getWhirlpoolPositions.d.ts +4 -3
  32. package/src/plugins/orca/getWhirlpoolPositions.js +7 -6
  33. package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
  34. package/src/plugins/orca/getWhirlpoolsJob.d.ts +3 -0
  35. package/src/plugins/orca/getWhirlpoolsJob.js +47 -0
  36. package/src/plugins/orca/getWhirlpoolsJob.js.map +1 -0
  37. package/src/plugins/orca/structs/whirlpool.d.ts +0 -5
  38. package/src/plugins/orca/structs/whirlpool.js.map +1 -1
  39. package/src/plugins/orca/whirlpoolsJob.js +2 -33
  40. package/src/plugins/orca/whirlpoolsJob.js.map +1 -1
  41. package/src/plugins/raydium/clmmJob.js +1 -1
  42. package/src/plugins/raydium/clmmJob.js.map +1 -1
  43. package/src/plugins/raydium/constants.d.ts +1 -0
  44. package/src/plugins/raydium/constants.js +2 -1
  45. package/src/plugins/raydium/constants.js.map +1 -1
  46. package/src/plugins/raydium/cpmmJob.d.ts +3 -0
  47. package/src/plugins/raydium/cpmmJob.js +98 -0
  48. package/src/plugins/raydium/cpmmJob.js.map +1 -0
  49. package/src/plugins/raydium/filters.d.ts +2 -1
  50. package/src/plugins/raydium/filters.js +5 -2
  51. package/src/plugins/raydium/filters.js.map +1 -1
  52. package/src/plugins/raydium/index.js +2 -1
  53. package/src/plugins/raydium/index.js.map +1 -1
  54. package/src/plugins/raydium/structs/cpmm.d.ts +30 -0
  55. package/src/plugins/raydium/structs/cpmm.js +32 -0
  56. package/src/plugins/raydium/structs/cpmm.js.map +1 -0
  57. package/src/plugins/scallop/cnyAirdropFetcher.d.ts +3 -0
  58. package/src/plugins/scallop/cnyAirdropFetcher.js +79 -0
  59. package/src/plugins/scallop/cnyAirdropFetcher.js.map +1 -0
  60. package/src/plugins/scallop/constants.d.ts +2 -0
  61. package/src/plugins/scallop/constants.js +3 -1
  62. package/src/plugins/scallop/constants.js.map +1 -1
  63. package/src/plugins/scallop/index.js +2 -0
  64. package/src/plugins/scallop/index.js.map +1 -1
  65. package/src/plugins/scallop/types/data.d.ts +29 -0
  66. package/src/plugins/tokens/fetchers/solana-nfts-underlyings.js +43 -24
  67. package/src/plugins/tokens/fetchers/solana-nfts-underlyings.js.map +1 -1
  68. package/src/plugins/tokens/fetchers/solana.js +2 -0
  69. package/src/plugins/tokens/fetchers/solana.js.map +1 -1
  70. package/src/plugins/tokens/types.d.ts +3 -0
  71. package/src/utils/misc/getLpTokenSourceRaw.js +1 -1
  72. package/src/utils/misc/getLpTokenSourceRaw.js.map +1 -1
  73. package/src/utils/misc/getLpUnderlyingTokenSource.js +6 -6
  74. package/src/utils/misc/getLpUnderlyingTokenSource.js.map +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.11.221](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.220...plugins-0.11.221) (2024-05-28)
6
+
7
+
8
+
9
+ ## [0.11.220](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.219...plugins-0.11.220) (2024-05-27)
10
+
11
+
12
+
5
13
  ## [0.11.219](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.218...plugins-0.11.219) (2024-05-27)
6
14
 
7
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.11.219",
3
+ "version": "0.11.221",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
@@ -42,7 +42,7 @@
42
42
  "web3-v1": "npm:web3@^1.5.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@sonarwatch/portfolio-core": "0.11.219"
45
+ "@sonarwatch/portfolio-core": "0.11.221"
46
46
  },
47
47
  "main": "./src/index.js",
48
48
  "types": "./src/index.d.ts"
package/src/index.js CHANGED
@@ -113,6 +113,8 @@ const haedal_1 = require("./plugins/haedal");
113
113
  const flowx_1 = require("./plugins/flowx");
114
114
  const mole_1 = require("./plugins/mole");
115
115
  const bonfida_1 = require("./plugins/bonfida");
116
+ const cropper_1 = require("./plugins/cropper");
117
+ const hedgehog_1 = require("./plugins/hedgehog");
116
118
  var constants_1 = require("./plugins/tokens/constants");
117
119
  Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
118
120
  Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
@@ -219,6 +221,8 @@ exports.platforms = [
219
221
  ...haedal_1.platforms,
220
222
  ...mole_1.platforms,
221
223
  ...bonfida_1.platforms,
224
+ ...cropper_1.platforms,
225
+ ...hedgehog_1.platforms,
222
226
  ];
223
227
  // JOBS //
224
228
  exports.jobs = [
@@ -308,6 +312,8 @@ exports.jobs = [
308
312
  ...flowx_1.jobs,
309
313
  ...mole_1.jobs,
310
314
  ...bonfida_1.jobs,
315
+ ...cropper_1.jobs,
316
+ ...hedgehog_1.jobs,
311
317
  ];
312
318
  // FETCHERS //
313
319
  exports.fetchers = [
@@ -399,6 +405,8 @@ exports.fetchers = [
399
405
  ...flowx_1.fetchers,
400
406
  ...mole_1.fetchers,
401
407
  ...bonfida_1.fetchers,
408
+ ...cropper_1.fetchers,
409
+ ...hedgehog_1.fetchers,
402
410
  ];
403
411
  exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
404
412
  exports.airdropFetchers = [
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,6CAI0B;AAC1B,+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;AA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B;IACnB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,kBAAe;IAClB,GAAG,cAAW;IACd,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;CACnB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,sBAAmB;IACnB,sBAAmB;CACpB,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
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,6CAI0B;AAC1B,+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,qDA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Ac;IACjB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;CACpB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,sBAAmB;IACnB,sBAAmB;CACpB,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const getWhirlpoolsJob_1 = __importDefault(require("../orca/getWhirlpoolsJob"));
7
+ const constants_1 = require("./constants");
8
+ // Based on Orca Whirlpools (CLMM)
9
+ const job = {
10
+ id: `${constants_1.platformId}-clmm`,
11
+ executor: (0, getWhirlpoolsJob_1.default)(constants_1.clmmPid),
12
+ label: 'normal',
13
+ };
14
+ exports.default = job;
15
+ //# sourceMappingURL=clmmJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clmmJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cropper/clmmJob.ts"],"names":[],"mappings":";;;;;AACA,gFAAwD;AACxD,2CAAkD;AAElD,kCAAkC;AAClC,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,QAAQ,EAAE,IAAA,0BAAgB,EAAC,mBAAO,CAAC;IACnC,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import { Platform } from '@sonarwatch/portfolio-core';
3
+ export declare const platformId = "cropper";
4
+ export declare const platform: Platform;
5
+ export declare const clmmPid: PublicKey;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clmmPid = exports.platform = exports.platformId = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
5
+ exports.platformId = 'cropper';
6
+ exports.platform = {
7
+ id: exports.platformId,
8
+ name: 'Cropper',
9
+ image: 'https://sonar.watch/img/platforms/cropper.webp',
10
+ website: 'https://cropper.finance/',
11
+ twitter: 'https://twitter.com/CropperFinance',
12
+ defiLlamaId: 'cropper', // from https://defillama.com/docs/api
13
+ };
14
+ exports.clmmPid = new web3_js_1.PublicKey('H8W3ctz92svYg6mkn1UtGfu2aQr2fnUFHM1RhScEtQDt');
15
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cropper/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,oCAAoC;IAC7C,WAAW,EAAE,SAAS,EAAE,sCAAsC;CAC/D,CAAC;AAEW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { PortfolioAssetCollectible } from '@sonarwatch/portfolio-core';
2
+ export declare function isClmmPosition(nft: PortfolioAssetCollectible): boolean;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isClmmPosition = void 0;
4
+ function isClmmPosition(nft) {
5
+ var _a;
6
+ return ((_a = nft.data.name) === null || _a === void 0 ? void 0 : _a.startsWith('Cropper CLMM Position')) === true;
7
+ }
8
+ exports.isClmmPosition = isClmmPosition;
9
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cropper/helpers.ts"],"names":[],"mappings":";;;AAEA,SAAgB,cAAc,CAAC,GAA8B;;IAC3D,OAAO,CAAA,MAAA,GAAG,CAAC,IAAI,CAAC,IAAI,0CAAE,UAAU,CAAC,uBAAuB,CAAC,MAAK,IAAI,CAAC;AACrE,CAAC;AAFD,wCAEC"}
@@ -0,0 +1,6 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ import { Fetcher } from '../../Fetcher';
3
+ import { Job } from '../../Job';
4
+ export declare const platforms: Platform[];
5
+ export declare const jobs: Job[];
6
+ export declare const fetchers: Fetcher[];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fetchers = exports.jobs = exports.platforms = void 0;
7
+ const constants_1 = require("./constants");
8
+ const clmmJob_1 = __importDefault(require("./clmmJob"));
9
+ exports.platforms = [constants_1.platform];
10
+ exports.jobs = [clmmJob_1.default];
11
+ exports.fetchers = [];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/cropper/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,wDAAgC;AAEnB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,iBAAO,CAAC,CAAC;AACxB,QAAA,QAAQ,GAAc,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,119 @@
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 portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
+ const constants_1 = require("./constants");
14
+ const clients_1 = require("../../utils/clients");
15
+ const solana_1 = require("../../utils/solana");
16
+ const structs_1 = require("./structs");
17
+ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
18
+ const client = (0, clients_1.getClientSolana)();
19
+ const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.swapStruct, constants_1.ammPid, [
20
+ {
21
+ dataSize: structs_1.swapStruct.byteSize,
22
+ },
23
+ ]);
24
+ if (accounts.length === 0)
25
+ return;
26
+ const tokenSwapAddresses = accounts.map((a) => a.underlyingSwap);
27
+ const tokenSwapAccounts = (yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.tokenSwapStruct, tokenSwapAddresses)).filter((a) => a !== null);
28
+ // Token accounts
29
+ const tokenAccountAddresses = tokenSwapAccounts
30
+ .map((a) => [a.tokenAccountA, a.tokenAccountB])
31
+ .flat();
32
+ const tokenAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, tokenAccountAddresses);
33
+ const tokenAccountsMap = new Map();
34
+ tokenAccounts.forEach((a) => {
35
+ if (!a)
36
+ return;
37
+ tokenAccountsMap.set(a.pubkey.toString(), a);
38
+ });
39
+ // Mint accounts
40
+ const mintAddresses = tokenSwapAccounts
41
+ .map((a) => [a.mintA, a.mintB, a.tokenPool])
42
+ .flat();
43
+ const mintAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.mintAccountStruct, mintAddresses);
44
+ const mintAccountsMap = new Map();
45
+ mintAccounts.forEach((a) => {
46
+ if (!a)
47
+ return;
48
+ mintAccountsMap.set(a.pubkey.toString(), a);
49
+ });
50
+ const tokenPrices = yield cache.getTokenPricesAsMap(tokenSwapAccounts.map((a) => a.tokenPool.toString()), portfolio_core_1.NetworkId.solana);
51
+ const sources = [];
52
+ for (let i = 0; i < tokenSwapAccounts.length; i++) {
53
+ const acc = tokenSwapAccounts[i];
54
+ const poolMint = mintAccountsMap.get(acc.tokenPool.toString());
55
+ if (!poolMint)
56
+ continue;
57
+ const mintA = mintAccountsMap.get(acc.mintA.toString());
58
+ const mintB = mintAccountsMap.get(acc.mintB.toString());
59
+ if (!mintA || !mintB)
60
+ continue;
61
+ const tokenAccountA = tokenAccountsMap.get(acc.tokenAccountA.toString());
62
+ const tokenAccountB = tokenAccountsMap.get(acc.tokenAccountB.toString());
63
+ if (!tokenAccountA || !tokenAccountB)
64
+ continue;
65
+ if (tokenAccountA.amount.isZero())
66
+ continue;
67
+ if (tokenAccountB.amount.isZero())
68
+ continue;
69
+ const tokenPrice = tokenPrices.get(acc.tokenPool.toString());
70
+ if (!tokenPrice)
71
+ continue;
72
+ const totalAmount = tokenAccountA.amount.plus(tokenAccountB.amount);
73
+ const priceA = totalAmount
74
+ .plus(tokenAccountA.amount)
75
+ .div(totalAmount)
76
+ .minus(1)
77
+ .times(tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.price)
78
+ .toNumber();
79
+ const priceB = totalAmount
80
+ .plus(tokenAccountB.amount)
81
+ .div(totalAmount)
82
+ .minus(1)
83
+ .times(tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.price)
84
+ .toNumber();
85
+ const sourceA = {
86
+ address: mintA.pubkey.toString(),
87
+ decimals: mintA.decimals,
88
+ id: constants_1.platformId,
89
+ networkId: portfolio_core_1.NetworkId.solana,
90
+ platformId: constants_1.platformId,
91
+ timestamp: Date.now(),
92
+ elementName: 'Hedgehog AMM',
93
+ liquidityName: 'Bet - YES',
94
+ weight: 1,
95
+ price: priceA,
96
+ };
97
+ const sourceB = {
98
+ address: mintB.pubkey.toString(),
99
+ decimals: mintB.decimals,
100
+ id: constants_1.platformId,
101
+ networkId: portfolio_core_1.NetworkId.solana,
102
+ platformId: constants_1.platformId,
103
+ timestamp: Date.now(),
104
+ elementName: 'Hedgehog AMM',
105
+ liquidityName: 'Bet - YES',
106
+ weight: 1,
107
+ price: priceB,
108
+ };
109
+ sources.push(sourceA, sourceB);
110
+ }
111
+ yield cache.setTokenPriceSources(sources);
112
+ });
113
+ const job = {
114
+ id: `${constants_1.platformId}-amm`,
115
+ executor,
116
+ label: 'normal',
117
+ };
118
+ exports.default = job;
119
+ //# sourceMappingURL=ammJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ammJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/ammJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AAGzE,2CAAiD;AACjD,iDAAsD;AACtD,+CAQ4B;AAC5B,uCAAmE;AAEnE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAAC,MAAM,EAAE,oBAAU,EAAE,kBAAM,EAAE;QAC1E;YACE,QAAQ,EAAE,oBAAU,CAAC,QAAQ;SAC9B;KACF,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAClC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,GAAG,CAAC,CA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AM;YAC3B,UAAU,EAAV,sBAAU;YACV,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,WAAW,EAAE,cAAc;YAC3B,aAAa,EAAE,WAAW;YAC1B,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,MAAM;SACd,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,MAAM;IACvB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import { Platform } from '@sonarwatch/portfolio-core';
3
+ export declare const platformId = "hedgehog";
4
+ export declare const platform: Platform;
5
+ export declare const ammPid: PublicKey;
6
+ export declare const swapPid: PublicKey;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.swapPid = exports.ammPid = exports.platform = exports.platformId = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
5
+ exports.platformId = 'hedgehog';
6
+ exports.platform = {
7
+ id: exports.platformId,
8
+ name: 'Hedgehog Markets',
9
+ image: 'https://sonar.watch/img/platforms/hedgehog.webp',
10
+ website: 'https://hedgehog.markets',
11
+ twitter: 'https://twitter.com/HedgehogMarket',
12
+ // defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
13
+ };
14
+ exports.ammPid = new web3_js_1.PublicKey('Hr4whNgXr3yZsJvx3TVSwfsFgXuSEPB1xKmvgrtLhsrM');
15
+ exports.swapPid = new web3_js_1.PublicKey('2ZznCMfx2XP43zaPw9R9wKnjXWiEeEexyhdBPv3UqDtD');
16
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,oCAAoC;IAC7C,qEAAqE;CACtE,CAAC;AACW,QAAA,MAAM,GAAG,IAAI,mBAAS,CACjC,8CAA8C,CAC/C,CAAC;AACW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ import { Fetcher } from '../../Fetcher';
3
+ import { Job } from '../../Job';
4
+ export declare const platforms: Platform[];
5
+ export declare const jobs: Job[];
6
+ export declare const fetchers: Fetcher[];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fetchers = exports.jobs = exports.platforms = void 0;
7
+ const constants_1 = require("./constants");
8
+ const ammJob_1 = __importDefault(require("./ammJob"));
9
+ exports.platforms = [constants_1.platform];
10
+ exports.jobs = [ammJob_1.default];
11
+ exports.fetchers = [];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sDAA8B;AAEjB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,gBAAM,CAAC,CAAC;AACvB,QAAA,QAAQ,GAAc,EAAE,CAAC"}
@@ -0,0 +1,40 @@
1
+ /// <reference types="node" />
2
+ import { BeetStruct } from '@metaplex-foundation/beet';
3
+ import { PublicKey } from '@solana/web3.js';
4
+ import BigNumber from 'bignumber.js';
5
+ export type Swap = {
6
+ buffer: Buffer;
7
+ underlyingSwap: PublicKey;
8
+ creator: PublicKey;
9
+ fees: Buffer;
10
+ index: BigNumber;
11
+ volume: BigNumber;
12
+ nonce: number;
13
+ padding: Buffer;
14
+ };
15
+ export declare const swapStruct: BeetStruct<Swap, Partial<Swap>>;
16
+ export type TokenSwap = {
17
+ buffer: Buffer;
18
+ version: number;
19
+ isInitialized: number;
20
+ bumpSeed: number;
21
+ tokenProgramId: PublicKey;
22
+ mintA: PublicKey;
23
+ mintB: PublicKey;
24
+ tokenPool: PublicKey;
25
+ tokenAccountA: PublicKey;
26
+ tokenAccountB: PublicKey;
27
+ feeAccount: PublicKey;
28
+ tradeFeeNumerator: BigNumber;
29
+ tradeFeeDenominator: BigNumber;
30
+ ownerTradeFeeNumerator: BigNumber;
31
+ ownerTradeFeeDenominator: BigNumber;
32
+ ownerWithdrawFeeNumerator: BigNumber;
33
+ ownerWithdrawFeeDenominator: BigNumber;
34
+ hostFeeNumerator: BigNumber;
35
+ hostFeeDenominator: BigNumber;
36
+ curveType: number;
37
+ curveParameters: Buffer;
38
+ swapGuardian: PublicKey;
39
+ };
40
+ export declare const tokenSwapStruct: BeetStruct<TokenSwap, Partial<TokenSwap>>;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tokenSwapStruct = exports.swapStruct = void 0;
4
+ const beet_1 = require("@metaplex-foundation/beet");
5
+ const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
+ const solana_1 = require("../../utils/solana");
7
+ exports.swapStruct = new beet_1.BeetStruct([
8
+ ['buffer', (0, solana_1.blob)(8)],
9
+ ['underlyingSwap', beet_solana_1.publicKey],
10
+ ['creator', beet_solana_1.publicKey],
11
+ ['fees', (0, solana_1.blob)(12)],
12
+ ['index', solana_1.u64],
13
+ ['volume', solana_1.u128],
14
+ ['nonce', beet_1.u8],
15
+ ['padding', (0, solana_1.blob)(32)],
16
+ ], (args) => args);
17
+ exports.tokenSwapStruct = new beet_1.BeetStruct([
18
+ ['buffer', (0, solana_1.blob)(5)],
19
+ ['version', beet_1.u8],
20
+ ['isInitialized', beet_1.u8],
21
+ ['bumpSeed', beet_1.u8],
22
+ ['tokenProgramId', beet_solana_1.publicKey],
23
+ ['mintA', beet_solana_1.publicKey],
24
+ ['mintB', beet_solana_1.publicKey],
25
+ ['tokenPool', beet_solana_1.publicKey],
26
+ ['tokenAccountA', beet_solana_1.publicKey],
27
+ ['tokenAccountB', beet_solana_1.publicKey],
28
+ ['feeAccount', beet_solana_1.publicKey],
29
+ ['tradeFeeNumerator', solana_1.u64],
30
+ ['tradeFeeDenominator', solana_1.u64],
31
+ ['ownerTradeFeeNumerator', solana_1.u64],
32
+ ['ownerTradeFeeDenominator', solana_1.u64],
33
+ ['ownerWithdrawFeeNumerator', solana_1.u64],
34
+ ['ownerWithdrawFeeDenominator', solana_1.u64],
35
+ ['hostFeeNumerator', solana_1.u64],
36
+ ['hostFeeDenominator', solana_1.u64],
37
+ ['curveType', beet_1.u8],
38
+ ['curveParameters', (0, solana_1.blob)(32)],
39
+ ['swapGuardian', beet_solana_1.publicKey],
40
+ ], (args) => args);
41
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/structs.ts"],"names":[],"mappings":";;;AAAA,oDAA2D;AAC3D,kEAA6D;AAG7D,+CAAqD;AAaxC,QAAA,UAAU,GAAG,IAAI,iBAAU,CACtC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,gBAAgB,EAAE,uBAAS,CAAC;IAC7B,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CA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EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC"}
@@ -98,11 +98,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
98
98
  }
99
99
  if (rewards.size > 0) {
100
100
  rewards.forEach((amount, coinType) => {
101
- const tokenPrice = tokenPrices.get((0, portfolio_core_1.formatTokenAddress)(coinType, portfolio_core_1.NetworkId.sui));
102
- if (tokenPrice) {
103
- rewardAssets.push((0, tokenPriceToAssetToken_1.default)(coinType, new bignumber_js_1.default(amount)
104
- .dividedBy(Math.pow(10, tokenPrice.decimals))
105
- .toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice));
101
+ if (amount > 0) {
102
+ const tokenPrice = tokenPrices.get((0, portfolio_core_1.formatTokenAddress)(coinType, portfolio_core_1.NetworkId.sui));
103
+ if (tokenPrice) {
104
+ rewardAssets.push((0, tokenPriceToAssetToken_1.default)(coinType, new bignumber_js_1.default(amount)
105
+ .dividedBy(Math.pow(10, tokenPrice.decimals))
106
+ .toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice));
107
+ }
106
108
  }
107
109
  });
108
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"collateralFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/navi/collateralFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AACnD,qGAA6E;AAE7E,iFAA8E;AAC9E,+DAA4D;AAE5D,MAAM,YAAY,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,EAAE,CAAA,CAAC,CAAC;AAE7C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,cAAc,GAAqB,EAAE,CAAC;I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S,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"collateralFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/navi/collateralFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AACnD,qGAA6E;AAE7E,iFAA8E;AAC9E,+DAA4D;AAE5D,MAAM,YAAY,GAAG,IAAI,sBAAS,CAAC,SAAA,EAAE,EAAI,EAAE,CAAA,CAAC,CAAC;AAE7C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,YAAY,GAAqB,EAAE,CAAC;IAC1C,MAAM,YAAY,GAAa,EAAE,CAAC;IAElC,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,OAAO,CAAgB,uBAAW,EAAE;QACnE,MAAM,EAAE,0BAAc;QACtB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;IACH,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAE7B,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC/C,KAAK,CAAC,mBAAmB,CACvB,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EACjD,0BAAS,CAAC,GAAG,CACd;QACD,IAAA,yCAAmB,EAAC,MAAM,EAAE,KAAK,CAAC;KACnC,CAAC,CAAC;IAEH,KAAK,M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QAEzB,OAAO,EAAE,CAAC;IAEZ,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EACrB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,CACb,CAAC;IACJ,MAAM,OAAO,GAAqB;QAChC,IAAI,EAAE,qCAAoB,CAAC,UAAU;QACrC,SAAS,EAAE,0BAAS,CAAC,GAAG;QACxB,UAAU,EAAV,sBAAU;QACV,KAAK,EAAE,SAAS;QAChB,KAAK;QACL,IAAI,EAAE;YACJ,cAAc;YACd,aAAa;YACb,cAAc;YACd,cAAc;YACd,aAAa;YACb,cAAc;YACd,eAAe,EAAE,IAAI;YACrB,WAAW;YACX,YAAY;YACZ,WAAW;YACX,KAAK;SACN;KACF,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,aAAa;IAC9B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -1,3 +1,4 @@
1
- import { PortfolioAssetCollectible, PortfolioElement } from '@sonarwatch/portfolio-core';
2
- import { Cache } from '../../Cache';
3
- export declare function getWhirlpoolPositions(cache: Cache, nfts: PortfolioAssetCollectible[]): Promise<PortfolioElement[]>;
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import { NftFetcher } from '../tokens/types';
3
+ export declare const getWhirlpoolPositions: NftFetcher;
4
+ export declare function getOrcaNftFetcher(platformId: string, programId: PublicKey): NftFetcher;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.getWhirlpoolPositions = void 0;
15
+ exports.getOrcaNftFetcher = exports.getWhirlpoolPositions = void 0;
16
16
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
17
  const web3_js_1 = require("@solana/web3.js");
18
18
  const constants_1 = require("./constants");
@@ -22,14 +22,15 @@ const whirlpool_1 = require("./structs/whirlpool");
22
22
  const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
23
23
  const runInBatch_1 = __importDefault(require("../../utils/misc/runInBatch"));
24
24
  const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
25
- function getWhirlpoolPositions(cache, nfts) {
26
- return __awaiter(this, void 0, void 0, function* () {
25
+ exports.getWhirlpoolPositions = getOrcaNftFetcher(constants_1.platformId, constants_1.whirlpoolProgram);
26
+ function getOrcaNftFetcher(platformId, programId) {
27
+ return (cache, nfts) => __awaiter(this, void 0, void 0, function* () {
27
28
  const client = (0, clients_1.getClientSolana)();
28
29
  const positionsProgramAddress = [];
29
30
  nfts.forEach((nft) => {
30
31
  const address = new web3_js_1.PublicKey(nft.data.address);
31
32
  const positionSeed = [Buffer.from('position'), address.toBuffer()];
32
- const [programAddress] = web3_js_1.PublicKey.findProgramAddressSync(positionSeed, constants_1.whirlpoolProgram);
33
+ const [programAddress] = web3_js_1.PublicKey.findProgramAddressSync(positionSeed, programId);
33
34
  positionsProgramAddress.push(programAddress);
34
35
  });
35
36
  if (positionsProgramAddress.length === 0)
@@ -111,7 +112,7 @@ function getWhirlpoolPositions(cache, nfts) {
111
112
  {
112
113
  type: portfolio_core_1.PortfolioElementType.liquidity,
113
114
  networkId: portfolio_core_1.NetworkId.solana,
114
- platformId: constants_1.platformId,
115
+ platformId,
115
116
  label: 'LiquidityPool',
116
117
  name: 'Concentrated',
117
118
  value: totalLiquidityValue,
@@ -122,5 +123,5 @@ function getWhirlpoolPositions(cache, nfts) {
122
123
  ];
123
124
  });
124
125
  }
125
- exports.getWhirlpoolPositions = getWhirlpoolPositions;
126
+ exports.getOrcaNftFetcher = getOrcaNftFetcher;
126
127
  //# sourceMappingURL=getWhirlpoolPositions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getWhirlpoolPositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/getWhirlpoolPositions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAC5C,2CAA4E;AAC5E,iDAAsD;AACtD,+CAG4B;AAE5B,mDAAgE;AAChE,qGAA6E;AAC7E,6EAAqD;AACrD,wFAAyF;AAEzF,SAAsB,qBAAqB,CACzC,KAAY,EACZ,IAAiC;;QAEjC,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;QACjC,MAAM,uBAAuB,GAAgB,EAAE,CAAC;QAEhD,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,OAAO,GAAG,IAAI,mBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEhD,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;YAEnE,MAAM,CAAC,cAAc,CAAC,GAAG,mBAAS,CAAC,sBAAsB,CACvD,YAAY,EACZ,4BAAgB,CACjB,CAAC;YACF,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAEpD,MAAM,aAAa,GAAG,MAAM,IAAA,sCAA6B,EACvD,MAAM,EACN,0BAAc,EACd,uBAAuB,CACxB,CAAC;QACF,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAE5D,MAAM,kBAAkB,GAAgB,IAAI,GAAG,EAAE,CAAC;QAClD,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC5B,IAAI,GAA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1
+ {"version":3,"file":"getWhirlpoolPositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/getWhirlpoolPositions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAC5C,2CAIqB;AACrB,iDAAsD;AACtD,+CAG4B;AAE5B,mDAAgE;AAChE,qGAA6E;AAC7E,6EAAqD;AACrD,wFAAyF;AAG5E,QAAA,qBAAqB,GAAG,iBAAiB,CACpD,sBAAc,EACd,4BAAgB,CACjB,CAAC;AAEF,SAAgB,iBAAiB,CAC/B,UAAkB,EAClB,SAAoB;IAEpB,OAAO,CACL,KAAY,EACZ,IAAiC,EACJ,EAAE;QAC/B,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;QACjC,MAAM,uBAAuB,GAAgB,EAAE,CAAC;QAEhD,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,OAAO,GAAG,IAAI,mBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEhD,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;YAEnE,MAAM,CAAC,cAAc,CAAC,GAAG,mBAAS,CAAC,sBAAsB,CACvD,YAAY,EACZ,SAAS,CACV,CAAC;YACF,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAEpD,MAAM,aAAa,GAAG,MAAM,IAAA,sCAA6B,EACvD,MAAM,EACN,0BAAc,EACd,uBAAuB,CACxB,CAAC;QACF,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAE5D,MAAM,kBAAkB,GAAgB,IAAI,GAAG,EAA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AAM;iBACpB;aACF;SACF,CAAC;IACJ,CAAC,CAAA,CAAC;AACJ,CAAC;AAlJD,8CAkJC"}
@@ -0,0 +1,3 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import { JobExecutor } from '../../Job';
3
+ export default function getWhirlpoolsJob(programId: PublicKey): JobExecutor;