@sonarwatch/portfolio-plugins 0.14.10 → 0.14.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/CHANGELOG.md +1636 -1628
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/plugins/balancer/helpers/pools.js +21 -21
  5. package/src/plugins/cetus/types.d.ts +109 -0
  6. package/src/plugins/jupiter/exchange/constants.js +1 -1
  7. package/src/plugins/jupiter/governance/asrAirdropFetcher.d.ts +3 -3
  8. package/src/plugins/jupiter/governance/asrAirdropFetcher.js +50 -71
  9. package/src/plugins/jupiter/governance/asrAirdropFetcher.js.map +1 -1
  10. package/src/plugins/jupiter/governance/constants.d.ts +12 -1
  11. package/src/plugins/jupiter/governance/constants.js +46 -2
  12. package/src/plugins/jupiter/governance/constants.js.map +1 -1
  13. package/src/plugins/jupiter/governance/index.d.ts +5 -0
  14. package/src/plugins/jupiter/governance/index.js +20 -0
  15. package/src/plugins/jupiter/governance/index.js.map +1 -0
  16. package/src/plugins/jupiter/index.js +5 -3
  17. package/src/plugins/jupiter/index.js.map +1 -1
  18. package/src/plugins/kriya/clmmsFetcher.d.ts +3 -0
  19. package/src/plugins/kriya/clmmsFetcher.js +81 -0
  20. package/src/plugins/kriya/clmmsFetcher.js.map +1 -0
  21. package/src/plugins/kriya/constants.d.ts +9 -4
  22. package/src/plugins/kriya/constants.js +48 -5
  23. package/src/plugins/kriya/constants.js.map +1 -1
  24. package/src/plugins/kriya/farmsFetcher.js.map +1 -1
  25. package/src/plugins/kriya/index.js +4 -0
  26. package/src/plugins/kriya/index.js.map +1 -1
  27. package/src/plugins/kriya/lpFetcher.d.ts +3 -0
  28. package/src/plugins/kriya/lpFetcher.js +80 -0
  29. package/src/plugins/kriya/lpFetcher.js.map +1 -0
  30. package/src/plugins/kriya/types/common.d.ts +46 -0
  31. package/src/plugins/kriya/types/common.js +9 -0
  32. package/src/plugins/kriya/types/common.js.map +1 -0
  33. package/src/plugins/kriya/types/farms.d.ts +55 -0
  34. package/src/plugins/kriya/{types.js → types/farms.js} +2 -1
  35. package/src/plugins/kriya/types/farms.js.map +1 -0
  36. package/src/plugins/kriya/types/pools.d.ts +131 -0
  37. package/src/plugins/kriya/types/pools.js +3 -0
  38. package/src/plugins/kriya/types/pools.js.map +1 -0
  39. package/src/plugins/kriya/{types.d.ts → types/vaults.d.ts} +104 -86
  40. package/src/plugins/kriya/types/vaults.js +3 -0
  41. package/src/plugins/kriya/types/vaults.js.map +1 -0
  42. package/src/plugins/kriya/vaultsFetcher.js +67 -59
  43. package/src/plugins/kriya/vaultsFetcher.js.map +1 -1
  44. package/src/plugins/kriya/vaultsJob.js +52 -16
  45. package/src/plugins/kriya/vaultsJob.js.map +1 -1
  46. package/src/plugins/native-stake/solana/solanaValidatorsJob.js +4 -0
  47. package/src/plugins/native-stake/solana/solanaValidatorsJob.js.map +1 -1
  48. package/src/plugins/native-stake/solana/types.d.ts +8 -0
  49. package/src/plugins/parcl/stakingFetcher.js +10 -24
  50. package/src/plugins/parcl/stakingFetcher.js.map +1 -1
  51. package/src/plugins/sushiswap/helpers.js +24 -24
  52. package/src/plugins/uniswap-v2/helpers.js +22 -22
  53. package/src/plugins/zeta/airdropFetcher.js +14 -14
  54. package/src/utils/elementbuilder/LiquidityBuilder.js +1 -1
  55. package/src/utils/elementbuilder/LiquidityBuilder.js.map +1 -1
  56. package/src/utils/sei/constants.js +8 -8
  57. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  58. package/src/plugins/kriya/types.js.map +0 -1
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.10",
3
+ "version": "0.14.12",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -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;
@@ -278,3 +278,112 @@ export type PosRewarderResult = {
278
278
  positionId: string;
279
279
  rewarderAmountOwed: RewarderAmountOwed[];
280
280
  };
