@sonarwatch/portfolio-plugins 0.11.148 → 0.11.150

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. package/CHANGELOG.md +1327 -1319
  2. package/README.md +3 -3
  3. package/package.json +2 -2
  4. package/src/index.js +0 -4
  5. package/src/index.js.map +1 -1
  6. package/src/plugins/balancer/helpers/pools.js +21 -21
  7. package/src/plugins/flexlend/depositsFetcher.js +63 -4
  8. package/src/plugins/flexlend/depositsFetcher.js.map +1 -1
  9. package/src/plugins/flexlend/struct.d.ts +18 -0
  10. package/src/plugins/flexlend/struct.js +18 -0
  11. package/src/plugins/flexlend/struct.js.map +1 -0
  12. package/src/plugins/hawksight/positionsFetcher.js +31 -13
  13. package/src/plugins/hawksight/positionsFetcher.js.map +1 -1
  14. package/src/plugins/orca/getWhirlpoolPositions.d.ts +2 -3
  15. package/src/plugins/orca/getWhirlpoolPositions.js +2 -14
  16. package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
  17. package/src/plugins/orca/helpers.d.ts +2 -2
  18. package/src/plugins/orca/helpers.js +1 -1
  19. package/src/plugins/orca/helpers.js.map +1 -1
  20. package/src/plugins/raydium/getRaydiumCLMMPositions.d.ts +2 -3
  21. package/src/plugins/raydium/getRaydiumCLMMPositions.js +3 -3
  22. package/src/plugins/raydium/getRaydiumCLMMPositions.js.map +1 -1
  23. package/src/plugins/raydium/helpers.d.ts +2 -2
  24. package/src/plugins/raydium/helpers.js +6 -1
  25. package/src/plugins/raydium/helpers.js.map +1 -1
  26. package/src/plugins/realms/constants.d.ts +4 -2
  27. package/src/plugins/realms/constants.js +10 -3
  28. package/src/plugins/realms/constants.js.map +1 -1
  29. package/src/plugins/realms/helpers.d.ts +4 -5
  30. package/src/plugins/realms/helpers.js +20 -28
  31. package/src/plugins/realms/helpers.js.map +1 -1
  32. package/src/plugins/realms/index.js +5 -5
  33. package/src/plugins/realms/index.js.map +1 -1
  34. package/src/plugins/realms/{depositsFetcher.js → realmsDepositsFetcher.js} +1 -1
  35. package/src/plugins/realms/realmsDepositsFetcher.js.map +1 -0
  36. package/src/plugins/realms/{programsJob.js → realmsProgramsJob.js} +4 -4
  37. package/src/plugins/realms/realmsProgramsJob.js.map +1 -0
  38. package/src/plugins/realms/types.d.ts +1 -1
  39. package/src/plugins/solend/constants.d.ts +1 -0
  40. package/src/plugins/solend/constants.js +2 -1
  41. package/src/plugins/solend/constants.js.map +1 -1
  42. package/src/plugins/solend/helpers.d.ts +6 -0
  43. package/src/plugins/solend/helpers.js +132 -1
  44. package/src/plugins/solend/helpers.js.map +1 -1
  45. package/src/plugins/solend/marketsJob.js +6 -0
  46. package/src/plugins/solend/marketsJob.js.map +1 -1
  47. package/src/plugins/solend/obligationsFetcher.js +27 -156
  48. package/src/plugins/solend/obligationsFetcher.js.map +1 -1
  49. package/src/plugins/solend/reservesJob.js +15 -6
  50. package/src/plugins/solend/reservesJob.js.map +1 -1
  51. package/src/plugins/solend/types.d.ts +1 -1
  52. package/src/plugins/suilend/obligationsFetcher.js +2 -0
  53. package/src/plugins/suilend/obligationsFetcher.js.map +1 -1
  54. package/src/plugins/sushiswap/helpers.js +24 -24
  55. package/src/plugins/tokens/fetchers/solana-nfts-underlyings.js +25 -14
  56. package/src/plugins/tokens/fetchers/solana-nfts-underlyings.js.map +1 -1
  57. package/src/plugins/tokens/fetchers/solana.js +3 -1
  58. package/src/plugins/tokens/fetchers/solana.js.map +1 -1
  59. package/src/plugins/uniswap-v2/helpers.js +22 -22
  60. package/src/utils/sei/constants.js +8 -8
  61. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  62. package/src/utils/solana/das/getAssetsByOwnerDas.d.ts +2 -2
  63. package/src/utils/solana/das/getAssetsByOwnerDas.js +3 -9
  64. package/src/utils/solana/das/getAssetsByOwnerDas.js.map +1 -1
  65. package/src/utils/solana/das/getDisplayOptions.d.ts +2 -0
  66. package/src/utils/solana/das/getDisplayOptions.js +16 -0
  67. package/src/utils/solana/das/getDisplayOptions.js.map +1 -0
  68. package/src/utils/solana/das/types.d.ts +8 -0
  69. package/src/plugins/phoenix/constants.d.ts +0 -7
  70. package/src/plugins/phoenix/constants.js +0 -17
  71. package/src/plugins/phoenix/constants.js.map +0 -1
  72. package/src/plugins/phoenix/helpers.d.ts +0 -6
  73. package/src/plugins/phoenix/helpers.js +0 -46
  74. package/src/plugins/phoenix/helpers.js.map +0 -1
  75. package/src/plugins/phoenix/helpers2.d.ts +0 -0
  76. package/src/plugins/phoenix/helpers2.js +0 -179
  77. package/src/plugins/phoenix/helpers2.js.map +0 -1
  78. package/src/plugins/phoenix/index.d.ts +0 -6
  79. package/src/plugins/phoenix/index.js +0 -10
  80. package/src/plugins/phoenix/index.js.map +0 -1
  81. package/src/plugins/phoenix/marketsJob.js +0 -39
  82. package/src/plugins/phoenix/marketsJob.js.map +0 -1
  83. package/src/plugins/phoenix/positionsFetcher.js +0 -64
  84. package/src/plugins/phoenix/positionsFetcher.js.map +0 -1
  85. package/src/plugins/phoenix/structs.d.ts +0 -67
  86. package/src/plugins/phoenix/structs.js +0 -82
  87. package/src/plugins/phoenix/structs.js.map +0 -1
  88. package/src/plugins/phoenix/types.d.ts +0 -29
  89. package/src/plugins/phoenix/types.js +0 -3
  90. package/src/plugins/phoenix/types.js.map +0 -1
  91. package/src/plugins/realms/depositsFetcher.d.ts +0 -3
  92. package/src/plugins/realms/depositsFetcher.js.map +0 -1
  93. package/src/plugins/realms/programsJob.d.ts +0 -3
  94. package/src/plugins/realms/programsJob.js.map +0 -1
  95. /package/src/plugins/{phoenix/positionsFetcher.d.ts → realms/realmsDepositsFetcher.d.ts} +0 -0
  96. /package/src/plugins/{phoenix/marketsJob.d.ts → realms/realmsProgramsJob.d.ts} +0 -0
