@sonarwatch/portfolio-plugins 0.12.36 → 0.12.38

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. package/CHANGELOG.md +1847 -1839
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/plugins/allbridge/constants.d.ts +0 -1
  5. package/src/plugins/allbridge/constants.js +1 -2
  6. package/src/plugins/allbridge/constants.js.map +1 -1
  7. package/src/plugins/allbridge/positionsFetcher.js +6 -2
  8. package/src/plugins/allbridge/positionsFetcher.js.map +1 -1
  9. package/src/plugins/balancer/helpers/pools.js +21 -21
  10. package/src/plugins/banx/constants.d.ts +0 -1
  11. package/src/plugins/banx/constants.js +1 -2
  12. package/src/plugins/banx/constants.js.map +1 -1
  13. package/src/plugins/banx/idl.d.ts +15 -7
  14. package/src/plugins/banx/idl.js +199 -268
  15. package/src/plugins/banx/idl.js.map +1 -1
  16. package/src/plugins/banx/loansFetcher.js +19 -23
  17. package/src/plugins/banx/loansFetcher.js.map +1 -1
  18. package/src/plugins/banx/offersFetcher.js +10 -15
  19. package/src/plugins/banx/offersFetcher.js.map +1 -1
  20. package/src/plugins/citrus/collectionsJob.js.map +1 -1
  21. package/src/plugins/citrus/constants.d.ts +0 -1
  22. package/src/plugins/citrus/constants.js +1 -2
  23. package/src/plugins/citrus/constants.js.map +1 -1
  24. package/src/plugins/citrus/loansFetcher.js +14 -20
  25. package/src/plugins/citrus/loansFetcher.js.map +1 -1
  26. package/src/plugins/drift/constants.d.ts +1 -0
  27. package/src/plugins/drift/constants.js +2 -1
  28. package/src/plugins/drift/constants.js.map +1 -1
  29. package/src/plugins/drift/depositsFetcher.js +63 -1
  30. package/src/plugins/drift/depositsFetcher.js.map +1 -1
  31. package/src/plugins/drift/filters.d.ts +1 -0
  32. package/src/plugins/drift/filters.js +4 -1
  33. package/src/plugins/drift/filters.js.map +1 -1
  34. package/src/plugins/drift/index.js +2 -1
  35. package/src/plugins/drift/index.js.map +1 -1
  36. package/src/plugins/drift/perpHelpers/amm.d.ts +74 -0
  37. package/src/plugins/drift/perpHelpers/amm.js +567 -0
  38. package/src/plugins/drift/perpHelpers/amm.js.map +1 -0
  39. package/src/plugins/drift/perpHelpers/assert.d.ts +1 -0
  40. package/src/plugins/drift/perpHelpers/assert.js +10 -0
  41. package/src/plugins/drift/perpHelpers/assert.js.map +1 -0
  42. package/src/plugins/drift/perpHelpers/constants.d.ts +27 -0
  43. package/src/plugins/drift/perpHelpers/constants.js +35 -0
  44. package/src/plugins/drift/perpHelpers/constants.js.map +1 -0
  45. package/src/plugins/drift/perpHelpers/convert.d.ts +0 -0
  46. package/src/plugins/drift/perpHelpers/convert.js +2 -0
  47. package/src/plugins/drift/perpHelpers/convert.js.map +1 -0
  48. package/src/plugins/drift/perpHelpers/getOraclePrice.d.ts +4 -0
  49. package/src/plugins/drift/perpHelpers/getOraclePrice.js +61 -0
  50. package/src/plugins/drift/perpHelpers/getOraclePrice.js.map +1 -0
  51. package/src/plugins/drift/perpHelpers/getPerpMarket.d.ts +4 -0
  52. package/src/plugins/drift/perpHelpers/getPerpMarket.js +33 -0
  53. package/src/plugins/drift/perpHelpers/getPerpMarket.js.map +1 -0
  54. package/src/plugins/drift/perpHelpers/margin.d.ts +10 -0
  55. package/src/plugins/drift/perpHelpers/margin.js +82 -0
  56. package/src/plugins/drift/perpHelpers/margin.js.map +1 -0
  57. package/src/plugins/drift/perpHelpers/math.d.ts +4 -0
  58. package/src/plugins/drift/perpHelpers/math.js +29 -0
  59. package/src/plugins/drift/perpHelpers/math.js.map +1 -0
  60. package/src/plugins/drift/perpHelpers/oracle.d.ts +6 -0
  61. package/src/plugins/drift/perpHelpers/oracle.js +54 -0
  62. package/src/plugins/drift/perpHelpers/oracle.js.map +1 -0
  63. package/src/plugins/drift/perpHelpers/orders.d.ts +2 -0
  64. package/src/plugins/drift/perpHelpers/orders.js +9 -0
  65. package/src/plugins/drift/perpHelpers/orders.js.map +1 -0
  66. package/src/plugins/drift/perpHelpers/position.d.ts +44 -0
  67. package/src/plugins/drift/perpHelpers/position.js +184 -0
  68. package/src/plugins/drift/perpHelpers/position.js.map +1 -0
  69. package/src/plugins/drift/perpHelpers/prelaunchOracle.d.ts +3 -0
  70. package/src/plugins/drift/perpHelpers/prelaunchOracle.js +20 -0
  71. package/src/plugins/drift/perpHelpers/prelaunchOracle.js.map +1 -0
  72. package/src/plugins/drift/perpHelpers/pyth.d.ts +5 -0
  73. package/src/plugins/drift/perpHelpers/pyth.js +42 -0
  74. package/src/plugins/drift/perpHelpers/pyth.js.map +1 -0
  75. package/src/plugins/drift/perpHelpers/repeg.d.ts +14 -0
  76. package/src/plugins/drift/perpHelpers/repeg.js +162 -0
  77. package/src/plugins/drift/perpHelpers/repeg.js.map +1 -0
  78. package/src/plugins/drift/perpHelpers/switchboard.d.ts +3 -0
  79. package/src/plugins/drift/perpHelpers/switchboard.js +31 -0
  80. package/src/plugins/drift/perpHelpers/switchboard.js.map +1 -0
  81. package/src/plugins/drift/perpHelpers/types.d.ts +28 -0
  82. package/src/plugins/drift/perpHelpers/types.js +19 -0
  83. package/src/plugins/drift/perpHelpers/types.js.map +1 -0
  84. package/src/plugins/drift/prepMarketsJob.d.ts +3 -0
  85. package/src/plugins/drift/prepMarketsJob.js +38 -0
  86. package/src/plugins/drift/prepMarketsJob.js.map +1 -0
  87. package/src/plugins/drift/struct.d.ts +82 -76
  88. package/src/plugins/drift/struct.js +79 -74
  89. package/src/plugins/drift/struct.js.map +1 -1
  90. package/src/plugins/drift/types.d.ts +1 -0
  91. package/src/plugins/jupiter/exchange/constants.d.ts +1 -0
  92. package/src/plugins/jupiter/exchange/constants.js +2 -1
  93. package/src/plugins/jupiter/exchange/constants.js.map +1 -1
  94. package/src/plugins/jupiter/exchange/limitFetcher.js +9 -6
  95. package/src/plugins/jupiter/exchange/limitFetcher.js.map +1 -1
  96. package/src/plugins/jupiter/exchange/perpetualFetcher.js +3 -6
  97. package/src/plugins/jupiter/exchange/perpetualFetcher.js.map +1 -1
  98. package/src/plugins/jupiter/exchange/structs.d.ts +21 -0
  99. package/src/plugins/jupiter/exchange/structs.js +21 -1
  100. package/src/plugins/jupiter/exchange/structs.js.map +1 -1
  101. package/src/plugins/jupiter/exchange/valueAverageFetcher.js.map +1 -1
  102. package/src/plugins/jupiter/helpers.d.ts +2 -2
  103. package/src/plugins/jupiter/helpers.js.map +1 -1
  104. package/src/plugins/rain/collectionsJob.js +6 -10
  105. package/src/plugins/rain/collectionsJob.js.map +1 -1
  106. package/src/plugins/rain/helpers.js +3 -1
  107. package/src/plugins/rain/helpers.js.map +1 -1
  108. package/src/plugins/rain/index.js +2 -1
  109. package/src/plugins/rain/index.js.map +1 -1
  110. package/src/plugins/rain/loansFetcher.js +60 -25
  111. package/src/plugins/rain/loansFetcher.js.map +1 -1
  112. package/src/plugins/rain/types.d.ts +3 -0
  113. package/src/plugins/sharky/constants.d.ts +0 -1
  114. package/src/plugins/sharky/constants.js +3 -4
  115. package/src/plugins/sharky/constants.js.map +1 -1
  116. package/src/plugins/sharky/loansFetcher.js +17 -20
  117. package/src/plugins/sharky/loansFetcher.js.map +1 -1
  118. package/src/plugins/sushiswap/helpers.js +24 -24
  119. package/src/plugins/uniswap-v2/helpers.js +22 -22
  120. package/src/plugins/zeta/airdropFetcher.js +14 -14
  121. package/src/utils/misc/MemoizedCache.d.ts +12 -0
  122. package/src/utils/misc/MemoizedCache.js +35 -0
  123. package/src/utils/misc/MemoizedCache.js.map +1 -0
  124. package/src/utils/misc/arrayToMap.d.ts +1 -0
  125. package/src/utils/misc/arrayToMap.js +12 -0
  126. package/src/utils/misc/arrayToMap.js.map +1 -0
  127. package/src/utils/misc/pick.d.ts +2 -0
  128. package/src/utils/misc/pick.js +16 -0
  129. package/src/utils/misc/pick.js.map +1 -0
  130. package/src/utils/sei/constants.js +8 -8
  131. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  132. package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js +8 -3
  133. package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js.map +1 -1
  134. package/src/plugins/allbridge/getPoolInfo.d.ts +0 -3
  135. package/src/plugins/allbridge/getPoolInfo.js +0 -28
  136. package/src/plugins/allbridge/getPoolInfo.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.positionStruct = exports.Side = exports.custodyStruct = exports.fundingRateStateStruct = exports.assetsStruct = exports.permissionsStruct = exports.pricingParamsStruct = exports.oracleParamsStruct = exports.OracleType = exports.perpetualPoolStruct = exports.feesStruct = exports.poolAprStruct = exports.limitStruct = exports.valueAverageStruct = exports.dcaStruct = exports.limitOrderStruct = void 0;
