@sonarwatch/portfolio-plugins 0.11.117 → 0.11.119

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # @sonarwatch/portfolio-plugins
2
-
3
- This library is @sonarwatch/portfolio-plugins
1
+ # @sonarwatch/portfolio-plugins
2
+
3
+ This library is @sonarwatch/portfolio-plugins
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.11.117",
3
+ "version": "0.11.119",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
@@ -41,7 +41,7 @@
41
41
  "web3-v1": "npm:web3@^1.5.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "@sonarwatch/portfolio-core": "0.11.117"
44
+ "@sonarwatch/portfolio-core": "0.11.119"
45
45
  },
46
46
  "main": "./src/index.js",
47
47
  "types": "./src/index.d.ts"
@@ -36,27 +36,27 @@ exports.getBalancerPoolsV2 = void 0;
36
36
  const graphql_request_1 = __importStar(require("graphql-request"));
37
37
  function getBalancerPoolsV2(url) {
38
38
  return __awaiter(this, void 0, void 0, function* () {
39
- const query = (0, graphql_request_1.gql) `
40
- query pools {
41
- pools(
42
- first: 1000
43
- orderBy: totalLiquidity
44
- orderDirection: desc
45
- where: { totalLiquidity_gt: "500" }
46
- ) {
47
- id
48
- address
49
- symbol
50
- totalLiquidity
51
- totalShares
52
- tokens {
53
- balance
54
- decimals
55
- symbol
56
- address
57
- }
58
- }
59
- }
39
+ const query = (0, graphql_request_1.gql) `
40
+ query pools {
41
+ pools(
42
+ first: 1000
43
+ orderBy: totalLiquidity
44
+ orderDirection: desc
45
+ where: { totalLiquidity_gt: "500" }
46
+ ) {
47
+ id
48
+ address
49
+ symbol
50
+ totalLiquidity
51
+ totalShares
52
+ tokens {
53
+ balance
54
+ decimals
55
+ symbol
56
+ address
57
+ }
58
+ }
59
+ }
60
60
  `;
61
61
  const res = yield (0, graphql_request_1.default)(url, query);
62
62
  const pools = res.pools;
@@ -39,7 +39,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
39
39
  return [
40
40
  {
41
41
  type: portfolio_core_1.PortfolioElementType.multiple,
42
- label: 'Deposit',
42
+ label: 'Staked',
43
+ name: 'Vote',
43
44
  networkId: portfolio_core_1.NetworkId.solana,
44
45
  platformId: constants_1.platformId,
45
46
  data: { assets: [asset] },
@@ -1 +1 @@
1
- {"version":3,"file":"voteFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/voteFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAAkD;AAClD,uCAAyC;AACzC,iDAAsD;AACtD,kFAA+E;AAC/E,uCAAuC;AACvC,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,YAAY,GAAG,IAAA,oBAAU,EAAC,KAAK,CAAC,CAAC;IACvC,MAAM,aAAa,GAAG,MAAM,IAAA,2CAAoB,EAC9C,MAAM,EACN,sBAAY,EACZ,YAAY,CACb,CAAC;IAEF,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAE9B,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,mBAAO,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IAC3E,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAC9B,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC;IAEnC,IAAI,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC;IAE7C,MAAM,KAAK,GAAmB,IAAA,gCAAsB,EAClD,mBAAO,EACP,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,QAAQ,CAAA,CAAC,CAAC,QAAQ,EAAE,EACzD,0BAAS,CAAC,MAAM,EAChB,aAAa,CACd,CAAC;IACF,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC;QAC5C,MAAM,WAAW,GAAG,IAAI,IAAI,CAC1B,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAClD,CAAC;QACF,KAAK,CAAC,UAAU,GAAG,EAAE,WAAW,EAAE,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;IAC5D,CAAC;IAED,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE;YACzB,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"voteFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/voteFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAAkD;AAClD,uCAAyC;AACzC,iDAAsD;AACtD,kFAA+E;AAC/E,uCAAuC;AACvC,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,YAAY,GAAG,IAAA,oBAAU,EAAC,KAAK,CAAC,CAAC;IACvC,MAAM,aAAa,GAAG,MAAM,IAAA,2CAAoB,EAC9C,MAAM,EACN,sBAAY,EACZ,Y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AQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -157,7 +157,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
157
157
  continue;
158
158
  const lpDecimals = lpMintAccount.decimals;
159
159
  const lpSupply = lpMint.toString() === 'CQurpF3WS3yEqFEt1Bu8s5zmZqznQG3EJkcYvsyg3sLc'
160
- ? new bignumber_js_1.default('3381427.37') // Temporary fix for SOL-WIF lp
160
+ ? new bignumber_js_1.default('3381427.37').times(Math.pow(10, lpDecimals)) // Temporary fix for SOL-WIF lp
161
161
  : lpMintAccount.supply;
162
162
  if (lpSupply.isZero())
163
163
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"lpTokensJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/lpTokensJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AAEvD,gEAAqC;AAGrC,iDAAsD;AACtD,2CAA+E;AAC/E,yCAAkE;AAClE,+CAK4B;AAC5B,uCAAqD;AACrD,mCAA8C;AAC9C,6EAAqD;AACrD,gGAA6F;AAE7F,6GAAqF;AACrF,+FAAuE;AACvE,gEAA0E;AAC1E,6FAAoE;AAEpE,MAAM,WAAW,GAAG;IAClB;QACE,SAAS,EAAE,CAAC;QACZ,MAAM,EAAE,sBAAe;QACvB,SAAS,EAAE,6BAAiB;QAC5B,OAAO,EAAE,qBAAW;QACpB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,SAAS,EAAE,CAAC;QACZ,MAAM,EAAE,sBAAe;QACvB,SAAS,EAAE,6BAAiB;QAC5B,OAAO,EAAE,qBAAW;QACpB,IAAI,EAAE,UAAU;KACjB;CACF,CAAC;AAEF,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,iBAAiB,GAAG,EAAE,CAAC;IAE7B,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,E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UAAU;oBACpB,SAAS,EAAE,QAAQ;iBACpB,EACD;oBACE;wBACE,OAAO,EAAE,WAAW,CAAC,OAAO;wBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;wBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;wBACxB,gBAAgB,EAAE,YAAY;qBAC/B;oBACD;wBACE,OAAO,EAAE,WAAW,CAAC,OAAO;wBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;wBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;wBACxB,gBAAgB,EAAE,YAAY;qBAC/B;iBACF,CACF,CACF,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,IAAA,oBAAU,EACd,iBAAiB,CAAC,GAAG,CACnB,CAAC,gBAAgB,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CACxE,CACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -12,7 +12,7 @@ exports.stakePid = new web3_js_1.PublicKey('STAKEGztX7S1MUHxcQHieZhELCntb9Ys9BgU
12
12
  exports.poolsKey = 'pools';
13
13
  exports.flowmaticPlatformId = 'flowmatic';
14
14
  exports.flowmaticPlatform = {
15
- id: exports.platformId,
15
+ id: exports.flowmaticPlatformId,
16
16
  name: 'Flowmatic',
17
17
  image: 'https://sonar.watch/img/platforms/flowmatic.png',
18
18
  website: 'https://www.flowmatic.xyz/',
@@ -20,7 +20,7 @@ exports.flowmaticPlatform = {
20
20
  };
21
21
  exports.kishuPlatformId = 'kishu';
22
22
  exports.kishuPlatform = {
23
- id: exports.platformId,
23
+ id: exports.kishuPlatformId,
24
24
  name: 'Kishu',
25
25
  image: 'https://sonar.watch/img/platforms/kishu.png',
26
26
  website: 'https://staking.kishuthedog.com/',
@@ -28,7 +28,7 @@ exports.kishuPlatform = {
28
28
  };
29
29
  exports.yakuPlatformId = 'yaku';
30
30
  exports.yakuPlatform = {
31
- id: exports.platformId,
31
+ id: exports.yakuPlatformId,
32
32
  name: 'Yaku',
33
33
  image: 'https://sonar.watch/img/platforms/yaku.png',
34
34
  website: 'https://staking.yaku.gg/',
@@ -36,7 +36,7 @@ exports.yakuPlatform = {
36
36
  };
37
37
  exports.madbearsPlatformId = 'madbears';
38
38
  exports.madbearsPlatform = {
39
- id: exports.platformId,
39
+ id: exports.madbearsPlatformId,
40
40
  name: 'MadBears',
41
41
  image: 'https://sonar.watch/img/platforms/madbears.png',
42
42
  website: 'https://staking.madbears.club/',
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/spl-staking/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,aAAa,CAAC;AAC3B,QAAA,kBAAkB,GAAa;IAC1C,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,kDAAkD;CAC1D,CAAC;AACW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,6CAA6C,CAC9C,CAAC;AACW,QAAA,QAAQ,GAAG,OAAO,CAAC;AAEnB,QAAA,mBAAmB,GAAG,WAAW,CAAC;AAClC,QAAA,iBAAiB,GAAa;IACzC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,eAAe,GAAG,OAAO,CAAC;AAC1B,QAAA,aAAa,GAAa;IACrC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,6CAA6C;IACpD,OAAO,EAAE,kCAAkC;IAC3C,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,cAAc,GAAG,MAAM,CAAC;AACxB,QAAA,YAAY,GAAa;IACpC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,4CAA4C;IACnD,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,kBAAkB,GAAG,UAAU,CAAC;AAChC,QAAA,gBAAgB,GAAa;IACxC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,gDAAgD;IACvD,OAAO,EAAE,gCAAgC;IACzC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,GAAG,CAAC;IACpC,CAAC,8CAA8C,EAAE,uBAAe,CAAC;IACjE,CAAC,8CAA8C,EAAE,sBAAc,CAAC;IAChE,CAAC,8CAA8C,EAAE,2BAAmB,CAAC;IACrE,CAAC,8CAA8C,EAAE,0BAAkB,CAAC;CACrE,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/spl-staking/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,aAAa,CAAC;AAC3B,QAAA,kBAAkB,GAAa;IAC1C,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,kDAAkD;CAC1D,CAAC;AACW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,6CAA6C,CAC9C,CAAC;AACW,QAAA,QAAQ,GAAG,OAAO,CAAC;AAEnB,QAAA,mBAAmB,GAAG,WAAW,CAAC;AAClC,QAAA,iBAAiB,GAAa;IACzC,EAAE,EAAE,2BAAmB;IACvB,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,eAAe,GAAG,OAAO,CAAC;AAC1B,QAAA,aAAa,GAAa;IACrC,EAAE,EAAE,uBAAe;IACnB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,6CAA6C;IACpD,OAAO,EAAE,kCAAkC;IAC3C,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,cAAc,GAAG,MAAM,CAAC;AACxB,QAAA,YAAY,GAAa;IACpC,EAAE,EAAE,sBAAc;IAClB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,4CAA4C;IACnD,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,kBAAkB,GAAG,UAAU,CAAC;AAChC,QAAA,gBAAgB,GAAa;IACxC,EAAE,EAAE,0BAAkB;IACtB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,gDAAgD;IACvD,OAAO,EAAE,gCAAgC;IACzC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,GAAG,CAAC;IACpC,CAAC,8CAA8C,EAAE,uBAAe,CAAC;IACjE,CAAC,8CAA8C,EAAE,sBAAc,CAAC;IAChE,CAAC,8CAA8C,EAAE,2BAAmB,CAAC;IACrE,CAAC,8CAA8C,EAAE,0BAAkB,CAAC;CACrE,CAAC,CAAC"}
@@ -4,5 +4,7 @@ export declare const platform: Platform;
4
4
  export declare const packageId = "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf";
5
5
  export declare const obligationType = "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::obligation::Obligation";
6
6
  export declare const mainMarket = "0x84030d26d85eaa7035084a057f2f11f701b7e2e4eda87551becbc7c97505ece1";
7
+ export declare const marketsRegistry = "0x64faff8d91a56c4f55debbb44767b009ee744a70bc2cc8e3bbd2718c92f85931";
7
8
  export declare const obligationOwnerCapType = "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf::lending_market::ObligationOwnerCap<0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf";
8
9
  export declare const poolsKey = "poolsInfo";
10
+ export declare const marketsKey = "markets";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.poolsKey = exports.obligationOwnerCapType = exports.mainMarket = exports.obligationType = exports.packageId = exports.platform = exports.platformId = void 0;
3
+ exports.marketsKey = exports.poolsKey = exports.obligationOwnerCapType = exports.marketsRegistry = exports.mainMarket = exports.obligationType = exports.packageId = exports.platform = exports.platformId = void 0;
4
4
  exports.platformId = 'suilend';
5
5
  exports.platform = {
6
6
  id: exports.platformId,
@@ -13,6 +13,8 @@ exports.platform = {
13
13
  exports.packageId = '0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf';
14
14
  exports.obligationType = `${exports.packageId}::obligation::Obligation`;
15
15
  exports.mainMarket = '0x84030d26d85eaa7035084a057f2f11f701b7e2e4eda87551becbc7c97505ece1';
16
+ exports.marketsRegistry = '0x64faff8d91a56c4f55debbb44767b009ee744a70bc2cc8e3bbd2718c92f85931';
16
17
  exports.obligationOwnerCapType = `${exports.packageId}::lending_market::ObligationOwnerCap<${exports.packageId}`;
17
18
  exports.poolsKey = 'poolsInfo';
19
+ exports.marketsKey = 'markets';
18
20
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,SAAS,EAAE,sCAAsC;IAC9D,OAAO,EAAE,yBAAyB;IAClC,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAE1D,QAAA,cAAc,GAAG,GAAG,iBAAS,0BAA0B,CAAC;AACxD,QAAA,UAAU,GACrB,oEAAoE,CAAC;AAE1D,QAAA,sBAAsB,GAAG,GAAG,iBAAS,wCAAwC,iBAAS,EAAE,CAAC;AACzF,QAAA,QAAQ,GAAG,WAAW,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,SAAS,EAAE,sCAAsC;IAC9D,OAAO,EAAE,yBAAyB;IAClC,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAE1D,QAAA,cAAc,GAAG,GAAG,iBAAS,0BAA0B,CAAC;AACxD,QAAA,UAAU,GACrB,oEAAoE,CAAC;AAC1D,QAAA,eAAe,GAC1B,oEAAoE,CAAC;AAE1D,QAAA,sBAAsB,GAAG,GAAG,iBAAS,wCAAwC,iBAAS,EAAE,CAAC;AACzF,QAAA,QAAQ,GAAG,WAAW,CAAC;AACvB,QAAA,UAAU,GAAG,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { LendingMarket, PoolReward } from './types';
2
+ export declare function getPoolsRewardsAsMap(lendingMarkets: LendingMarket[] | undefined): Map<string, PoolReward> | undefined;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPoolsRewardsAsMap = void 0;
4
+ function getPoolsRewardsAsMap(lendingMarkets) {
5
+ if (!lendingMarkets)
6
+ return undefined;
7
+ const rewardMintByPoolId = new Map();
8
+ for (const lendingMarket of lendingMarkets) {
9
+ const { reserves } = lendingMarket;
10
+ for (const reserve of reserves) {
11
+ const poolsRewards = reserve.fields.deposits_pool_reward_manager.fields.pool_rewards;
12
+ for (const poolReward of poolsRewards)
13
+ rewardMintByPoolId.set(poolReward.fields.id.id, poolReward.fields);
14
+ }
15
+ }
16
+ return rewardMintByPoolId;
17
+ }
18
+ exports.getPoolsRewardsAsMap = getPoolsRewardsAsMap;
19
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/helpers.ts"],"names":[],"mappings":";;;AAEA,SAAgB,oBAAoB,CAClC,cAA2C;IAE3C,IAAI,CAAC,cAAc;QAAE,OAAO,SAAS,CAAC;IAEtC,MAAM,kBAAkB,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC9D,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;QAC3C,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC;QACnC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,YAAY,GAChB,OAAO,CAAC,MAAM,CAAC,4BAA4B,CAAC,MAAM,CAAC,YAAY,CAAC;YAClE,KAAK,MAAM,UAAU,IAAI,YAAY;gBACnC,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAhBD,oDAgBC"}
@@ -15,23 +15,10 @@ const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
15
15
  const constants_1 = require("./constants");
16
16
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
17
17
  const client = (0, clients_1.getClientSui)();
18
- const objects = yield (0, multiGetObjects_1.multiGetObjects)(client, [constants_1.mainMarket]);
19
- const poolsRewardsInfo = [];
20
- for (const object of objects) {
21
- if (!object.data || !object.data.content)
22
- continue;
23
- const { fields } = object.data.content;
24
- const { reserves } = fields;
25
- for (const reserve of reserves) {
26
- const poolsRewards = reserve.fields.deposits_pool_reward_manager.fields.pool_rewards;
27
- for (const poolReward of poolsRewards)
28
- poolsRewardsInfo.push({
29
- poolId: poolReward.fields.id.id,
30
- rewardMint: poolReward.fields.coin_type.fields.name,
31
- });
32
- }
33
- }
34
- yield cache.setItem(constants_1.poolsKey, poolsRewardsInfo, {
18
+ const marketsObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, [
19
+ constants_1.mainMarket,
20
+ ]);
21
+ yield cache.setItem(constants_1.marketsKey, marketsObjects.map((object) => { var _a, _b; return (_b = (_a = object.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields; }), {
35
22
  prefix: constants_1.platformId,
36
23
  networkId: portfolio_core_1.NetworkId.sui,
37
24
  });
@@ -1 +1 @@
1
- {"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAmD;AACnD,qEAAkE;AAClE,2CAA+D;AAG/D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,MAAM,IAAA,iCAAe,EAAgB,MAAM,EAAE,CAAC,sBAAU,CAAC,CAAC,CAAC;IAE3E,MAAM,gBAAgB,GAAiB,EAAE,CAAC;IAC1C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;YAAE,SAAS;QACnD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACvC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAE5B,KAAK,M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,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CACF,CAAC;AACJ,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"}
@@ -18,108 +18,148 @@ const constants_1 = require("./constants");
18
18
  const clients_1 = require("../../utils/clients");
19
19
  const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
20
20
  const multiGetObjects_1 = require("../../utils/sui/multiGetObjects");
21
- const tokenPriceToAssetTokens_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetTokens"));
21
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
22
+ const helpers_1 = require("./helpers");
23
+ const constants_2 = require("../solend/constants");
22
24
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
23
25
  var _a, _b, _c, _d;
24
26
  const client = (0, clients_1.getClientSui)();
25
- const suilendObjects = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
27
+ const obligationsCapFields = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
26
28
  filter: { Package: constants_1.packageId },
27
29
  });
28
- if (suilendObjects.length === 0)
30
+ if (obligationsCapFields.length === 0)
29
31
  return [];
30
- const mints = new Set();
31
- const rewardsInfo = yield cache.getItem(constants_1.poolsKey, {
32
- prefix: constants_1.platformId,
33
- networkId: portfolio_core_1.NetworkId.sui,
34
- });
35
- const rewardInfoById = new Map();
36
- if (rewardsInfo)
37
- rewardsInfo.forEach((rI) => {
38
- rewardInfoById.set(rI.poolId, rI.rewardMint);
39
- mints.add(rI.rewardMint);
40
- });
41
32
  const obligationsId = [];
42
- for (const object of suilendObjects) {
43
- const type = (_b = (_a = object.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.type;
44
- if (!type || !type.startsWith(constants_1.obligationOwnerCapType))
33
+ for (const obligationCapField of obligationsCapFields) {
34
+ const type = (_b = (_a = obligationCapField.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.type;
35
+ if (!(type === null || type === void 0 ? void 0 : type.startsWith(constants_1.obligationOwnerCapType)))
45
36
  continue;
46
- const obligationId = (_d = (_c = object.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields.obligation_id;
37
+ const obligationId = (_d = (_c = obligationCapField.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields.obligation_id;
47
38
  if (obligationId)
48
39
  obligationsId.push(obligationId);
49
40
  }
50
- const obligationsObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, obligationsId);
41
+ const obligations = yield (0, multiGetObjects_1.multiGetObjects)(client, obligationsId);
42
+ if (obligations.length === 0)
43
+ return [];
44
+ const mints = new Set();
45
+ const markets = yield cache.getItem(constants_1.marketsKey, {
46
+ prefix: constants_1.platformId,
47
+ networkId: portfolio_core_1.NetworkId.sui,
48
+ });
49
+ const marketsByIndex = new Map();
50
+ if (markets)
51
+ markets.forEach((market) => {
52
+ marketsByIndex.set(market.id.id, market);
53
+ });
54
+ const poolRewardById = (0, helpers_1.getPoolsRewardsAsMap)(markets);
55
+ if (poolRewardById)
56
+ poolRewardById.forEach((pool) => mints.add(pool.coin_type.fields.name));
51
57
  const borrowedAssets = [];
52
58
  const borrowedYields = [];
53
59
  const suppliedAssets = [];
54
60
  const suppliedYields = [];
55
61
  const rewardAssets = [];
56
- obligationsObjects.forEach((obj) => {
62
+ const suppliedLtvs = [];
63
+ const borrowedWeights = [];
64
+ obligations.forEach((obj) => {
57
65
  if (obj.data && obj.data.content) {
58
66
  obj.data.content.fields.deposits.forEach((dep) => mints.add(dep.fields.coin_type.fields.name));
59
67
  obj.data.content.fields.borrows.forEach((bor) => mints.add(bor.fields.coin_type.fields.name));
60
68
  }
61
69
  });
62
70
  const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.sui);
63
- for (const obligation of obligationsObjects) {
71
+ for (const obligation of obligations) {
64
72
  const { data } = obligation;
65
73
  if (!data || !data.content)
66
74
  continue;
67
- const { deposits, borrows, user_reward_managers: rewardManagers, } = data.content.fields;
75
+ const market = marketsByIndex.get(data.content.fields.lending_market_id);
76
+ if (!market)
77
+ continue;
78
+ const { reserves } = market;
79
+ const { deposits, borrows, user_reward_managers: userRewardManagers, } = data.content.fields;
80
+ // Deposits
68
81
  for (const deposit of deposits) {
69
82
  const { fields } = deposit;
83
+ const reserve = reserves.at(Number(fields.reserve_array_index));
84
+ if (!reserve)
85
+ continue;
86
+ const reserveBorrowAmount = new bignumber_js_1.default(reserve.fields.borrowed_amount.fields.value).dividedBy(Math.pow(10, constants_2.wadsDecimal));
87
+ const reserveAvailableAmount = new bignumber_js_1.default(reserve.fields.available_amount);
88
+ const cSupply = new bignumber_js_1.default(reserve.fields.ctoken_supply);
89
+ const cRatio = reserveAvailableAmount
90
+ .plus(reserveBorrowAmount)
91
+ .dividedBy(cSupply);
70
92
  const tokenPrice = tokenPriceById.get((0, portfolio_core_1.formatTokenAddress)(fields.coin_type.fields.name, portfolio_core_1.NetworkId.sui));
71
93
  if (!tokenPrice)
72
94
  continue;
73
- const amount = new bignumber_js_1.default(fields.deposited_ctoken_amount).dividedBy(Math.pow(10, tokenPrice.decimals));
95
+ const amount = new bignumber_js_1.default(fields.deposited_ctoken_amount)
96
+ .multipliedBy(cRatio)
97
+ .dividedBy(Math.pow(10, tokenPrice.decimals));
74
98
  const price = new bignumber_js_1.default(fields.market_value.fields.value)
75
99
  .dividedBy(Math.pow(10, 18))
76
100
  .dividedBy(amount);
77
- suppliedAssets.push(...(0, tokenPriceToAssetTokens_1.default)(tokenPrice.address, amount.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice, price.toNumber()));
101
+ suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice, price.toNumber()));
102
+ suppliedLtvs.push(reserve.fields.config.fields.element.fields.max_close_ltv_pct / 100);
78
103
  }
104
+ // Borrows
79
105
  for (const borrow of borrows) {
80
106
  const { fields } = borrow;
107
+ const reserve = reserves.at(Number(fields.reserve_array_index));
108
+ if (!reserve)
109
+ continue;
81
110
  const tokenPrice = tokenPriceById.get((0, portfolio_core_1.formatTokenAddress)(fields.coin_type.fields.name, portfolio_core_1.NetworkId.sui));
82
111
  if (!tokenPrice)
83
112
  continue;
84
- const amount = new bignumber_js_1.default(fields.borrowed_amount.fields.value).dividedBy(Math.pow(10, 24));
113
+ const cumulativeRateRatio = new bignumber_js_1.default(reserve.fields.cumulative_borrow_rate.fields.value).dividedBy(fields.cumulative_borrow_rate.fields.value);
114
+ const amount = new bignumber_js_1.default(fields.borrowed_amount.fields.value)
115
+ .times(cumulativeRateRatio)
116
+ .dividedBy(Math.pow(10, (constants_2.wadsDecimal + tokenPrice.decimals)));
85
117
  if (amount.isZero())
86
118
  continue;
87
119
  const price = new bignumber_js_1.default(fields.market_value.fields.value)
88
- .dividedBy(Math.pow(10, 18))
120
+ .dividedBy(Math.pow(10, constants_2.wadsDecimal))
89
121
  .dividedBy(amount);
90
- borrowedAssets.push(...(0, tokenPriceToAssetTokens_1.default)(tokenPrice.address, amount.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice, price.toNumber()));
122
+ borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice, price.toNumber()));
123
+ const borrowWeight = new bignumber_js_1.default(reserve.fields.config.fields.element.fields.borrow_weight_bps).dividedBy(Math.pow(10, 4));
124
+ borrowedWeights.push(borrowWeight.toNumber());
91
125
  }
126
+ // Rewards
127
+ if (!poolRewardById)
128
+ continue;
92
129
  const rewardAmountByMint = new Map();
93
- for (const rewardManager of rewardManagers) {
94
- for (const reward of rewardManager.fields.rewards) {
95
- const rewardMint = rewardInfoById.get(reward.fields.pool_reward_id);
96
- if (!rewardMint)
130
+ for (const userRewardManager of userRewardManagers) {
131
+ const share = new bignumber_js_1.default(userRewardManager.fields.share);
132
+ for (const userReward of userRewardManager.fields.rewards) {
133
+ const poolReward = poolRewardById.get(userReward.fields.pool_reward_id);
134
+ if (!poolReward)
97
135
  continue;
98
- const amount = new bignumber_js_1.default(rewardManager.fields.share)
99
- .times(new bignumber_js_1.default(reward.fields.cumulative_rewards_per_share.fields.value))
100
- .dividedBy(Math.pow(10, 18));
101
- if (amount.isZero())
136
+ const rewardMint = poolReward.coin_type.fields.name;
137
+ const cumulativeAmount = new bignumber_js_1.default(poolReward.cumulative_rewards_per_share.fields.value)
138
+ .minus(userReward.fields.cumulative_rewards_per_share.fields.value)
139
+ .times(share)
140
+ .dividedBy(Math.pow(10, constants_2.wadsDecimal));
141
+ if (cumulativeAmount.isZero())
102
142
  continue;
103
- const previousAmount = rewardAmountByMint.get(rewardMint);
104
- if (previousAmount) {
105
- rewardAmountByMint.set(rewardMint, previousAmount.plus(amount));
143
+ const previousCumAmount = rewardAmountByMint.get(rewardMint);
144
+ if (previousCumAmount) {
145
+ rewardAmountByMint.set(rewardMint, previousCumAmount.plus(cumulativeAmount));
106
146
  }
107
147
  else {
108
- rewardAmountByMint.set(rewardMint, amount);
148
+ rewardAmountByMint.set(rewardMint, cumulativeAmount);
109
149
  }
110
150
  }
111
151
  }
112
152
  rewardAmountByMint.forEach((amount, mint) => {
113
153
  const tokenPrice = tokenPriceById.get((0, portfolio_core_1.formatTokenAddress)(mint, portfolio_core_1.NetworkId.sui));
114
154
  if (tokenPrice)
115
- rewardAssets.push(...(0, tokenPriceToAssetTokens_1.default)(tokenPrice.address, amount.dividedBy(Math.pow(10, tokenPrice.decimals)).toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice));
155
+ rewardAssets.push(Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.dividedBy(Math.pow(10, tokenPrice.decimals)).toNumber(), portfolio_core_1.NetworkId.sui, tokenPrice)), { attributes: { isClaimable: true } }));
116
156
  });
117
157
  }
118
158
  if (suppliedAssets.length === 0 &&
119
159
  borrowedAssets.length === 0 &&
120
160
  rewardAssets.length === 0)
121
161
  return [];
122
- const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
162
+ const { borrowedValue, suppliedValue, value, healthRatio, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs, borrowedWeights);
123
163
  const element = {
124
164
  type: portfolio_core_1.PortfolioElementType.borrowlend,
125
165
  networkId: portfolio_core_1.NetworkId.sui,
@@ -1 +1 @@
1
- {"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AACnD,qEAAkE;AAElE,qEAAkE;AAClE,uGAA+E;AAE/E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,cAAc,GAAG,MAAM,IAAA,iCAAe,EAC1C,MAAM,EACN,KAAK,EACL;QACE,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAS,EAAE;KAC/B,CACF,CAAC;IACF,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE3C,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IACrC,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,OAAO,CAAe,oBAAQ,EAAE;QAC9D,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAA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AAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC,CAAC,QAAQ,EAAE,EACtD,0BAAS,CAAC,GAAG,EACb,UAAU,CACX,CACF,CAAC;QACN,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IACE,cAAc,CAAC,MAAM,KAAK,CAAC;QAC3B,cAAc,CAAC,MAAM,KAAK,CAAC;QAC3B,YAAY,CAAC,MAAM,KAAK,CAAC;QAEzB,OAAO,EAAE,CAAC;IAEZ,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;IAExE,MAAM,OAAO,GAAqB;QAChC,IAAI,EAAE,qCAAoB,CAAC,UAAU;QACrC,SAAS,EAAE,0BAAS,CAAC,GAAG;QACxB,UAAU,EAAV,sBAAU;QACV,KAAK,EAAE,SAAS;QAChB,KAAK;QACL,IAAI,EAAE;YACJ,cAAc;YACd,aAAa;YACb,cAAc;YACd,cAAc;YACd,aAAa;YACb,cAAc;YACd,eAAe,EAAE,IAAI;YACrB,WAAW;YACX,YAAY;YACZ,WAAW;YACX,KAAK;SACN;KACF,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suilend/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAGrC,2CAKqB;AACrB,iDAAmD;AACnD,qEAAkE;AAElE,qEAAkE;AAClE,qGAA6E;AAC7E,uCAAiD;AACjD,mDAA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AAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -50,6 +50,7 @@ export type Reward = {
50
50
  export type LendingMarket = {
51
51
  id: ID;
52
52
  version: string;
53
+ fee_receiver: string;
53
54
  reserves: ParsedData<Reserve>[];
54
55
  };
55
56
  export type Reserve = {
@@ -58,12 +59,12 @@ export type Reserve = {
58
59
  attributed_borrow_value: ParsedData<Value>;
59
60
  available_amount: string;
60
61
  borrowed_amount: ParsedData<Value>;
61
- borrows_pool_reward_manager: ParsedData<SPoolRewardManager>;
62
+ borrows_pool_reward_manager: ParsedData<PoolRewardManager>;
62
63
  coin_type: ParsedData<Name>;
63
64
  config: ParsedData<Config>;
64
65
  ctoken_supply: string;
65
66
  cumulative_borrow_rate: ParsedData<Value>;
66
- deposits_pool_reward_manager: ParsedData<SPoolRewardManager>;
67
+ deposits_pool_reward_manager: ParsedData<PoolRewardManager>;
67
68
  interest_last_update_timestamp_s: string;
68
69
  lending_market_id: string;
69
70
  mint_decimals: number;
@@ -73,7 +74,7 @@ export type Reserve = {
73
74
  smoothed_price: ParsedData<Value>;
74
75
  unclaimed_spread_fees: ParsedData<Value>;
75
76
  };
76
- export type SPoolRewardManager = {
77
+ export type PoolRewardManager = {
77
78
  id: ID;
78
79
  last_update_time_ms: string;
79
80
  pool_rewards: ParsedData<PoolReward>[];
@@ -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;