@@ -8,39 +8,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
- const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
13
  const web3_js_1 = require("@solana/web3.js");
18
14
  const constants_1 = require("./constants");
19
15
  const helpers_1 = require("./helpers");
20
16
  const solana_1 = require("../../utils/solana");
21
17
  const clients_1 = require("../../utils/clients");
22
18
  const structs_1 = require("./structs");
23
- const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
24
- const runInBatch_1 = __importDefault(require("../../utils/misc/runInBatch"));
25
- const constants_2 = require("../flexlend/constants");
26
- const helpers_2 = require("../../utils/solana/pyth/helpers");
19
+ const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
27
20
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
28
21
  const client = (0, clients_1.getClientSolana)();
29
22
  const obligationAddresses = [];
30
- const markets = yield cache.getAllItems({
31
- prefix: constants_1.marketsPrefix,
23
+ const markets = yield cache.getItem(constants_1.marketsKey, {
24
+ prefix: constants_1.platformId,
32
25
  networkId: portfolio_core_1.NetworkId.solana,
33
26
  });
34
- if (markets.length === 0)
27
+ if (!markets)
35
28
  return [];
36
29
  const marketsByAddress = new Map();
37
30
  markets.forEach((market) => {
38
31
  if (market)
39
32
  marketsByAddress.set(market.address.toString(), market);
40
33
  });
41
- for (const marketInfo of markets) {
34
+ marketsByAddress.forEach((marketInfo) => __awaiter(void 0, void 0, void 0, function* () {
42
35
  if (!marketInfo)
43
- continue;
36
+ return;
44
37
  const seeds = [
45
38
  (0, helpers_1.getObligationSeed)(marketInfo.address, 0),
46
39
  (0, helpers_1.getObligationSeed)(marketInfo.address, 1),
@@ -51,28 +44,25 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
51
44
  const obligationAddress = yield web3_js_1.PublicKey.createWithSeed(new web3_js_1.PublicKey(owner), seed, constants_1.pid);
52
45
  obligationAddresses.push(obligationAddress);
53
46
  }
54
- }
55
- // Flexlend, only support the main pool on Solend
56
- const marketSeed = constants_1.mainMarket.slice(0, 16);
57
- const ownerSeed = owner.slice(0, 16);
58
- const obligationSeed = ownerSeed + marketSeed;
59
- const oldFlexlendObligAddress = yield web3_js_1.PublicKey.createWithSeed(constants_2.AUTOMATION_PUBLIC_KEY, obligationSeed, constants_1.pid);
60
- const newFlexlendObligAddress = yield web3_js_1.PublicKey.createWithSeed(new web3_js_1.PublicKey(owner), obligationSeed, constants_1.pid);
61
- obligationAddresses.push(...[oldFlexlendObligAddress, newFlexlendObligAddress]);
62
- const obligations = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.obligationStruct, obligationAddresses);
63
- if (obligations.length === 0)
47
+ }));
48
+ const obligationsRaw = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.obligationStruct, obligationAddresses);
49
+ if (obligationsRaw.length === 0)
64
50
  return [];
