@sonarwatch/portfolio-plugins 0.11.158 → 0.11.159

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. package/CHANGELOG.md +1359 -1355
  2. package/README.md +3 -3
  3. package/package.json +2 -2
  4. package/src/plugins/abex/marketsJob.js +2 -2
  5. package/src/plugins/abex/marketsJob.js.map +1 -1
  6. package/src/plugins/aftermath/poolsJob.js +36 -102
  7. package/src/plugins/aftermath/poolsJob.js.map +1 -1
  8. package/src/plugins/atrix/poolsV1Job.js +2 -2
  9. package/src/plugins/atrix/poolsV1Job.js.map +1 -1
  10. package/src/plugins/auxexchange/aptosLpJob.js +6 -4
  11. package/src/plugins/auxexchange/aptosLpJob.js.map +1 -1
  12. package/src/plugins/balancer/helpers/pools.js +21 -21
  13. package/src/plugins/fluxbeam/poolsJob.js +6 -4
  14. package/src/plugins/fluxbeam/poolsJob.js.map +1 -1
  15. package/src/plugins/kai/vaultsJob.js +2 -2
  16. package/src/plugins/kai/vaultsJob.js.map +1 -1
  17. package/src/plugins/liquiditypools-sei/job.js +6 -4
  18. package/src/plugins/liquiditypools-sei/job.js.map +1 -1
  19. package/src/plugins/liquidswap/aptosLpJob.js +2 -2
  20. package/src/plugins/liquidswap/aptosLpJob.js.map +1 -1
  21. package/src/plugins/marginfi/banksJob.d.ts +3 -0
  22. package/src/plugins/marginfi/{jobExecutor.js → banksJob.js} +8 -3
  23. package/src/plugins/marginfi/banksJob.js.map +1 -0
  24. package/src/plugins/marginfi/depositsFetcher.d.ts +3 -0
  25. package/src/plugins/marginfi/{fetcherExecutor.js → depositsFetcher.js} +8 -3
  26. package/src/plugins/marginfi/{fetcherExecutor.js.map → depositsFetcher.js.map} +1 -1
  27. package/src/plugins/marginfi/index.js +4 -17
  28. package/src/plugins/marginfi/index.js.map +1 -1
  29. package/src/plugins/meteora/multiTokenPoolsJob.js +2 -2
  30. package/src/plugins/meteora/multiTokenPoolsJob.js.map +1 -1
  31. package/src/plugins/meteora/poolsJob.js +6 -4
  32. package/src/plugins/meteora/poolsJob.js.map +1 -1
  33. package/src/plugins/orca/lpTokensJob.js +6 -4
  34. package/src/plugins/orca/lpTokensJob.js.map +1 -1
  35. package/src/plugins/pancakeswap/aptosLpJob.js +6 -4
  36. package/src/plugins/pancakeswap/aptosLpJob.js.map +1 -1
  37. package/src/plugins/raydium/lpTokensJob.js +6 -4
  38. package/src/plugins/raydium/lpTokensJob.js.map +1 -1
  39. package/src/plugins/sushiswap/aptos/poolsJob.js +2 -2
  40. package/src/plugins/sushiswap/aptos/poolsJob.js.map +1 -1
  41. package/src/plugins/sushiswap/helpers.js +24 -24
  42. package/src/plugins/symmetry/basketsJob.js +2 -2
  43. package/src/plugins/symmetry/basketsJob.js.map +1 -1
  44. package/src/plugins/tulip/lendingTokensJob.js +2 -2
  45. package/src/plugins/tulip/lendingTokensJob.js.map +1 -1
  46. package/src/plugins/tulip/strategyTokensJob.js +2 -2
  47. package/src/plugins/tulip/strategyTokensJob.js.map +1 -1
  48. package/src/plugins/uniswap-v2/helpers.js +22 -22
  49. package/src/utils/clmm/tokenPricesFromSqrt.js +11 -4
  50. package/src/utils/clmm/tokenPricesFromSqrt.js.map +1 -1
  51. package/src/utils/misc/getLpTokenSource.d.ts +13 -9
  52. package/src/utils/misc/getLpTokenSource.js +29 -8
  53. package/src/utils/misc/getLpTokenSource.js.map +1 -1
  54. package/src/utils/misc/getLpTokenSourceOld.d.ts +18 -0
  55. package/src/utils/misc/getLpTokenSourceOld.js +32 -0
  56. package/src/utils/misc/getLpTokenSourceOld.js.map +1 -0
  57. package/src/utils/misc/getLpTokenSourceRaw.d.ts +16 -5
  58. package/src/utils/misc/getLpTokenSourceRaw.js +22 -6
  59. package/src/utils/misc/getLpTokenSourceRaw.js.map +1 -1
  60. package/src/utils/misc/getLpTokenSourceRawOld.d.ts +25 -0
  61. package/src/utils/misc/getLpTokenSourceRawOld.js +20 -0
  62. package/src/utils/misc/getLpTokenSourceRawOld.js.map +1 -0
  63. package/src/utils/misc/getLpUnderlyingTokenSource.d.ts +14 -18
  64. package/src/utils/misc/getLpUnderlyingTokenSource.js +101 -70
  65. package/src/utils/misc/getLpUnderlyingTokenSource.js.map +1 -1
  66. package/src/utils/misc/getLpUnderlyingTokenSourceOld.d.ts +26 -0
  67. package/src/utils/misc/getLpUnderlyingTokenSourceOld.js +73 -0
  68. package/src/utils/misc/getLpUnderlyingTokenSourceOld.js.map +1 -0
  69. package/src/utils/sei/constants.js +8 -8
  70. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  71. package/src/plugins/marginfi/fetcherExecutor.d.ts +0 -3
  72. package/src/plugins/marginfi/jobExecutor.d.ts +0 -3
  73. package/src/plugins/marginfi/jobExecutor.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.11.158",