281
+ export type CetusPool = {
282
+ coin_a: string;
283
+ coin_b: string;
284
+ current_sqrt_price: string;
285
+ current_tick_index: CurrentTickIndex;
286
+ fee_growth_global_a: string;
287
+ fee_growth_global_b: string;
288
+ fee_protocol_coin_a: string;
289
+ fee_protocol_coin_b: string;
290
+ fee_rate: string;
291
+ id: ID;
292
+ index: string;
293
+ is_pause: boolean;
294
+ liquidity: string;
295
+ position_manager: PositionManager;
296
+ rewarder_manager: RewarderManager;
297
+ tick_manager: TickManager;
298
+ tick_spacing: number;
299
+ url: string;
300
+ };
301
+ export type CurrentTickIndex = {
302
+ fields: CurrentTickIndexFields;
303
+ type: string;
304
+ };
305
+ export type CurrentTickIndexFields = {
306
+ bits: number;
307
+ };
308
+ export type PositionManager = {
309
+ fields: PositionManagerFields;
310
+ type: string;
311
+ };
312
+ export type PositionManagerFields = {
313
+ position_index: string;
314
+ positions: Positions;
315
+ tick_spacing: number;
316
+ };
317
+ export type Positions = {
318
+ fields: PositionsFields;
319
+ type: string;
320
+ };
321
+ export type PositionsFields = {
322
+ head: string;
323
+ id: ID;
324
+ size: string;
325
+ tail: string;
326
+ };
327
+ export type RewarderManager = {
328
+ fields: RewarderManagerFields;
329
+ type: string;
330
+ };
331
+ export type RewarderManagerFields = {
332
+ last_updated_time: string;
333
+ points_growth_global: string;
334
+ points_released: string;
335
+ rewarders: RewarderInfo[];
336
+ };
337
+ export type RewarderInfo = {
338
+ fields: RewarderFields;
339
+ type: string;
340
+ };
341
+ export type RewarderFields = {
342
+ emissions_per_second: string;
343
+ growth_global: string;
344
+ reward_coin: RewardCoin;
345
+ };
346
+ export type RewardCoin = {
347
+ fields: RewardCoinFields;
348
+ type: string;
349
+ };
350
+ export type RewardCoinFields = {
351
+ name: string;
352
+ };
353
+ export type TickManager = {
354
+ fields: TickManagerFields;
355
+ type: string;
356
+ };
357
+ export type TickManagerFields = {
358
+ tick_spacing: number;
359
+ ticks: Ticks;
360
+ };
361
+ export type Ticks = {
362
+ fields: TicksFields;
363
+ type: string;
364
+ };
365
+ export type TicksFields = {
366
+ head: Tail[];
367
+ id: ID;
368
+ level: string;
369
+ list_p: string;
370
+ max_level: string;
371
+ random: Random;
372
+ size: string;
373
+ tail: Tail;
374
+ };
375
+ export type Tail = {
376
+ fields: TailFields;
377
+ type: string;
378
+ };
379
+ export type TailFields = {
380
+ is_none: boolean;
381
+ v: string;
382
+ };
383
+ export type Random = {
384
+ fields: RandomFields;
385
+ type: string;
386
+ };
387
+ export type RandomFields = {
388
+ seed: string;
389
+ };
@@ -12,7 +12,7 @@ exports.platform = {
12
12
  twitter: 'https://twitter.com/JupiterExchange',
13
13
  };
14
14
  exports.perpsProgramId = new web3_js_1.PublicKey('PERPHjGBqRHArX4DySjwM6UJHiR3sWAatqfdBS2qQJu');
15
- exports.valueAverageProgramId = new web3_js_1.PublicKey('JVAp1DSLnM4Qh8qM1QasQ8x56ccb9S3DhbyEckybTF9');
15
+ exports.valueAverageProgramId = new web3_js_1.PublicKey('VALaaymxQh2mNy2trH9jUqHT1mTow76wpTcGmSWSwJe');
16
16
  exports.limitProgramId = new web3_js_1.PublicKey('jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu');
17
17
  exports.limitV2ProgramId = new web3_js_1.PublicKey('j1o2qRpjcyUwEvwtcfhEQefh773ZgjxcVRry7LDqg5X');
18
18
  exports.dcaProgramId = new web3_js_1.PublicKey('DCA265Vj8a9CEuX1eb1LWRnDT7uK6q1xMipnNyatn23M');
