@sonarwatch/portfolio-plugins 0.12.163 → 0.12.165

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +1 -1
  3. package/src/index.js +4 -4
  4. package/src/index.js.map +1 -1
  5. package/src/plugins/abex/types.d.ts +5 -12
  6. package/src/plugins/aftermath/types.d.ts +2 -6
  7. package/src/plugins/alphafi/types.d.ts +1 -3
  8. package/src/plugins/bucket/types.d.ts +2 -3
  9. package/src/plugins/cetus/clmmsFetcher.js +3 -3
  10. package/src/plugins/cetus/clmmsFetcher.js.map +1 -1
  11. package/src/plugins/cetus/constants.d.ts +2 -0
  12. package/src/plugins/cetus/constants.js +5 -1
  13. package/src/plugins/cetus/constants.js.map +1 -1
  14. package/src/plugins/cetus/farmsFetcher.js +118 -0
  15. package/src/plugins/cetus/farmsFetcher.js.map +1 -0
  16. package/src/plugins/cetus/helpers.js +3 -2
  17. package/src/plugins/cetus/helpers.js.map +1 -1
  18. package/src/plugins/cetus/index.js +4 -2
  19. package/src/plugins/cetus/index.js.map +1 -1
  20. package/src/plugins/cetus/types.d.ts +92 -3
  21. package/src/plugins/cetus/types.js.map +1 -1
  22. package/src/plugins/cetus/vaultsJob.d.ts +3 -0
  23. package/src/plugins/cetus/vaultsJob.js +101 -0
  24. package/src/plugins/cetus/vaultsJob.js.map +1 -0
  25. package/src/plugins/drift/index.js +2 -1
  26. package/src/plugins/drift/index.js.map +1 -1
  27. package/src/plugins/flowx/stakingPoolV3Fetcher.js +2 -2
  28. package/src/plugins/flowx/stakingPoolV3Fetcher.js.map +1 -1
  29. package/src/plugins/flowx/types.d.ts +2 -3
  30. package/src/plugins/haedal/types.d.ts +1 -3
  31. package/src/plugins/jewel/types.d.ts +1 -3
  32. package/src/plugins/kai/types.d.ts +3 -6
  33. package/src/plugins/kriya/types.d.ts +1 -3
  34. package/src/plugins/kriya/types.js.map +1 -1
  35. package/src/plugins/{flexlend → lulo}/constants.d.ts +1 -1
  36. package/src/plugins/{flexlend → lulo}/constants.js +2 -2
  37. package/src/plugins/lulo/constants.js.map +1 -0
  38. package/src/plugins/lulo/depositsFetcher.js.map +1 -0
  39. package/src/plugins/{flexlend → lulo}/helpers.js +1 -1
  40. package/src/plugins/lulo/helpers.js.map +1 -0
  41. package/src/plugins/{flexlend → lulo}/index.js +6 -1
  42. package/src/plugins/lulo/index.js.map +1 -0
  43. package/src/plugins/lulo/liftFetcher.d.ts +3 -0
  44. package/src/plugins/{flexlend → lulo}/liftFetcher.js +1 -1
  45. package/src/plugins/lulo/liftFetcher.js.map +1 -0
  46. package/src/plugins/lulo/rewardsFetcher.d.ts +3 -0
  47. package/src/plugins/lulo/rewardsFetcher.js +38 -0
  48. package/src/plugins/lulo/rewardsFetcher.js.map +1 -0
  49. package/src/plugins/lulo/struct.js.map +1 -0
  50. package/src/plugins/navi/types.d.ts +4 -9
  51. package/src/plugins/orca/getWhirlpoolPositions.js +17 -20
  52. package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
  53. package/src/plugins/raydium/getRaydiumCLMMPositions.js +21 -11
  54. package/src/plugins/raydium/getRaydiumCLMMPositions.js.map +1 -1
  55. package/src/plugins/raydium/helpers.d.ts +5 -1
  56. package/src/plugins/raydium/helpers.js +59 -11
  57. package/src/plugins/raydium/helpers.js.map +1 -1
  58. package/src/plugins/scallop/types/basic.d.ts +2 -3
  59. package/src/plugins/scallop/types/data.d.ts +1 -3
  60. package/src/plugins/tokens/fetchers/sui.js +1 -8
  61. package/src/plugins/tokens/fetchers/sui.js.map +1 -1
  62. package/src/plugins/tradeport/types.d.ts +1 -4
  63. package/src/plugins/turbos/clmmVaultFetcher.js +2 -2
  64. package/src/plugins/turbos/clmmVaultFetcher.js.map +1 -1
  65. package/src/plugins/turbos/clmmsPositionsFetcher.js +2 -1
  66. package/src/plugins/turbos/clmmsPositionsFetcher.js.map +1 -1
  67. package/src/plugins/turbos/helper.d.ts +0 -1
  68. package/src/plugins/turbos/helper.js +1 -6
  69. package/src/plugins/turbos/helper.js.map +1 -1
  70. package/src/plugins/turbos/types.d.ts +2 -6
  71. package/src/plugins/typus/constants.d.ts +8 -0
  72. package/src/plugins/typus/constants.js +12 -1
  73. package/src/plugins/typus/constants.js.map +1 -1
  74. package/src/plugins/typus/index.js +4 -2
  75. package/src/plugins/typus/index.js.map +1 -1
  76. package/src/plugins/typus/safuFetcher.d.ts +3 -0
  77. package/src/plugins/typus/safuFetcher.js +97 -0
  78. package/src/plugins/typus/safuFetcher.js.map +1 -0
  79. package/src/plugins/typus/safuVaultsJob.d.ts +3 -0
  80. package/src/plugins/typus/safuVaultsJob.js +30 -0
  81. package/src/plugins/typus/safuVaultsJob.js.map +1 -0
  82. package/src/plugins/typus/safu_helpers.d.ts +8 -0
  83. package/src/plugins/typus/safu_helpers.js +205 -0
  84. package/src/plugins/typus/safu_helpers.js.map +1 -0
  85. package/src/plugins/typus/safu_types.d.ts +55 -0
  86. package/src/plugins/typus/safu_types.js +3 -0
  87. package/src/plugins/typus/safu_types.js.map +1 -0
  88. package/src/plugins/typus/types.d.ts +1 -3
  89. package/src/utils/sui/bitsToNumber.d.ts +1 -0
  90. package/src/utils/sui/bitsToNumber.js +11 -0
  91. package/src/utils/sui/bitsToNumber.js.map +1 -0
  92. package/src/utils/sui/structs/id.d.ts +3 -0
  93. package/src/utils/sui/structs/id.js +3 -0
  94. package/src/utils/sui/structs/id.js.map +1 -0
  95. package/src/utils/sui/structs/nft.d.ts +2 -3
  96. package/src/utils/sui/types.d.ts +2 -3
  97. package/src/plugins/flexlend/constants.js.map +0 -1
  98. package/src/plugins/flexlend/depositsFetcher.js.map +0 -1
  99. package/src/plugins/flexlend/helpers.js.map +0 -1
  100. package/src/plugins/flexlend/index.js.map +0 -1
  101. package/src/plugins/flexlend/liftFetcher.js.map +0 -1
  102. package/src/plugins/flexlend/struct.js.map +0 -1
  103. /package/src/plugins/{flexlend/depositsFetcher.d.ts → cetus/farmsFetcher.d.ts} +0 -0
  104. /package/src/plugins/{flexlend/liftFetcher.d.ts → lulo/depositsFetcher.d.ts} +0 -0
  105. /package/src/plugins/{flexlend → lulo}/depositsFetcher.js +0 -0
  106. /package/src/plugins/{flexlend → lulo}/helpers.d.ts +0 -0
  107. /package/src/plugins/{flexlend → lulo}/index.d.ts +0 -0
  108. /package/src/plugins/{flexlend → lulo}/struct.d.ts +0 -0
  109. /package/src/plugins/{flexlend → lulo}/struct.js +0 -0