3
+ exports.positionStruct = exports.Side = exports.custodyStruct = exports.fundingRateStateStruct = exports.assetsStruct = exports.permissionsStruct = exports.pricingParamsStruct = exports.oracleParamsStruct = exports.OracleType = exports.perpetualPoolStruct = exports.feesStruct = exports.poolAprStruct = exports.limitStruct = exports.valueAverageStruct = exports.dcaStruct = exports.limitOrderV2Struct = exports.limitOrderStruct = void 0;
4
4
  const beet_1 = require("@metaplex-foundation/beet");
5
5
  const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
6
  const solana_1 = require("../../../utils/solana");
@@ -22,6 +22,26 @@ exports.limitOrderStruct = new beet_1.BeetStruct([
22
22
  ['base', beet_solana_1.publicKey],
23
23
  ['referral', beet_solana_1.publicKey],
24
24
  ], (args) => args);
25
+ exports.limitOrderV2Struct = new beet_1.BeetStruct([
26
+ ['buffer', (0, solana_1.blob)(8)],
27
+ ['maker', beet_solana_1.publicKey],
28
+ ['inputMint', beet_solana_1.publicKey],
29
+ ['outputMint', beet_solana_1.publicKey],
30
+ ['inputTokenProgram', beet_solana_1.publicKey],
31
+ ['outputTokenProgram', beet_solana_1.publicKey],
32
+ ['uniqueId', solana_1.u64],
33
+ ['oriMakingAmount', solana_1.u64],
34
+ ['oriTakingAmount', solana_1.u64],
35
+ ['makingAmount', solana_1.u64],
36
+ ['takingAmount', solana_1.u64],
37
+ ['borrowMakingAmount', solana_1.u64],
38
+ ['expiredAt', solana_1.i64],
39
+ ['feeBps', beet_1.u16],
40
+ ['feeAccount', beet_solana_1.publicKey],
41
+ ['createdAt', solana_1.i64],
42
+ ['updatedAt', solana_1.i64],
43
+ ['bump', beet_1.u8],
44
+ ], (args) => args);
25
45
  exports.dcaStruct = new beet_1.BeetStruct([
26
46
  ['buffer', (0, solana_1.blob)(8)],
27
47
  ['user', beet_solana_1.publicKey],
@@ -1 +1 @@
1
- {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/structs.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AACnC,kEAA6D;AAG7D,kDAA6D;AAqBhD,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,SAAS,EAAE,WAAI,CAAC;IACjB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,oBAAoB,EAAE,uBAAS,CAAC;IACjC,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,KAAK,EAAE,YAAG,CAAC;IACZ,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,UAAU,EAAE,uBAAS,CAAC;CACxB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAkB,CAC7B,CAAC;AA2BW,QAAA,SAAS,GAAG,IAAI,iBAAU,CACrC;IACE,CAAC,Q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UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,4BAA4B,EAAE,aAAI,CAAC;IACpC,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,MAAM,EAAE,SAAE,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC"}
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/structs.ts"],"names":[],"mappings":";;;AAAA,oDAQmC;AACnC,kEAA6D;AAG7D,kDAA6D;AAqBhD,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,SAAS,EAAE,WAAI,CAAC;IACjB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,oBAAoB,EAAE,uBAAS,CAAC;IACjC,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,KAAK,EAAE,YAAG,CAAC;IACZ,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,UAAU,EAAE,uBAAS,CAAC;CACxB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IACrB,CAAC,MAAM,EAAE,SAAE,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"valueAverageFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/valueAverageFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AAGpC,2CAAgE;AAChE,oDAAyD;AACzD,kDAAiE;AACjE,wGAAgF;AAChF,wCAA6C;AAC7C,uCAA+C;AAC/C,uCAAgD;AAEhD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,oBAAoB,GAAG,MAAM,IAAA,iCAAwB,EACzD,MAAM,EACN,4BAAkB,EAClB,iCAAqB,EACrB,IAAA,6BAAmB,EAAC,KAAK,CAAC,CAC3B,CAAC;IACF,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEjD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IACrC,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;QAClC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACpD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EACjB,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,MAAM,SAAS,GAAqB,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAuB,EAAE,CAAC;IACxC,KAAK,MAAM,iBAAiB,IAAI,oBAAoB,EAAE,CAAC;QACrD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3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"valueAverageFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/valueAverageFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AAGpC,2CAAgE;AAChE,oDAAyD;AACzD,kDAAiE;AACjE,wGAAgF;AAChF,wCAA6C;AAC7C,uCAA+C;AAC/C,uCAAgD;AAEhD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,oBAAoB,GAAG,MAAM,IAAA,iCAAwB,EACzD,MAAM,EACN,4BAAkB,EAClB,iCAAqB,EACrB,IAAA,6BAAmB,EAAC,KAAK,CAAC,CAC3B,CAAC;IACF,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEjD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IACrC,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;QAClC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACpD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EACjB,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,MAAM,SAAS,GAA0B,EAAE,CAAC;IAC5C,MAAM,QAAQ,GAAuB,EAAE,CAAC;IACxC,KAAK,MAAM,iBAAiB,IAAI,oBAAoB,EAAE,CAAC;QACrD,MAAM,aAAa,GAAqB,EAAE,CAAC;QAC3C,MAAM,SAAS,GAAG,iBA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,6 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
- import { PortfolioAsset } from '@sonarwatch/portfolio-core';
2
+ import { PortfolioAssetToken } from '@sonarwatch/portfolio-core';
3
3
  export declare function deriveClaimStatus(claimant: string, merkleTree: string, merkleDistributor: string): PublicKey;
4
4
  export declare function getVotePda(owner: string): PublicKey;
5
5
  export declare function getJupiterPrices(mints: PublicKey[], vsMint: PublicKey): Promise<Map<string, number>>;
6
- export declare function getMergedAssets(assets: PortfolioAsset[]): PortfolioAsset[];
6
+ export declare function getMergedAssets(assets: PortfolioAssetToken[]): PortfolioAssetToken[];
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,kDAA6C;AAC7C,+DAA4E;AAE5E,qDAAoE;AAEpE,SAAgB,iBAAiB,CAC/B,QAAgB,EAChB,UAAkB,EAClB,iBAAyB;IAEzB,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;QAC1B,IAAI,mBAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;QACjC,IAAI,mBAAS,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;KACpC,EACD,IAAI,mBAAS,CAAC,iBAAiB,CAAC,CACjC,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AAbD,8CAaC;AAED,SAAgB,UAAU,CAAC,KAAa;IACtC,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;QACrB,wBAAY,CAAC,OAAO,EAAE;QACtB,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE;KAC/B,EACD,yBAAa,CACd,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AATD,gCASC;AAED,SAAsB,gBAAgB,CAAC,KAAkB,EAAE,MAAiB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,GAAG,IAAA,+BAAc,EAAC,CAAC,UAAU,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;YACxE,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1C,CAAC;AAnBD,0CAmBC"}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,kDAA6C;AAC7C,+DAGoC;AAEpC,qDAAoE;AAEpE,SAAgB,iBAAiB,CAC/B,QAAgB,EAChB,UAAkB,EAClB,iBAAyB;IAEzB,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;QAC1B,IAAI,mBAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;QACjC,IAAI,mBAAS,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;KACpC,EACD,IAAI,mBAAS,CAAC,iBAAiB,CAAC,CACjC,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AAbD,8CAaC;AAED,SAAgB,UAAU,CAAC,KAAa;IACtC,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;QACrB,wBAAY,CAAC,OAAO,EAAE;QACtB,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE;KAC/B,EACD,yBAAa,CACd,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AATD,gCASC;AAED,SAAsB,gBAAgB,CAAC,KAAkB,EAAE,MAAiB;;QAC1E,MAAM,GAAG,GAAG,MAAM,eAAK,CAAC,GAAG,CACzB,+BAA+B,EAC/B;YACE,MAAM,EAAE;gBACN,GAAG,EAAE,KAAK,CAAC,GA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aAAa,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1C,CAAC;AAnBD,0CAmBC"}
@@ -12,20 +12,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
13
13
  const constants_1 = require("./constants");
14
14
  const helpers_1 = require("./helpers");
15
+ const pick_1 = require("../../utils/misc/pick");
15
16
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
16
17
  const collections = yield (0, helpers_1.getCollections)();
17
- const promises = [];
18
- for (const collecion of collections) {
19
- promises.push(cache.setItem(collecion.collectionId.toString(), collecion, {
20
- prefix: constants_1.platformId,
21
- networkId: portfolio_core_1.NetworkId.solana,
22
- }));
23
- }
24
- promises.push(cache.setItem(constants_1.collectionsKey, collections, {
18
+ const filteredCollections = collections
19
+ .filter((c) => !c.isDefi)
20
+ .map((c) => (0, pick_1.pick)(c, ['collectionId', 'name', 'floorPrice']));
21
+ yield cache.setItem(constants_1.collectionsKey, filteredCollections, {
25
22
  prefix: constants_1.platformId,
26
23
  networkId: portfolio_core_1.NetworkId.solana,
27
- }));
28
- yield Promise.all(promises);
24
+ });
29
25
  });