@@ -1,3 +1,3 @@
1
- import { AirdropFetcher } from '../../../AirdropFetcher';
2
- export declare const airdropFetcher: AirdropFetcher;
3
- export declare const fetcher: import("../../..").Fetcher;
1
+ import { AsrConfig } from './constants';
2
+ import { AirdropFetcherExecutor } from '../../../AirdropFetcher';
3
+ export declare function getAsrAirdropExecutor(config: AsrConfig): AirdropFetcherExecutor;
@@ -12,8 +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.fetcher = exports.airdropFetcher = void 0;
16
- const portfolio_core_1 = require("@sonarwatch/portfolio-core");
15
+ exports.getAsrAirdropExecutor = void 0;
17
16
  const axios_1 = __importDefault(require("axios"));
18
17
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
19
18
  const constants_1 = require("./constants");
@@ -22,82 +21,62 @@ const getMultipleAccountsInfoSafe_1 = require("../../../utils/solana/getMultiple
22
21
  const clients_1 = require("../../../utils/clients");
23
22
  const constants_2 = require("../launchpad/constants");
24
23
  const deriveClaimStatus_1 = require("../../../utils/solana/jupiter/deriveClaimStatus");
25
- const asr1Items = new Map([
26
- [constants_2.jupMint, { label: 'JUP', decimals: 6 }],
27
- [
28
- 'ZEUS1aR7aX8DFFJf5QjWj2ftDDdNTroMNGo8YoQm3Gq',
29
- { label: 'ZEUS', decimals: 6 },
30
- ],
31
- [
32
- 'WENWENvqqNya429ubCdR81ZmD69brwQaaBYY6p3LCpk',
33
- { label: 'WEN', decimals: 5 },
34
- ],
35
- [
36
- 'UPTx1d24aBWuRgwxVnFmX4gNraj3QGFzL3QqBgxtWQG',
37
- { label: 'UPT', decimals: 9 },
38
- ],
39
- [
40
- 'SHARKSYJjqaNyxVfrpnBN9pjgkhwDhatnMyicWPnr1s',
41
- { label: 'SHARK', decimals: 6 },
42
- ],
43
- ]);
44
- const ineligibleItems = Array.from(asr1Items).map(([address, { label }]) => ({
45
- amount: 0,
46
- label,
47
- address,
48
- isClaimed: false,
49
- }));
24
+ function getInegibleItems(items) {
25
+ return Array.from(items).map(([address, { label }]) => ({
26
+ amount: 0,
27
+ label,
28
+ address,
29
+ isClaimed: false,
30
+ }));
31
+ }
50
32
  function asrDeriveClaimStatus(claimant, claimProof) {
51
33
  if (claimProof.mint === constants_2.jupMint) {
52
34
  return (0, deriveClaimStatus_1.deriveClaimStatus)(claimant, claimProof.merkle_tree, constants_1.jupDisProgram);
53
35
  }
54
36
  return (0, deriveClaimStatus_1.deriveClaimStatus)(claimant, claimProof.merkle_tree, constants_2.lfgDisProgram);
55
37
  }
56
- const fetchAirdropExecutor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
57
- const claimsProof = yield axios_1.default
58
- .get(`${constants_1.asrApi}/${owner}`, { timeout: 5000 })
59
- .catch(() => {
60
- throw new Error('Failed to get asr claim proof');
61
- });
62
- if (!claimsProof ||
63
- !claimsProof.data.claim ||
64
- claimsProof.data.claim.length === 0)
38
+ function getAsrAirdropExecutor(config) {
39
+ return (owner) => __awaiter(this, void 0, void 0, function* () {
40
+ const claimsProof = yield axios_1.default
41
+ .get(config.api(owner), { timeout: 5000 })
42
+ .catch(() => {
43
+ throw new Error('Failed to get asr claim proof');
44
+ });
45
+ if (!claimsProof ||
46
+ !claimsProof.data.claim ||
47
+ claimsProof.data.claim.length === 0)
48
+ return (0, AirdropFetcher_1.getAirdropRaw)({
49
+ statics: config.statics,
50
+ items: getInegibleItems(config.items),
51
+ });
52
+ const claimAddresses = claimsProof.data.claim.map((cp) => asrDeriveClaimStatus(owner, cp));
53
+ const client = (0, clients_1.getClientSolana)();
54
+ const claimAccounts = yield (0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(client, claimAddresses);
65
55
  return (0, AirdropFetcher_1.getAirdropRaw)({
66
- statics: constants_1.asr1Statics,
67
- items: ineligibleItems,
56
+ statics: config.statics,
57
+ items: claimAccounts
58
+ .map((claimAcc, i) => {
59
+ const claimProofRes = claimsProof.data.claim[i];
60
+ if (!claimProofRes.mint)
61
+ return [];
62
+ const asrItem = config.items.get(claimProofRes.mint);
63
+ if (!asrItem)
64
+ return [];
65
+ const { label, decimals } = asrItem;
66
+ return [
67
+ {
68
+ amount: new bignumber_js_1.default(claimProofRes.amount)
69
+ .div(Math.pow(10, decimals))
70
+ .toNumber(),
71
+ isClaimed: !!claimAcc,
72
+ label,
73
+ address: claimProofRes.mint,
74
+ },
75
+ ];
76
+ })
77
+ .flat(),
68
78
  });
69
- const claimAddresses = claimsProof.data.claim.map((cp) => asrDeriveClaimStatus(owner, cp));
70
- const client = (0, clients_1.getClientSolana)();
71
- const claimAccounts = yield (0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(client, claimAddresses);
72
- return (0, AirdropFetcher_1.getAirdropRaw)({
73
- statics: constants_1.asr1Statics,
74
- items: claimAccounts
75
- .map((claimAcc, i) => {
76
- const claimProofRes = claimsProof.data.claim[i];
77
- if (!claimProofRes.mint)
78
- return [];
79
- const asrItem = asr1Items.get(claimProofRes.mint);
80
- if (!asrItem)
81
- return [];
82
- const { label, decimals } = asrItem;
83
- return [
84
- {
85
- amount: new bignumber_js_1.default(claimProofRes.amount)
86
- .div(Math.pow(10, decimals))
87
- .toNumber(),
88
- isClaimed: !!claimAcc,
89
- label,
90
- address: claimProofRes.mint,
91
- },
92
- ];
93
- })
94
- .flat(),
95
79
  });
96
- });
97
- exports.airdropFetcher = {
98
- id: constants_1.asr1Statics.id,
99
- networkId: portfolio_core_1.NetworkId.solana,
100
- executor: fetchAirdropExecutor,
101
- };
102
- exports.fetcher = (0, AirdropFetcher_1.airdropFetcherToFetcher)(exports.airdropFetcher, constants_1.platformId, `${constants_1.platformId}-asr-1`, constants_1.asr1Statics.claimEnd);
80
+ }
81
+ exports.getAsrAirdropExecutor = getAsrAirdropExecutor;
103
82
  //# sourceMappingURL=asrAirdropFetcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"asrAirdropFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/governance/asrAirdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA6C;AAC7C,gEAAqC;AACrC,2CAA6E;AAC7E,4DAKiC;AAEjC,mGAAgG;AAChG,oDAAyD;AACzD,sDAAgE;AAChE,uFAAoF;AAEpF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACxB,CAAC,mBAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACxC;QACE,6CAA6C;QAC7C,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE;KAC/B;IACD;QACE,6CAA6C;QAC7C,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE;KAC9B;IACD;QACE,6CAA6C;QAC7C,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE;KAC9B;IACD;QACE,6CAA6C;QAC7C,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE;KAChC;CACF,CAAC,CAAC;AACH,MAAM,eAAe,GAAG,KAAK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,sDAoDC"}
@@ -3,5 +3,16 @@ import { AirdropStatics } from '../../../AirdropFetcher';
3
3
  export declare const platformId = "jupiter-governance";
4
4
  export declare const jupDisProgram = "Dis2TfkFnXFkrtvAktEkw37sdb7qwJgY6H7YZJwk51wK";
5
5
  export declare const platform: Platform;
6
- export declare const asrApi = "https://worker.jup.ag/jup-asr-july-2024-claim-proof";
7
6
  export declare const asr1Statics: AirdropStatics;
7
+ export declare const asr2Statics: AirdropStatics;
8
+ export type AsrItems = Map<string, {
9
+ label: string;
10
+ decimals: number;
11
+ }>;
12
+ export type AsrConfig = {
13
+ statics: AirdropStatics;
14
+ items: AsrItems;
15
+ api: (owner: string) => string;
16
+ };
17
+ export declare const asr1Config: AsrConfig;
18
+ export declare const asr2Config: AsrConfig;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.asr1Statics = exports.asrApi = exports.platform = exports.jupDisProgram = exports.platformId = void 0;
3
+ exports.asr2Config = exports.asr1Config = exports.asr2Statics = exports.asr1Statics = exports.platform = exports.jupDisProgram = exports.platformId = void 0;
4
+ const constants_1 = require("../launchpad/constants");
4
5
  exports.platformId = 'jupiter-governance';
5
6
  const platformName = 'Jupiter Governance';
6
7
  const platformImage = 'https://sonar.watch/img/platforms/jupiter.webp';
@@ -13,7 +14,6 @@ exports.platform = {
13
14
  website: platformWebsite,
14
15
  twitter: 'https://twitter.com/JupiterExchange',
15
16
  };
16
- exports.asrApi = 'https://worker.jup.ag/jup-asr-july-2024-claim-proof';
17
17
  exports.asr1Statics = {
18
18
  id: 'jup-asr-1',
19
19
  claimLink: 'https://vote.jup.ag/asr',
@@ -24,4 +24,48 @@ exports.asr1Statics = {
24
24
  claimEnd: 1722470400000,
25
25
  name: 'ASR #1',
26
26
  };
27
+ exports.asr2Statics = {
28
+ id: 'jup-asr-2',
29
+ claimLink: 'https://vote.jup.ag/asr',
30
+ image: platformImage,
31
+ emitterLink: platformWebsite,
32
+ emitterName: 'Jupiter',
33
+ claimStart: 1729512000000,
34
+ claimEnd: 1732190400000,
35
+ name: 'ASR #2',
36
+ };
37
+ exports.asr1Config = {
38
+ statics: exports.asr1Statics,
39
+ items: new Map([
40
+ [constants_1.jupMint, { label: 'JUP', decimals: 6 }],
41
+ [
42
+ 'ZEUS1aR7aX8DFFJf5QjWj2ftDDdNTroMNGo8YoQm3Gq',
43
+ { label: 'ZEUS', decimals: 6 },
44
+ ],
45
+ [
46
+ 'WENWENvqqNya429ubCdR81ZmD69brwQaaBYY6p3LCpk',
47
+ { label: 'WEN', decimals: 5 },
48
+ ],
49
+ [
50
+ 'UPTx1d24aBWuRgwxVnFmX4gNraj3QGFzL3QqBgxtWQG',
51
+ { label: 'UPT', decimals: 9 },
52
+ ],
53
+ [
54
+ 'SHARKSYJjqaNyxVfrpnBN9pjgkhwDhatnMyicWPnr1s',
55
+ { label: 'SHARK', decimals: 6 },
56
+ ],
57
+ ]),
58
+ api: (owner) => `https://worker.jup.ag/jup-asr-july-2024-claim-proof/${owner}`,
59
+ };
60
+ exports.asr2Config = {
61
+ statics: exports.asr2Statics,
62
+ items: new Map([
63
+ [constants_1.jupMint, { label: 'JUP', decimals: 6 }],
64
+ [
65
+ 'CLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu',
66
+ { label: 'CLOUD', decimals: 9 },
67
+ ],
68
+ ]),
69
+ api: (owner) => `https://worker.jup.ag/asr-claim-proof/${owner}?asrTimeline=oct-2024&mints=JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN%2CCLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu`,
70
+ };
27
71
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/governance/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,oBAAoB,CAAC;AAC/C,MAAM,YAAY,GAAG,oBAAoB,CAAC;AAC1C,MAAM,aAAa,GAAG,gDAAgD,CAAC;AACvE,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAElC,QAAA,aAAa,GAAG,8CAA8C,CAAC;AAC/D,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;IACpB,OAAO,EAAE,eAAe;IACxB,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,MAAM,GAAG,qDAAqD,CAAC;AAC/D,QAAA,WAAW,GAAmB;IACzC,EAAE,EAAE,WAAW;IACf,SAAS,EAAE,yBAAyB;IACpC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,SAAS;IACtB,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,aAAa;IACvB,IAAI,EAAE,QAAQ;CACf,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/governance/constants.ts"],"names":[],"mappings":";;;AAEA,sDAAiD;AAEpC,QAAA,UAAU,GAAG,oBAAoB,CAAC;AAC/C,MAAM,YAAY,GAAG,oBAAoB,CAAC;AAC1C,MAAM,aAAa,GAAG,gDAAgD,CAAC;AACvE,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAElC,QAAA,aAAa,GAAG,8CAA8C,CAAC;AAC/D,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;IACpB,OAAO,EAAE,eAAe;IACxB,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,WAAW,GAAmB;IACzC,EAAE,EAAE,WAAW;IACf,SAAS,EAAE,yBAAyB;IACpC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,SAAS;IACtB,UAAU,EAAE,aAAa;IACzB,QAA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wH;CACzK,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { AirdropFetcher } from '../../../AirdropFetcher';
2
+ export declare const asr1AirdropFetcher: AirdropFetcher;
3
+ export declare const asr1Fetcher: import("../../..").Fetcher;
4
+ export declare const asr2AirdropFetcher: AirdropFetcher;
5
+ export declare const asr2Fetcher: import("../../..").Fetcher;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asr2Fetcher = exports.asr2AirdropFetcher = exports.asr1Fetcher = exports.asr1AirdropFetcher = void 0;
4
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
5
+ const AirdropFetcher_1 = require("../../../AirdropFetcher");
6
+ const constants_1 = require("./constants");
7
+ const asrAirdropFetcher_1 = require("./asrAirdropFetcher");
8
+ exports.asr1AirdropFetcher = {
9
+ id: constants_1.asr1Statics.id,
10
+ networkId: portfolio_core_1.NetworkId.solana,
11
+ executor: (0, asrAirdropFetcher_1.getAsrAirdropExecutor)(constants_1.asr1Config),
12
+ };
13
+ exports.asr1Fetcher = (0, AirdropFetcher_1.airdropFetcherToFetcher)(exports.asr1AirdropFetcher, constants_1.platformId, `${constants_1.platformId}-asr-1`, constants_1.asr1Statics.claimEnd);
14
+ exports.asr2AirdropFetcher = {
15
+ id: constants_1.asr2Statics.id,
16
+ networkId: portfolio_core_1.NetworkId.solana,
17
+ executor: (0, asrAirdropFetcher_1.getAsrAirdropExecutor)(constants_1.asr2Config),
18
+ };
19
+ exports.asr2Fetcher = (0, AirdropFetcher_1.airdropFetcherToFetcher)(exports.asr2AirdropFetcher, constants_1.platformId, `${constants_1.platformId}-asr-2`, constants_1.asr2Statics.claimEnd);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/governance/index.ts"],"names":[],"mappings":";;;AAAA,+DAAuD;AACvD,4DAGiC;AACjC,2CAMqB;AACrB,2DAA4D;AAE/C,QAAA,kBAAkB,GAAmB;IAChD,EAAE,EAAE,uBAAW,CAAC,EAAE;IAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ,EAAE,IAAA,yCAAqB,EAAC,sBAAU,CAAC;CAC5C,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,wCAAuB,EAChD,0BAAkB,EAClB,sBAAU,EACV,GAAG,sBAAU,QAAQ,EACrB,uBAAW,CAAC,QAAQ,CACrB,CAAC;AAEW,QAAA,kBAAkB,GAAmB;IAChD,EAAE,EAAE,uBAAW,CAAC,EAAE;IAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ,EAAE,IAAA,yCAAqB,EAAC,sBAAU,CAAC;CAC5C,CAAC;AACW,QAAA,WAAW,GAAG,IAAA,wCAAuB,EAChD,0BAAkB,EAClB,sBAAU,EACV,GAAG,sBAAU,QAAQ,EACrB,uBAAW,CAAC,QAAQ,CACrB,CAAC"}
@@ -15,7 +15,7 @@ const voteFetcher_1 = __importDefault(require("./governance/voteFetcher"));
15
15
  const constants_2 = require("./governance/constants");
16
16
  const pricingJob_1 = __importDefault(require("./pricingJob"));
17
17
  const constants_3 = require("./exchange/constants");
18
- const asrAirdropFetcher_1 = require("./governance/asrAirdropFetcher");
18
+ const governance_1 = require("./governance");
19
19
  const launchpad_1 = require("./launchpad");
20
20
  exports.platforms = [
21
21
  constants_1.platform,
@@ -30,11 +30,13 @@ exports.fetchers = [
30
30
  dcaFetcher_1.default,
31
31
  lockFetcher_1.default,
32
32
  voteFetcher_1.default,
33
- asrAirdropFetcher_1.fetcher,
33
+ governance_1.asr1Fetcher,
34
+ governance_1.asr2Fetcher,
34
35
  ...launchpad_1.lfgFetchers,
35
36
  ];
36
37
  exports.airdropFetchers = [
37
- asrAirdropFetcher_1.airdropFetcher,
38
+ governance_1.asr1AirdropFetcher,
39
+ governance_1.asr2AirdropFetcher,
38
40
  ...launchpad_1.lfgAirdropFetchers,
39
41
  ];
40
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/index.ts"],"names":[],"mappings":";;;;;;AAGA,mFAA2D;AAC3D,yFAAiE;AACjE,2EAAmD;AACnD,uEAA+C;AAC/C,yEAAiD;AACjD,2EAAmD;AAEnD,qDAAsE;AACtE,2EAAmD;AACnD,sDAAwE;AACxE,8DAAsC;AACtC,oDAAoE;AAEpE,sEAGwC;AACxC,2CAA8D;AAEjD,QAAA,SAAS,GAAe;IACnC,oBAAiB;IACjB,oBAAkB;IAClB,oBAAgB;CACjB,CAAC;AACW,QAAA,IAAI,GAAU,CAAC,sBAAY,EAAE,oBAAU,CAAC,CAAC;AACzC,QAAA,QAAQ,GAAc;IACjC,0BAAgB;IAChB,6BAAmB;IACnB,sBAAY;IACZ,oBAAU;IACV,qBAAW;IACX,qBAAW;IACX,2BAAU;IACV,GAAG,uBAAW;CACf,CAAC;AACW,QAAA,eAAe,GAAqB;IAC/C,kCAAiB;IACjB,GAAG,8BAAkB;CACtB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/index.ts"],"names":[],"mappings":";;;;;;AAGA,mFAA2D;AAC3D,yFAAiE;AACjE,2EAAmD;AACnD,uEAA+C;AAC/C,yEAAiD;AACjD,2EAAmD;AAEnD,qDAAsE;AACtE,2EAAmD;AACnD,sDAAwE;AACxE,8DAAsC;AACtC,oDAAoE;AAEpE,6CAKsB;AACtB,2CAA8D;AAEjD,QAAA,SAAS,GAAe;IACnC,oBAAiB;IACjB,oBAAkB;IAClB,oBAAgB;CACjB,CAAC;AACW,QAAA,IAAI,GAAU,CAAC,sBAAY,EAAE,oBAAU,CAAC,CAAC;AACzC,QAAA,QAAQ,GAAc;IACjC,0BAAgB;IAChB,6BAAmB;IACnB,sBAAY;IACZ,oBAAU;IACV,qBAAW;IACX,qBAAW;IACX,wBAAW;IACX,wBAAW;IACX,GAAG,uBAAW;CACf,CAAC;AACW,QAAA,eAAe,GAAqB;IAC/C,+BAAkB;IAClB,+BAAkB;IAClB,GAAG,8BAAkB;CACtB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,81 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
+ const constants_1 = require("./constants");
18
+ const clients_1 = require("../../utils/clients");
19
+ const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
20
+ const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
21
+ const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
22
+ const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
23
+ const bitsToNumber_1 = require("../../utils/sui/bitsToNumber");
24
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
25
+ var _a, _b;
26
+ const client = (0, clients_1.getClientSui)();
27
+ const ownerRes = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
28
+ filter: { StructType: constants_1.clmmType },
29
+ });
30
+ if (ownerRes.length === 0)
31
+ return [];
32
+ const clmmPositions = [];
33
+ for (let i = 0; i < ownerRes.length; i++) {
34
+ const position = (_b = (_a = ownerRes[i].data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields;
35
+ if (position)
36
+ clmmPositions.push(position);
37
+ }
38
+ if (clmmPositions.length === 0)
39
+ return [];
40
+ const poolsIds = clmmPositions.map((position) => position.pool_id);
41
+ const poolsById = new Map();
42
+ const poolsObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, [
43
+ ...new Set(poolsIds),
44
+ ]);
45
+ poolsObjects.forEach((poolObj) => {
46
+ var _a, _b, _c, _d;
47
+ if ((_b = (_a = poolObj.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields) {
48
+ poolsById.set(poolObj.data.objectId, (_d = (_c = poolObj.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields);
49
+ }
50
+ });
51
+ const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui, constants_1.platformId);
52
+ clmmPositions.forEach((clmmPosition) => {
53
+ const pool = poolsById.get(clmmPosition.pool_id);
54
+ if (!pool)
55
+ return;
56
+ const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, bitsToNumber_1.bitsToNumber)(pool.tick_index.fields.bits), (0, bitsToNumber_1.bitsToNumber)(clmmPosition.tick_lower_index.fields.bits), (0, bitsToNumber_1.bitsToNumber)(clmmPosition.tick_upper_index.fields.bits), false);
57
+ const element = elementRegistry.addElementLiquidity({
58
+ label: 'LiquidityPool',
59
+ tags: ['Concentrated'],
60
+ });
61
+ const liquidity = element.addLiquidity();
62
+ liquidity.addAsset({
63
+ address: pool.type_x.fields.name,
64
+ amount: tokenAmountA,
65
+ });
66
+ liquidity.addAsset({
67
+ address: pool.type_y.fields.name,
68
+ amount: tokenAmountB,
69
+ });
70
+ if (tokenAmountA.isZero() || tokenAmountB.isZero())
71
+ element.addTag('Out Of Range');
72
+ });
73
+ return elementRegistry.getElements(cache);
74
+ });
75
+ const fetcher = {
76
+ id: `${constants_1.platformId}-clmms`,
77
+ networkId: portfolio_core_1.NetworkId.sui,
78
+ executor,
79
+ };
80
+ exports.default = fetcher;
81
+ //# sourceMappingURL=clmmsFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clmmsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kriya/clmmsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEAAqC;AAGrC,2CAAmD;AACnD,iDAAmD;AACnD,wFAAyF;AACzF,qEAAkE;AAClE,qEAAkE;AAClE,gFAA6E;AAC7E,+DAA4D;AAG5D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAe,EAAe,MAAM,EAAE,KAAK,EAAE;QAClE,MAAM,EAAE,EAAE,UAAU,EAAE,oBAAQ,EAAE;KACjC,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,aAAa,GAAmB,EAAE,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,MAAM,QAAQ,GAAG,MAAA,MAAA,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC;QACnD,IAAI,QAAQ;YAAE,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,aAAa,CAAC,MAAM,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AAK,CACN,CAAC;QAEF,MAAM,OAAO,GAAG,eAAe,CAAC,mBAAmB,CAAC;YAClD,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,CAAC,cAAc,CAAC;SACvB,CAAC,CAAC;QACH,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;QAEzC,SAAS,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI;YAChC,MAAM,EAAE,YAAY;SACrB,CAAC,CAAC;QAEH,SAAS,CAAC,QAAQ,CAAC;YACjB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI;YAChC,MAAM,EAAE,YAAY;SACrB,CAAC,CAAC;QAEH,IAAI,YAAY,CAAC,MAAM,EAAE,IAAI,YAAY,CAAC,MAAM,EAAE;YAChD,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -1,15 +1,20 @@
1
1
  import { Platform } from '@sonarwatch/portfolio-core';
2
- import { VaultInfo } from './types';
2
+ import { VaultConfig } from './types/common';
3
3
  export declare const platformId = "kriya";
4
4
  export declare const platform: Platform;
5
5
  export declare const vaultsPackageId = "0xc4ee7b00ea981402a6285b14ffa5dcd1ee7f97eb2a91df3bcc04fa88c56ac7d7";
6
6
  export declare const farmsPackageId = "0x88701243d0445aa38c0a13f02a9af49a58092dfadb93af9754edb41c52f40085";
7
+ export declare const poolsV2PackageId = "0xa0eba10b173538c8fecca1dff298e488402cc9ff374f8a12ca7758eebe830b66";
8
+ export declare const clmmPoolPackageId = "0xf6c05e2d9301e6e91dc6ab6c3ca918f7d55896e1f1edd64adc0e615cde27ebf1";
9
+ export declare const lpPositionTypeV2 = "0xa0eba10b173538c8fecca1dff298e488402cc9ff374f8a12ca7758eebe830b66::spot_dex::KriyaLPToken";
10
+ export declare const clmmType = "0xf6c05e2d9301e6e91dc6ab6c3ca918f7d55896e1f1edd64adc0e615cde27ebf1::position::Position";
11
+ export declare const vaultStakeReceipt = "0xba0dd78bdd5d1b5f02a689444522ea9a79e1bc4cd4d8e6a57b59f3fbcae5e978::farm::StakeReceipt";
7
12
  export declare const vaultsInfoKey = "vaultsInfos";
8
13
  export declare const leverageVaultsInfoKey = "leverageVaultsInfos";
9
14
  export declare const farmsInfoKey = "farmsInfos";
10
15
  export declare const vaultsUrl = "https://88ob93rfva.execute-api.ap-southeast-1.amazonaws.com/release/vaults";
11
16
  export declare const poolsUrl = "https://xd0ljetd33.execute-api.ap-southeast-1.amazonaws.com/release/pools";
12
17
  export declare const leverageVaultsUrl = "https://4sacq88271.execute-api.ap-southeast-1.amazonaws.com/release/vaults";
13
- export declare const vaultsCointsTypes: string[];
14
- export declare const vaultsInfo: VaultInfo[];
15
- export declare const dynamicFieldPositionType = "0x2::dynamic_field::Field<vector<u8>, 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::position::Position>";
18
+ export declare const vaultsInfo: VaultConfig[];
19
+ export declare const dynamicFieldPositionTypeCetus = "0x2::dynamic_field::Field<vector<u8>, 0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb::position::Position>";
20
+ export declare const dynamicFieldPositionTypeKriya = "0x2::dynamic_field::Field<vector<u8>, 0xf6c05e2d9301e6e91dc6ab6c3ca918f7d55896e1f1edd64adc0e615cde27ebf1::position::Position>";