51
+ const obligations = [];
65
52
  const reserveAddresses = new Set();
66
- obligations.forEach((obligation) => {
53
+ obligationsRaw.forEach((obligation) => {
67
54
  if (!obligation)
68
55
  return;
69
56
  const market = marketsByAddress.get(obligation.lendingMarket.toString());
70
57
  if (!market)
71
58
  return;
59
+ obligations.push(obligation);
72
60
  market.reserves.forEach((reserve) => {
73
61
  reserveAddresses.add(reserve.address);
74
62
  });
75
63
  });
64
+ if (obligations.length === 0)
65
+ return [];
76
66
  const reservesInfos = yield cache.getItems(Array.from(reserveAddresses), {
77
67
  prefix: constants_1.reservesPrefix,
78
68
  networkId: portfolio_core_1.NetworkId.solana,
@@ -80,144 +70,25 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
80
70
  if (!reservesInfos)
81
71
  return [];
82
72
  const reserveByAddress = new Map();
83
- reservesInfos.forEach((reserve) => {
84
- if (!reserve)
85
- return;
86
- reserveByAddress.set(reserve.pubkey, reserve);
87
- });
88
- const tokensAddresses = new Set();
73
+ const mints = new Set();
74
+ const pythAddresses = [];
89
75
  reservesInfos.forEach((reserveInfo) => {
90
76
  if (!reserveInfo)
91
77
  return;
92
- tokensAddresses.add(reserveInfo.reserve.liquidity.mintPubkey);
93
- });
94
- const tokenPriceResults = yield (0, runInBatch_1.default)([...tokensAddresses].map((mint) => () => cache.getTokenPrice(mint, portfolio_core_1.NetworkId.solana)));
95
- const tokenPrices = new Map();
96
- tokenPriceResults.forEach((r) => {
97
- if (r.status === 'rejected')
98
- return;
99
- if (!r.value)
100
- return;
101
- tokenPrices.set(r.value.address, r.value);
78
+ mints.add(reserveInfo.reserve.liquidity.mintPubkey);
79
+ reserveByAddress.set(reserveInfo.pubkey, reserveInfo);
80
+ pythAddresses.push(new web3_js_1.PublicKey(reserveInfo.reserve.liquidity.pythOracle));
102
81
  });
103
- const elements = [];
104
- for (let i = 0; i < obligations.length; i += 1) {
105
- const obligation = obligations[i];
106
- if (!obligation)
107
- continue;
108
- const market = marketsByAddress.get(obligation.lendingMarket.toString());
109
- if (!market)
110
- continue;
111
- const { depositsMap, borrowsMap } = (0, helpers_1.parseDataflat)(obligation.dataFlat, obligation.depositsLen, obligation.borrowsLen);
112
- if (depositsMap.size === 0 && borrowsMap.size === 0)
82
+ const tokenPriceByAddress = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
83
+ const pythAccounts = yield (0, getMultipleAccountsInfoSafe_1.getMultipleAccountsInfoSafe)(client, pythAddresses);
84
+ const pythAccByAddress = new Map();
85
+ for (let i = 0; i < pythAddresses.length; i++) {
86
+ const account = pythAccounts[i];
87
+ if (account === null)
113
88
  continue;
114
- const borrowedAssets = [];
115
- const borrowedYields = [];
116
- const suppliedAssets = [];
117
- const suppliedYields = [];
118
- const rewardAssets = [];
119
- const suppliedLtvs = [];
120
- const borrowedWeights = [];
121
- for (let j = 0; j < market.reserves.length; j += 1) {
122
- const { address: reserveAddress } = market.reserves[j];
123
- const reserveInfo = reserveByAddress.get(reserveAddress);
124
- if (!reserveInfo)
125
- continue;
126
- const { reserve } = reserveInfo;
127
- const { liquidity, collateral } = reserve;
128
- const lMint = liquidity.mintPubkey;
129
- const lTokenPrice = tokenPrices.get(lMint);
130
- let price;
131
- if (!lTokenPrice) {
132
- const pythOracle = new web3_js_1.PublicKey(reserve.liquidity.pythOracle);
133
- const pythAccount = yield client.getAccountInfo(pythOracle);
134
- const pythPrice = pythAccount
135
- ? (0, helpers_2.parsePriceData)(pythAccount.data)
136
- : undefined;
137
- if (pythPrice)
138
- price = pythPrice.price;
139
- }
140
- const decimals = liquidity.mintDecimals;
141
- const reserveBorrowAmount = new bignumber_js_1.default(liquidity.borrowedAmountWads)
142
- .dividedBy(Math.pow(10, (constants_1.wadsDecimal + decimals)))
143
- .toNumber();
144
- const reserveAvailableAmount = new bignumber_js_1.default(liquidity.availableAmount)
145
- .dividedBy(Math.pow(10, decimals))
146
- .toNumber();
147
- const collateralSupply = new bignumber_js_1.default(collateral.mintTotalSupply)
148
- .dividedBy(Math.pow(10, decimals))
149
- .toNumber();
150
- const reserveDepositAmount = reserveBorrowAmount + reserveAvailableAmount;
151
- // Deposit
152
- const deposit = depositsMap.get(reserveAddress);
153
- if (deposit) {
154
- if (!deposit.depositedAmount.isZero()) {
155
- const suppliedAmount = deposit.depositedAmount
156
- .div(Math.pow(10, decimals))
157
- .times(reserveDepositAmount / collateralSupply)
158
- .toNumber();
159
- suppliedLtvs.push(reserve.config.liquidationThreshold / 100);
160
- const apy = +reserveInfo.rates.supplyInterest / 100;
161
- const cSuppliedYields = [
162
- {
163
- apr: (0, portfolio_core_1.apyToApr)(apy),
164
- apy,
165
- },
166
- ];
167
- suppliedYields.push(cSuppliedYields);
168
- suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(lMint, suppliedAmount, portfolio_core_1.NetworkId.solana, lTokenPrice, price));
169
- }
170
- }
171
- // Borrow
172
- const borrow = borrowsMap.get(reserveAddress);
173
- if (borrow) {
174
- if (!borrow.borrowedAmountWads.isZero()) {
175
- const borrowedAmount = borrow.borrowedAmountWads
176
- .times(new bignumber_js_1.default(liquidity.cumulativeBorrowRateWads))
177
- .div(borrow.cumulativeBorrowRateWads)
178
- .dividedBy(new bignumber_js_1.default(Math.pow(10, (constants_1.wadsDecimal + decimals))))
179
- .toNumber();
180
- borrowedWeights.push(new bignumber_js_1.default(reserve.config.addedBorrowWeightBPS)
181
- .dividedBy(Math.pow(10, 4))
182
- .plus(1)
183
- .toNumber());
184
- const apy = +reserveInfo.rates.borrowInterest / 100;
185
- const cBorrowedYields = [
186
- {
187
- apr: -(0, portfolio_core_1.apyToApr)(apy),
188
- apy: -apy,
189
- },
190
- ];
191
- borrowedYields.push(cBorrowedYields);
192
- borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(lMint, borrowedAmount, portfolio_core_1.NetworkId.solana, lTokenPrice, price));
193
- }
194
- }
195
- }
196
- if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
197
- continue;
198
- const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs, borrowedWeights);
199
- elements.push({
200
- type: portfolio_core_1.PortfolioElementType.borrowlend,
201
- networkId: portfolio_core_1.NetworkId.solana,
202
- platformId: constants_1.platformId,
203
- label: 'Lending',
204
- value,
205
- name: market.name,
206
- data: {
207
- borrowedAssets,
208
- borrowedValue,
209
- borrowedYields,
210
- suppliedAssets,
211
- suppliedValue,
212
- suppliedYields,
213
- collateralRatio: null,
214
- healthRatio,
215
- rewardAssets,
216
- rewardValue,
217
- value,
218
- },
219
- });
89
+ pythAccByAddress.set(pythAddresses[i].toString(), account);
220
90
  }
91
+ const elements = (0, helpers_1.getElementsFromObligations)(obligations, reserveByAddress, marketsByAddress, tokenPriceByAddress, pythAccByAddress);
221
92
  return elements;
222
93
  });