30
26
  const job = {
31
27
  id: `${constants_1.platformId}-collections`,
@@ -1 +1 @@
1
- {"version":3,"file":"collectionsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/collectionsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAyD;AACzD,uCAA2C;AAE3C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,WAAW,GAAG,MAAM,IAAA,wBAAc,GAAE,CAAC;IAC3C,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,KAAK,MAAM,SAAS,IAAI,WAAW,EAAE,CAAC;QACpC,QAAQ,CAAC,IAAI,CACX,KAA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;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -45,7 +45,9 @@ exports.getPoolPda = getPoolPda;
45
45
  function getLoans(owner) {
46
46
  return __awaiter(this, void 0, void 0, function* () {
47
47
  const getLoansRes = yield axios_1.default
48
- .get(`${constants_1.rainApi}/loans/user?pubkey=${owner}`, { timeout: 1000 })
48
+ .get(`${constants_1.rainApi}/loans/user?pubkey=${owner}&status=Ongoing`, {
49
+ timeout: 1000,
50
+ })
49
51
  .catch(() => null);
50
52
  if (!getLoansRes || getLoansRes.data.ongoingCount === 0)
51
53
  return [];
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,6CAA4C;AAC5C,gEAAqC;AACrC,2CAAiD;AASjD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEnC,SAAsB,OAAO,CAAC,IAAY;;QACxC,MAAM,WAAW,GAAuC,MAAM,eAAK;aAChE,GAAG,CAAC,GAAG,mBAAO,sBAAsB,IAAI,EAAE,CAAC;aAC3C,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC;QACxD,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;IAC/B,CAAC;CAAA;AAND,0BAMC;AAED,SAAsB,cAAc;;QAClC,MAAM,iBAAiB,GACrB,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,mBAAO,cAAc,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC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IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACnE,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;IAChC,CAAC;CAAA;AARD,4BAQC;AAED,SAAgB,gBAAgB,CAAC,KAAW,EAAE,GAAS;IACrD,OAAO,IAAI,sBAAS,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;SAChC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;SACtB,SAAS,CAAC,MAAM,CAAC;SACjB,aAAa,CAAC,CAAC,EAAE,sBAAS,CAAC,UAAU,CAAC;SACtC,QAAQ,EAAE,CAAC;AAChB,CAAC;AAND,4CAMC"}
@@ -7,7 +7,8 @@ exports.fetchers = exports.jobs = exports.platforms = void 0;
7
7
  const constants_1 = require("./constants");
8
8
  const poolsFetcher_1 = __importDefault(require("./poolsFetcher"));
9
9
  const loansFetcher_1 = __importDefault(require("./loansFetcher"));
10
+ const collectionsJob_1 = __importDefault(require("./collectionsJob"));
10
11
  exports.platforms = [constants_1.platform];
11
- exports.jobs = [];
12
+ exports.jobs = [collectionsJob_1.default];
12
13
  exports.fetchers = [poolsFetcher_1.default, loansFetcher_1.default];
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,kEAA0C;AAC1C,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,sBAAY,EAAE,sBAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,kEAA0C;AAC1C,kEAA0C;AAC1C,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,wBAAc,CAAC,CAAC;AAC/B,QAAA,QAAQ,GAAc,CAAC,sBAAY,EAAE,sBAAY,CAAC,CAAC"}
@@ -21,55 +21,90 @@ const solana_1 = require("../../utils/solana");
21
21
  const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
22
22
  const pool_1 = require("./structs/pool");
23
23
  const helpers_1 = require("./helpers");
24
+ const getAssetBatchDas_1 = require("../../utils/solana/das/getAssetBatchDas");
25
+ const getSolanaDasEndpoint_1 = __importDefault(require("../../utils/clients/getSolanaDasEndpoint"));
26
+ const heliusAssetToAssetCollectible_1 = require("../../utils/solana/das/heliusAssetToAssetCollectible");
27
+ const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
28
+ const collectionMemo = new MemoizedCache_1.MemoizedCache(constants_1.collectionsKey, {
29
+ prefix: constants_1.platformId,
30
+ networkId: portfolio_core_1.NetworkId.solana,
31
+ });
24
32
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
25
33
  const client = (0, clients_1.getClientSolana)();
26
- // const loans = await getParsedProgramAccounts(
27
- // client,
28
- // loanStruct,
29
- // programId,
30
- // loanBorrowerFilter(owner)
31
- // );
32
- // if (loans.length === 0) return [];
34
+ const dasUrl = (0, getSolanaDasEndpoint_1.default)();
33
35
  const loans = yield (0, helpers_1.getLoans)(owner);
34
36
  if (loans.length === 0)
35
37
  return [];
36
- const mints = new Set();
38
+ const tokenMints = new Set();
39
+ const nftMints = new Set();
37
40
  const pools = new Set();
41
+ tokenMints.add(portfolio_core_1.solanaNativeAddress);
38
42
  loans.forEach((loan) => {
39
43
  pools.add(loan.pool.toString());
40
- mints.add(loan.currency.toString());
41
- mints.add(loan.mint.toString());
44
+ tokenMints.add(loan.currency.toString());
45
+ if (loan.isDefi)
46
+ tokenMints.add(loan.mint.toString());
47
+ else
48
+ nftMints.add(loan.mint.toString());
42
49
  });
43
- const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
44
- const poolsAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, pool_1.poolStruct, Array.from(pools).map((pool) => new web3_js_1.PublicKey(pool)));
50
+ const [tokenPriceById, heliusAssets, collections, poolsAccounts] = yield Promise.all([
51
+ cache.getTokenPricesAsMap(Array.from(tokenMints), portfolio_core_1.NetworkId.solana),
52
+ (0, getAssetBatchDas_1.getAssetBatchDasAsMap)(dasUrl, Array.from(nftMints)),
53
+ collectionMemo.getItem(cache),
54
+ (0, solana_1.getParsedMultipleAccountsInfo)(client, pool_1.poolStruct, Array.from(pools).map((pool) => new web3_js_1.PublicKey(pool))),
55
+ ]);
45
56
  const poolById = new Map();
46
57
  poolsAccounts.forEach((account) => account ? poolById.set(account.pubkey.toString(), account) : undefined);
47
58
  const elements = [];
48
59
  for (const loan of loans) {
49
60
  if (new bignumber_js_1.default(loan.amount).isZero())
50
61
  continue;
51
- if (loan.status !== 'Ongoing')
52
- continue;
53
- if (!loan.isDefi)
54
- continue;
55
- const collateraMint = loan.mint.toString();
62
+ const collateralMint = loan.mint.toString();
56
63
  const borrowMint = loan.currency.toString();
57
- const collatTokenPrice = tokenPriceById.get(collateraMint);
58
- const borrowTokenPrice = tokenPriceById.get(borrowMint);
59
- if (!collatTokenPrice || !borrowTokenPrice)
60
- continue;
61
64
  const borrowedAssets = [];
62
65
  const borrowedYields = [];
63
66
  const suppliedAssets = [];
64
67
  const suppliedYields = [];
65
68
  const rewardAssets = [];
66
- const amountBorrowed = new bignumber_js_1.default(loan.amount).dividedBy(Math.pow(10, borrowTokenPrice.decimals));
67
69
  const daysRemaining = (0, helpers_1.daysBetweenDates)(new Date(), new Date(loan.expiredAt));
70
+ const borrowTokenPrice = tokenPriceById.get(borrowMint);
71
+ if (!borrowTokenPrice)
72
+ continue;
73
+ if (loan.isDefi) {
74
+ // mint is a token
75
+ const collatTokenPrice = tokenPriceById.get(collateralMint);
76
+ if (!collatTokenPrice)
77
+ continue;
78
+ const amountDeposited = new bignumber_js_1.default(loan.collateralAmount).dividedBy(Math.pow(10, collatTokenPrice.decimals));
79
+ if (!amountDeposited.isZero())
80
+ suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(collatTokenPrice.address, amountDeposited.toNumber(), portfolio_core_1.NetworkId.solana, collatTokenPrice));
81
+ }
82
+ else {
83
+ // mint is a nft
84
+ const heliusAsset = heliusAssets.get(loan.mint);
85
+ if (heliusAsset && collections) {
86
+ const collection = collections.find((c) => c.collectionId === loan.collectionId);
87
+ const solTokenPrice = tokenPriceById.get(portfolio_core_1.solanaNativeAddress);
88
+ const assetValue = collection && solTokenPrice
89
+ ? new bignumber_js_1.default(collection.floorPrice)
90
+ .dividedBy(Math.pow(10, solTokenPrice.decimals))
91
+ .multipliedBy(solTokenPrice.price)
92
+ .toNumber()
93
+ : undefined;
94
+ const asset = (0, heliusAssetToAssetCollectible_1.heliusAssetToAssetCollectible)(heliusAsset, {
95
+ tags: [portfolio_core_1.collectibleFreezedTag],
96
+ collection: {
97
+ name: collection === null || collection === void 0 ? void 0 : collection.name,
98
+ floorPrice: assetValue,
99
+ },
100
+ });
101
+ if (asset)
102
+ suppliedAssets.push(asset);
103
+ }
104
+ }
105
+ const amountBorrowed = new bignumber_js_1.default(loan.amount).dividedBy(Math.pow(10, borrowTokenPrice.decimals));
68
106
  if (!amountBorrowed.isZero())
69
107
  borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(borrowTokenPrice.address, amountBorrowed.toNumber(), portfolio_core_1.NetworkId.solana, borrowTokenPrice, undefined, { tags: [`Refund in ${daysRemaining} days`] }));
70
- const amountDeposited = new bignumber_js_1.default(loan.collateralAmount).dividedBy(Math.pow(10, collatTokenPrice.decimals));
71
- if (!amountDeposited.isZero())
72
- suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(collatTokenPrice.address, amountDeposited.toNumber(), portfolio_core_1.NetworkId.solana, collatTokenPrice));
73
108
  if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
74
109
  continue;
75
110
  const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({ suppliedAssets, borrowedAssets, rewardAssets });
@@ -1 +1 @@
1
- {"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAC5C,gEAAqC;AAGrC,2CAAyC;AACzC,iDAAsD;AACtD,+CAG4B;AAC5B,qGAA6E;AAC7E,yCAAkD;AAClD,uCAAuD;AAEvD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,gDAAgD;IAChD,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,8BAA8B;IAC9B,KAAK;IAEL,qCAAqC;IAErC,MAAM,KAAK,GAAG,MAAM,IAAA,kBAAQ,EAAC,KAAK,CAAC,CAAC;IACpC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAElC,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IACrC,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IACrC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAChC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QACpC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClC,CAAC,CA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wCAAuB,EAAC,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CAAC;QAE5E,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK;YACL,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,YAAY;gBACZ,WAAW;gBACX,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,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"}
1
+ {"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,6CAA4C;AAC5C,gEAAqC;AAGrC,2CAAyD;AACzD,iDAAsD;AACtD,+CAG4B;AAC5B,qGAA6E;AAC7E,yCAAkD;AAClD,uCAAuD;AACvD,8EAAgF;AAChF,oGAA4E;AAC5E,wGAAqG;AAErG,kEAA+D;AAE/D,MAAM,cAAc,GAAG,IAAI,6BAAa,CAAqB,0BAAc,EAAE;IAC3E,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,MAAM,GAAG,IAAA,8BAAoB,GAAE,CAAC;IAEtC,MAAM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AAC"}
@@ -96,7 +96,10 @@ export type Collection = {
96
96
  updatedAt: string;
97
97
  deletedAt: string;
98
98
  version: number;
99
+ mintIn: string;
100
+ isDefi: boolean;
99
101
  };
102
+ export type PickedCollection = Pick<Collection, 'collectionId' | 'name' | 'floorPrice'>;
100
103
  export type LoansResponse = {
101
104
  user: string;
102
105
  platform: string;
@@ -8,5 +8,4 @@ export declare const cachePrefix = "sharky";
8
8
  export declare const sharkyProgram: PublicKey;
9
9
  export declare const loanDataSize = 338;
10
10
  export declare const orderBookDataSize = 10240;
11
- export declare const collectionRefreshInterval = 3600000;
12
11
  export declare const sharkyIdlItem: IdlItem;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sharkyIdlItem = exports.collectionRefreshInterval = exports.orderBookDataSize = exports.loanDataSize = exports.sharkyProgram = exports.cachePrefix = exports.collectionsCacheKey = exports.platform = exports.platformId = void 0;
3
+ exports.sharkyIdlItem = 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
5
  const idl_1 = require("./idl");
6
6
  exports.platformId = 'sharky';
7
7
  exports.platform = {
8
8
  id: exports.platformId,
9
9
  name: 'Sharky',
10
- image: 'https://sonar.watch/img/platforms/sharki.webp',
11
- website: 'https://sharki.fi/',
10
+ image: 'https://sonar.watch/img/platforms/sharky.webp',
11
+ website: 'https://sharky.fi/',
12
12
  twitter: 'https://twitter.com/SharkyFi',
13
13
  defiLlamaId: 'sharky', // from https://defillama.com/docs/api
14
14
  };
@@ -17,7 +17,6 @@ exports.cachePrefix = `${exports.platformId}`;
17
17
  exports.sharkyProgram = new web3_js_1.PublicKey('SHARKobtfF1bHhxD2eqftjHBdVSCbKo9JtgK71FhELP');
18
18
  exports.loanDataSize = 338;
19
19
  exports.orderBookDataSize = 10240;
20
- exports.collectionRefreshInterval = 3600000;
21
20
  exports.sharkyIdlItem = {
22
21
  programId: exports.sharkyProgram.toString(),
23
22
  idl: idl_1.SharkyIDL,
@@ -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,EAAE,+CAA+C;IACtD,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,8BAA8B;IACvC,WAAW,EAAE,QAAQ,EAAE,sCAAsC;CAC9D,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;AAC1B,QAAA,yBAAyB,GAAG,OAAO,CAAC;AAEpC,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;AAE5C,+BAAkC;AAErB,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,+CAA+C;IACtD,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,8BAA8B;IACvC,WAAW,EAAE,QAAQ,EAAE,sCAAsC;CAC9D,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"}
@@ -22,8 +22,12 @@ const getAssetBatchDas_1 = require("../../utils/solana/das/getAssetBatchDas");
22
22
  const getSolanaDasEndpoint_1 = __importDefault(require("../../utils/clients/getSolanaDasEndpoint"));
23
23
  const heliusAssetToAssetCollectible_1 = require("../../utils/solana/das/heliusAssetToAssetCollectible");
24
24
  const filters_1 = require("./filters");
25
- const collections = new Map();
26
- let collectionLastUpdate = 0;
25
+ const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
26
+ const arrayToMap_1 = require("../../utils/misc/arrayToMap");
27
+ const collectionsMemo = new MemoizedCache_1.MemoizedCache(constants_1.collectionsCacheKey, {
28
+ prefix: constants_1.cachePrefix,
29
+ networkId: portfolio_core_1.NetworkId.solana,
30
+ }, (arr) => (0, arrayToMap_1.arrayToMap)(arr || [], 'orderBook'));
27
31
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
28
32
  const dasUrl = (0, getSolanaDasEndpoint_1.default)();
29
33
  const connection = (0, clients_1.getClientSolana)();
@@ -35,26 +39,15 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
35
39
  ])).flat();
36
40
  if (accounts.length === 0)
37
41
  return [];
38
- const [solTokenPrice, heliusAssets] = yield Promise.all([
42
+ const [solTokenPrice, heliusAssets, collections] = yield Promise.all([
39
43
  cache.getTokenPrice(portfolio_core_1.solanaNativeAddress, portfolio_core_1.NetworkId.solana),
40
44
  (0, getAssetBatchDas_1.getAssetBatchDasAsMap)(dasUrl, accounts
41
45
  .map((acc) => { var _a; return (_a = acc.loanState.taken) === null || _a === void 0 ? void 0 : _a.taken.nftCollateralMint; })
42
46
  .filter((mint) => mint)),
47
+ collectionsMemo.getItem(cache),
43
48
  ]);
44
- if (!solTokenPrice)
49
+ if (!solTokenPrice || !collections)
45
50
  return [];
46
- if (collectionLastUpdate + constants_1.collectionRefreshInterval < Date.now()) {
47
- const collectionsArr = yield cache.getItem(constants_1.collectionsCacheKey, {
48
- prefix: constants_1.cachePrefix,
49
- networkId: portfolio_core_1.NetworkId.solana,
50
- });
51
- if (collectionsArr) {
52
- collectionsArr.forEach((cc) => {
53
- collections.set(cc.orderBook, cc);
54
- });
55
- }
56
- collectionLastUpdate = Date.now();
57
- }
58
51
  const elements = [];
59
52
  accounts.forEach((acc) => {
60
53
  var _a;
@@ -107,17 +100,21 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
107
100
  }
108
101
  if (suppliedAssets.length === 0)
109
102
  return;
110
- const { borrowedValue, suppliedValue, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({
103
+ const { borrowedValue, suppliedValue, rewardValue, value } = (0, portfolio_core_1.getElementNFTLendingValues)({
111
104
  suppliedAssets,
112
105
  borrowedAssets,
113
106
  rewardAssets: [],
107
+ lender: acc.loanState.offer !== undefined ||
108
+ (acc.loanState.taken
109
+ ? acc.loanState.taken.taken.lenderNoteMint === owner.toString()
110
+ : false),
114
111
  });
115
112
  elements.push({
116
113
  networkId: portfolio_core_1.NetworkId.solana,
117
114
  label: 'Lending',
118
115
  platformId: constants_1.platformId,
119
116
  type: portfolio_core_1.PortfolioElementType.borrowlend,
120
- value: suppliedValue,
117
+ value,
121
118
  name,
122
119
  data: {
123
120
  borrowedAssets,
@@ -128,8 +125,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
128
125
  suppliedYields: [],
129
126
  rewardAssets: [],
130
127
  rewardValue,
131
- healthRatio,
132
- value: suppliedValue,
128
+ healthRatio: null,
129
+ value,
133
130
  expireOn: acc.loanState.taken
134
131
  ? Number(acc.loanState.taken.taken.terms.time.start) +
135
132
  Number(acc.loanState.taken.taken.terms.time.duration)
@@ -1 +1 @@
1
- {"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAUoC;AACpC,gEAAqC;AAErC,2CAMqB;AAErB,iDAAsD;AACtD,+CAAkE;AAElE,qGAA6E;AAC7E,8EAAgF;AAChF,oGAA4E;AAC5E,wGAAqG;AACrG,uCAA2C;AAE3C,MAAM,WAAW,GAA4B,IAAI,GAAG,EAAE,CAAC;AACvD,IAAI,oBAAoB,GAAG,CAAC,CAAC;AAE7B,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,8BAAoB,GAAE,CAAC;IACtC,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,IAAA,wBAAc,EAAC,KAAK,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,CACf,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,IAAA,qCAA4B,EAAO,UAAU,EAAE,yBAAa,EAAE,OAAO,CAAC;QACtE,IAAA,qCAA4B,EAAO,UAAU,EAAE,yBAAa,EAAE,OAAO,CAAC;QACtE,IAAA,qCAA4B,EAAO,UAAU,EAAE,yBAAa,EAAE,OAAO,CAAC;KACvE,CAAC,CACH,CAAC,IAAI,EAAE,CAAC;IACT,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG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CAAC,SAAS;aACd;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,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"}
@@ -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;
@@ -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;