@@ -14,4 +14,8 @@ export declare function getStakePubKey(owner: string): PublicKey;
14
14
  export declare function getFarmYield(rewardToken: TokenPrice, rewardPerBlock: BigNumber, tvl: number, slotsPerSec?: number): Yield;
15
15
  export declare function getPendingAssetToken(depositBalance: BigNumber, rewardDebt: BigNumber, perShare: BigNumber, rewardToken: TokenPrice, multiplier: number | BigNumber): PortfolioAssetToken;
16
16
  export declare const getTickArrayAddress: (programId: string, poolId: string, tickNumber: number, tickSpacing: number) => PublicKey;
17
- export declare const getRewardBalance: (personalPositionInfo: ParsedAccount<PersonalPositionState>, poolStateInfo: ParsedAccount<PoolState>, tickArrays: (ParsedAccount<TickArrayState> | null)[]) => BigNumber[];
17
+ export declare const getFeesAndRewardsBalance: (personalPositionInfo: ParsedAccount<PersonalPositionState>, poolStateInfo: ParsedAccount<PoolState>, tickArrays: (ParsedAccount<TickArrayState> | null)[]) => {
18
+ tokenFeeAmountA: BigNumber;
19
+ tokenFeeAmountB: BigNumber;
20
+ rewards: BigNumber[];
21
+ } | null;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getRewardBalance = exports.getTickArrayAddress = exports.getPendingAssetToken = exports.getFarmYield = exports.getStakePubKey = exports.getRaydiumTokenAmountsFromLiquidity = exports.raydiumTickToPriceX64 = exports.isARaydiumPosition = void 0;
6
+ exports.getFeesAndRewardsBalance = exports.getTickArrayAddress = exports.getPendingAssetToken = exports.getFarmYield = exports.getStakePubKey = exports.getRaydiumTokenAmountsFromLiquidity = exports.raydiumTickToPriceX64 = exports.isARaydiumPosition = void 0;
7
7
  /* eslint-disable eqeqeq */
8
8
  /* eslint-disable @typescript-eslint/naming-convention */
9
9
  /* eslint-disable no-underscore-dangle */
@@ -295,29 +295,69 @@ function getTickOffsetInArray(tickIndex, tickSpacing) {
295
295
  }
296
296
  return offsetInArray;
297
297
  }
