@sonarwatch/portfolio-plugins 0.11.172 → 0.11.174

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/CHANGELOG.md +1415 -1407
  2. package/README.md +3 -3
  3. package/package.json +2 -2
  4. package/src/Cache.d.ts +8 -0
  5. package/src/Cache.js +8 -0
  6. package/src/Cache.js.map +1 -1
  7. package/src/plugins/armada-staking/constants.d.ts +8 -0
  8. package/src/plugins/armada-staking/constants.js +37 -1
  9. package/src/plugins/armada-staking/constants.js.map +1 -1
  10. package/src/plugins/armada-staking/index.js +4 -0
  11. package/src/plugins/armada-staking/index.js.map +1 -1
  12. package/src/plugins/armada-staking/stakingFetcher.js +1 -1
  13. package/src/plugins/armada-staking/stakingFetcher.js.map +1 -1
  14. package/src/plugins/balancer/helpers/pools.js +21 -21
  15. package/src/plugins/daos/filters.d.ts +4 -4
  16. package/src/plugins/daos/filters.js +9 -9
  17. package/src/plugins/daos/filters.js.map +1 -1
  18. package/src/plugins/daos/realmsDepositsFetcher.js +1 -1
  19. package/src/plugins/daos/realmsDepositsFetcher.js.map +1 -1
  20. package/src/plugins/daos/realmsProgramsJob.js +2 -2
  21. package/src/plugins/daos/realmsProgramsJob.js.map +1 -1
  22. package/src/plugins/jupiter/helpers.d.ts +1 -1
  23. package/src/plugins/jupiter/helpers.js +6 -2
  24. package/src/plugins/jupiter/helpers.js.map +1 -1
  25. package/src/plugins/jupiter/launchpad/allocationsFetcher.js +1 -2
  26. package/src/plugins/jupiter/launchpad/allocationsFetcher.js.map +1 -1
  27. package/src/plugins/jupiter/launchpad/constants.d.ts +1 -2
  28. package/src/plugins/jupiter/launchpad/constants.js +4 -3
  29. package/src/plugins/jupiter/launchpad/constants.js.map +1 -1
  30. package/src/plugins/mango/banksJob.js +15 -5
  31. package/src/plugins/mango/banksJob.js.map +1 -1
  32. package/src/plugins/mango/collateralFetcher.js +4 -4
  33. package/src/plugins/mango/collateralFetcher.js.map +1 -1
  34. package/src/plugins/mango/constants.d.ts +1 -1
  35. package/src/plugins/mango/constants.js +2 -2
  36. package/src/plugins/mango/constants.js.map +1 -1
  37. package/src/plugins/marginfi/banksJob.js +34 -9
  38. package/src/plugins/marginfi/banksJob.js.map +1 -1
  39. package/src/plugins/marginfi/constants.d.ts +1 -1
  40. package/src/plugins/marginfi/constants.js +2 -2
  41. package/src/plugins/marginfi/constants.js.map +1 -1
  42. package/src/plugins/marginfi/depositsFetcher.js +12 -41
  43. package/src/plugins/marginfi/depositsFetcher.js.map +1 -1
  44. package/src/plugins/marginfi/filters.js +4 -0
  45. package/src/plugins/marginfi/filters.js.map +1 -1
  46. package/src/plugins/marginfi/helpers.d.ts +1 -1
  47. package/src/plugins/marginfi/helpers.js +41 -31
  48. package/src/plugins/marginfi/helpers.js.map +1 -1
  49. package/src/plugins/marginfi/structs/Bank.d.ts +19 -12
  50. package/src/plugins/marginfi/structs/Bank.js +19 -12
  51. package/src/plugins/marginfi/structs/Bank.js.map +1 -1
  52. package/src/plugins/marginfi/types.d.ts +7 -3
  53. package/src/plugins/rain/helpers.d.ts +1 -1
  54. package/src/plugins/rain/helpers.js +1 -1
  55. package/src/plugins/rain/helpers.js.map +1 -1
  56. package/src/plugins/rain/poolsFetcher.js +1 -3
  57. package/src/plugins/rain/poolsFetcher.js.map +1 -1
  58. package/src/plugins/solend/marketsJob.js +1 -1
  59. package/src/plugins/solend/marketsJob.js.map +1 -1
  60. package/src/plugins/solend/reservesJob.js +24 -14
  61. package/src/plugins/solend/reservesJob.js.map +1 -1
  62. package/src/plugins/suilend/marketsJob.js +1 -1
  63. package/src/plugins/suilend/marketsJob.js.map +1 -1
  64. package/src/plugins/sushiswap/helpers.js +24 -24
  65. package/src/plugins/uniswap-v2/helpers.js +22 -22
  66. package/src/utils/sei/constants.js +8 -8
  67. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