223
94
  const fetcher = {
@@ -1 +1 @@
1
- {"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/pl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AoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK;YACL,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,eAAe,EAAE,IAAI;gBAErB,WAAW;gBACX,YAAY;gBACZ,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solend/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAAyD;AAGzD,2CAA0E;AAC1E,uCAA0E;AAE1E,+CAG4B;AAC5B,iDAAsD;AACtD,uCAAyD;AACzD,gGAA6F;AAE7F,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,mBAAmB,GAAgB,EAAE,CAAC;IAE5C,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,CAAe,sBAAU,EAAE;QAC5D,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,MAAM,gBAAgB,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC5D,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EA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ACjB,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,MAAM,YAAY,GAAG,MAAM,IAAA,yDAA2B,EAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC9E,MAAM,gBAAgB,GAAqC,IAAI,GAAG,EAAE,CAAC;IACrE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9C,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,OAAO,KAAK,IAAI;YAAE,SAAS;QAE/B,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,QAAQ,GAAuB,IAAA,oCAA0B,EAC7D,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,CACjB,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -22,20 +22,29 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
22
22
  });
23
23
  const reservesAddressesByMarket = markets.map((m) => m.reserves.map((r) => r.address));
24
24
  const promises = [];
25
+ const reservesInfosResponses = [];
26
+ const mints = new Set();
25
27
  for (let i = 0; i < reservesAddressesByMarket.length; i += 1) {
26
28
  const reservesAddresses = reservesAddressesByMarket[i];
27
- const poolName = markets[i].name;
28
29
  const reservesInfoRes = yield axios_1.default
29
30
  .get(`${constants_1.reserveEndpoint}${reservesAddresses.join(',')}`)
30
31
  .catch(() => {
31
32
  //
32
33
  });
34
+ reservesInfosResponses.push(reservesInfoRes);
35
+ if (!reservesInfoRes)
36
+ continue;
37
+ reservesInfoRes.data.results.forEach((res) => {
38
+ mints.add(res.reserve.liquidity.mintPubkey);
39
+ });
40
+ }
41
+ const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
42
+ for (let i = 0; i < reservesAddressesByMarket.length; i += 1) {
43
+ const reservesAddresses = reservesAddressesByMarket[i];
44
+ const poolName = markets[i].name;
45
+ const reservesInfoRes = reservesInfosResponses[i];
33
46
  if (!reservesInfoRes)
34
47
  continue;
35
- const mints = reservesInfoRes.data.results.map((res) => res.reserve.liquidity.mintPubkey);
36
- const tokensPrices = yield cache.getTokenPrices(mints, portfolio_core_1.NetworkId.solana);
37
- const tokenPriceById = new Map();
38
- tokensPrices.forEach((tokenPrice) => tokenPrice ? tokenPriceById.set(tokenPrice.address, tokenPrice) : []);
39
48
  for (let j = 0; j < reservesInfoRes.data.results.length; j += 1) {
40
49
  const reserveInfo = reservesInfoRes.data.results[j];
41
50
  const reserveAddress = reservesAddresses[j];
@@ -47,7 +56,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
47
56
  const { liquidity, collateral } = reserve;
48
57
  const { mintPubkey } = liquidity;
49
58
  const decimals = liquidity.mintDecimals;
50
- const cTokenExchangeRate = new bignumber_js_1.default(reserve.cTokenExchangeRate);
59
+ const cTokenExchangeRate = new bignumber_js_1.default(reserveInfo.cTokenExchangeRate);
51
60
  const tokenAddress = reserveInfo.reserve.collateral.mintPubkey;
52
61
  const borrowApy = +reserveInfo.rates.borrowInterest / 100;
53
62
  const depositApy = +reserveInfo.rates.supplyInterest / 100;
@@ -1 +1 @@
1
- {"version":3,"file":"reservesJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solend/reservesJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,+DAMoC;AACpC,gEAAqC;AACrC,2CAMqB;AAKrB,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAA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eRate: string;
40
41
  }
41
42
  export type ReserveInfoExtended = ReserveInfo & {
42
43
  pubkey: string;
@@ -80,7 +81,6 @@ export interface ReserveData {
80
81
  borrowedAmountWads: string;
81
82
  addedBorrowWeightBPS: string;
82
83
  };
83
- cTokenExchangeRate: string;
84
84
  }
85
85
  export interface RatesInfo {
86
86
  supplyInterest: string;
@@ -140,6 +140,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
140
140
  for (const userRewardManager of userRewardManagers) {
141
141
  const share = new bignumber_js_1.default(userRewardManager.fields.share);
142
142
  for (const userReward of userRewardManager.fields.rewards) {
143
+ if (!userReward)
144
+ continue;
143
145
  const poolReward = poolRewardById.get(userReward.fields.pool_reward_id);
144
146
  if (!poolReward)
145
147
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AACnD,qEAAkE;AAOlE,qEAAkE;AAClE,qGAA6E;AAC7E,uCAAgE;AAChE,mDAAkD;AAElD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,oBAAoB,GAAG,MAAM,IAAA,iCAAe,EAChD,MAAM,EACN,KAAK,EACL;QACE,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAS,EAAE;KAC/B,CACF,CAAC;IACF,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEjD,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,KAAK,MAAM,kBAAkB,IAAI,oBAAoB,EAAE,CAAC;QACtD,MAAM,IAAI,GAAG,MAAA,MAAA,kBAAkB,CAAC,IAAI,0CAAE,OAAO,0CAAE,I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W;YACX,KAAK;SACN;KACF,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AACnD,qEAAkE;AAOlE,qEAAkE;AAClE,qGAA6E;AAC7E,uCAAgE;AAChE,mDAAkD;AAElD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,oBAAoB,GAAG,MAAM,IAAA,iCAAe,EAChD,MAAM,EACN,KAAK,EACL;QACE,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAS,EAAE;KAC/B,CACF,CAAC;IACF,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEjD,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,KAAK,MAAM,kBAAkB,IAAI,oBAAoB,EAAE,CAAC;QACtD,MAAM,IAAI,GAAG,MAAA,MAAA,kBAAkB,CAAC,IAAI,0CAAE,OAAO,0CAAE,IAAI,CAAC;QACpD,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,CAAC,kCAAsB,CAAC,CAAA;YAAE,SAAS;QAExD,MAAM,YAAY,GAAG,MAAA,MAAA,kBAAkB,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,aAAa,CAAC;QAC5E,IAAI,YAAY;YAAE,aAAa,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AAEF,kBAAe,OAAO,CAAC"}
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
54
54
  }
55
55
  function getV3PairsAddresses(url, length = 300) {
56
56
  return __awaiter(this, void 0, void 0, function* () {
57
- const query = (0, graphql_request_1.gql) `
58
- {
59
- pools(
60
- orderBy: totalValueLockedUSD
61
- first: ${length}
62
- orderDirection: desc
63
- where: { volumeUSD_not: "0", liquidity_not: "0" }
64
- ) {
65
- id
66
- token0Price
67
- token1Price
68
- liquidity
69
- token0 {
70
- id
71
- totalSupply
72
- decimals
73
- }
74
- token1 {
75
- id
76
- totalSupply
77
- decimals
78
- }
79
- }
80
- }
57
+ const query = (0, graphql_request_1.gql) `
58
+ {
59
+ pools(
60
+ orderBy: totalValueLockedUSD
61
+ first: ${length}
62
+ orderDirection: desc
63
+ where: { volumeUSD_not: "0", liquidity_not: "0" }
64
+ ) {
65
+ id
66
+ token0Price
67
+ token1Price
68
+ liquidity
69
+ token0 {
70
+ id
71
+ totalSupply
72
+ decimals
73
+ }
74
+ token1 {
75
+ id
76
+ totalSupply
77
+ decimals
78
+ }
79
+ }
80
+ }
81
81
  `;
82
82
  const res = yield (0, graphql_request_1.default)(url, query);
83
83
  const pools = res.pools;
@@ -8,17 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
- const web3_js_1 = require("@solana/web3.js");
14
- const js_1 = require("@metaplex-foundation/js");
15
16
  const constants_1 = require("../constants");
16
- const clients_1 = require("../../../utils/clients");
17
17
  const getRaydiumCLMMPositions_1 = require("../../raydium/getRaydiumCLMMPositions");
18
18
  const getWhirlpoolPositions_1 = require("../../orca/getWhirlpoolPositions");
19
19
  const helpers_1 = require("../../raydium/helpers");
20
20
  const helpers_2 = require("../../orca/helpers");
21
21
  const helpers_3 = require("../../realms/helpers");
22
+ const getSolanaDasEndpoint_1 = __importDefault(require("../../../utils/clients/getSolanaDasEndpoint"));
23
+ const getAssetsByOwnerDas_1 = require("../../../utils/solana/das/getAssetsByOwnerDas");
24
+ const heliusAssetToAssetCollectible_1 = require("../../../utils/solana/das/heliusAssetToAssetCollectible");
22
25
  // Add here any pair of [Identifier,Appraiser] =
23
26
  // Identifier : a string to filter the asset concerned
24
27
  // Appraiser : the function to apply to those asset to get their underlying value
@@ -27,26 +30,34 @@ const helpers_3 = require("../../realms/helpers");
27
30
  const appraiserByIdentifier = new Map([
28
31
  [helpers_1.isARaydiumPosition, getRaydiumCLMMPositions_1.getRaydiumCLMMPositions],
29
32
  [helpers_2.isAnOrcaPosition, getWhirlpoolPositions_1.getWhirlpoolPositions],
30
- [helpers_3.isAVotingEscrowPosition, helpers_3.getPositionFromVotingEscrowNFT],
33
+ [helpers_3.isAnHeliumNFTVote, helpers_3.getHeliumElementsFromNFTs],
31
34
  ]);
32
35
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
33
- var _a;
34
- const client = (0, clients_1.getClientSolana)();
35
- const ownerPubKey = new web3_js_1.PublicKey(owner);
36
- const metaplex = new js_1.Metaplex(client);
37
- const outputs = yield metaplex.nfts().findAllByOwner({
38
- owner: ownerPubKey,
39
- });
36
+ var _a, _b;
37
+ const dasEndpoint = (0, getSolanaDasEndpoint_1.default)();
38
+ const displayOptions = {
39
+ showCollectionMetadata: true,
40
+ showUnverifiedCollections: true,
41
+ showInscription: false,
42
+ showNativeBalance: false,
43
+ showGrandTotal: false,
44
+ showFungible: true,
45
+ };
46
+ const assets = yield (0, getAssetsByOwnerDas_1.getAssetsByOwnerDas)(dasEndpoint, owner, displayOptions);
40
47
  const nftsByIndentifier = new Map();
41
- for (let n = 0; n < outputs.length; n++) {
42
- const nft = outputs[n];
48
+ for (let n = 0; n < assets.length; n++) {
49
+ const nft = (0, heliusAssetToAssetCollectible_1.heliusAssetToAssetCollectible)(assets[n]);
50
+ if (!nft)
51
+ continue;
52
+ if ((_a = nft.attributes.tags) === null || _a === void 0 ? void 0 : _a.includes('compressed'))
53
+ continue;
43
54
  for (const identifier of appraiserByIdentifier.keys()) {
44
55
  if (identifier(nft)) {
45
56
  if (!nftsByIndentifier.get(identifier)) {
46
57
  nftsByIndentifier.set(identifier, [nft]);
47
58
  }
48
59
  else {
49
- (_a = nftsByIndentifier.get(identifier)) === null || _a === void 0 ? void 0 : _a.push(nft);
60
+ (_b = nftsByIndentifier.get(identifier)) === null || _b === void 0 ? void 0 : _b.push(nft);
50
61
  }
51
62
  }
52
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"solana-nfts-underlyings.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/tokens/fetchers/solana-nfts-underlyings.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AACzE,6CAA4C;AAE5C,gDAMiC;AAEjC,4CAAoD;AACpD,oDAAyD;AAEzD,mFAAgF;AAChF,4EAAyE;AACzE,mDAA2D;AAC3D,gDAAsD;AACtD,kDAG8B;AAS9B,gDAAgD;AAChD,sDAAsD;AACtD,iFAAiF;AACjF,EAAE;AACF,2BAA2B;AAE3B,MAAM,qBAAqB,GAA+B,IAAI,GAAG,CAAC;IAChE,CAAC,4BAAkB,EAAE,iDAAuB,CAAC;IAC7C,CAAC,0BAAgB,EAAE,6CAAqB,CAAC;IACzC,CAAC,iCAAuB,EAAE,wCAA8B,CAAC;CAC1D,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,WAAW,GAAG,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAI,aAA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AC,GAAG,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAC1D,IAAI,EAAE,CAAC;IAEV,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,gCAAoB,CAAC,EAAE,0BAA0B;IACxD,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"solana-nfts-underlyings.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/tokens/fetchers/solana-nfts-underlyings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,4CAAoD;AAEpD,mFAAgF;AAChF,4EAAyE;AACzE,mDAA2D;AAC3D,gDAAsD;AACtD,kDAG8B;AAC9B,uGAA+E;AAC/E,uFAAoF;AAEpF,2GAAwG;AASxG,gDAAgD;AAChD,sDAAsD;AACtD,iFAAiF;AACjF,EAAE;AACF,2BAA2B;AAE3B,MAAM,qBAAqB,GAA+B,IAAI,GAAG,CAAC;IAChE,CAAC,4BAAkB,EAAE,iDAAuB,CAAC;IAC7C,CAAC,0BAAgB,EAAE,6CAAqB,CAAC;IACzC,CAAC,2BAAiB,EAAE,mCAAyB,CAAC;CAC/C,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,WAAW,GAAG,IAAA,8BAAoB,GAAE,CAAC;IAC3C,MAAM,cAAc,GAAmB;QACrC,sBAAsB,EAAE,IAAI;QAC5B,yBAAyB,EAAE,IAAI;QAC/B,eAAe,EAAE,KAAK;QACtB,iBAAiB,EAAE,KAAK;QACxB,cAAc,EAAE,KAAK;QACrB,YAAY,EAAE,IAAI;KACnB,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,IAAA,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AQ,GAAG,MAAM;SACpB,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SAC1D,IAAI,EAAE,CAAC;IAEV,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,gCAAoB,CAAC,EAAE,0BAA0B;IACxD,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -24,7 +24,9 @@ const isHeliusFungibleAsset_1 = require("../../../utils/solana/das/isHeliusFungi
24
24
  const getSolanaDasEndpoint_1 = __importDefault(require("../../../utils/clients/getSolanaDasEndpoint"));
25
25
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
26
26
  const dasEndpoint = (0, getSolanaDasEndpoint_1.default)();
27
- const items = yield (0, getAssetsByOwnerDas_1.getAssetsByOwnerDas)(dasEndpoint, owner);
27
+ const items = yield (0, getAssetsByOwnerDas_1.getAssetsByOwnerDas)(dasEndpoint, owner, {
28
+ showNativeBalance: false,
29
+ });
28
30
  const fungibleAddresses = items.reduce((addresses, curr) => {
29
31
  if ((0, isHeliusFungibleAsset_1.isHeliusFungibleAsset)(curr))
30
32
  addresses.push(curr.id);
@@ -1 +1 @@
1
- {"version":3,"file":"solana.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/tokens/fetchers/solana.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAErC,4CAAwE;AAExE,wCAAkD;AAClD,wGAAgF;AAChF,sGAA8E;AAC9E,2GAAwG;AACxG,uFAAoF;AACpF,2FAAwF;AACxF,uGAA+E;AAE/E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;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,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,gCAAoB,CAAC,EAAE,SAAS;IACvC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"solana.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/tokens/fetchers/solana.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAErC,4CAAwE;AAExE,wCAAkD;AAClD,wGAAgF;AAChF,sGAA8E;AAC9E,2GAAwG;AACxG,uFAAoF;AACpF,2FAAwF;AACxF,uGAA+E;AAE/E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,WAAW,GAAG,IAAA,8BAAoB,GAAE,CAAC;IAC3C,MAAM,KAAK,GAAG,MAAM,IAAA,yCAAmB,EAAC,WAAW,EAAE,KAAK,EAAE;QAC1D,iBAAiB,EAAE,KAAK;KACzB,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,SAAmB,EAAE,IAAI,EAAE,EAAE;QACnE,IAAI,IAAA,6CAAqB,EAAC,IAAI,CAAC;YAAE,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzD,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,cAAc,CACjD,iBAAiB,EACjB,0BAAS,CAAC,MAAM,CACjB,CAAC;IACF,MAAM,WAAW,GAA4B,IAAI,GAAG,EAAE,CAAC;IACvD,gBAAgB,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QACtC,IAAI,UAAU;YAAE,WAAW,CAAC,GAAG,CA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ACtD,IAAI,EAAE;gBACJ,MAAM,EAAE,WAAW;aACpB;SACF,CAAC,CAAC;IACL,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,MAAM;YAC3B,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,SAAS;IACvC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -40,28 +40,28 @@ function getPairKey(version) {
40
40
  exports.getPairKey = getPairKey;
41
41
  function getPairsV2FromTheGraph(url, length = 300) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
- const query = (0, graphql_request_1.gql) `
44
- {
45
- pairs(
46
- orderBy: reserveUSD
47
- first: ${length}
48
- orderDirection: desc
49
- where: { trackedReserveETH_not: "0" }
50
- ) {
51
- id
52
- reserve0
53
- reserve1
54
- totalSupply
55
- token0 {
56
- id
57
- decimals
58
- }
59
- token1 {
60
- id
61
- decimals
62
- }
63
- }
64
- }
43
+ const query = (0, graphql_request_1.gql) `
44
+ {
45
+ pairs(
46
+ orderBy: reserveUSD
47
+ first: ${length}
48
+ orderDirection: desc
49
+ where: { trackedReserveETH_not: "0" }
50
+ ) {
51
+ id
52
+ reserve0
53
+ reserve1
54
+ totalSupply
55
+ token0 {
56
+ id
57
+ decimals
58
+ }
59
+ token1 {
60
+ id
61
+ decimals
62
+ }
63
+ }
64
+ }
65
65
  `;
66
66
  const res = yield (0, graphql_request_1.default)(url, query);
67
67
  const pairs = res.pairs;