3
+ "version": "0.11.159",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
@@ -41,7 +41,7 @@
41
41
  "web3-v1": "npm:web3@^1.5.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "@sonarwatch/portfolio-core": "0.11.158"
44
+ "@sonarwatch/portfolio-core": "0.11.159"
45
45
  },
46
46
  "main": "./src/index.js",
47
47
  "types": "./src/index.d.ts"
@@ -18,7 +18,7 @@ const constants_1 = require("./constants");
18
18
  const clients_1 = require("../../utils/clients");
19
19
  const getDynamicFields_1 = require("../../utils/sui/getDynamicFields");
20
20
  const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
21
- const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
21
+ const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
22
22
  const aptos_1 = require("../../utils/aptos");
23
23
  const getObject_1 = require("../../utils/sui/getObject");
24
24
  const constants_2 = require("../tokens/constants");
@@ -72,7 +72,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
72
72
  price: tokenPrice.price,
73
73
  });
74
74
  }
75
- const lpSource = (0, getLpTokenSourceRaw_1.default)(portfolio_core_1.NetworkId.sui, constants_1.platformId, constants_1.platformId, {
75
+ const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.sui, constants_1.platformId, constants_1.platformId, {
76
76
  address: constants_1.alpType,
77
77
  decimals: constants_1.alpDecimals,
78
78
  supplyRaw: new bignumber_js_1.default(lpSupply),
@@ -1 +1 @@
1
- {"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/abex/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA2E;AAC3E,gEAAqC;AAGrC,2CAQqB;AACrB,iDAAmD;AACnD,uEAAoE;AAEpE,qEAAkE;AAClE,+FAE8C;AAC9C,6CAAoD;AACpD,yDAAsD;AACtD,mDAA2D;AAE3D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,OAAO;IACP,MAAM,UAAU,GAAG,MAAM,IAAA,qBAAS,EAAO,MAAM,EAAE,wBAAY,CAAC,CAAC;IAC/D,MAAM,iBAAiB,GACrB,MAAA,MAAA,UAAU,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,oBAAoB,CAAC;IACxD,IAAI,iBAAiB,EAAE,CAAC;QACtB,MAAM,KAAK,CAAC,OAAO,CAAC,oCAAwB,EAAE,iBAAiB,EAAE;YAC/D,MAAM,EAAE,sBAAU;YAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;SACzB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAS,E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,CAAC,GAAG,EAAE;KACtB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -16,17 +16,14 @@ const bignumber_js_1 = __importDefault(require("bignumber.js"));
16
16
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
17
  const clients_1 = require("../../utils/clients");
18
18
  const constants_1 = require("./constants");
19
- const computeAndStoreLpPrice_1 = require("../../utils/misc/computeAndStoreLpPrice");
20
19
  const aptos_1 = require("../../utils/aptos");
21
- const getTokensPricesMap_1 = __importDefault(require("../../utils/misc/getTokensPricesMap"));
22
- const getLpUnderlyingTokenSource_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSource"));
23
- const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
24
20
  const getDynamicFields_1 = require("../../utils/sui/getDynamicFields");
25
21
  const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
22
+ const getLpTokenSourceRaw_1 = require("../../utils/misc/getLpTokenSourceRaw");
23
+ const networkId = portfolio_core_1.NetworkId.sui;
26
24
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
27
- var _a, _b, _c, _d, _e;
25
+ var _a, _b, _c, _d;
28
26
  const client = (0, clients_1.getClientSui)();
29
- const networkId = portfolio_core_1.NetworkId.sui;
30
27
  const coinsTableFields = yield (0, getDynamicFields_1.getDynamicFields)(client, constants_1.lpCoinsTable);
31
28
  const poolFactoryIds = coinsTableFields.map((f) => f.objectId);
32
29
  if (!poolFactoryIds.length)
@@ -46,15 +43,10 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
46
43
  if (!poolsIds.length)
47
44
  return;
48
45
  const poolsInfo = yield (0, multiGetObjects_1.multiGetObjects)(client, poolsIds);
49
- const tokenPriceById = yield (0, getTokensPricesMap_1.default)(poolsInfo
50
- .map((pool) => {
51
- var _a, _b, _c, _d;
52
- return ((_b = (_a = pool.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields)
53
- ? ((_d = (_c = pool.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields).type_names
54
- : [];
55
- })
56
- .flat()
57
- .map((type) => `0x${type}`), networkId, cache);
46
+ const tokenPriceById = yield cache.getTokenPricesAsMap(poolsInfo
47
+ .map((pool) => { var _a, _b, _c; return ((_c = (_b = (_a = pool.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields) === null || _c === void 0 ? void 0 : _c.type_names) || []; })
48
+ .flat(), networkId);
49
+ const sources = [];
58
50
  for (const pool of poolsInfo) {
59
51
  if (!((_b = (_a = pool.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields))
60
52
  continue;
@@ -64,96 +56,38 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
64
56
  const moveType = (0, aptos_1.parseTypeString)(poolInfo.lp_supply.type);
65
57
  if (!moveType.keys)
66
58
  continue;
67
- const address = moveType.keys[0].type;
68
- if (poolInfo.normalized_balances.length > 2) {
69
- const totalTokens = poolInfo.normalized_balances.length;
70
- const mints = poolInfo.type_names.map((type) => `0x${type}`);
71
- const rawTokensPrices = yield cache.getTokenPrices(mints, portfolio_core_1.NetworkId.sui);
72
- if (!rawTokensPrices)
73
- continue;
74
- const tokensPrices = rawTokensPrices.filter((tokenPrice) => tokenPrice !== undefined);
75
- if (tokensPrices.length === 0)
76
- continue;
77
- const tokenPriceRef = (_e = tokensPrices[0]) === null || _e === void 0 ? void 0 : _e.price;
78
- if (!tokenPriceRef)
79
- continue;
80
- const decimals = poolInfo.lp_decimals;
81
- const poolSupply = new bignumber_js_1.default(poolInfo.lp_supply.fields.value).dividedBy(Math.pow(10, decimals));
82
- let totalLiquidity = new bignumber_js_1.default(0);
83
- const underlyings = [];
84
- for (let i = 0; i < totalTokens; i++) {
85
- const coinDecimal = poolInfo.coin_decimals[i];
86
- const reserveAmount = new bignumber_js_1.default(poolInfo.normalized_balances[i])
87
- .dividedBy(Math.pow(10, coinDecimal))
88
- .dividedBy(poolInfo.decimal_scalars[i]);
89
- const tokenLiquidity = reserveAmount.multipliedBy(tokenPriceRef);
90
- const amountPerLp = reserveAmount.dividedBy(poolSupply).toNumber();
91
- totalLiquidity = totalLiquidity.plus(tokenLiquidity);
92
- underlyings.push({
93
- address: mints[i],
94
- amountPerLp,
95
- decimals: coinDecimal,
96
- networkId,
97
- price: tokenPriceRef,
98
- });
99
- }
100
- if (totalLiquidity.isLessThan(computeAndStoreLpPrice_1.minimumLiquidity))
101
- continue;
102
- const price = totalLiquidity.dividedBy(poolSupply).toNumber();
103
- const tokenPriceSoure = {
104
- id: constants_1.platformId,
105
- weight: 1,
106
- address,
107
- networkId,
108
- platformId: constants_1.platformId,
109
- decimals,
110
- price,
111
- underlyings,
112
- timestamp: Date.now(),
113
- };
114
- yield cache.setTokenPriceSource(tokenPriceSoure);
115
- }
116
- else {
117
- const tokenPriceA = tokenPriceById.get(`0x${poolInfo.type_names[0]}`);
118
- const tokenPriceB = tokenPriceById.get(`0x${poolInfo.type_names[1]}`);
119
- const reserveAmountRawA = new bignumber_js_1.default(poolInfo.normalized_balances[0]).dividedBy(poolInfo.decimal_scalars[0]);
120
- const reserveAmountRawB = new bignumber_js_1.default(poolInfo.normalized_balances[1]).dividedBy(poolInfo.decimal_scalars[1]);
121
- const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(address, networkId, {
122
- address: `0x${poolInfo.type_names[0]}`,
123
- decimals: poolInfo.coin_decimals[0],
124
- reserveAmountRaw: reserveAmountRawA,
125
- tokenPrice: tokenPriceA,
126
- }, {
127
- address: `0x${poolInfo.type_names[1]}`,
128
- decimals: poolInfo.coin_decimals[1],
129
- reserveAmountRaw: reserveAmountRawB,
130
- tokenPrice: tokenPriceB,
59
+ const lpAddress = moveType.keys[0].type;
60
+ const poolUnderlyingsRaw = [];
61
+ poolInfo.normalized_balances.forEach((nBalance, i) => {
62
+ const caddress = (0, portfolio_core_1.formatTokenAddress)(`0x${poolInfo.type_names[i]}`, networkId);
63
+ const tokenPrice = tokenPriceById.get(caddress);
64
+ if (!tokenPrice)
65
+ return;
66
+ poolUnderlyingsRaw.push({
67
+ address: caddress,
68
+ decimals: poolInfo.coin_decimals[i],
69
+ reserveAmountRaw: new bignumber_js_1.default(poolInfo.normalized_balances[i]).dividedBy(poolInfo.decimal_scalars[i]),
70
+ tokenPrice,
71
+ weight: new bignumber_js_1.default(poolInfo.weights[i]).div(Math.pow(10, 18)).toNumber(),
131
72
  });
132
- if (underlyingSource)
133
- yield cache.setTokenPriceSource(underlyingSource);
134
- if (!tokenPriceA || !tokenPriceB)
135
- continue;
136
- const lpSource = (0, getLpTokenSourceRaw_1.default)(networkId, address, constants_1.platformId, {
137
- address,
73
+ });
74
+ if (poolUnderlyingsRaw.length !== poolInfo.normalized_balances.length)
75
+ continue;
76
+ const lpSources = (0, getLpTokenSourceRaw_1.getLpTokenSourceRaw)({
77
+ networkId,
78
+ platformId: constants_1.platformId,
79
+ lpDetails: {
80
+ address: lpAddress,
138
81
  decimals: poolInfo.lp_decimals,
139
- supplyRaw: new bignumber_js_1.default(poolInfo.lp_supply.fields.value),
140
- }, [
141
- {
142
- address: tokenPriceA.address,
143
- decimals: tokenPriceA.decimals,
144
- price: tokenPriceA.price,
145
- reserveAmountRaw: reserveAmountRawA,
146
- },
147
- {
148
- address: tokenPriceB.address,
149
- decimals: tokenPriceB.decimals,
150
- price: tokenPriceB.price,
151
- reserveAmountRaw: reserveAmountRawB,
152
- },
153
- ], '');
154
- yield cache.setTokenPriceSource(lpSource);
155
- }
82
+ supplyRaw: poolInfo.lp_supply.fields.value,
83
+ },
84
+ sourceId: lpAddress,
85
+ poolUnderlyingsRaw,
86
+ priceUnderlyings: true,
87
+ });
88
+ sources.push(...lpSources);
156
89
  }
90
+ yield cache.setTokenPriceSources(sources);
157
91
  });
158
92
  const job = {
159
93
  id: `${constants_1.platformId}-pools`,
@@ -1 +1 @@
1
- {"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aftermath/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAIoC;AAGpC,iDAAmD;AACnD,2CAAuD;AAEvD,oFAA2E;AAC3E,6CAAoD;AACpD,6FAAoE;AACpE,6GAAqF;AACrF,+FAAuE;AACvE,uEAAoE;AACpE,qEAAkE;AAElE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,0BAAS,CAAC,GAAG,CAAC;IAChC,MAAM,gBAAgB,GAAG,MAAM,IAAA,mCAAgB,EAAC,MAAM,EAAE,wBAAY,CAAC,CAAC;IAEtE,MAAM,cAAc,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC/D,IAAI,CAAC,cAAc,CAAC,MAAM;QAAE,OAAO;IAEnC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAe,EAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,QAAQ;SACtB,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;;QAClB,IAAI,MAAA,MAAA,UAAU,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,EAAE,CAAC;YACrC,MAAM,MAAM,GAAG,MAAA,MAAA,UAAU,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAIxC,CAAC;YACF,IAAI,MAAM,CAAC,KAAK;gBAAE,OAAO,MAAM,CAAC,KAAK,CAAC;QACxC,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CA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,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -19,7 +19,7 @@ const structs_1 = require("../orders/clobs-solana/structs");
19
19
  const constants_1 = require("./constants");
20
20
  const structs_2 = require("./structs");
21
21
  const fetchTokenSupplyAndDecimals_1 = require("../../utils/solana/fetchTokenSupplyAndDecimals");
22
- const getLpTokenSource_1 = __importDefault(require("../../utils/misc/getLpTokenSource"));
22
+ const getLpTokenSourceOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceOld"));
23
23
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
24
24
  const client = (0, clients_1.getClientSolana)();
25
25
  const poolsAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_2.poolStruct, constants_1.atrixV1);
@@ -93,7 +93,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
93
93
  decimals,
94
94
  supply,
95
95
  };
96
- const source = (0, getLpTokenSource_1.default)(portfolio_core_1.NetworkId.solana, pool.pubkey.toString(), constants_1.platformId, lpDetailsRaw, poolUnderlyings, 'V1 (Deprecated)');
96
+ const source = (0, getLpTokenSourceOld_1.default)(portfolio_core_1.NetworkId.solana, pool.pubkey.toString(), constants_1.platformId, lpDetailsRaw, poolUnderlyings, 'V1 (Deprecated)');
97
97
  sourcesPromises.push(cache.setTokenPriceSource(source));
98
98
  }
99
99
  yield Promise.allSettled(sourcesPromises);
@@ -1 +1 @@
1
- {"version":3,"file":"poolsV1Job.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/atrix/poolsV1Job.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,+DAAmE;AAGnE,iDAAsD;AACtD,+CAK4B;AAC5B,4DAGwC;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F,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -18,8 +18,8 @@ const aptos_1 = require("../../utils/aptos");
18
18
  const clients_1 = require("../../utils/clients");
19
19
  const constants_1 = require("./constants");
20
20
  const getDecimalsForToken_1 = require("../../utils/misc/getDecimalsForToken");
21
- const getLpUnderlyingTokenSource_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSource"));
22
- const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
21
+ const getLpUnderlyingTokenSourceOld_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSourceOld"));
22
+ const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
23
23
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
24
24
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
25
25
  const client = (0, clients_1.getClientAptos)();
@@ -76,22 +76,24 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
76
76
  new bignumber_js_1.default(tokenPairData.x_reserve.value),
77
77
  new bignumber_js_1.default(tokenPairData.y_reserve.value),
78
78
  ];
79
- const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpType, portfolio_core_1.NetworkId.aptos, {
79
+ const underlyingSource = (0, getLpUnderlyingTokenSourceOld_1.default)(lpType, portfolio_core_1.NetworkId.aptos, {
80
80
  address: typeX,
81
81
  decimals: decimalsX,
82
82
  reserveAmountRaw: reserveAmountRawX,
83
83
  tokenPrice: tokenPriceX,
84
+ weight: 0.5,
84
85
  }, {
85
86
  address: typeY,
86
87
  decimals: decimalsY,
87
88
  reserveAmountRaw: reserveAmountRawY,
88
89
  tokenPrice: tokenPriceY,
90
+ weight: 0.5,
89
91
  });
90
92
  if (underlyingSource)
91
93
  lpSources.push(underlyingSource);
92
94
  if (!tokenPriceX || !tokenPriceY)
93
95
  continue;
94
- const lpSource = (0, getLpTokenSourceRaw_1.default)(portfolio_core_1.NetworkId.aptos, lpType, constants_1.platformId, {
96
+ const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.aptos, lpType, constants_1.platformId, {
95
97
  address: lpType,
96
98
  decimals: lpDecimals,
97
99
  supplyRaw: lpSupply,
@@ -1 +1 @@
1
- {"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/auxexchange/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAIoC;AAGpC,6CAK2B;AAC3B,iDAAqD;AACrD,2CAA+E;AAC/E,8EAA2E;AAC3E,6GAAqF;AACrF,+FAAuE;AAOvE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAChC,MAAM,SAAS,GAAG,MAAM,IAAA,2BAAmB,EAAC,MAAM,EAAE,0BAAc,CAAC,CAAC;IACpE,IAAI,CAAC,SAAS;QAAE,OAAO;IAEvB,MAAM,eAAe,GAAuC,IAAI,GAAG,EAAE,CAAC;IACtE,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC7B,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACjD,SAAS;SACN,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QAChB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,uBAAe,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,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E,WAAW;YACvB,MAAM,EAAE,GAAG;SACZ,CACF,CAAC;QACF,IAAI,gBAAgB;YAAE,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAEvD,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW;YAAE,SAAS;QAC3C,MAAM,QAAQ,GAAG,IAAA,gCAAsB,EACrC,0BAAS,CAAC,KAAK,EACf,MAAM,EACN,sBAAU,EACV;YACE,OAAO,EAAE,MAAM;YACf,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE,QAAQ;SACpB,EACD;YACE;gBACE,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,iBAAiB;aACpC;YACD;gBACE,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,iBAAiB;aACpC;SACF,EACD,EAAE,CACH,CAAC;QACF,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;AAC9C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -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;
@@ -18,8 +18,8 @@ const constants_1 = require("./constants");
18
18
  const clients_1 = require("../../utils/clients");
19
19
  const solana_1 = require("../../utils/solana");
20
20
  const structs_1 = require("./structs");
21
- const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
22
- const getLpUnderlyingTokenSource_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSource"));
21
+ const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
22
+ const getLpUnderlyingTokenSourceOld_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSourceOld"));
23
23
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
24
24
  const connection = (0, clients_1.getClientSolana)();
25
25
  let pools = yield (0, solana_1.getParsedProgramAccounts)(connection, structs_1.poolStruct, new web3_js_1.PublicKey(constants_1.fluxbeamPoolsPid), [{ dataSize: structs_1.poolStruct.byteSize }]);
@@ -71,23 +71,25 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
71
71
  continue;
72
72
  const tokenPriceA = tokenPrices.get(pool.tokenAMint.toString());
73
73
  const tokenPriceB = tokenPrices.get(pool.tokenBMint.toString());
74
- const underlyingsSource = (0, getLpUnderlyingTokenSource_1.default)(pool.poolMint.toString(), portfolio_core_1.NetworkId.solana, {
74
+ const underlyingsSource = (0, getLpUnderlyingTokenSourceOld_1.default)(pool.poolMint.toString(), portfolio_core_1.NetworkId.solana, {
75
75
  address: pool.tokenAMint.toString(),
76
76
  decimals: mintAccountA.decimals,
77
77
  reserveAmountRaw: tokenAccountA.amount,
78
78
  tokenPrice: tokenPriceA,
79
+ weight: 0.5,
79
80
  }, {
80
81
  address: pool.tokenBMint.toString(),
81
82
  decimals: mintAccountB.decimals,
82
83
  reserveAmountRaw: tokenAccountB.amount,
83
84
  tokenPrice: tokenPriceB,
85
+ weight: 0.5,
84
86
  });
85
87
  if (underlyingsSource) {
86
88
  yield cache.setTokenPriceSource(underlyingsSource);
87
89
  }
88
90
  if (!tokenPriceA || !tokenPriceB)
89
91
  continue;
90
- const lpSource = (0, getLpTokenSourceRaw_1.default)(portfolio_core_1.NetworkId.solana, constants_1.platformId, constants_1.platformId, {
92
+ const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.solana, constants_1.platformId, constants_1.platformId, {
91
93
  address: pool.poolMint.toString(),
92
94
  decimals: poolMint.decimals,
93
95
  supplyRaw: poolMint.supply,
@@ -1 +1 @@
1
- {"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/fluxbeam/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,+DAAmE;AAGnE,2CAA2D;AAC3D,iDAAsD;AACtD,+CAQ4B;AAC5B,uCAAuC;AACvC,+FAAuE;AACvE,6GAAqF;AAErF,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,IAAI,KAAK,GAAG,MAAM,IAAA,iCAAwB,EACxC,UAAU,EACV,oBAAU,EACV,IAAI,mBAAS,CAAC,4BAAgB,CAAC,EAC/B,CAAC,EAAE,QAAQ,EAAE,oBAAU,CAAC,QAAQ,EAAE,CAAC,CACpC,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AQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,aAAa,CAAC,MAAM;aACvC;YACD;gBACE,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,aAAa,CAAC,MAAM;aACvC;SACF,EACD,OAAO,CACR,CAAC;QACF,MAAM,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -17,7 +17,7 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
17
  const constants_1 = require("./constants");
18
18
  const clients_1 = require("../../utils/clients");
19
19
  const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
20
- const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
20
+ const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
21
21
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
22
22
  var _a, _b, _c;
23
23
  const client = (0, clients_1.getClientSui)();
@@ -36,7 +36,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
36
36
  (_c = (_b = object.data) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.fields.strategies.fields.contents.forEach((c) => {
37
37
  amount = amount.plus(c.fields.value.fields.borrowed);
38
38
  });
39
- const lpSource = (0, getLpTokenSourceRaw_1.default)(portfolio_core_1.NetworkId.sui, constants_1.platformId, constants_1.platformId, {
39
+ const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.sui, constants_1.platformId, constants_1.platformId, {
40
40
  address: vaultInfo.lpType,
41
41
  decimals: vaultInfo.decimals,
42
42
  supplyRaw: new bignumber_js_1.default(vault.lp_treasury.fields.total_supply.fields.value),
@@ -1 +1 @@
1
- {"version":3,"file":"vaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kai/vaultsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAA2E;AAG3E,2CAAqD;AACrD,iDAAmD;AACnD,qEAAkE;AAElE,+FAAuE;AAEvE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,MAAM,IAAA,iCAAe,EACnC,MAAM,EACN,sBAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAC5B,CAAC;IAEF,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACjD,sBAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAC9B,0BAAS,CAAC,GAAG,CACd,CAAC;IAEF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,MAAM,SAAS,GAAG,sBAAU,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAChC,IAAA,mCAAkB,EAAC,SAAS,CAAC,KAAK,EAAE,0BAAS,CAAC,GAAG,CAAC,CACnD,CAAC;QACF,IAAI,CAAC,UAAU;YAAE,SAAS;QAC1B,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,CAAA,MAAA,MAAM,CAAC,IAAI,0CAAE,OAAO,CAAA;YAAE,SAAS;QAEpC,MAAM,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C,CAAC,EAAE,EAAE;YACpE,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,IAAA,gCAAsB,EACrC,0BAAS,CAAC,GAAG,EACb,sBAAU,EACV,sBAAU,EACV;YACE,OAAO,EAAE,SAAS,CAAC,MAAM;YACzB,QAAQ,EAAE,SAAS,CAAC,QAAQ;YAC5B,SAAS,EAAE,IAAI,sBAAS,CACtB,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CACnD;SACF,EACD;YACE;gBACE,OAAO,EAAE,SAAS,CAAC,KAAK;gBACxB,QAAQ,EAAE,SAAS,CAAC,QAAQ;gBAC5B,gBAAgB,EAAE,MAAM;gBACxB,KAAK,EAAE,UAAU,CAAC,KAAK;aACxB;SACF,EACD,QAAQ,CACT,CAAC;QACF,MAAM,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -20,8 +20,8 @@ const constants_2 = require("./constants");
20
20
  const sei_1 = require("../../utils/sei");
21
21
  const isAContract_1 = __importDefault(require("../../utils/sei/isAContract"));
22
22
  const getDecimalsForToken_1 = require("../../utils/misc/getDecimalsForToken");
23
- const getLpUnderlyingTokenSource_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSource"));
24
- const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
23
+ const getLpUnderlyingTokenSourceOld_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSourceOld"));
24
+ const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
25
25
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
26
26
  const cosmWasmClient = yield (0, core_1.getCosmWasmClient)((0, constants_1.getUrlEndpoint)(portfolio_core_1.NetworkId.sei));
27
27
  const pushedContractsByPlatform = new Map();
@@ -64,22 +64,24 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
64
64
  ];
65
65
  if (!decimalsX || !decimalsY)
66
66
  continue;
67
- const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpContract, portfolio_core_1.NetworkId.sei, {
67
+ const underlyingSource = (0, getLpUnderlyingTokenSourceOld_1.default)(lpContract, portfolio_core_1.NetworkId.sei, {
68
68
  address: poolInfo.mintX,
69
69
  decimals: decimalsX,
70
70
  reserveAmountRaw: reserveAmountRawX,
71
71
  tokenPrice: tokenPriceX,
72
+ weight: 0.5,
72
73
  }, {
73
74
  address: poolInfo.mintY,
74
75
  decimals: decimalsY,
75
76
  reserveAmountRaw: reserveAmountRawY,
76
77
  tokenPrice: tokenPriceY,
78
+ weight: 0.5,
77
79
  });
78
80
  if (underlyingSource)
79
81
  yield cache.setTokenPriceSource(underlyingSource);
80
82
  if (!tokenPriceX || !tokenPriceY)
81
83
  continue;
82
- const lpSource = (0, getLpTokenSourceRaw_1.default)(portfolio_core_1.NetworkId.sei, lpContract, platformId, {
84
+ const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.sei, lpContract, platformId, {
83
85
  address: lpContract,
84
86
  decimals: lpTokenInfo.decimals,
85
87
  supplyRaw: supply,
@@ -1 +1 @@
1
- {"version":3,"file":"job.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liquiditypools-sei/job.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uCAAiD;AACjD,+DAAuD;AACvD,gEAAqC;AAGrC,6DAA+D;AAC/D,2CAA4D;AAC5D,yCAKyB;AACzB,8EAAsD;AACtD,8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Q;YAChB,SAAS,EAAE,0BAAS,CAAC,GAAG;SACzB,CACF,CAAC;IACJ,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,oBAAQ;IACZ,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -17,7 +17,7 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
17
  const aptos_1 = require("../../utils/aptos");
18
18
  const clients_1 = require("../../utils/clients");
19
19
  const constants_1 = require("./constants");
20
- const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
20
+ const getLpTokenSourceRawOld_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRawOld"));
21
21
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
22
22
  var _a, _b, _c;
23
23
  const client = (0, clients_1.getClientAptos)();
@@ -89,7 +89,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
89
89
  ];
90
90
  if (!tokenPriceX || !tokenPriceY)
91
91
  continue;
92
- const lpSource = (0, getLpTokenSourceRaw_1.default)(portfolio_core_1.NetworkId.aptos, lpType, constants_1.platformId, {
92
+ const lpSource = (0, getLpTokenSourceRawOld_1.default)(portfolio_core_1.NetworkId.aptos, lpType, constants_1.platformId, {
93
93
  address: lpType,
94
94
  decimals: lpDecimals,
95
95
  supplyRaw: lpSupply,
@@ -1 +1 @@
1
- {"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liquidswap/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAA2E;AAO3E,6CAK2B;AAC3B,iDAAqD;AACrD,2CAKqB;AACrB,+FAAuE;AAEvE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAChC,MAAM,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