@@ -23,7 +23,7 @@ var RiskTier;
23
23
  RiskTier[RiskTier["Collateral"] = 0] = "Collateral";
24
24
  RiskTier[RiskTier["Isolated"] = 1] = "Isolated";
25
25
  })(RiskTier || (exports.RiskTier = RiskTier = {}));
26
- exports.interestRateConfigStruct = new beet_1.FixableBeetStruct([
26
+ exports.interestRateConfigStruct = new beet_1.BeetStruct([
27
27
  ['optimalUtilizationRate', common_1.wrappedI80F48Struct],
28
28
  ['plateauInterestRate', common_1.wrappedI80F48Struct],
29
29
  ['maxInterestRate', common_1.wrappedI80F48Struct],
@@ -31,9 +31,9 @@ exports.interestRateConfigStruct = new beet_1.FixableBeetStruct([
31
31
  ['insuranceIrFee', common_1.wrappedI80F48Struct],
32
32
  ['protocolFixedFeeApr', common_1.wrappedI80F48Struct],
33
33
  ['protocolIrFee', common_1.wrappedI80F48Struct],
34
- ['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u128, 8)],
34
+ ['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u32, 32)],
35
35
  ], (args) => args);
36
- exports.bankConfigStruct = new beet_1.FixableBeetStruct([
36
+ exports.bankConfigStruct = new beet_1.BeetStruct([
37
37
  ['assetWeightInit', common_1.wrappedI80F48Struct],
38
38
  ['assetWeightMaint', common_1.wrappedI80F48Struct],
39
39
  ['liabilityWeightInit', common_1.wrappedI80F48Struct],
@@ -42,31 +42,38 @@ exports.bankConfigStruct = new beet_1.FixableBeetStruct([
42
42
  ['interestRateConfig', exports.interestRateConfigStruct],
43
43
  ['operationalState', beet_1.u8],
44
44
  ['oracleSetup', beet_1.u8],
45
- ['oracleKeys', (0, beet_1.uniformFixedSizeArray)(beet_solana_1.publicKey, 5)],
46
- ['ignore1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 6)],
45
+ ['oracleKeys_1', beet_solana_1.publicKey],
46
+ ['oracleKeys_2', beet_solana_1.publicKey],
47
+ ['oracleKeys_3', beet_solana_1.publicKey],
48
+ ['oracleKeys_4', beet_solana_1.publicKey],
49
+ ['oracleKeys_5', beet_solana_1.publicKey],
50
+ ['auto_padding_0', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 6)],
47
51
  ['borrowLimit', solana_1.u64],
48
52
  ['riskTier', beet_1.u8],
49
- ['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 6)],
53
+ ['auto_padding_1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 7)],
54
+ ['totalAssetValueInitLimit', solana_1.u64],
55
+ ['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 5)],
50
56
  ], (args) => args);
51
- exports.bankStruct = new beet_1.FixableBeetStruct([
57
+ exports.bankStruct = new beet_1.BeetStruct([
52
58
  ['padding', (0, solana_1.blob)(8)],
53
59
  ['mint', beet_solana_1.publicKey],
54
60
  ['mintDecimals', beet_1.u8],
55
61
  ['group', beet_solana_1.publicKey],
56
- ['ignore1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 7)],
62
+ ['auto_padding_0', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 7)],
57
63
  ['assetShareValue', common_1.wrappedI80F48Struct],
58
64
  ['liabilityShareValue', common_1.wrappedI80F48Struct],
59
65
  ['liquidityVault', beet_solana_1.publicKey],
60
- ['blob', (0, solana_1.blob)(2)],
66
+ ['liquidityVaultBump', beet_1.u8],
67
+ ['liquidityVaultAuthorityBump', beet_1.u8],
61
68
  ['insuranceVault', beet_solana_1.publicKey],
62
69
  ['insuranceVaultBump', beet_1.u8],
63
70
  ['insuranceVaultAuthorityBump', beet_1.u8],
64
- ['ignore3', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 4)],
71
+ ['auto_padding_1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 4)],
65
72
  ['collectedInsuranceFeesOutstanding', common_1.wrappedI80F48Struct],
66
73
  ['feeVault', beet_solana_1.publicKey],
67
74
  ['feeVaultBump', beet_1.u8],
68
75
  ['feeVaultAuthorityBump', beet_1.u8],
69
- ['ignore4', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 6)],
76
+ ['auto_padding_2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 6)],
70
77
  ['collectedGroupFeesOutstanding', common_1.wrappedI80F48Struct],
71
78
  ['totalLiabilityShares', common_1.wrappedI80F48Struct],
72
79
  ['totalAssetShares', common_1.wrappedI80F48Struct],
@@ -74,8 +81,8 @@ exports.bankStruct = new beet_1.FixableBeetStruct([
74
81
  ['config', exports.bankConfigStruct],
75
82
  ['emissionsFlags', solana_1.u64],
76
83
  ['emissionsRate', solana_1.u64],
77
- ['emissionsMint', beet_solana_1.publicKey],
78
84
  ['emissionsRemaining', common_1.wrappedI80F48Struct],
85
+ ['emissionsMint', beet_solana_1.publicKey],
79
86
  ['padding0', (0, beet_1.uniformFixedSizeArray)(solana_1.u128, 28)],
80
87
  ['padding1', (0, beet_1.uniformFixedSizeArray)(solana_1.u128, 32)],
81
88
  ], (args) => args);
@@ -1 +1 @@
1
- {"version":3,"file":"Bank.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/marginfi/structs/Bank.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AACnC,kEAA6D;AAG7D,qCAA8D;AAC9D,kDAA6D;AAE7D,sIAAsI;AAEtI,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,6CAAI,CAAA;IACJ,mDAAO,CAAA;IACP,+DAAa,CAAA;AACf,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAED,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,mEAAM,CAAA;IACN,6EAAW,CAAA;IACX,2EAAU,CAAA;AACZ,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B;AAED,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,mDAAU,CAAA;IACV,+CAAQ,CAAA;AACV,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAaY,QAAA,wBAAwB,GACnC,IAAI,wBAAiB,CACnB;IACE,CAAC,wBAAwB,EAAE,4BAAmB,CAAC;IAC/C,CAAC,qBAAqB,EAAE,4BAAmB,CAAC;IAC5C,CAAC,iBAAiB,EAAE,4BAA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AAE,EAAE,CAAC,IAAY,CACvB,CAAC"}
1
+ {"version":3,"file":"Bank.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/marginfi/structs/Bank.ts"],"names":[],"mappings":";;;AAAA,oDAMmC;AACnC,kEAA6D;AAG7D,qCAA8D;AAC9D,kDAA6D;AAE7D,sIAAsI;AAEtI,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,6CAAI,CAAA;IACJ,mDAAO,CAAA;IACP,+DAAa,CAAA;AACf,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAED,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,mEAAM,CAAA;IACN,6EAAW,CAAA;IACX,2EAAU,CAAA;AACZ,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B;AAED,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,mDAAU,CAAA;IACV,+CAAQ,CAAA;AACV,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAaY,QAAA,wBAAwB,GAAG,IAAI,iBAAU,CACpD;IACE,CAAC,wBAAwB,EAAE,4BAAmB,CAAC;IAC/C,CAAC,qBAAqB,EAAE,4BAAmB,CAAC;IAC5C,CAAC,iBAAiB,EAAE,4BAAmB,CAAC;IACxC,CAAC,sBAAsB,EAAE,4BAAmB,CAAC;IAC7C,CAAC,gBAAgB,EAAE,4BAAmB,CAAC;IACvC,CAAC,qBAAqB,EAAE,4BAAmB,CAAC;IAC5C,CAAC,eAAe,EAAE,4BAAmB,CAAC;IACtC,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,UAAG,EAAE,EAAE,CAAC,CAAC;CAC5C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAA0B,CACrC,CAAC;AAwBW,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,iBAAiB,EAAE,4BAAmB,CAAC;IACxC,CAAC,kBAAkB,EAAE,4BAAmB,CAAC;IACzC,CAAC,qBAAqB,E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AC,oBAAoB,EAAE,SAAE,CAAC;IAC1B,CAAC,6BAA6B,EAAE,SAAE,CAAC;IACnC,CAAC,gBAAgB,EAAE,uBAAS,CAAC;IAC7B,CAAC,oBAAoB,EAAE,SAAE,CAAC;IAC1B,CAAC,6BAA6B,EAAE,SAAE,CAAC;IACnC,CAAC,gBAAgB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC,mCAAmC,EAAE,4BAAmB,CAAC;IAC1D,CAAC,UAAU,EAAE,uBAAS,CAAC;IACvB,CAAC,cAAc,EAAE,SAAE,CAAC;IACpB,CAAC,uBAAuB,EAAE,SAAE,CAAC;IAC7B,CAAC,gBAAgB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC,+BAA+B,EAAE,4BAAmB,CAAC;IACtD,CAAC,sBAAsB,EAAE,4BAAmB,CAAC;IAC7C,CAAC,kBAAkB,EAAE,4BAAmB,CAAC;IACzC,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,QAAQ,EAAE,wBAAgB,CAAC;IAC5B,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,oBAAoB,EAAE,4BAAmB,CAAC;IAC3C,CAAC,eAAe,EAAE,uBAAS,CAAC;IAC5B,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,aAAI,EAAE,EAAE,CAAC,CAAC;IAC7C,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,aAAI,EAAE,EAAE,CAAC,CAAC;CAC9C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAY,CACvB,CAAC"}
@@ -1,6 +1,10 @@
1
- import BigNumber from 'bignumber.js';
1
+ import { Yield } from '@sonarwatch/portfolio-core';
2
2
  import { Bank } from './structs/Bank';
3
3
  export type BankInfo = Bank & {
4
- dividedAssetShareValue: BigNumber;
5
- dividedLiabilityShareValue: BigNumber;
4
+ dividedAssetShareValue: string;
5
+ dividedLiabilityShareValue: string;
6
+ suppliedYields: Yield[];
7
+ borrowedYields: Yield[];
8
+ suppliedLtv: number;
9
+ borrowedWeight: number;
6
10
  };
@@ -2,6 +2,6 @@ import { PublicKey } from '@solana/web3.js';
2
2
  import { Collection, Pool } from './types';
3
3
  export declare function getPool(pool: string): Promise<Pool | undefined>;
4
4
  export declare function getCollections(): Promise<Collection[]>;
5
- export declare function getPoolPda(owner: PublicKey): PublicKey;
5
+ export declare function getPoolPda(owner: string): PublicKey;
6
6
  export declare function getLoans(owner: string): Promise<import("./types").Loan[]>;
7
7
  export declare function daysBetweenDates(start: Date, end: Date): number;
@@ -39,7 +39,7 @@ function getCollections() {
39
39
  }
40
40
  exports.getCollections = getCollections;
41
41
  function getPoolPda(owner) {
42
- return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('poolv2', 'utf-8'), owner.toBuffer()], constants_1.programId)[0];
42
+ return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('poolv2', 'utf-8'), new web3_js_1.PublicKey(owner).toBuffer()], constants_1.programId)[0];
43
43
  }
44
44
  exports.getPoolPda = getPoolPda;
45
45
  function getLoans(owner) {
@@ -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,C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,CAAC,CAAC,CAAC;AACP,CAAC;AALD,gCAKC;AAED,SAAsB,QAAQ,CAAC,KAAa;;QAC1C,MAAM,WAAW,GAAwC,MAAM,eAAK;aACjE,GAAG,CAAC,GAAG,mBAAO,sBAAsB,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;aAC/D,KAAK,CAAC,GAAG,EAAE,CAAC,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;AAND,4BAMC;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"}
@@ -13,7 +13,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
- const web3_js_1 = require("@solana/web3.js");
17
16
  const constants_1 = require("./constants");
18
17
  const clients_1 = require("../../utils/clients");
19
18
  const pool_1 = require("./structs/pool");
@@ -23,8 +22,7 @@ const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo"
23
22
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
24
23
  const client = (0, clients_1.getClientSolana)();
25
24
  // Trying to get https://solscan.io/account/4g5zooignaoVrS6NdUWEcNLxZmJGN9UJBAGtrUiBwieF
26
- const pda = (0, helpers_1.getPoolPda)(new web3_js_1.PublicKey(owner));
27
- const poolAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, pool_1.poolStruct, pda);
25
+ const poolAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, pool_1.poolStruct, (0, helpers_1.getPoolPda)(owner));
28
26
  if (!poolAccount || poolAccount.totalAmount.isZero())
29
27
  return [];
30
28
  const tokenPrice = yield cache.getTokenPrice(poolAccount.currency.toString(), portfolio_core_1.NetworkId.solana);
@@ -1 +1 @@
1
- {"version":3,"file":"poolsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/poolsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,6CAA4C;AAG5C,2CAAyC;AACzC,iDAAsD;AACtD,yCAA4C;AAC5C,qGAA6E;AAC7E,uCAAuC;AACvC,kFAA+E;AAE/E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,wFAAwF;IAExF,MAAM,GAAG,GAAG,IAAA,oBAAU,EAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAE7C,MAAM,WAAW,GAAG,MAAM,IAAA,2CAAoB,EAAC,MAAM,EAAE,iBAAU,EAAE,GAAG,CAAC,CAAC;IACxE,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,WAAW,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC;IAEhE,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAC1C,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAC/B,0BAAS,CAAC,MAAM,CACjB,CAAC;IACF,IAAI,CAAC,UAAU;QAAE,OAAO,EAAE,CAAC;IAE3B,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,cAAc,GAAqB,EAAE,CAAC;IAC5C,MAAM,cAAc,GAAc,EAAE,CAAC;IACrC,MAAM,YAAY,GAAqB,EAAE,CAAC;IAE1C,MAAM,MAAM,GAAG,WAAW,CAAC,WAAW;SACnC,SAAS,CAAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC;SACpC,QAAQ,EAAE,CAAC;IACd,cAAc,CAAC,IAAI,CACjB,IAAA,gCAAsB,EACpB,UAAU,CAAC,OAAO,EAClB,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CACF,CAAC;IAEF,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE1E,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,GACrE,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;IAExE,OAAO;QACL;YACE,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,eAAe,EAAE,IAAI;gBACrB,WAAW;gBACX,WAAW;gBACX,YAAY;gBACZ,KAAK;aACN;SACF;KACF,CAAC;AACJ,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":"poolsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/rain/poolsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AAGpC,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AE,GACrE,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;IAExE,OAAO;QACL;YACE,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,eAAe,EAAE,IAAI;gBACrB,WAAW;gBACX,WAAW;gBACX,YAAY;gBACZ,KAAK;aACN;SACF;KACF,CAAC;AACJ,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"}
@@ -28,7 +28,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
28
28
  });
29
29
  }
30
30
  yield cache.setItem(constants_1.marketsKey, marketsEnhanced, {
31
- prefix: constants_1.solendPlatform.id,
31
+ prefix: constants_1.platformId,
32
32
  networkId: portfolio_core_1.NetworkId.solana,
33
33
  });
34
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solend/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA6C;AAC7C,2CAMqB;AAErB,uCAAuC;AAIvC,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,cAAc,GAAgC,MAAM,eAAK,CAAC,GAAG,CACjE,2BAAe,CAChB,CAAC;IACF,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC;IACxC,MAAM,eAAe,GAAiB,EAAE,CAAC;IACzC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,eAAe,CAAC,IAAI,iCACf,UAAU,KACb,IAAI,EAAE,IAAA,oBAAU,EAAC,UAAU,CAAC,IAAI,CAAC,IACjC,CAAC;QACH,MAAM,KAAK,CAAC,OAAO,CACjB,UAAU,CAAC,OAAO,kCAEb,UAAU,KACb,IAAI,EAAE,IAAA,oBAAU,EAAC,UAAU,CAAC,IAAI,CAAC,KAEnC;YACE,MAAM,EAAN,yBAAM;YACN,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CACF,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,CAAC,OAAO,CAAC,sBAAU,EAAE,eAAe,EAAE;QAC/C,MAAM,EAAE,0BAAc,CAAC,EAAE;QACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solend/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA6C;AAC7C,2CAKqB;AAErB,uCAAuC;AAIvC,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,cAAc,GAAgC,MAAM,eAAK,CAAC,GAAG,CACjE,2BAAe,CAChB,CAAC;IACF,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC;IACxC,MAAM,eAAe,GAAiB,EAAE,CAAC;IACzC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,eAAe,CAAC,IAAI,iCACf,UAAU,KACb,IAAI,EAAE,IAAA,oBAAU,EAAC,UAAU,CAAC,IAAI,CAAC,IACjC,CAAC;QACH,MAAM,KAAK,CAAC,OAAO,CACjB,UAAU,CAAC,OAAO,kCAEb,UAAU,KACb,IAAI,EAAE,IAAA,oBAAU,EAAC,UAAU,CAAC,IAAI,CAAC,KAEnC;YACE,MAAM,EAAN,yBAAM;YACN,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CACF,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,CAAC,OAAO,CAAC,sBAAU,EAAE,eAAe,EAAE;QAC/C,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -17,11 +17,13 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
17
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
18
18
  const constants_1 = require("./constants");
19
19
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
20
- const markets = yield cache.getAllItems({
21
- prefix: constants_1.marketsPrefix,
20
+ const markets = yield cache.getItem(constants_1.marketsKey, {
21
+ prefix: constants_1.platformId,
22
+ networkId: portfolio_core_1.NetworkId.solana,
22
23
  });
24
+ if (!markets)
25
+ return;
23
26
  const reservesAddressesByMarket = markets.map((m) => m.reserves.map((r) => r.address));
24
- const promises = [];
25
27
  const reservesInfosResponses = [];
26
28
  const mints = new Set();
27
29
  for (let i = 0; i < reservesAddressesByMarket.length; i += 1) {
@@ -39,6 +41,9 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
39
41
  });
40
42
  }
41
43
  const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
44
+ const reserveItems = [];
45
+ const rateItems = [];
46
+ const sources = [];
42
47
  for (let i = 0; i < reservesAddressesByMarket.length; i += 1) {
43
48
  const reservesAddresses = reservesAddressesByMarket[i];
44
49
  const poolName = markets[i].name;
@@ -48,9 +53,9 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
48
53
  for (let j = 0; j < reservesInfoRes.data.results.length; j += 1) {
49
54
  const reserveInfo = reservesInfoRes.data.results[j];
50
55
  const reserveAddress = reservesAddresses[j];
51
- yield cache.setItem(reserveAddress, Object.assign({ pubkey: reserveAddress }, reserveInfo), {
52
- prefix: constants_1.reservesPrefix,
53
- networkId: portfolio_core_1.NetworkId.solana,
56
+ reserveItems.push({
57
+ key: reserveAddress,
58
+ value: Object.assign({ pubkey: reserveAddress }, reserveInfo),
54
59
  });
55
60
  const { reserve } = reserveInfo;
56
61
  const { liquidity, collateral } = reserve;
@@ -73,7 +78,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
73
78
  ? cTokenExchangeRate.multipliedBy(mintTokenPrice.price).toNumber()
74
79
  : undefined;
75
80
  if (cPrice) {
76
- promises.push(cache.setTokenPriceSource({
81
+ sources.push({
77
82
  address: collateral.mintPubkey.toString(),
78
83
  decimals,
79
84
  id: constants_1.platformId,
@@ -82,9 +87,9 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
82
87
  price: cPrice,
83
88
  timestamp: Date.now(),
84
89
  weight: 1,
85
- }));
90
+ });
86
91
  }
87
- if (borrowedAmount <= 10 && depositedAmount <= 10)
92
+ if (borrowedAmount <= 1 && depositedAmount <= 1)
88
93
  continue;
89
94
  const rate = {
90
95
  tokenAddress,
@@ -101,13 +106,18 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
101
106
  platformId: constants_1.platformId,
102
107
  poolName,
103
108
  };
104
- promises.push(cache.setItem(`${reserveAddress}-${tokenAddress}`, rate, {
105
- prefix: portfolio_core_1.borrowLendRatesPrefix,
106
- networkId: portfolio_core_1.NetworkId.solana,
107
- }));
109
+ rateItems.push({ key: `${reserveAddress}-${tokenAddress}`, value: rate });
108
110
  }
109
111
  }
110
- yield Promise.all(promises);
112
+ yield cache.setTokenPriceSources(sources);
113
+ yield cache.setItems(reserveItems, {
114
+ prefix: constants_1.reservesPrefix,
115
+ networkId: portfolio_core_1.NetworkId.solana,
116
+ });
117
+ yield cache.setItems(rateItems, {
118
+ prefix: portfolio_core_1.borrowLendRatesPrefix,
119
+ networkId: portfolio_core_1.NetworkId.solana,
120
+ });
111
121
  });
112
122
  const job = {
113
123
  id: `${constants_1.platformId}-reserves`,
@@ -1 +1 @@
1
- {"version":3,"file":"reservesJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solend/reservesJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,+DAKoC;AACpC,gEAAqC;AACrC,2CAMqB;AAKrB,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,WAAW,CAAa;QAClD,MAAM,EAAE,yBAAa;KACtB,CAAC,CAAC;IACH,MAAM,yBAAyB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAClD,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CACjC,CAAC;IAEF,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,MAAM,sBAAsB,GAAG,EAAE,CAAC;IAClC,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IAErC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,yBAAyB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7D,MAAM,iBAAiB,GAAG,yBAAyB,CAAC,CAAC,CAAC,CAAC;QACvD,MAAM,eAAe,GACnB,MAAM,eAAK;aACR,GAAG,CAAC,GAAG,2BAAe,GAAG,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;aACvD,KAAK,CAAC,GAAG,EAAE;YACV,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AU,CAAC,QAAQ,EAAE;oBACzC,QAAQ;oBACR,EAAE,EAAE,sBAAU;oBACd,SAAS,EAAE,0BAAS,CAAC,MAAM;oBAC3B,UAAU,EAAV,sBAAU;oBACV,KAAK,EAAE,MAAM;oBACb,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;oBACrB,MAAM,EAAE,CAAC;iBACV,CAAC,CACH,CAAC;YACJ,CAAC;YAED,IAAI,cAAc,IAAI,EAAE,IAAI,eAAe,IAAI,EAAE;gBAAE,SAAS;YAE5D,MAAM,IAAI,GAAmB;gBAC3B,YAAY;gBACZ,WAAW,EAAE;oBACX,GAAG,EAAE,SAAS;oBACd,GAAG,EAAE,IAAA,yBAAQ,EAAC,SAAS,CAAC;iBACzB;gBACD,cAAc;gBACd,YAAY,EAAE;oBACZ,GAAG,EAAE,UAAU;oBACf,GAAG,EAAE,IAAA,yBAAQ,EAAC,UAAU,CAAC;iBAC1B;gBACD,eAAe;gBACf,UAAU,EAAV,sBAAU;gBACV,QAAQ;aACT,CAAC;YAEF,QAAQ,CAAC,IAAI,CACX,KAAK,CAAC,OAAO,CAAC,GAAG,cAAc,IAAI,YAAY,EAAE,EAAE,IAAI,EAAE;gBACvD,MAAM,EAAE,sCAAqB;gBAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;aAC5B,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IACD,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC9B,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"reservesJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solend/reservesJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,+DAMoC;AACpC,gEAAqC;AACrC,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gBAC3B,YAAY;gBACZ,WAAW,EAAE;oBACX,GAAG,EAAE,SAAS;oBACd,GAAG,EAAE,IAAA,yBAAQ,EAAC,SAAS,CAAC;iBACzB;gBACD,cAAc;gBACd,YAAY,EAAE;oBACZ,GAAG,EAAE,UAAU;oBACf,GAAG,EAAE,IAAA,yBAAQ,EAAC,UAAU,CAAC;iBAC1B;gBACD,eAAe;gBACf,UAAU,EAAV,sBAAU;gBACV,QAAQ;aACT,CAAC;YAEF,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,cAAc,IAAI,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,KAAK,CAAC,QAAQ,CAAC,YAAY,EAAE;QACjC,MAAM,EAAN,0BAAM;QACN,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,MAAM,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE;QAC9B,MAAM,EAAE,sCAAqB;QAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -45,7 +45,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
45
45
  tokenAddress: reserve.fields.coin_type.fields.name,
46
46
  utilizationRatio: utilization.toNumber(),
47
47
  depositYield: { apr: depositApr, apy: (0, portfolio_core_1.aprToApy)(depositApr) },
48
- borrowYield: { apr: borrowApr, apy: (0, portfolio_core_1.aprToApy)(borrowApr) },
48
+ borrowYield: { apr: -borrowApr, apy: -(0, portfolio_core_1.aprToApy)(borrowApr) },
49
49
  };
50
50
  rates.push(rate);
51
51
  promises.push(cache.setItem(`${reserve.fields.id.id}-${reserve.fields.coin_type.fields.name}`, rate, {
@@ -1 +1 @@
1
- {"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AAGrC,iDAAmD;AACnD,qEAAkE;AAClE,2CAAiE;AAEjE,uCAAwD;AACxD,mDAAkD;AAElD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,cAAc,GAAG,MAAM,IAAA,iCAAe,EAAgB,MAAM,EAAE;QAClE,sBAAU;KACX,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,MAAM,cAAc,GAAoB,EAAE,CAAC;IAE3C,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;QACpC,IAAI,MAAA,MAAA,MAAM,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,EAAE,CAAC;YACjC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAChD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;gBAC1D,MAAM,cAAc,GAAG,IAAI,sBAAS,CAClC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,CAC5C,CAAC;gBACF,MAAM,eAAe,GAAG,IAAI,sBAAS,CACnC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAChC,CAAC,KAAK,CAAC,SAAA,EAAE,EAAI,uBAAW,CAAA,CAAC,CAAC;gBAC3B,MAAM,WAAW,GAAG,cAAc,CAAC,SAAS,CAC1C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U,EACV;QACE,cAAc;QACd,KAAK;KACN,EACD;QACE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CACF,CACF,CAAC;IAEF,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AAGrC,iDAAmD;AACnD,qEAAkE;AAClE,2CAAiE;AAEjE,uCAAwD;AACxD,mDAAkD;AAElD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,cAAc,GAAG,MAAM,IAAA,iCAAe,EAAgB,MAAM,EAAE;QAClE,sBAAU;KACX,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,MAAM,cAAc,GAAoB,EAAE,CAAC;IAE3C,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;QACpC,IAAI,MAAA,MAAA,MAAM,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,EAAE,CAAC;YACjC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAChD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;gBAC1D,MAAM,cAAc,GAAG,IAAI,sBAAS,CAClC,OAAO,CAAC,MA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,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,EACjE,IAAI,EACJ;oBACE,MAAM,EAAE,sCAAqB;oBAC7B,SAAS,EAAE,0BAAS,CAAC,GAAG;iBACzB,CACF,CACF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,QAAQ,CAAC,IAAI,CACX,KAAK,CAAC,OAAO,CACX,sBAAU,EACV;QACE,cAAc;QACd,KAAK;KACN,EACD;QACE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CACF,CACF,CAAC;IAEF,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,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;
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
4
- exports.infoQueryMsg = JSON.parse(`{
5
- "info": {}
4
+ exports.infoQueryMsg = JSON.parse(`{
5
+ "info": {}
6
6
  }`);
7
- exports.tokenInfoQueryMsg = JSON.parse(`{
8
- "token_info": {}
7
+ exports.tokenInfoQueryMsg = JSON.parse(`{
8
+ "token_info": {}
9
9
  }`);
10
- exports.minterQueryMsg = JSON.parse(`{
11
- "minter": {}
10
+ exports.minterQueryMsg = JSON.parse(`{
11
+ "minter": {}
12
12
  }`);
13
- exports.poolQueryMsg = JSON.parse(`{
14
- "pool": {}
13
+ exports.poolQueryMsg = JSON.parse(`{
14
+ "pool": {}
15
15
  }`);
16
16
  //# sourceMappingURL=constants.js.map
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  function getQueryBalanceByOwner(owner) {
4
- return JSON.parse(`{
5
- "balance": {
6
- "address": "${owner}"
7
- }
4
+ return JSON.parse(`{
5
+ "balance": {
6
+ "address": "${owner}"
7
+ }
8
8
  }`);
9
9
  }
10
10
  exports.default = getQueryBalanceByOwner;