@sonarwatch/portfolio-plugins 0.14.151 → 0.14.153

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +1 -1
  3. package/src/plugins/allbridge/constants.d.ts +0 -6
  4. package/src/plugins/allbridge/constants.js +1 -9
  5. package/src/plugins/allbridge/constants.js.map +1 -1
  6. package/src/plugins/allbridge/helpers.d.ts +1 -1
  7. package/src/plugins/allbridge/helpers.js +1 -3
  8. package/src/plugins/allbridge/helpers.js.map +1 -1
  9. package/src/plugins/allbridge/positionsFetcher.js +2 -1
  10. package/src/plugins/allbridge/positionsFetcher.js.map +1 -1
  11. package/src/plugins/allbridge/structs.d.ts +13 -0
  12. package/src/plugins/allbridge/structs.js +14 -0
  13. package/src/plugins/allbridge/structs.js.map +1 -0
  14. package/src/plugins/allbridge/types.d.ts +0 -6
  15. package/src/plugins/bonfida/constants.js +1 -1
  16. package/src/plugins/bonfida/constants.js.map +1 -1
  17. package/src/plugins/divvy/constants.d.ts +0 -2
  18. package/src/plugins/divvy/constants.js +1 -7
  19. package/src/plugins/divvy/constants.js.map +1 -1
  20. package/src/plugins/divvy/houseJob.js +6 -3
  21. package/src/plugins/divvy/houseJob.js.map +1 -1
  22. package/src/plugins/divvy/housePoolFetcher.js +9 -11
  23. package/src/plugins/divvy/housePoolFetcher.js.map +1 -1
  24. package/src/plugins/divvy/stakingFetcher.js +7 -12
  25. package/src/plugins/divvy/stakingFetcher.js.map +1 -1
  26. package/src/plugins/divvy/structs.d.ts +57 -0
  27. package/src/plugins/divvy/structs.js +57 -0
  28. package/src/plugins/divvy/structs.js.map +1 -0
  29. package/src/plugins/drift/spotMarketsJob.js +0 -1
  30. package/src/plugins/drift/spotMarketsJob.js.map +1 -1
  31. package/src/plugins/elemental/constants.d.ts +4 -2
  32. package/src/plugins/elemental/constants.js +3 -7
  33. package/src/plugins/elemental/constants.js.map +1 -1
  34. package/src/plugins/elemental/filters.d.ts +0 -1
  35. package/src/plugins/elemental/filters.js +1 -6
  36. package/src/plugins/elemental/filters.js.map +1 -1
  37. package/src/plugins/elemental/helpers.js +2 -2
  38. package/src/plugins/elemental/helpers.js.map +1 -1
  39. package/src/plugins/elemental/poolsJob.js +4 -4
  40. package/src/plugins/elemental/poolsJob.js.map +1 -1
  41. package/src/plugins/ensofi/constants.d.ts +4 -2
  42. package/src/plugins/ensofi/constants.js +3 -7
  43. package/src/plugins/ensofi/constants.js.map +1 -1
  44. package/src/plugins/ensofi/idl.d.ts +149 -6
  45. package/src/plugins/ensofi/idl.js +1074 -61
  46. package/src/plugins/ensofi/idl.js.map +1 -1
  47. package/src/plugins/ensofi/index.js +2 -1
  48. package/src/plugins/ensofi/index.js.map +1 -1
  49. package/src/plugins/ensofi/solanaLoansFetcher.js +23 -37
  50. package/src/plugins/ensofi/solanaLoansFetcher.js.map +1 -1
  51. package/src/plugins/ensofi/solanaLoansJob.d.ts +3 -0
  52. package/src/plugins/ensofi/solanaLoansJob.js +63 -0
  53. package/src/plugins/ensofi/solanaLoansJob.js.map +1 -0
  54. package/src/plugins/ensofi/structs.d.ts +58 -0
  55. package/src/plugins/ensofi/structs.js +60 -0
  56. package/src/plugins/ensofi/structs.js.map +1 -0
  57. package/src/plugins/jupiter/governance/constants.js +3 -3
  58. package/src/plugins/jupiter/governance/constants.js.map +1 -1
  59. package/src/plugins/jupiter/launchpad/constants.d.ts +1 -0
  60. package/src/plugins/jupiter/launchpad/constants.js +8 -7
  61. package/src/plugins/jupiter/launchpad/constants.js.map +1 -1
  62. package/src/plugins/jupiter/pricingJob.js +2 -1
  63. package/src/plugins/jupiter/pricingJob.js.map +1 -1
  64. package/src/plugins/kamino/reservesJob.js +35 -0
  65. package/src/plugins/kamino/reservesJob.js.map +1 -1
  66. package/src/plugins/loopscale/constants.d.ts +2 -3
  67. package/src/plugins/loopscale/constants.js +3 -4
  68. package/src/plugins/loopscale/constants.js.map +1 -1
  69. package/src/plugins/loopscale/helpers.d.ts +6 -33
  70. package/src/plugins/loopscale/helpers.js +39 -142
  71. package/src/plugins/loopscale/helpers.js.map +1 -1
  72. package/src/plugins/loopscale/index.js +10 -3
  73. package/src/plugins/loopscale/index.js.map +1 -1
  74. package/src/plugins/loopscale/lendFetcher.js +57 -0
  75. package/src/plugins/loopscale/lendFetcher.js.map +1 -0
  76. package/src/plugins/loopscale/lendVaultsFetcher.d.ts +6 -0
  77. package/src/plugins/loopscale/lendVaultsFetcher.js +68 -0
  78. package/src/plugins/loopscale/lendVaultsFetcher.js.map +1 -0
  79. package/src/plugins/loopscale/loansFetcher.d.ts +3 -0
  80. package/src/plugins/loopscale/loansFetcher.js +79 -0
  81. package/src/plugins/loopscale/loansFetcher.js.map +1 -0
  82. package/src/plugins/loopscale/structs.d.ts +116 -86
  83. package/src/plugins/loopscale/structs.js +101 -79
  84. package/src/plugins/loopscale/structs.js.map +1 -1
  85. package/src/plugins/loopscale/types.d.ts +6 -0
  86. package/src/plugins/loopscale/types.js.map +1 -0
  87. package/src/plugins/loopscale/vaultsJob.d.ts +3 -0
  88. package/src/plugins/loopscale/vaultsJob.js +121 -0
  89. package/src/plugins/loopscale/vaultsJob.js.map +1 -0
  90. package/src/plugins/lulo/depositsFetcher.js +9 -29
  91. package/src/plugins/lulo/depositsFetcher.js.map +1 -1
  92. package/src/plugins/marginfi/banksJob.js +6 -2
  93. package/src/plugins/marginfi/banksJob.js.map +1 -1
  94. package/src/plugins/marginfi/constants.d.ts +5 -3
  95. package/src/plugins/marginfi/constants.js +8 -7
  96. package/src/plugins/marginfi/constants.js.map +1 -1
  97. package/src/plugins/marginfi/depositsFetcher.js +50 -27
  98. package/src/plugins/marginfi/depositsFetcher.js.map +1 -1
  99. package/src/plugins/marginfi/getMarginFiAccounts.d.ts +6 -0
  100. package/src/plugins/marginfi/getMarginFiAccounts.js +44 -0
  101. package/src/plugins/marginfi/getMarginFiAccounts.js.map +1 -0
  102. package/src/plugins/marginfi/helpers.d.ts +0 -5
  103. package/src/plugins/marginfi/helpers.js +1 -81
  104. package/src/plugins/marginfi/helpers.js.map +1 -1
  105. package/src/plugins/marginfi/structs/MarginfiAccount.d.ts +5 -0
  106. package/src/plugins/marginfi/structs/MarginfiAccount.js.map +1 -1
  107. package/src/plugins/orca/getWhirlpoolPositions.js +7 -7
  108. package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
  109. package/src/plugins/orca/types.d.ts +2 -0
  110. package/src/plugins/picasso/constants.d.ts +0 -2
  111. package/src/plugins/picasso/constants.js +1 -7
  112. package/src/plugins/picasso/constants.js.map +1 -1
  113. package/src/plugins/picasso/helpers.js +7 -4
  114. package/src/plugins/picasso/helpers.js.map +1 -1
  115. package/src/plugins/picasso/structs.d.ts +39 -0
  116. package/src/plugins/picasso/structs.js +37 -0
  117. package/src/plugins/picasso/structs.js.map +1 -0
  118. package/src/plugins/picasso/unstakingNftsJob.js +2 -1
  119. package/src/plugins/picasso/unstakingNftsJob.js.map +1 -1
  120. package/src/plugins/picasso/unstakingPositionsFetcher.js +4 -4
  121. package/src/plugins/picasso/unstakingPositionsFetcher.js.map +1 -1
  122. package/src/plugins/raydium/ammV2ApiJob.js +24 -0
  123. package/src/plugins/raydium/ammV2ApiJob.js.map +1 -1
  124. package/src/plugins/raydium/constants.d.ts +1 -0
  125. package/src/plugins/raydium/constants.js +2 -1
  126. package/src/plugins/raydium/constants.js.map +1 -1
  127. package/src/plugins/raydium/getRaydiumCLMMPositions.js +9 -5
  128. package/src/plugins/raydium/getRaydiumCLMMPositions.js.map +1 -1
  129. package/src/plugins/raydium/types.d.ts +14 -4
  130. package/src/plugins/sanctum/s1AirdropFetcher.js +2 -2
  131. package/src/plugins/sanctum/s1AirdropFetcher.js.map +1 -1
  132. package/src/plugins/sharky/collectionsJob.js +8 -9
  133. package/src/plugins/sharky/collectionsJob.js.map +1 -1
  134. package/src/plugins/sharky/constants.d.ts +0 -2
  135. package/src/plugins/sharky/constants.js +1 -7
  136. package/src/plugins/sharky/constants.js.map +1 -1
  137. package/src/plugins/sharky/loansFetcher.js +25 -19
  138. package/src/plugins/sharky/loansFetcher.js.map +1 -1
  139. package/src/plugins/sharky/structs.d.ts +96 -0
  140. package/src/plugins/sharky/structs.js +103 -0
  141. package/src/plugins/sharky/structs.js.map +1 -0
  142. package/src/plugins/sharky/types.d.ts +0 -15
  143. package/src/plugins/sharky/types.js +0 -8
  144. package/src/plugins/sharky/types.js.map +1 -1
  145. package/src/plugins/stabble/constants.d.ts +0 -3
  146. package/src/plugins/stabble/constants.js +1 -13
  147. package/src/plugins/stabble/constants.js.map +1 -1
  148. package/src/plugins/stabble/poolsJob.js +14 -9
  149. package/src/plugins/stabble/poolsJob.js.map +1 -1
  150. package/src/plugins/stabble/structs.d.ts +43 -0
  151. package/src/plugins/stabble/structs.js +42 -0
  152. package/src/plugins/stabble/structs.js.map +1 -0
  153. package/src/plugins/suilend/helpers.js +2 -0
  154. package/src/plugins/suilend/helpers.js.map +1 -1
  155. package/src/utils/misc/getLendingMarketAprs.d.ts +3 -1
  156. package/src/utils/misc/getLendingMarketAprs.js +24 -1
  157. package/src/utils/misc/getLendingMarketAprs.js.map +1 -1
  158. package/src/utils/solana/beets/ParsedGpa.d.ts +1 -0
  159. package/src/utils/solana/beets/ParsedGpa.js +9 -0
  160. package/src/utils/solana/beets/ParsedGpa.js.map +1 -1
  161. package/src/plugins/divvy/types.d.ts +0 -28
  162. package/src/plugins/divvy/types.js.map +0 -1
  163. package/src/plugins/loopscale/filters.d.ts +0 -9
  164. package/src/plugins/loopscale/filters.js +0 -62
  165. package/src/plugins/loopscale/filters.js.map +0 -1
  166. package/src/plugins/loopscale/positionsFetcher.js +0 -119
  167. package/src/plugins/loopscale/positionsFetcher.js.map +0 -1
  168. package/src/plugins/marginfi/filters.d.ts +0 -5
  169. package/src/plugins/marginfi/filters.js +0 -45
  170. package/src/plugins/marginfi/filters.js.map +0 -1
  171. package/src/plugins/picasso/types.d.ts +0 -17
  172. package/src/plugins/picasso/types.js +0 -3
  173. package/src/plugins/picasso/types.js.map +0 -1
  174. package/src/plugins/sharky/filters.d.ts +0 -8
  175. package/src/plugins/sharky/filters.js +0 -43
  176. package/src/plugins/sharky/filters.js.map +0 -1
  177. package/src/plugins/stabble/filters.d.ts +0 -5
  178. package/src/plugins/stabble/filters.js +0 -20
  179. package/src/plugins/stabble/filters.js.map +0 -1
  180. package/src/plugins/stabble/types.d.ts +0 -40
  181. package/src/plugins/stabble/types.js +0 -3
  182. package/src/plugins/stabble/types.js.map +0 -1
  183. /package/src/plugins/loopscale/{positionsFetcher.d.ts → lendFetcher.d.ts} +0 -0
  184. /package/src/plugins/{divvy → loopscale}/types.js +0 -0