298
- const getRewardBalance = (personalPositionInfo, poolStateInfo, tickArrays) => {
298
+ function getfeeGrowthInside(poolState, tickLowerState, tickUpperState) {
299
+ let feeGrowthBelowX64A = new bn_js_1.default(0);
300
+ let feeGrowthBelowX64B = new bn_js_1.default(0);
301
+ if (poolState.tickCurrent >= tickLowerState.tick) {
302
+ feeGrowthBelowX64A = tickLowerState.feeGrowthOutsideX64A;
303
+ feeGrowthBelowX64B = tickLowerState.feeGrowthOutsideX64B;
304
+ }
305
+ else {
306
+ feeGrowthBelowX64A = poolState.feeGrowthGlobalX64A.sub(tickLowerState.feeGrowthOutsideX64A);
307
+ feeGrowthBelowX64B = poolState.feeGrowthGlobalX64B.sub(tickLowerState.feeGrowthOutsideX64B);
308
+ }
309
+ let feeGrowthAboveX64A = new bn_js_1.default(0);
310
+ let feeGrowthAboveX64B = new bn_js_1.default(0);
311
+ if (poolState.tickCurrent < tickUpperState.tick) {
312
+ feeGrowthAboveX64A = tickUpperState.feeGrowthOutsideX64A;
313
+ feeGrowthAboveX64B = tickUpperState.feeGrowthOutsideX64B;
314
+ }
315
+ else {
316
+ feeGrowthAboveX64A = poolState.feeGrowthGlobalX64A.sub(tickUpperState.feeGrowthOutsideX64A);
317
+ feeGrowthAboveX64B = poolState.feeGrowthGlobalX64B.sub(tickUpperState.feeGrowthOutsideX64B);
318
+ }
319
+ const feeGrowthInsideX64A = wrappingSubU128(wrappingSubU128(poolState.feeGrowthGlobalX64A, feeGrowthBelowX64A), feeGrowthAboveX64A);
320
+ const feeGrowthInsideBX64 = wrappingSubU128(wrappingSubU128(poolState.feeGrowthGlobalX64B, feeGrowthBelowX64B), feeGrowthAboveX64B);
321
+ return { feeGrowthInsideX64A, feeGrowthInsideBX64 };
322
+ }
323
+ function GetPositionFeesV2(ammPool, positionState, tickLowerState, tickUpperState) {
324
+ const { feeGrowthInsideX64A, feeGrowthInsideBX64 } = getfeeGrowthInside(ammPool, tickLowerState, tickUpperState);
325
+ const feeGrowthdeltaA = mulDivFloor(wrappingSubU128(feeGrowthInsideX64A, positionState.feeGrowthInsideLastX64A), positionState.liquidity, Q64);
326
+ const tokenFeeAmountA = positionState.tokenFeesOwedA.add(feeGrowthdeltaA);
327
+ const feeGrowthdelta1 = mulDivFloor(wrappingSubU128(feeGrowthInsideBX64, positionState.feeGrowthInsideLastX64B), positionState.liquidity, Q64);
328
+ const tokenFeeAmountB = positionState.tokenFeesOwedB.add(feeGrowthdelta1);
329
+ return { tokenFeeAmountA, tokenFeeAmountB };
330
+ }
331
+ const getFeesAndRewardsBalance = (personalPositionInfo, poolStateInfo, tickArrays) => {
299
332
  const [tickArrayLower, tickArrayUpper] = tickArrays;
300
333
  if (!tickArrayLower || !tickArrayUpper)
301
- return [];
334
+ return null;
302
335
  const tickLowerState = tickArrayLower &&
303
336
  tickArrayLower.ticks[getTickOffsetInArray(personalPositionInfo.tickLowerIndex, poolStateInfo.tickSpacing)];
304
337
  const tickUpperState = tickArrayUpper &&
305
338
  tickArrayUpper.ticks[getTickOffsetInArray(personalPositionInfo.tickUpperIndex, poolStateInfo.tickSpacing)];
306
339
  if (!tickLowerState || !tickUpperState)
307
- return [];
308
- return GetPositionRewardsV2({
340
+ return null;
341
+ const ammPool = {
309
342
  tickCurrent: poolStateInfo.tickCurrent,
310
- feeGrowthGlobalX64B: (0, toBN_1.toBN)(poolStateInfo.feeGrowthGlobal0X64),
343
+ feeGrowthGlobalX64A: (0, toBN_1.toBN)(poolStateInfo.feeGrowthGlobal0X64),
344
+ feeGrowthGlobalX64B: (0, toBN_1.toBN)(poolStateInfo.feeGrowthGlobal1X64),
311
345
  rewardInfos: poolStateInfo.rewardInfos.map((ri) => ({
312
346
  rewardGrowthGlobalX64: (0, toBN_1.toBN)(ri.rewardGrowthGlobalX64),
313
347
  })),
314
- }, {
348
+ };
349
+ const positionState = {
315
350
  liquidity: (0, toBN_1.toBN)(personalPositionInfo.liquidity),
316
351
  rewardInfos: personalPositionInfo.rewardInfos.map((ri) => ({
317
352
  growthInsideLastX64: (0, toBN_1.toBN)(ri.growthInsideLastX64),
318
353
  rewardAmountOwed: (0, toBN_1.toBN)(ri.rewardAmountOwed),
319
354
  })),
320
- }, {
355
+ feeGrowthInsideLastX64A: (0, toBN_1.toBN)(personalPositionInfo.feeGrowthInside0LastX64),
356
+ feeGrowthInsideLastX64B: (0, toBN_1.toBN)(personalPositionInfo.feeGrowthInside1LastX64),
357
+ tokenFeesOwedA: (0, toBN_1.toBN)(personalPositionInfo.tokenFeesOwed0),
358
+ tokenFeesOwedB: (0, toBN_1.toBN)(personalPositionInfo.tokenFeesOwed1),
359
+ };
360
+ const tickLowerS = {
321
361
  tick: tickLowerState.tick,
322
362
  liquidityNet: (0, toBN_1.toBN)(tickLowerState.liquidityNet),
323
363
  liquidityGross: (0, toBN_1.toBN)(tickLowerState.liquidityGross),
@@ -328,7 +368,8 @@ const getRewardBalance = (personalPositionInfo, poolStateInfo, tickArrays) => {
328
368
  (0, toBN_1.toBN)(tickLowerState.rewardGrowthsOutsideX641),
329
369
  (0, toBN_1.toBN)(tickLowerState.rewardGrowthsOutsideX642),
330
370
  ],
331
- }, {
371
+ };
372
+ const tickUpperS = {
332
373
  tick: tickUpperState.tick,
333
374
  liquidityNet: (0, toBN_1.toBN)(tickUpperState.liquidityNet),
334
375
  liquidityGross: (0, toBN_1.toBN)(tickUpperState.liquidityGross),
@@ -339,7 +380,14 @@ const getRewardBalance = (personalPositionInfo, poolStateInfo, tickArrays) => {
339
380
  (0, toBN_1.toBN)(tickUpperState.rewardGrowthsOutsideX641),
340
381
  (0, toBN_1.toBN)(tickUpperState.rewardGrowthsOutsideX642),
341
382
  ],
342
- }).map((bn) => new bignumber_js_1.default(bn.toString(10)));
383
+ };
384
+ const fees = GetPositionFeesV2(ammPool, positionState, tickLowerS, tickUpperS);
385
+ const rewards = GetPositionRewardsV2(ammPool, positionState, tickLowerS, tickUpperS);
386
+ return {
387
+ tokenFeeAmountA: new bignumber_js_1.default(fees.tokenFeeAmountA.toString(10)),
388
+ tokenFeeAmountB: new bignumber_js_1.default(fees.tokenFeeAmountB.toString(10)),
389
+ rewards: rewards.map((bn) => new bignumber_js_1.default(bn.toString(10))),
390
+ };
343
391
  };
344
- exports.getRewardBalance = getRewardBalance;
392
+ exports.getFeesAndRewardsBalance = getFeesAndRewardsBalance;
345
393
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA2B;AAC3B,yDAAyD;AACzD,yCAAyC;AACzC,sCAAsC;AACtC,+BAA+B;AAC/B,gEAAqC;AACrC,kDAAuB;AACvB,+DAOoC;AACpC,6CAA4C;AAC5C,2CAAqE;AACrE,qGAA6E;AAE7E,gDAA6C;AAQ7C,SAAgB,kBAAkB,CAAC,GAA8B;IAC/D,OAAO,GAAG,CAAC,IAAI,KAAK,+BAAmB,CAAC;AAC1C,CAAC;AAFD,gDAEC;AAED,MAAM,IAAI,GAAG,IAAI,eAAE,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,GAAG,GAAG,IAAI,eAAE,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,IAAI,eAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,IAAI,eAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjC,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MA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1,10 +1,9 @@
1
+ import { ID } from '../../../utils/sui/structs/id';
1
2
  export type BasicField = {
2
3
  type: string;
3
4
  fields: object;
4
5
  };
5
- export type IdField = {
6
- id: string;
7
- };
6
+ export type IdField = ID;
8
7
  export type NameField = {
9
8
  name: string;
10
9
  };
@@ -1,6 +1,7 @@
1
1
  import BigNumber from 'bignumber.js';
2
2
  import { CoinTypeMetadata } from './coin';
3
3
  import { sCoinNames } from '../constants';
4
+ import { ID } from '../../../utils/sui/structs/id';
4
5
  export type UserLending = {
5
6
  coinType: string;
6
7
  amount: BigNumber;
@@ -48,9 +49,6 @@ export type Fields = {
48
49
  id: ID;
49
50
  size: string;
50
51
  };
51
- export type ID = {
52
- id: string;
53
- };
54
52
  export type ApiResponse = {
55
53
  signature: {
56
54
  [key: string]: number;
@@ -21,14 +21,7 @@ const helpers_1 = require("../helpers");
21
21
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
22
22
  const client = (0, clients_1.getClientSui)();
23
23
  const coinsBalances = yield client.getAllBalances({ owner });
24
- const coinsTypes = [...new Set(coinsBalances.map((cb) => cb.coinType))];
25
- const tokensPrices = yield cache.getTokenPrices(coinsTypes, portfolio_core_1.NetworkId.sui);
26
- const tokenPricesMap = new Map();
27
- tokensPrices.forEach((tp) => {
28
- if (!tp)
29
- return;
30
- tokenPricesMap.set(tp.address, tp);
31
- });
24
+ const tokenPricesMap = yield cache.getTokenPricesAsMap([...new Set(coinsBalances.map((cb) => cb.coinType))], portfolio_core_1.NetworkId.sui);
32
25
  const walletTokensAssets = [];
33
26
  const liquiditiesByTag = {};
34
27
  for (let i = 0; i < coinsBalances.length; i++) {
@@ -1 +1 @@
1
- {"version":3,"file":"sui.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/tokens/fetchers/sui.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAUoC;AAIpC,oDAAsD;AACtD,wGAAgF;AAChF,4CAAoD;AACpD,0GAAkF;AAClF,wCAA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AE,IAAA,+BAAc,EAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC7D,IAAI,EAAE;gBACJ,MAAM,EAAE,kBAAkB;aAC3B;SACF,CAAC;QACF,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACrC,CAAC;IACD,KAAK,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAClE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,IAAA,oBAAU,EAAC,GAAG,CAAC,CAAC;QACpD,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU;YACV,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,eAAe;YACtB,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACtD,IAAI,EAAE;gBACJ,WAAW;aACZ;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,gCAAoB,CAAC,EAAE,MAAM;IACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -1,6 +1,4 @@
1
- type ID = {
2
- id: string;
3
- };
1
+ import { ID } from '../../utils/sui/structs/id';
4
2
  export type Lock = {
5
3
  fields: {
6
4
  expire_at: string;
@@ -25,4 +23,3 @@ export type LockObject = {
25
23
  name: number[];
26
24
  value: Lock;
27
25
  };
28
- export {};
@@ -18,10 +18,10 @@ const constants_1 = require("./constants");
18
18
  const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
19
19
  const clients_1 = require("../../utils/clients");
20
20
  const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
21
- const helper_1 = require("./helper");
22
21
  const tokenAmountFromLiquidity_1 = require("../../utils/clmm/tokenAmountFromLiquidity");
23
22
  const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
24
23
  const multiDynamicFieldObjects_1 = require("../../utils/sui/multiDynamicFieldObjects");
24
+ const bitsToNumber_1 = require("../../utils/sui/bitsToNumber");
25
25
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
26
26
  var _a;
27
27
  const client = (0, clients_1.getClientSui)();
@@ -137,7 +137,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
137
137
  const clmmPosition = clmmPositionById.get(vaultInfo.base_clmm_position_id);
138
138
  if (!pool || !clmmPosition)
139
139
  continue;
140
- const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, helper_1.bitsToNumber)(vaultInfo.base_last_tick_index.fields.bits), (0, helper_1.bitsToNumber)(clmmPosition.tick_lower_index.fields.bits), (0, helper_1.bitsToNumber)(clmmPosition.tick_upper_index.fields.bits), false);
140
+ const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, bitsToNumber_1.bitsToNumber)(vaultInfo.base_last_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);
141
141
  const coinA = (0, portfolio_core_1.formatMoveTokenAddress)(vaultInfo.coin_a_type_name.fields.name);
142
142
  const coinB = (0, portfolio_core_1.formatMoveTokenAddress)(vaultInfo.coin_b_type_name.fields.name);
143
143
  const tokenPriceA = tokenPriceById.get(coinA);
@@ -1 +1 @@
1
- {"version":3,"file":"clmmVaultFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/clmmVaultFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AAGrC,2CAA0E;AAC1E,qEAAkE;AAClE,iDAAmD;AAQnD,qEAAkE;AAClE,qCAAwC;AACxC,wFAAyF;AACzF,qGAA6E;AAC7E,uFAAoF;AAEpF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,uBAAuB,GAAG,MAAM,IAAA,iCAAe,EACnD,MAAM,EACN,KAAK,EACL;QACE,MAAM,EAAE;YACN,OAAO,EAAE,0BAAc;SACxB;QACD,OAAO,EAAE;YACP,WAAW,EAAE,IAAI;YACjB,QAAQ,EAAE,IAAI;SACf;KACF,CACF,CAAC;IAEF,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEpD,MAAM,WAAW,GAAgB,IAAI,GAAG,EAAE,CAAC;IAC3C,MAAM,iBAAiB,GAA0B,IAAI,GAAG,EAAE,CAAC;IAC3D,uBAAuB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;;QACtC,IAAI,MAAA,GAAG,CAAC,IAAI,0CAAE,OAAO,EAAE,CAAC;YACtB,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YACrD,MAAM,UAAU,GAAG,iBAAiB,CAAC,GAAG,CACtC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CACpC,CAAC;YACF,IAAI,UAAU,EAAE,CAAC;gBACf,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,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AC;IAC/B,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM;aACpB;SACF;KACF,CAAC;AACJ,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
+ {"version":3,"file":"clmmVaultFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/clmmVaultFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AAGrC,2CAA0E;AAC1E,qEAAkE;AAClE,iDAAmD;AAQnD,qEAAkE;AAClE,wFAAyF;AACzF,qGAA6E;AAC7E,uFAAoF;AACpF,+DAA4D;AAE5D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,uBAAuB,GAAG,MAAM,IAAA,iCAAe,EACnD,MAAM,EACN,KAAK,EACL;QACE,MAAM,EAAE;YACN,OAAO,EAAE,0BAAc;SACxB;QACD,OAAO,EAAE;YACP,WAAW,EAAE,IAAI;YACjB,QAAQ,EAAE,IAAI;SACf;KACF,CACF,CAAC;IAEF,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEpD,MAAM,WAAW,GAAgB,IAAI,GAAG,EAAE,CAAC;IAC3C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AE,EAC7D,0BAAS,CAAC,GAAG,EACb,WAAW,CACZ,CAAC;QACF,IACE,CAAC,WAAW;YACZ,CAAC,WAAW;YACZ,WAAW,CAAC,KAAK,KAAK,IAAI;YAC1B,WAAW,CAAC,KAAK,KAAK,IAAI;YAE1B,SAAS;QACX,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;QACpD,MAAM,CAAC,IAAI,CAAC;YACV,MAAM,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;YAClC,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,CAAC;YACpB,KAAK;YACL,MAAM,EAAE,EAAE;SACX,CAAC,CAAC;QACH,mBAAmB,IAAI,KAAK,CAAC;IAC/B,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM;aACpB;SACF;KACF,CAAC;AACJ,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"}
@@ -21,6 +21,7 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
21
21
  const helper_1 = require("./helper");
22
22
  const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
23
23
  const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
24
+ const bitsToNumber_1 = require("../../utils/sui/bitsToNumber");
24
25
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
25
26
  var _a, _b;
26
27
  const client = (0, clients_1.getClientSui)();
@@ -81,7 +82,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
81
82
  const pool = poolsById.get(nftPosition.pool_id);
82
83
  if (!pool)
83
84
  continue;
84
- const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, helper_1.bitsToNumber)(pool.tick_current_index.fields.bits), (0, helper_1.bitsToNumber)(clmmPosition.tick_lower_index.fields.bits), (0, helper_1.bitsToNumber)(clmmPosition.tick_upper_index.fields.bits), false);
85
+ const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(clmmPosition.liquidity), (0, bitsToNumber_1.bitsToNumber)(pool.tick_current_index.fields.bits), (0, bitsToNumber_1.bitsToNumber)(clmmPosition.tick_lower_index.fields.bits), (0, bitsToNumber_1.bitsToNumber)(clmmPosition.tick_upper_index.fields.bits), false);
85
86
  // TODO : améliorer le problème du 0x000002::sui::SUI + manque de 0x
86
87
  const coinA = (0, helper_1.formatForNative)(`0x${nftPosition.coin_type_a.fields.name}`);
87
88
  const coinB = (0, helper_1.formatForNative)(`0x${nftPosition.coin_type_b.fields.name}`);
@@ -1 +1 @@
1
- {"version":3,"file":"clmmsPositionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/clmmsPositionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AAEnD,wFAAyF;AACzF,qGAA6E;AAC7E,qCAAyD;AACzD,qEAAkE;AAClE,qEAAkE;AAElE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IA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,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;QACpD,MAAM,CAAC,IAAI,CAAC;YACV,MAAM,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;YAClC,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,CAAC;YACpB,KAAK;YACL,MAAM,EAAE,EAAE;SACX,CAAC,CAAC;QACH,mBAAmB,IAAI,KAAK,CAAC;IAC/B,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,CAAC,cAAc,CAAC;YACtB,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM;aACpB;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,kBAAkB;IACnC,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"clmmsPositionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/clmmsPositionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AAEnD,wFAAyF;AACzF,qGAA6E;AAC7E,qCAA2C;AAC3C,qEAAkE;AAClE,qEAAkE;AAClE,+DAA4D;AAE5D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,gBAAgB,GAAG,MAAM,IAAA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,CAAC;QACpD,MAAM,CAAC,IAAI,CAAC;YACV,MAAM,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;YAClC,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,CAAC;YACpB,KAAK;YACL,MAAM,EAAE,EAAE;SACX,CAAC,CAAC;QACH,mBAAmB,IAAI,KAAK,CAAC;IAC/B,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,CAAC,cAAc,CAAC;YACtB,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE;gBACJ,WAAW,EAAE,MAAM;aACpB;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,kBAAkB;IACnC,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -5,4 +5,3 @@ export declare function parsePoolType(type: string, length: 3): Types;
5
5
  export declare function parsePoolType(type: string): string[];
6
6
  export declare function parsePool(pool: ObjectResponse<PoolFields>): Pool;
7
7
  export declare function formatForNative(coin: string): string;
8
- export declare function bitsToNumber(bits: number): number;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bitsToNumber = exports.formatForNative = exports.parsePool = exports.parsePoolType = void 0;
3
+ exports.formatForNative = exports.parsePool = exports.parsePoolType = void 0;
4
4
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
5
- const helpers_1 = require("../cetus/helpers");
6
5
  function parsePoolType(type, length) {
7
6
  var _a;
8
7
  const types = ((_a = type.replace('>', '').split('<')[1]) === null || _a === void 0 ? void 0 : _a.split(/,\s*/)) || [];
@@ -27,8 +26,4 @@ function formatForNative(coin) {
27
26
  return coin === portfolio_core_1.suiNativeAddress ? '0x2::sui::SUI' : coin;
28
27
  }
29
28
  exports.formatForNative = formatForNative;
30
- function bitsToNumber(bits) {
31
- return (0, helpers_1.asIntN)(BigInt(bits));
32
- }
33
- exports.bitsToNumber = bitsToNumber;
34
29
  //# sourceMappingURL=helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/turbos/helper.ts"],"names":[],"mappings":";;;AAAA,+DAA8D;AAE9D,8CAA0C;AAM1C,SAAgB,aAAa,CAAC,IAAY,EAAE,MAAe;;IACzD,MAAM,KAAK,GAAG,CAAA,MAAA,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC,MAAM,CAAC,KAAI,EAAE,CAAC;IAEvE,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AARD,sCAQC;AACD,SAAgB,SAAS,CAAC,IAAgC;;IACxD,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,OAAO,CAAA;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC;IAC1C,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,CAAC;IACrC,MAAM,IAAI,GAAG,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,CAAC;IAC7B,uCACK,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GAAG,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,CAAC;IAC7B,uCACK,MAAM,KACT,QAAQ;QACR,IAAI,EACJ,KAAK,EAAE,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,IAC7B;AACJ,CAAC;AAXD,8BAWC;AAED,SAAgB,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,KAAK,iCAAgB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5D,CAAC;AAFD,0CAEC"}
@@ -1,4 +1,5 @@
1
1
  import BigNumber from 'bignumber.js';
2
+ import { ID } from '../../utils/sui/structs/id';
2
3
  export type PoolFields = {
3
4
  coin_a: string;
4
5
  coin_b: string;
@@ -19,9 +20,7 @@ export type PoolFields = {
19
20
  fields: {
20
21
  emissions_per_second: string;
21
22
  growth_global: string;
22
- id: {
23
- id: string;
24
- };
23
+ id: ID;
25
24
  manager: string;
26
25
  vault: string;
27
26
  vault_coin_type: string;
@@ -118,9 +117,6 @@ export type CoinTypeName = {
118
117
  export type Fields = {
119
118
  name: string;
120
119
  };
121
- export type ID = {
122
- id: string;
123
- };
124
120
  export type VaultStrategy = {
125
121
  accounts: Accounts;
126
122
  base_tick_step_minimum: number;
@@ -7,3 +7,11 @@ export declare const sender = "0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
7
7
  export declare const packageDovSingle = "0x9c907e9af7bedaab3382542f342cce21ca95fa72bedcc887edb478d17f8293d1";
8
8
  export declare const registryDovSingle = "0x3d70b09359e3ca8301ae0abeda4f2fdf72ce313ba58c919ce568e5f535fd2ea8";
9
9
  export declare const viewDepositSharesType = "0x9c907e9af7bedaab3382542f342cce21ca95fa72bedcc887edb478d17f8293d1::tds_view_function::get_deposit_shares_bcs";
10
+ export declare const safuPackage = "0x8bde4eedabbdaf0c4c463c4eb35f00456dbac5fdccb94ce9c2d7a77653aa481f";
11
+ export declare const frameworkPackage = "0x5c6648fb219c046256488486d23d4af7bc562d5ab5c382e1f4b558066a327fe8";
12
+ export declare const safuRegistryId = "0xdc970d638d1489385e49ddb76889748011bac4616b95a51aa63633972b841706";
13
+ export declare const safuVaultsKey = "safu-vaults";
14
+ export declare const vaultsIndexes: string[];
15
+ export declare const safuVaultsNames: {
16
+ [key: string]: string;
17
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.viewDepositSharesType = exports.registryDovSingle = exports.packageDovSingle = exports.sender = exports.depositReceiptType = exports.packageId = exports.platform = exports.platformId = void 0;
3
+ exports.safuVaultsNames = exports.vaultsIndexes = exports.safuVaultsKey = exports.safuRegistryId = exports.frameworkPackage = exports.safuPackage = exports.viewDepositSharesType = exports.registryDovSingle = exports.packageDovSingle = exports.sender = exports.depositReceiptType = exports.packageId = exports.platform = exports.platformId = void 0;
4
4
  exports.platformId = 'typus';
5
5
  exports.platform = {
6
6
  id: exports.platformId,
@@ -16,4 +16,15 @@ exports.sender = '0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
16
16
  exports.packageDovSingle = '0x9c907e9af7bedaab3382542f342cce21ca95fa72bedcc887edb478d17f8293d1';
17
17
  exports.registryDovSingle = '0x3d70b09359e3ca8301ae0abeda4f2fdf72ce313ba58c919ce568e5f535fd2ea8';
18
18
  exports.viewDepositSharesType = `${exports.packageDovSingle}::tds_view_function::get_deposit_shares_bcs`;
19
+ exports.safuPackage = '0x8bde4eedabbdaf0c4c463c4eb35f00456dbac5fdccb94ce9c2d7a77653aa481f';
20
+ exports.frameworkPackage = '0x5c6648fb219c046256488486d23d4af7bc562d5ab5c382e1f4b558066a327fe8';
21
+ exports.safuRegistryId = '0xdc970d638d1489385e49ddb76889748011bac4616b95a51aa63633972b841706';
22
+ exports.safuVaultsKey = 'safu-vaults';
23
+ exports.vaultsIndexes = ['0', '1', '2', '3'];
24
+ exports.safuVaultsNames = {
25
+ '0': 'Bull',
26
+ '1': 'Bear',
27
+ '2': 'All Weather SUI',
28
+ '3': 'All Weather USDC',
29
+ };
19
30
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/typus/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,eAAe,EAAE,sCAAsC;IACpE,OAAO,EAAE,wBAAwB;IACjC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AACW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAC1D,QAAA,kBAAkB,GAAG,GAAG,iBAAS,8BAA8B,CAAC;AAChE,QAAA,MAAM,GACjB,oEAAoE,CAAC;AAC1D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAC1D,QAAA,iBAAiB,GAC5B,oEAAoE,CAAC;AAC1D,QAAA,qBAAqB,GAAG,GAAG,wBAAgB,6CAA6C,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/typus/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,eAAe,EAAE,sCAAsC;IACpE,OAAO,EAAE,wBAAwB;IACjC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AACW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAC1D,QAAA,kBAAkB,GAAG,GAAG,iBAAS,8BAA8B,CAAC;AAChE,QAAA,MAAM,GACjB,oEAAoE,CAAC;AAC1D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAC1D,QAAA,iBAAiB,GAC5B,oEAAoE,CAAC;AAC1D,QAAA,qBAAqB,GAAG,GAAG,wBAAgB,6CAA6C,CAAC;AAEzF,QAAA,WAAW,GACtB,oEAAoE,CAAC;AAC1D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAC1D,QAAA,cAAc,GACzB,oEAAoE,CAAC;AAC1D,QAAA,aAAa,GAAG,aAAa,CAAC;AAE9B,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACrC,QAAA,eAAe,GAA8B;IACxD,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,kBAAkB;CACxB,CAAC"}
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.fetchers = exports.jobs = exports.platforms = void 0;
7
7
  const constants_1 = require("./constants");
8
8
  const vaultsFetcher_1 = __importDefault(require("./vaultsFetcher"));
9
+ const safuVaultsJob_1 = __importDefault(require("./safuVaultsJob"));
10
+ const safuFetcher_1 = __importDefault(require("./safuFetcher"));
9
11
  exports.platforms = [constants_1.platform];
10
- exports.jobs = [];
11
- exports.fetchers = [vaultsFetcher_1.default];
12
+ exports.jobs = [safuVaultsJob_1.default];
13
+ exports.fetchers = [vaultsFetcher_1.default, safuFetcher_1.default];
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/typus/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,oEAA4C;AAE/B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,uBAAa,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/typus/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,oEAA4C;AAC5C,oEAA4C;AAC5C,gEAAwC;AAE3B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,uBAAa,CAAC,CAAC;AAC9B,QAAA,QAAQ,GAAc,CAAC,uBAAa,EAAE,qBAAW,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,97 @@
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 constants_1 = require("./constants");
17
+ const clients_1 = require("../../utils/clients");
18
+ const safu_helpers_1 = require("./safu_helpers");
19
+ const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
20
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
21
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
22
+ const vaultsMemo = new MemoizedCache_1.MemoizedCache(constants_1.safuVaultsKey, {
23
+ prefix: constants_1.platformId,
24
+ networkId: portfolio_core_1.NetworkId.sui,
25
+ });
26
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
27
+ const client = (0, clients_1.getClientSui)();
28
+ const shareDatas = yield (0, safu_helpers_1.getShareData)(client, owner);
29
+ let hasPosition = false;
30
+ for (let i = 0; i < constants_1.vaultsIndexes.length; i++) {
31
+ const vaultIndex = constants_1.vaultsIndexes[i];
32
+ if (shareDatas[vaultIndex].length > 0) {
33
+ hasPosition = true;
34
+ break;
35
+ }
36
+ }
37
+ if (!hasPosition)
38
+ return [];
39
+ const vaults = yield vaultsMemo.getItem(cache);
40
+ if (!vaults)
41
+ return [];
42
+ const tokenPrices = yield cache.getTokenPricesAsMap(Object.values(vaults).map((v) => (0, portfolio_core_1.formatMoveTokenAddress)(v[0].depositToken)), portfolio_core_1.NetworkId.sui);
43
+ const elements = [];
44
+ for (let i = 0; i < constants_1.vaultsIndexes.length; i++) {
45
+ const vaultIndex = constants_1.vaultsIndexes[i];
46
+ const share = shareDatas[vaultIndex];
47
+ if (share.length > 0) {
48
+ const [vault, bidReceipt] = vaults[vaultIndex];
49
+ if (!vault)
50
+ continue;
51
+ const amount = new bignumber_js_1.default(share[0].share.active_share)
52
+ .plus(share[0].share.deactivating_share)
53
+ .plus(share[0].share.inactive_share)
54
+ .plus(share[0].share.warmup_share);
55
+ if (amount.isZero())
56
+ continue;
57
+ const tokenPrice = tokenPrices.get((0, portfolio_core_1.formatMoveTokenAddress)(vault.depositToken));
58
+ if (!tokenPrice)
59
+ continue;
60
+ const assets = [];
61
+ const rewardAssets = [];
62
+ assets.push((0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.dividedBy(Math.pow(10, tokenPrice.decimals)).toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice));
63
+ const assetsValue = (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value));
64
+ const rewardAssetsValue = (0, portfolio_core_1.getUsdValueSum)(rewardAssets.map((a) => a.value));
65
+ const value = (0, portfolio_core_1.getUsdValueSum)([...assets, ...rewardAssets].map((a) => a.value));
66
+ const liquidities = [
67
+ {
68
+ assets,
69
+ assetsValue,
70
+ rewardAssets,
71
+ rewardAssetsValue,
72
+ value,
73
+ yields: [],
74
+ },
75
+ ];
76
+ elements.push({
77
+ type: portfolio_core_1.PortfolioElementType.liquidity,
78
+ networkId: portfolio_core_1.NetworkId.sui,
79
+ platformId: constants_1.platformId,
80
+ label: 'Lending',
81
+ name: `SAFU ${constants_1.safuVaultsNames[vaultIndex] || ''}`,
82
+ value: (0, portfolio_core_1.getUsdValueSum)(liquidities.map((a) => a.value)),
83
+ data: {
84
+ liquidities,
85
+ },
86
+ });
87
+ }
88
+ }
89
+ return elements;
90
+ });
91
+ const fetcher = {
92
+ id: `${constants_1.platformId}-safu`,
93
+ networkId: portfolio_core_1.NetworkId.sui,
94
+ executor,
95
+ };
96
+ exports.default = fetcher;
97
+ //# sourceMappingURL=safuFetcher.js.map