@@ -27,16 +27,16 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
27
27
  const allVaults = yield allVaultsMemo.getItem(cache);
28
28
  if (!allVaults)
29
29
  throw new Error('Vaults not cached');
30
- const myVaults = allVaults.filter((v) => { var _a; return ((_a = v.withdrawalRequest) === null || _a === void 0 ? void 0 : _a.owner) === owner; });
30
+ const myVaults = allVaults.filter((v) => { var _a; return ((_a = v.withdrawalRequest) === null || _a === void 0 ? void 0 : _a.owner.toString()) === owner; });
31
31
  if (myVaults.length === 0)
32
32
  return [];
33
33
  const tokenMints = [
34
- ...new Set(myVaults.map((vault) => vault.stakeMint).flat()),
34
+ ...new Set(myVaults.map((vault) => vault.stakeMint.toString()).flat()),
35
35
  ];
36
36
  const tokenPrices = yield cache.getTokenPricesAsMap(tokenMints, portfolio_core_1.NetworkId.solana);
37
37
  const assets = [];
38
38
  myVaults.forEach((vault) => {
39
- const tokenPrice = tokenPrices.get(vault.stakeMint);
39
+ const tokenPrice = tokenPrices.get(vault.stakeMint.toString());
40
40
  if (!tokenPrice || !vault.withdrawalRequest)
41
41
  return;
42
42
  const unlockingAt = new Date(new bignumber_js_1.default(vault.withdrawalRequest.timestampInSec)
@@ -44,7 +44,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
44
44
  .times(1000)
45
45
  .toNumber());
46
46
  const isClaimable = unlockingAt.getTime() < Date.now();
47
- assets.push(Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(vault.stakeMint, new bignumber_js_1.default(vault.stakeAmount)
47
+ assets.push(Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(vault.stakeMint.toString(), new bignumber_js_1.default(vault.stakeAmount)
48
48
  .dividedBy(Math.pow(10, tokenPrice.decimals))
49
49
  .toNumber(), portfolio_core_1.NetworkId.solana, tokenPrice, undefined, {
50
50
  isClaimable,
@@ -1 +1 @@
1
- {"version":3,"file":"unstakingPositionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/picasso/unstakingPositionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AAErC,2CAIqB;AAErB,qGAA6E;AAE7E,kEAA+D;AAG/D,MAAM,aAAa,GAAG,IAAI,6BAAa,CACrC,iCAAqB,EACrB;IACE,MAAM,EAAE,oCAAwB;IAChC,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,CACF,CAAC;AAEF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,0CAA0C;IAC1C,8DAA8D;IAE9D,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAErD,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAErD,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAC/B,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,CAAA,MAAA,CAAC,CAAC,iBAAiB,0CAAE,KAAK,MAAK,KAAK,CAAA,EAAA,CAC5C,CAAC;IAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,UAAU,GAAG;QACjB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,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,KAAK,EAAE,QAAQ;YACf,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACjD,IAAI,EAAE;gBACJ,MAAM;gBACN,IAAI,EAAE,qCAAqC;aAC5C;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,sBAAsB;IACvC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"unstakingPositionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/picasso/unstakingPositionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AAErC,2CAIqB;AAErB,qGAA6E;AAC7E,kEAA+D;AAI/D,MAAM,aAAa,GAAG,IAAI,6BAAa,CACrC,iCAAqB,EACrB;IACE,MAAM,EAAE,oCAAwB;IAChC,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,CACF,CAAC;AAEF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,0CAA0C;IAC1C,8DAA8D;IAE9D,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAErD,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAErD,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAC/B,CAAC,CAAC,EAAE,EAAE,WAAC,OAAA,CAA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;aACpC,QAAQ,EAAE,EACb,0BAAS,CAAC,MAAM,EAChB,UAAU,EACV,SAAS,EACT;YACE,WAAW;YACX,WAAW,EAAE,WAAW,CAAC,OAAO,EAAE;SACnC,CACF,KACD,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,IAC5B,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,KAAK,EAAE,QAAQ;YACf,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACjD,IAAI,EAAE;gBACJ,MAAM;gBACN,IAAI,EAAE,qCAAqC;aAC5C;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,sBAAsB;IACvC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -63,6 +63,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
63
63
  let tokenPriceA;
64
64
  let tokenPriceB;
65
65
  const tokenPriceSources = [];
66
+ const poolStats = [];
66
67
  for (let id = 0; id < subPools.data.length; id++) {
67
68
  poolInfo = subPools.data[id];
68
69
  lpSupply = new bignumber_js_1.default(poolInfo.lpAmount);
@@ -145,7 +146,30 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
145
146
  });
146
147
  }
147
148
  }
149
+ poolStats.push({
150
+ key: poolInfo.id,
151
+ value: {
152
+ address: poolInfo.id,
153
+ stats: {
154
+ '24h': {
155
+ volume: poolInfo.day.volume.toString(),
156
+ fees: poolInfo.day.volumeFee.toString(),
157
+ },
158
+ },
159
+ tvlUsdc: poolInfo.tvl.toString(),
160
+ apr: poolInfo.day.apr.toString(),
161
+ feeRate: poolInfo.config
162
+ ? Number(poolInfo.feeRate) *
163
+ 100 *
164
+ (1 - poolInfo.config.protocolFeeRate / 1000000)
165
+ : undefined,
166
+ },
167
+ });
148
168
  }
169
+ yield cache.setItems(poolStats, {
170
+ prefix: constants_2.poolStatsPrefix,
171
+ networkId: portfolio_core_1.NetworkId.solana,
172
+ });
149
173
  yield cache.setTokenPriceSources(tokenPriceSources);
150
174
  page += 1;
151
175
  } while (subPools.hasNextPage && computeAndStoreLpPrice_1.minimumLiquidity.isLessThan(lastLiquidity));
@@ -1 +1 @@
1
- {"version":3,"file":"ammV2ApiJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/ammV2ApiJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA0B;AAC1B,gEAAqC;AACrC,mDAA2D;AAG3D,2CAAgD;AAEhD,wEAAqE;AACrE,oFAA2E;AAC3E,4FAAmF;AACnF,uFAA+D;AAE/D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,IAAI,MAAM,CAAC;IACX,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,QAAQ,CAAC;IACb,IAAI,cAAc,CAAC;IACnB,IAAI,aAAa,CAAC;IAElB,MAAM,aAAa,GAAG,iDAAoB,CAAC,GAAG,CAAC,0BAAS,CAAC,MAAM,CAAC,CAAC;IAEjE,GAAG,CAAC;QACF,MAAM,GAAG,MAAM,eAAK;aACjB,GAAG,CAAgB,GAAG,iBAAK,iBAAiB,EAAE;YAC7C,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,aAAa,EAAE,WAAW;gBAC1B,QAAQ,EAAE,MAAM;gBAChB,QAAQ,EAAE,GAAG;gBACb,IAAI;aACL;SACF,CAA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;AAC/E,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,gBAAgB;IACjC,QAAQ;IACR,MAAM,EAAE,CAAC,QAAQ,CAAC;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -5,6 +5,7 @@ import { Platform } from '@sonarwatch/portfolio-core';
5
5
  export declare const platformId = "raydium";
6
6
  export declare const rayMint = "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R";
7
7
  export declare const platform: Platform;
8
+ export declare const poolStatsPrefix = "raydium-pool-stats";
8
9
  export declare const apiV3 = "https://api-v3.raydium.io/";
9
10
  export declare const AMM_PROGRAM_ID_V3: PublicKey;
10
11
  export declare const AMM_PROGRAM_ID_V4: PublicKey;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rayDecimals = exports.positionsIdentifier = exports.cpmmProgramId = exports.raydiumProgram = exports.AMM_PROGRAM_ID_V5 = exports.AMM_PROGRAM_ID_V4 = exports.AMM_PROGRAM_ID_V3 = exports.apiV3 = exports.platform = exports.rayMint = exports.platformId = void 0;
3
+ exports.rayDecimals = exports.positionsIdentifier = exports.cpmmProgramId = exports.raydiumProgram = exports.AMM_PROGRAM_ID_V5 = exports.AMM_PROGRAM_ID_V4 = exports.AMM_PROGRAM_ID_V3 = exports.apiV3 = exports.poolStatsPrefix = exports.platform = exports.rayMint = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.platformId = 'raydium';
6
6
  exports.rayMint = '4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R';
@@ -17,6 +17,7 @@ exports.platform = {
17
17
  tokens: [exports.rayMint],
18
18
  description: 'Raydium is an automated market maker (AMM) built on the Solana blockchain which enables lightning-fast trades, permissionless pool creation, and new features for earning yield',
19
19
  };
20
+ exports.poolStatsPrefix = 'raydium-pool-stats';
20
21
  exports.apiV3 = 'https://api-v3.raydium.io/';
21
22
  exports.AMM_PROGRAM_ID_V3 = new web3_js_1.PublicKey('EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q');
22
23
  exports.AMM_PROGRAM_ID_V4 = new web3_js_1.PublicKey('675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8');
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,OAAO,GAAG,8CAA8C,CAAC;AACzD,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EACH,6EAA6E;IAC/E,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,qBAAqB;IAC9B,aAAa,EAAE,kCAAkC;IACjD,OAAO,EAAE,oCAAoC;IAC7C,QAAQ,EAAE,8BAA8B;IACxC,MAAM,EAAE,+BAA+B;IACvC,MAAM,EAAE,CAAC,eAAO,CAAC;IACjB,WAAW,EACT,iLAAiL;CACpL,CAAC;AAEW,QAAA,KAAK,GAAG,4BAA4B,CAAC;AAErC,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AACW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,mBAAmB,GAAG,gCAAgC,CAAC;AAEvD,QAAA,WAAW,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,OAAO,GAAG,8CAA8C,CAAC;AACzD,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EACH,6EAA6E;IAC/E,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,qBAAqB;IAC9B,aAAa,EAAE,kCAAkC;IACjD,OAAO,EAAE,oCAAoC;IAC7C,QAAQ,EAAE,8BAA8B;IACxC,MAAM,EAAE,+BAA+B;IACvC,MAAM,EAAE,CAAC,eAAO,CAAC;IACjB,WAAW,EACT,iLAAiL;CACpL,CAAC;AAEW,QAAA,eAAe,GAAG,oBAAoB,CAAC;AACvC,QAAA,KAAK,GAAG,4BAA4B,CAAC;AAErC,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AACW,QAAA,iBAAiB,GAAG,IAAI,mBAAS,CAC5C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,mBAAmB,GAAG,gCAAgC,CAAC;AAEvD,QAAA,WAAW,GAAG,CAAC,CAAC"}
@@ -34,7 +34,10 @@ function getRaydiumCLMMPositions(cache, nfts) {
34
34
  if (!personalPositionsInfo || personalPositionsInfo.length === 0)
35
35
  return [];
36
36
  const poolsIds = personalPositionsInfo.flatMap((position) => position ? position.poolId : []);
37
- const poolStatesInfo = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, clmms_1.poolStateStruct, poolsIds);
37
+ const [poolStatesInfo, poolsStats] = yield Promise.all([
38
+ (0, solana_1.getParsedMultipleAccountsInfo)(client, clmms_1.poolStateStruct, poolsIds),
39
+ cache.getItems(poolsIds.map((p) => p.toString()), { prefix: constants_1.poolStatsPrefix, networkId: portfolio_core_1.NetworkId.solana }),
40
+ ]);
38
41
  const tickArrays = yield Promise.all(personalPositionsInfo.map((personalPositionInfo, index) => {
39
42
  if (!personalPositionInfo)
40
43
  return [];
@@ -54,13 +57,10 @@ function getRaydiumCLMMPositions(cache, nfts) {
54
57
  const personalPositionInfo = personalPositionsInfo[index];
55
58
  if (!personalPositionInfo)
56
59
  continue;
57
- if (!poolStateInfo.tokenMint0 ||
58
- !poolStateInfo.tokenMint1 ||
59
- !poolStateInfo.tickCurrent)
60
- continue;
61
60
  const element = elementRegistry.addElementConcentratedLiquidity({
62
61
  link: 'https://raydium.io/portfolio/?position_tab=concentrated',
63
62
  });
63
+ const poolStats = poolsStats.find((p) => (p === null || p === void 0 ? void 0 : p.address) === personalPositionInfo.poolId.toString());
64
64
  const liquidity = element.setLiquidity({
65
65
  addressA: poolStateInfo.tokenMint0,
66
66
  addressB: poolStateInfo.tokenMint1,
@@ -69,6 +69,10 @@ function getRaydiumCLMMPositions(cache, nfts) {
69
69
  tickLowerIndex: personalPositionInfo.tickLowerIndex,
70
70
  tickUpperIndex: personalPositionInfo.tickUpperIndex,
71
71
  ref: personalPositionInfo.pubkey,
72
+ swapVolume24h: poolStats === null || poolStats === void 0 ? void 0 : poolStats.stats['24h'].volume,
73
+ feeRate: poolStats === null || poolStats === void 0 ? void 0 : poolStats.feeRate,
74
+ currentSqrtPrice: poolStateInfo.sqrtPriceX64,
75
+ poolLiquidity: poolStateInfo.liquidity,
72
76
  sourceRefs: [
73
77
  {
74
78
  name: 'Pool',
@@ -1 +1 @@
1
- {"version":3,"file":"getRaydiumCLMMPositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/getRaydiumCLMMPositions.ts"],"names":[],"mappings":";;;;;;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AAc,CAAC;wBACvB,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;wBAC/C,MAAM,EAAE,aAAa;qBACtB,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;CAAA;AAvID,0DAuIC"}
1
+ {"version":3,"file":"getRaydiumCLMMPositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/getRaydiumCLMMPositions.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAIoC;AACpC,6CAA4C;AAC5C,2CAA0E;AAC1E,+CAAmE;AACnE,iDAAsD;AACtD,2CAIyB;AAEzB,uCAA0E;AAC1E,gFAA6E;AAG7E,SAAsB,uBAAuB,CAC3C,KAAY,EACZ,IAAiC;;QAEjC,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;QAEjC,MAAM,uBAAuB,GAAgB,EAAE,CAAC;QAChD,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,OAAO,GAAG,IAAI,mBAAS,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAEhD,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;YAEnE,MAAM,CAAC,cAAc,CAAC,GAAG,mBAAS,CAAC,sBAAsB,CACvD,YAAY,EACZ,0BAAc,CACf,CAAC;YACF,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAEpD,MAAM,qBAAqB,GAAG,MAAM,IAAA,sCAA6B,EAC/D,MAAM,EACN,mCAA2B,EAC3B,uBAAuB,CACxB,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export type PoolInfo = {
201
201
  feeRate: number;
202
202
  openTime: string;
203
203
  tvl: number;
204
- day: Day;
205
- week: Day;
206
- month: Day;
204
+ day: Stats;
205
+ week: Stats;
206
+ month: Stats;
207
207
  pooltype: string[];
208
208
  rewardDefaultInfos: number[];
209
209
  farmUpcomingCount: number;
@@ -214,8 +214,18 @@ export type PoolInfo = {
214
214
  lpPrice: number;
215
215
  lpAmount: number;
216
216
  burnPercent: number;
217
+ config?: {
218
+ id: string;
219
+ index: number;
220
+ protocolFeeRate: number;
221
+ tradeFeeRate: number;
222
+ tickSpacing: number;
223
+ fundFeeRate: number;
224
+ defaultRange: number;
225
+ defaultRangePoint: number[];
226
+ };
217
227
  };
218
- export type Day = {
228
+ export type Stats = {
219
229
  volume: number;
220
230
  volumeQuote: number;
221
231
  volumeFee: number;
@@ -28,7 +28,7 @@ const capitalClaimDuration = 14 * 24 * 60 * 60 * 1000;
28
28
  const capitalClaimEnd = claimStart.plus(capitalClaimDuration);
29
29
  const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
30
30
  const claimProofBase = yield axios_1.default
31
- .get(`${constants_1.lfgApiBaseUrl}/CLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu/${owner}`, {
31
+ .get(`${constants_1.lfgApiBaseUrl}/CLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu/${owner}?${constants_1.jupApiToken !== null && constants_1.jupApiToken !== void 0 ? constants_1.jupApiToken : ''}`, {
32
32
  timeout: 5000,
33
33
  })
34
34
  .catch((e) => {
@@ -88,7 +88,7 @@ const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
88
88
  ];
89
89
  // Check Earnestness
90
90
  const claimProofEarn = yield axios_1.default
91
- .get(`${constants_1.lfgApiBaseUrl}/earnestness-CLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu/${owner}`, {
91
+ .get(`${constants_1.lfgApiBaseUrl}/earnestness-CLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu/${owner}?${constants_1.jupApiToken !== null && constants_1.jupApiToken !== void 0 ? constants_1.jupApiToken : ''}`, {
92
92
  timeout: 5000,
93
93
  })
94
94
  .catch((e) => {
@@ -1 +1 @@
1
- {"version":3,"file":"s1AirdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sanctum/s1AirdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,kDAA6C;AAC7C,+DAAuD;AACvD,yDAK8B;AAC9B,oFAAiF;AACjF,iDAAsD;AAEtD,8DAA8E;AAC9E,2CAKqB;AAErB,MAAM,UAAU,GAAG,IAAI,sBAAS,CAAC,aAAa,CAAC,CAAC;AAChD,MAAM,oBAAoB,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACvD,MAAM,eAAe,GAAG,UAAU,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAC9D,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACtD,MAAM,eAAe,GAAG,UAAU,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAE9D,MAAM,QAAQ,GAA2B,CAAO,KAAa,EAAE,EAAE;IAC/D,MAAM,cAAc,GAA6C,MAAM,eAAK;SACzE,GAAG,CACF,GAAG,yBAAa,iDAAiD,KAAK,EAAE,EACxE;QACE,OAAO,EAAE,IAAI;KACd,CACF;SACA,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;QACX,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IACL,IAAI,CAAC,cAAc,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AC,CAAC,CAAC;YACX,aAAa,GAAG,IAAI,sBAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACzE,CAAC;QACD,KAAK,CAAC,IAAI,CAAC;YACT,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,SAAA,EAAE,EAAI,yBAAa,CAAA,CAAC,CAAC,QAAQ,EAAE;YACzD,SAAS,EAAE,sBAAsB,KAAK,IAAI;YAC1C,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,qBAAS;SACnB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAA,8BAAa,EAAC;QACnB,OAAO,EAAE,4BAAgB;QACzB,KAAK;KACN,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEW,QAAA,cAAc,GAAmB;IAC5C,EAAE,EAAE,4BAAgB,CAAC,EAAE;IACvB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEW,QAAA,OAAO,GAAG,IAAA,wCAAuB,EAC5C,sBAAc,EACd,oBAAQ,CAAC,EAAE,EACX,GAAG,oBAAQ,CAAC,EAAE,UAAU,EACxB,4BAAgB,CAAC,QAAQ,CAC1B,CAAC"}
1
+ {"version":3,"file":"s1AirdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sanctum/s1AirdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,kDAA6C;AAC7C,+DAAuD;AACvD,yDAK8B;AAC9B,oFAAiF;AACjF,iDAAsD;AAEtD,8DAIwC;AACxC,2CAKqB;AAErB,MAAM,UAAU,GAAG,IAAI,sBAAS,CAAC,aAAa,CAAC,CAAC;AAChD,MAAM,oBAAoB,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACvD,MAAM,eAAe,GAAG,UAAU,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAA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AAE,4BAAgB,CAAC,EAAE;IACvB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEW,QAAA,OAAO,GAAG,IAAA,wCAAuB,EAC5C,sBAAc,EACd,oBAAQ,CAAC,EAAE,EACX,GAAG,oBAAQ,CAAC,EAAE,UAAU,EACxB,4BAAgB,CAAC,QAAQ,CAC1B,CAAC"}
@@ -16,9 +16,10 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
16
  const axios_1 = __importDefault(require("axios"));
17
17
  const web3_js_1 = require("@solana/web3.js");
18
18
  const constants_1 = require("./constants");
19
- const types_1 = require("./types");
20
19
  const solana_1 = require("../../utils/solana");
21
20
  const clients_1 = require("../../utils/clients");
21
+ const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
22
+ const structs_1 = require("./structs");
22
23
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
23
24
  const connection = (0, clients_1.getClientSolana)();
24
25
  const [floorPrices, orderBooks] = yield Promise.all([
@@ -29,15 +30,13 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
29
30
  .catch((err) => {
30
31
  throw Error(`SHARKY_API ERR: ${err}`);
31
32
  }),
32
- (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.sharkyIdlItem, [
33
- {
34
- dataSize: constants_1.orderBookDataSize,
35
- },
36
- ]),
33
+ ParsedGpa_1.ParsedGpa.build(connection, structs_1.orderBookStruct, constants_1.sharkyProgram)
34
+ .addDataSizeFilter(constants_1.orderBookDataSize)
35
+ .run(),
37
36
  ]);
38
37
  if (!floorPrices.data || !orderBooks)
39
38
  return;
40
- const nftLists = yield (0, solana_1.getParsedMultipleAccountsInfo)(connection, types_1.nftListStruct, orderBooks.map((ob) => new web3_js_1.PublicKey(ob.orderBookType.nftList.listAccount)), {
39
+ const nftLists = yield (0, solana_1.getParsedMultipleAccountsInfo)(connection, structs_1.nftListStruct, orderBooks.map((ob) => new web3_js_1.PublicKey(ob.orderBookType.collectionKey)), {
41
40
  dataSlice: { offset: 0, length: 231 },
42
41
  });
43
42
  const collectionNamesAsMap = new Map();
@@ -49,9 +48,9 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
49
48
  const collections = [];
50
49
  orderBooks.forEach((orderBook) => {
51
50
  var _a, _b, _c;
52
- if (!orderBook || !orderBook.orderBookType.nftList.listAccount)
51
+ if (!orderBook || !orderBook.orderBookType.collectionKey)
53
52
  return;
54
- const collectionName = collectionNamesAsMap.get(orderBook.orderBookType.nftList.listAccount);
53
+ const collectionName = collectionNamesAsMap.get(orderBook.orderBookType.collectionKey.toString());
55
54
  if (!collectionName)
56
55
  return;
57
56
  collections.push({
@@ -1 +1 @@
1
- {"version":3,"file":"collectionsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/collectionsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA0B;AAC1B,6CAA4C;AAG5C,2CAMqB;AACrB,mCAA+D;AAC/D,+CAI4B;AAC5B,iDAAsD;AAEtD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAClD,eAAK;aACF,GAAG,CAAC,oCAAoC,EAAE;YACzC,OAAO,EAAE,IAAI;SACd,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,MAAM,KAAK,CAAC,mBAAmB,GAAG,EAAE,CAAC,CAAC;QACxC,CAAC,CAAC;QACJ,IAAA,qCAA4B,EAAY,UAAU,EAAE,yBAAa,EAAE;YACjE;gBACE,QAAQ,EAAE,6BAAiB;aAC5B;SACF,CAAC;KACH,CAAC,CAAC;IAEH,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,UAAU;QAAE,OAAO;IAE7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AAM,0CAAE,IAAI;SACtE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,CAAC,OAAO,CAAC,+BAAmB,EAAE,WAAW,EAAE;QACpD,MAAM,EAAE,uBAAW;QACnB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,QAAQ;IACR,MAAM,EAAE,CAAC,QAAQ,CAAC;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"collectionsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/collectionsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA0B;AAC1B,6CAA4C;AAG5C,2CAMqB;AACrB,+CAG4B;AAC5B,iDAAsD;AACtD,kEAA+D;AAC/D,uCAA2D;AAG3D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAClD,eAAK;aACF,GAAG,CAAC,oCAAoC,EAAE;YACzC,OAAO,EAAE,IAAI;SACd,CAAC;aACD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,MAAM,KAAK,CAAC,mBAAmB,GAAG,EAAE,CAAC,CAAC;QACxC,CAAC,CAAC;QACJ,qBAAS,CAAC,KAAK,CAAC,UAAU,EAAE,yBAAe,EAAE,yBAAa,CAAC;aACxD,iBAAiB,CAAC,6BAAiB,CAAC;aACpC,GAAG,EAAE;KACT,CAAC,CAAC;IAEH,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,UAAU;QAAE,OAAO;IAE7C,MAAM,QAAQ,GAAG,MAAM,IAAA,sCAA6B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AEH,MAAM,KAAK,CAAC,OAAO,CAAC,+BAAmB,EAAE,WAAW,EAAE;QACpD,MAAM,EAAE,uBAAW;QACnB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,QAAQ;IACR,MAAM,EAAE,CAAC,QAAQ,CAAC;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -2,7 +2,6 @@
2
2
  /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
3
  import { Platform } from '@sonarwatch/portfolio-core';
4
4
  import { PublicKey } from '@solana/web3.js';
5
- import { IdlItem } from '@solanafm/explorer-kit-idls';
6
5
  export declare const platformId = "sharky";
7
6
  export declare const platform: Platform;
8
7
  export declare const collectionsCacheKey = "sharky-collections";
@@ -10,4 +9,3 @@ export declare const cachePrefix = "sharky";
10
9
  export declare const sharkyProgram: PublicKey;
11
10
  export declare const loanDataSize = 338;
12
11
  export declare const orderBookDataSize = 10240;
13
- export declare const sharkyIdlItem: IdlItem;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sharkyIdlItem = exports.orderBookDataSize = exports.loanDataSize = exports.sharkyProgram = exports.cachePrefix = exports.collectionsCacheKey = exports.platform = exports.platformId = void 0;
3
+ exports.orderBookDataSize = exports.loanDataSize = exports.sharkyProgram = exports.cachePrefix = exports.collectionsCacheKey = exports.platform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
- const idl_1 = require("./idl");
6
5
  exports.platformId = 'sharky';
7
6
  exports.platform = {
8
7
  id: exports.platformId,
@@ -21,9 +20,4 @@ exports.cachePrefix = `${exports.platformId}`;
21
20
  exports.sharkyProgram = new web3_js_1.PublicKey('SHARKobtfF1bHhxD2eqftjHBdVSCbKo9JtgK71FhELP');
22
21
  exports.loanDataSize = 338;
23
22
  exports.orderBookDataSize = 10240;
24
- exports.sharkyIdlItem = {
25
- programId: exports.sharkyProgram.toString(),
26
- idl: idl_1.SharkyIDL,
27
- idlType: 'anchor',
28
- };
29
23
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE5C,+BAAkC;AAErB,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EACH,4EAA4E;IAC9E,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,8BAA8B;IACvC,WAAW,EAAE,QAAQ,EAAE,sCAAsC;IAC7D,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,6BAA6B;IACrC,MAAM,EAAE,CAAC,6CAA6C,CAAC;IACvD,WAAW,EACT,yJAAyJ;CAC5J,CAAC;AACW,QAAA,mBAAmB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAClD,QAAA,WAAW,GAAG,GAAG,kBAAU,EAAE,CAAC;AAE9B,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,YAAY,GAAG,GAAG,CAAC;AACnB,QAAA,iBAAiB,GAAG,KAAK,CAAC;AAE1B,QAAA,aAAa,GAAG;IAC3B,SAAS,EAAE,qBAAa,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,eAAS;IACd,OAAO,EAAE,QAAQ;CACP,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE/B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EACH,4EAA4E;IAC9E,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,8BAA8B;IACvC,WAAW,EAAE,QAAQ,EAAE,sCAAsC;IAC7D,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,6BAA6B;IACrC,MAAM,EAAE,CAAC,6CAA6C,CAAC;IACvD,WAAW,EACT,yJAAyJ;CAC5J,CAAC;AACW,QAAA,mBAAmB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAClD,QAAA,WAAW,GAAG,GAAG,kBAAU,EAAE,CAAC;AAE9B,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,YAAY,GAAG,GAAG,CAAC;AACnB,QAAA,iBAAiB,GAAG,KAAK,CAAC"}
@@ -16,22 +16,30 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
16
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
17
  const constants_1 = require("./constants");
18
18
  const clients_1 = require("../../utils/clients");
19
- const solana_1 = require("../../utils/solana");
20
- const filters_1 = require("./filters");
21
19
  const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
22
20
  const arrayToMap_1 = require("../../utils/misc/arrayToMap");
23
21
  const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
22
+ const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
23
+ const structs_1 = require("./structs");
24
24
  const collectionsMemo = new MemoizedCache_1.MemoizedCache(constants_1.collectionsCacheKey, {
25
25
  prefix: constants_1.cachePrefix,
26
26
  networkId: portfolio_core_1.NetworkId.solana,
27
27
  }, (arr) => (0, arrayToMap_1.arrayToMap)(arr || [], 'orderBook'));
28
28
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
29
29
  const connection = (0, clients_1.getClientSolana)();
30
- const [filterA, filterB, filterC] = (0, filters_1.getLoanFilters)(owner);
31
30
  const accounts = (yield Promise.all([
32
- (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.sharkyIdlItem, filterA),
33
- (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.sharkyIdlItem, filterB),
34
- (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.sharkyIdlItem, filterC),
31
+ ParsedGpa_1.ParsedGpa.build(connection, structs_1.loanStruct, constants_1.sharkyProgram)
32
+ .addRawFilter(115, owner)
33
+ .addDataSizeFilter(constants_1.loanDataSize)
34
+ .run(),
35
+ ParsedGpa_1.ParsedGpa.build(connection, structs_1.loanStruct, constants_1.sharkyProgram)
36
+ .addRawFilter(147, owner)
37
+ .addDataSizeFilter(constants_1.loanDataSize)
38
+ .run(),
39
+ ParsedGpa_1.ParsedGpa.build(connection, structs_1.loanStruct, constants_1.sharkyProgram)
40
+ .addRawFilter(83, owner)
41
+ .addDataSizeFilter(constants_1.loanDataSize)
42
+ .run(),
35
43
  ])).flat();
36
44
  if (accounts.length === 0)
37
45
  return [];
@@ -45,17 +53,16 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
45
53
  throw new Error('Sol price not cached');
46
54
  const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
47
55
  accounts.forEach((acc) => {
48
- var _a;
49
- const collection = collections.get(acc.orderBook);
56
+ const collection = collections.get(acc.orderBook.toString());
50
57
  if (!collection)
51
58
  return;
52
59
  const element = elementRegistry.addElementBorrowlend({
53
60
  label: 'Lending',
54
61
  });
55
62
  let mintAsset = null;
56
- if ((_a = acc.loanState.taken) === null || _a === void 0 ? void 0 : _a.taken.nftCollateralMint) {
63
+ if (acc.loanState.__kind === 'Taken') {
57
64
  mintAsset = {
58
- address: acc.loanState.taken.taken.nftCollateralMint,
65
+ address: acc.loanState.nftCollateralMint,
59
66
  collection: {
60
67
  name: collection.name,
61
68
  floorPrice: new bignumber_js_1.default(collection.floor).multipliedBy(solTokenPrice.price),
@@ -68,13 +75,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
68
75
  amount: acc.principalLamports,
69
76
  };
70
77
  let name;
71
- if (acc.loanState.offer) {
78
+ if (acc.loanState.__kind === 'Offer') {
72
79
  // LENDER
73
80
  element.addSuppliedAsset(solAsset);
74
81
  name = `Lend Offer on ${collection.name}`;
75
82
  }
76
- else if (acc.loanState.taken) {
77
- if (acc.loanState.taken.taken.lenderNoteMint === owner.toString()) {
83
+ else if (acc.loanState.__kind === 'Taken') {
84
+ if (acc.loanState.lenderNoteMint.toString() === owner.toString()) {
78
85
  // LENDER
79
86
  element.addSuppliedAsset(solAsset);
80
87
  if (mintAsset)
@@ -92,12 +99,11 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
92
99
  }
93
100
  if (name)
94
101
  element.setName(name);
95
- element.setFixedTerms(acc.loanState.offer !== undefined ||
96
- (acc.loanState.taken
97
- ? acc.loanState.taken.taken.lenderNoteMint === owner.toString()
98
- : false), acc.loanState.taken
99
- ? (Number(acc.loanState.taken.taken.terms.time.start) +
100
- Number(acc.loanState.taken.taken.terms.time.duration)) *
102
+ element.setFixedTerms((acc.loanState.__kind === 'Taken'
103
+ ? acc.loanState.lenderNoteMint.toString() === owner.toString()
104
+ : false) || acc.loanState.__kind !== 'Offer', acc.loanState.__kind === 'Taken'
105
+ ? (Number(acc.loanState.terms.start) +
106
+ Number(acc.loanState.terms.duration)) *
101
107
  1000
102
108
  : undefined);
103
109
  });
@@ -1 +1 @@
1
- {"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAErC,2CAKqB;AAErB,iDAAsD;AACtD,+CAG4B;AAE5B,uCAA2C;AAC3C,kEAA+D;AAC/D,4DAAyD;AACzD,gFAA6E;AAG7E,MAAM,eAAe,GAAG,IAAI,6BAAa,CAIvC,+BAAmB,EACnB;IACE,MAAM,EAAE,uBAAW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,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;gBAChC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBACrC,IAAI;YACR,CAAC,CAAC,SAAS,CACd,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,96 @@
1
+ /// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
2
+ /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
+ import { PublicKey } from '@solana/web3.js';
4
+ import BigNumber from 'bignumber.js';
5
+ import { FixableBeetStruct, DataEnumKeyAsKind } from '@metaplex-foundation/beet';
6
+ type APYRecord = {
7
+ Fixed: {
8
+ apy: number;
9
+ };
10
+ };
11
+ type APY = DataEnumKeyAsKind<APYRecord>;
12
+ type LoanTermsRecord = {
13
+ Time: {
14
+ start: BigNumber;
15
+ duration: BigNumber;
16
+ total_owed_lamports: BigNumber;
17
+ };
18
+ };
19
+ type LoanTerms = DataEnumKeyAsKind<LoanTermsRecord>;
20
+ type OrderBookTypeRecord = {
21
+ Collection: {
22
+ collectionKey: PublicKey;
23
+ };
24
+ NFTList: {
25
+ collectionKey: PublicKey;
26
+ };
27
+ };
28
+ type OrderBookType = DataEnumKeyAsKind<OrderBookTypeRecord>;
29
+ type LoanTermsSpecRecord = {
30
+ Time: {
31
+ duration: BigNumber;
32
+ };
33
+ };
34
+ type LoanTermsSpec = DataEnumKeyAsKind<LoanTermsSpecRecord>;
35
+ type BookLoanTermsRecord = {
36
+ Fixed: {
37
+ terms: LoanTermsSpec;
38
+ };
39
+ LenderChooses: NonNullable<unknown>;
40
+ };
41
+ type BookLoanTerms = DataEnumKeyAsKind<BookLoanTermsRecord>;
42
+ export type OrderBook = {
43
+ accountDiscriminator: number[];
44
+ version: number;
45
+ orderBookType: OrderBookType;
46
+ apy: APY;
47
+ loanTerms: BookLoanTerms;
48
+ feePermillicentage: number;
49
+ feeAuthority: PublicKey;
50
+ };
51
+ export declare const orderBookStruct: FixableBeetStruct<OrderBook, Partial<OrderBook>>;
52
+ export type NftList = {
53
+ accountDiscriminator: number[];
54
+ version: number;
55
+ collectionName: number[];
56
+ };
57
+ export declare const nftListStruct: FixableBeetStruct<NftList, Partial<NftList>>;
58
+ type LoanStateRecord = {
59
+ Offer: {
60
+ lenderWallet: PublicKey;
61
+ termsSpec: LoanTermsSpec;
62
+ offerTime: BigNumber;
63
+ };
64
+ Taken: {
65
+ nftCollateralMint: PublicKey;
66
+ lenderNoteMint: PublicKey;
67
+ borrowerNoteMint: PublicKey;
68
+ apy: APY;
69
+ terms: LoanTerms;
70
+ isCollateralFrozen: number;
71
+ };
72
+ };
73
+ type LoanState = DataEnumKeyAsKind<LoanStateRecord>;
74
+ export type Loan = {
75
+ accountDiscriminator: number[];
76
+ version: number;
77
+ principalLamports: BigNumber;
78
+ orderBook: PublicKey;
79
+ valueTokenMint: PublicKey;
80
+ escrowBumpSeed: number;
81
+ loanState: LoanState;
82
+ };
83
+ export declare const loanStruct: FixableBeetStruct<Loan, Partial<Loan>>;
84
+ export type EscrowPda = {
85
+ accountDiscriminator: number[];
86
+ bump: number;
87
+ };
88
+ export declare const escrowPdaStruct: FixableBeetStruct<EscrowPda, Partial<EscrowPda>>;
89
+ export type ProgramVersion = {
90
+ accountDiscriminator: number[];
91
+ version: number;
92
+ bump: number;
93
+ updated: BigNumber;
94
+ };
95
+ export declare const programVersionStruct: FixableBeetStruct<ProgramVersion, Partial<ProgramVersion>>;
96
+ export {};