@sonarwatch/portfolio-plugins 0.11.189 → 0.11.191

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/CHANGELOG.md +1505 -1497
  2. package/README.md +3 -3
  3. package/package.json +2 -2
  4. package/src/plugins/01/constants.d.ts +6 -1
  5. package/src/plugins/01/constants.js +21 -2
  6. package/src/plugins/01/constants.js.map +1 -1
  7. package/src/plugins/01/helpers.d.ts +0 -1
  8. package/src/plugins/01/helpers.js +3 -3
  9. package/src/plugins/01/helpers.js.map +1 -1
  10. package/src/plugins/aave/constants.js.map +1 -1
  11. package/src/plugins/aave/index.d.ts +2 -1
  12. package/src/plugins/aave/index.js +3 -1
  13. package/src/plugins/aave/index.js.map +1 -1
  14. package/src/plugins/aave/services.d.ts +30 -0
  15. package/src/plugins/aave/services.js +181 -0
  16. package/src/plugins/aave/services.js.map +1 -0
  17. package/src/plugins/aries/constants.d.ts +5 -2
  18. package/src/plugins/aries/constants.js +6 -3
  19. package/src/plugins/aries/constants.js.map +1 -1
  20. package/src/plugins/aries/depositsFetcher.js +102 -96
  21. package/src/plugins/aries/depositsFetcher.js.map +1 -1
  22. package/src/plugins/aries/helpers.d.ts +20 -1
  23. package/src/plugins/aries/helpers.js +94 -2
  24. package/src/plugins/aries/helpers.js.map +1 -1
  25. package/src/plugins/aries/reservesJob.js +1 -1
  26. package/src/plugins/aries/reservesJob.js.map +1 -1
  27. package/src/plugins/aries/types.d.ts +56 -33
  28. package/src/plugins/balancer/helpers/pools.js +21 -21
  29. package/src/plugins/jupiter/launchpad/allocationsFetcher.js.map +1 -1
  30. package/src/plugins/jupiter/pricingJob.js +20 -1
  31. package/src/plugins/jupiter/pricingJob.js.map +1 -1
  32. package/src/plugins/kamino/airdropFetcher.js +21 -46
  33. package/src/plugins/kamino/airdropFetcher.js.map +1 -1
  34. package/src/plugins/kamino/constants.d.ts +4 -0
  35. package/src/plugins/kamino/constants.js +5 -1
  36. package/src/plugins/kamino/constants.js.map +1 -1
  37. package/src/plugins/meteora/multiTokenPools.json +9 -0
  38. package/src/plugins/saber/constants.js +1 -1
  39. package/src/plugins/saber/constants.js.map +1 -1
  40. package/src/plugins/sushiswap/helpers.js +24 -24
  41. package/src/plugins/uniswap-v2/helpers.js +22 -22
  42. package/src/utils/aptos/getTableItemsByKeys.d.ts +1 -1
  43. package/src/utils/aptos/getTableItemsByKeys.js.map +1 -1
  44. package/src/utils/misc/getLpTokenSource.js +6 -0
  45. package/src/utils/misc/getLpTokenSource.js.map +1 -1
  46. package/src/utils/misc/getLpUnderlyingTokenSource.js +5 -4
  47. package/src/utils/misc/getLpUnderlyingTokenSource.js.map +1 -1
  48. package/src/utils/sei/constants.js +8 -8
  49. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
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.189",
3
+ "version": "0.11.191",
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.189"
44
+ "@sonarwatch/portfolio-core": "0.11.191"
45
45
  },
46
46
  "main": "./src/index.js",
47
47
  "types": "./src/index.d.ts"
@@ -1,4 +1,9 @@
1
- import { Platform } from '@sonarwatch/portfolio-core';
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import { Contract, Platform, Service, ServiceConfig } from '@sonarwatch/portfolio-core';
2
3
  export declare const platformId = "01";
3
4
  export declare const platform: Platform;
5
+ export declare const programId: PublicKey;
6
+ export declare const contract: Contract;
7
+ export declare const config: ServiceConfig;
8
+ export declare const service: Service;
4
9
  export declare const mints: string[];
@@ -1,15 +1,34 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mints = exports.platform = exports.platformId = void 0;
3
+ exports.mints = exports.service = exports.config = exports.contract = exports.programId = exports.platform = exports.platformId = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
5
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
4
6
  exports.platformId = '01';
5
7
  exports.platform = {
6
8
  id: exports.platformId,
7
9
  name: '01',
8
10
  image: 'https://sonar.watch/img/platforms/01.png',
9
11
  defiLlamaId: '01', // from https://defillama.com/docs/api
10
- website: 'https://01.xyz/dashboard/',
12
+ website: 'https://01.xyz/',
11
13
  // twitter: 'https://twitter.com/myplatform',
12
14
  };
15
+ exports.programId = new web3_js_1.PublicKey('Zo1ggzTUKMY5bYnDvT5mtVeZxzf2FaLTbKkmvGUhUQk');
16
+ exports.contract = {
17
+ address: exports.programId.toString(),
18
+ name: 'Lending',
19
+ network: portfolio_core_1.NetworkId.solana,
20
+ };
21
+ exports.config = {
22
+ integratedOn: 1700784000000,
23
+ networkId: portfolio_core_1.NetworkId.solana,
24
+ contracts: [exports.contract],
25
+ };
26
+ exports.service = {
27
+ id: `${exports.platformId}_lending`,
28
+ platformId: exports.platformId,
29
+ name: 'Lending',
30
+ configs: [exports.config],
31
+ };
13
32
  exports.mints = [
14
33
  'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
15
34
  'So11111111111111111111111111111111111111112',
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/01/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,IAAI,CAAC;AAClB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,0CAA0C;IACjD,WAAW,EAAE,IAAI,EAAE,sCAAsC;IACzD,OAAO,EAAE,2BAA2B;I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V,kBAAU;IACV,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,CAAC,cAAM,CAAC;CAClB,CAAC;AAEW,QAAA,KAAK,GAAG;IACnB,8CAA8C;IAC9C,6CAA6C;IAC7C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;CAC9C,CAAC"}
@@ -1,3 +1,2 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
- export declare const programId: PublicKey;
3
2
  export declare function getPda(owner: PublicKey): PublicKey;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPda = exports.programId = void 0;
3
+ exports.getPda = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
- exports.programId = new web3_js_1.PublicKey('Zo1ggzTUKMY5bYnDvT5mtVeZxzf2FaLTbKkmvGUhUQk');
5
+ const constants_1 = require("./constants");
6
6
  const state = new web3_js_1.PublicKey('71yykwxq1zQqy99PgRsgZJXi2HHK2UDx9G4va7pH6qRv');
7
7
  function getPda(owner) {
8
- return web3_js_1.PublicKey.findProgramAddressSync([owner.toBuffer(), state.toBuffer(), Buffer.from('marginv1')], exports.programId)[0];
8
+ return web3_js_1.PublicKey.findProgramAddressSync([owner.toBuffer(), state.toBuffer(), Buffer.from('marginv1')], constants_1.programId)[0];
9
9
  }
10
10
  exports.getPda = getPda;
11
11
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/01/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAE/B,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AACF,MAAM,KAAK,GAAG,IAAI,mBAAS,CAAC,8CAA8C,CAAC,CAAC;AAE5E,SAAgB,MAAM,CAAC,KAAgB;IACrC,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAC7D,iBAAS,CACV,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AALD,wBAKC"}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/01/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,2CAAwC;AAExC,MAAM,KAAK,GAAG,IAAI,mBAAS,CAAC,8CAA8C,CAAC,CAAC;AAE5E,SAAgB,MAAM,CAAC,KAAgB;IACrC,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAC7D,qBAAS,CACV,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AALD,wBAKC"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aave/constants.ts"],"names":[],"mappings":";;;AAAA,+DAKoC;AAGvB,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,4CAA4C;IACnD,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE,mBAAmB;CAC7B,CAAC;AACW,QAAA,WAAW,GAAG,4C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5B,WAAW,EAAE,SAAS;gBACtB,0BAA0B,EACxB,4CAA4C;gBAC9C,8BAA8B,EAC5B,4CAA4C;gBAC9C,yBAAyB,EAAE,4CAA4C;gBACvE,OAAO,EAAE,CAAC;aACX;SACF;KACF;IACD;QACE,0BAAS,CAAC,QAAQ;QAClB;YACE;gBACE,OAAO,EAAE,yBAAQ,CAAC,QAAQ,CAAC,OAAO;gBAClC,SAAS,EAAE,0BAAS,CAAC,QAAQ;gBAC7B,WAAW,EAAE,cAAc;gBAC3B,0BAA0B,EACxB,4CAA4C;gBAC9C,8BAA8B,EAC5B,4CAA4C;gBAC9C,yBAAyB,EAAE,4CAA4C;gBACvE,OAAO,EAAE,CAAC;aACX;YACD;gBACE,OAAO,EAAE,yBAAQ,CAAC,QAAQ,CAAC,OAAO;gBAClC,SAAS,EAAE,0BAAS,CAAC,QAAQ;gBAC7B,WAAW,EAAE,aAAa;gBAC1B,0BAA0B,EACxB,4CAA4C;gBAC9C,8BAA8B,EAC5B,4CAA4C;gBAC9C,yBAAyB,EAAE,4CAA4C;gBACvE,OAAO,EAAE,CAAC;aACX;YACD;gBACE,OAAO,EAAE,yBAAQ,CAAC,QAAQ,CAAC,OAAO;gBAClC,SAAS,EAAE,0BAAS,CAAC,QAAQ;gBAC7B,WAAW,EAAE,aAAa;gBAC1B,0BAA0B,EACxB,4CAA4C;gBAC9C,8BAA8B,EAC5B,4CAA4C;gBAC9C,yBAAyB,EAAE,4CAA4C;gBACvE,OAAO,EAAE,CAAC;aACX;SACF;KACF;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aave/constants.ts"],"names":[],"mappings":";;;AAAA,+DAKoC;AAGvB,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,4CAA4C;IACnD,WAAW,EAAE,aAAa;IAC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C,OAAO,CAAC,OAAO;gBACjC,SAAS,EAAE,0BAAS,CAAC,OAAO;gBAC5B,WAAW,EAAE,SAAS;gBACtB,0BAA0B,EACxB,4CAA4C;gBAC9C,8BAA8B,EAC5B,4CAA4C;gBAC9C,yBAAyB,EAAE,4CAA4C;gBACvE,OAAO,EAAE,CAAC;aACX;SACF;KACF;IACD;QACE,0BAAS,CAAC,QAAQ;QAClB;YACE;gBACE,OAAO,EAAE,yBAAQ,CAAC,QAAQ,CAAC,OAAO;gBAClC,SAAS,EAAE,0BAAS,CAAC,QAAQ;gBAC7B,WAAW,EAAE,cAAc;gBAC3B,0BAA0B,EACxB,4CAA4C;gBAC9C,8BAA8B,EAC5B,4CAA4C;gBAC9C,yBAAyB,EAAE,4CAA4C;gBACvE,OAAO,EAAE,CAAC;aACX;YACD;gBACE,OAAO,EAAE,yBAAQ,CAAC,QAAQ,CAAC,OAAO;gBAClC,SAAS,EAAE,0BAAS,CAAC,QAAQ;gBAC7B,WAAW,EAAE,aAAa;gBAC1B,0BAA0B,EACxB,4CAA4C;gBAC9C,8BAA8B,EAC5B,4CAA4C;gBAC9C,yBAAyB,EAAE,4CAA4C;gBACvE,OAAO,EAAE,CAAC;aACX;YACD;gBACE,OAAO,EAAE,yBAAQ,CAAC,QAAQ,CAAC,OAAO;gBAClC,SAAS,EAAE,0BAAS,CAAC,QAAQ;gBAC7B,WAAW,EAAE,aAAa;gBAC1B,0BAA0B,EACxB,4CAA4C;gBAC9C,8BAA8B,EAC5B,4CAA4C;gBAC9C,yBAAyB,EAAE,4CAA4C;gBACvE,OAAO,EAAE,CAAC;aACX;SACF;KACF;CACF,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
- import { Platform } from '@sonarwatch/portfolio-core';
1
+ import { Platform, Service } from '@sonarwatch/portfolio-core';
2
2
  import { Job } from '../../Job';
3
3
  import { Fetcher } from '../../Fetcher';
4
4
  export declare const platforms: Platform[];
5
+ export declare const services: Service[];
5
6
  export declare const jobs: Job[];
6
7
  export declare const fetchers: Fetcher[];
@@ -3,13 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.fetchers = exports.jobs = exports.platforms = void 0;
6
+ exports.fetchers = exports.jobs = exports.services = exports.platforms = void 0;
7
7
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
8
8
  const lendingPoolsJob_1 = __importDefault(require("./lendingPoolsJob"));
9
9
  const getLendingFetcherExecutor_1 = __importDefault(require("./getLendingFetcherExecutor"));
10
10
  const stakingFetcher_1 = __importDefault(require("./stakingFetcher"));
11
11
  const constants_1 = require("./constants");
12
+ const services_1 = require("./services");
12
13
  exports.platforms = [constants_1.platform];
14
+ exports.services = [services_1.lendingV2, services_1.lendingV3];
13
15
  exports.jobs = [lendingPoolsJob_1.default];
14
16
  exports.fetchers = [
15
17
  {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aave/index.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAiE;AAGjE,wEAAgD;AAChD,4FAAoE;AACpE,sEAA8C;AAC9C,2CAAmD;AAEtC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,yBAAe,CAAC,CAAC;AAChC,QAAA,QAAQ,GAAc;IACjC;QACE,EAAE,EAAE,GAAG,sBAAU,IAAI,0BAAS,CAAC,QAAQ,UAAU;QACjD,SAAS,EAAE,0BAAS,CAAC,QAAQ;QAC7B,QAAQ,EAAE,IAAA,mCAAyB,EAAC,0BAAS,CAAC,QAAQ,CAAC;KACxD;IACD;QACE,EAAE,EAAE,GAAG,sBAAU,IAAI,0BAAS,CAAC,OAAO,UAAU;QAChD,SAAS,EAAE,0BAAS,CAAC,OAAO;QAC5B,QAAQ,EAAE,IAAA,mCAAyB,EAAC,0BAAS,CAAC,OAAO,CAAC;KACvD;IACD;QACE,EAAE,EAAE,GAAG,sBAAU,IAAI,0BAAS,CAAC,SAAS,UAAU;QAClD,SAAS,EAAE,0BAAS,CAAC,SAAS;QAC9B,QAAQ,EAAE,IAAA,mCAAyB,EAAC,0BAAS,CAAC,SAAS,CAAC;KACzD;IACD,wBAAc;CACf,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aave/index.ts"],"names":[],"mappings":";;;;;;AAAA,+DAA0E;AAG1E,wEAAgD;AAChD,4FAAoE;AACpE,sEAA8C;AAC9C,2CAAmD;AACnD,yCAAkD;AAErC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,QAAQ,GAAc,CAAC,oBAAS,EAAE,oBAAS,CAAC,CAAC;AAC7C,QAAA,IAAI,GAAU,CAAC,yBAAe,CAAC,CAAC;AAChC,QAAA,QAAQ,GAAc;IACjC;QACE,EAAE,EAAE,GAAG,sBAAU,IAAI,0BAAS,CAAC,QAAQ,UAAU;QACjD,SAAS,EAAE,0BAAS,CAAC,QAAQ;QAC7B,QAAQ,EAAE,IAAA,mCAAyB,EAAC,0BAAS,CAAC,QAAQ,CAAC;KACxD;IACD;QACE,EAAE,EAAE,GAAG,sBAAU,IAAI,0BAAS,CAAC,OAAO,UAAU;QAChD,SAAS,EAAE,0BAAS,CAAC,OAAO;QAC5B,QAAQ,EAAE,IAAA,mCAAyB,EAAC,0BAAS,CAAC,OAAO,CAAC;KACvD;IACD;QACE,EAAE,EAAE,GAAG,sBAAU,IAAI,0BAAS,CAAC,SAAS,UAAU;QAClD,SAAS,EAAE,0BAAS,CAAC,SAAS;QAC9B,QAAQ,EAAE,IAAA,mCAAyB,EAAC,0BAAS,CAAC,SAAS,CAAC;KACzD;IACD,wBAAc;CACf,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { Contract, Service, ServiceConfig } from '@sonarwatch/portfolio-core';
2
+ export declare const ethV2MainLendProvider: Contract;
3
+ export declare const ethV2AMMLendProvider: Contract;
4
+ export declare const ethV2IncentiveProvider: Contract;
5
+ export declare const ethV2DataProvider: Contract;
6
+ export declare const polygonV2LendProvider: Contract;
7
+ export declare const polygonV2IncentiveProvider: Contract;
8
+ export declare const polygonV2DataProvider: Contract;
9
+ export declare const avalancheV2LendProvider: Contract;
10
+ export declare const avalancheV2IncentiveProvider: Contract;
11
+ export declare const avalancheV2DataProvider: Contract;
12
+ export declare const ethMainV2Config: ServiceConfig;
13
+ export declare const ethAMMV2Config: ServiceConfig;
14
+ export declare const polygonV2Config: ServiceConfig;
15
+ export declare const avalancheV2Config: ServiceConfig;
16
+ export declare const lendingV2: Service;
17
+ export declare const v3LendProviderAddress = "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb";
18
+ export declare const avalancheV3LendProvider: Contract;
19
+ export declare const avalancheV3IncentiveProvider: Contract;
20
+ export declare const avalancheV3DataProvider: Contract;
21
+ export declare const polygonV3LendProvider: Contract;
22
+ export declare const polygonV3IncentiveProvider: Contract;
23
+ export declare const polygonV3DataProvider: Contract;
24
+ export declare const ethereumV3LendProvider: Contract;
25
+ export declare const ethereumV3IncentiveProvider: Contract;
26
+ export declare const ethereumV3DataProvider: Contract;
27
+ export declare const avalancheV3Config: ServiceConfig;
28
+ export declare const polygonV3Config: ServiceConfig;
29
+ export declare const ethereumV3Config: ServiceConfig;
30
+ export declare const lendingV3: Service;
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lendingV3 = exports.ethereumV3Config = exports.polygonV3Config = exports.avalancheV3Config = exports.ethereumV3DataProvider = exports.ethereumV3IncentiveProvider = exports.ethereumV3LendProvider = exports.polygonV3DataProvider = exports.polygonV3IncentiveProvider = exports.polygonV3LendProvider = exports.avalancheV3DataProvider = exports.avalancheV3IncentiveProvider = exports.avalancheV3LendProvider = exports.v3LendProviderAddress = exports.lendingV2 = exports.avalancheV2Config = exports.polygonV2Config = exports.ethAMMV2Config = exports.ethMainV2Config = exports.avalancheV2DataProvider = exports.avalancheV2IncentiveProvider = exports.avalancheV2LendProvider = exports.polygonV2DataProvider = exports.polygonV2IncentiveProvider = exports.polygonV2LendProvider = exports.ethV2DataProvider = exports.ethV2IncentiveProvider = exports.ethV2AMMLendProvider = exports.ethV2MainLendProvider = void 0;
4
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
5
+ const constants_1 = require("./constants");
6
+ exports.ethV2MainLendProvider = {
7
+ address: '0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5',
8
+ name: 'Aave V2 Main Lenging Pool Provider',
9
+ network: portfolio_core_1.NetworkId.ethereum,
10
+ };
11
+ exports.ethV2AMMLendProvider = {
12
+ address: '0xAcc030EF66f9dFEAE9CbB0cd1B25654b82cFA8d5',
13
+ name: 'Aave V2 AMM Lenging Pool Provider',
14
+ network: portfolio_core_1.NetworkId.ethereum,
15
+ };
16
+ exports.ethV2IncentiveProvider = {
17
+ address: '0xD01ab9a6577E1D84F142e44D49380e23A340387d',
18
+ name: 'Aave V2 Incentive Provider',
19
+ network: portfolio_core_1.NetworkId.ethereum,
20
+ };
21
+ exports.ethV2DataProvider = {
22
+ address: '0x00e50FAB64eBB37b87df06Aa46b8B35d5f1A4e1A',
23
+ name: 'Aave V2 Data Provider',
24
+ network: portfolio_core_1.NetworkId.ethereum,
25
+ };
26
+ exports.polygonV2LendProvider = {
27
+ address: '0xd05e3E715d945B59290df0ae8eF85c1BdB684744',
28
+ name: 'Aave V2 Lenging Pool Provider',
29
+ network: portfolio_core_1.NetworkId.polygon,
30
+ };
31
+ exports.polygonV2IncentiveProvider = {
32
+ address: '0x874313A46e4957D29FAAC43BF5Eb2B144894f557',
33
+ name: 'Aave V2 Incentive Provider',
34
+ network: portfolio_core_1.NetworkId.polygon,
35
+ };
36
+ exports.polygonV2DataProvider = {
37
+ address: '0xC69728f11E9E6127733751c8410432913123acf1',
38
+ name: 'Aave V2 Data Provider',
39
+ network: portfolio_core_1.NetworkId.polygon,
40
+ };
41
+ exports.avalancheV2LendProvider = {
42
+ address: '0xb6A86025F0FE1862B372cb0ca18CE3EDe02A318f',
43
+ name: 'Aave V2 Lenging Pool Provider',
44
+ network: portfolio_core_1.NetworkId.avalanche,
45
+ };
46
+ exports.avalancheV2IncentiveProvider = {
47
+ address: '0x11979886A6dBAE27D7a72c49fCF3F23240D647bF',
48
+ name: 'Aave V2 Incentive Provider',
49
+ network: portfolio_core_1.NetworkId.avalanche,
50
+ };
51
+ exports.avalancheV2DataProvider = {
52
+ address: '0x00e50FAB64eBB37b87df06Aa46b8B35d5f1A4e1A',
53
+ name: 'Aave V2 Data Provider',
54
+ network: portfolio_core_1.NetworkId.avalanche,
55
+ };
56
+ exports.ethMainV2Config = {
57
+ integratedOn: 1692489600000,
58
+ networkId: portfolio_core_1.NetworkId.ethereum,
59
+ contracts: [exports.ethV2MainLendProvider, exports.ethV2IncentiveProvider, exports.ethV2DataProvider],
60
+ link: 'https://app.aave.com/?marketName=proto_mainnet',
61
+ };
62
+ exports.ethAMMV2Config = {
63
+ integratedOn: 1692489600000,
64
+ networkId: portfolio_core_1.NetworkId.ethereum,
65
+ contracts: [exports.ethV2AMMLendProvider, exports.ethV2IncentiveProvider, exports.ethV2DataProvider],
66
+ link: 'https://app.aave.com/?marketName=amm_mainnet',
67
+ };
68
+ exports.polygonV2Config = {
69
+ integratedOn: 1692489600000,
70
+ networkId: portfolio_core_1.NetworkId.polygon,
71
+ contracts: [
72
+ exports.polygonV2LendProvider,
73
+ exports.polygonV2IncentiveProvider,
74
+ exports.polygonV2DataProvider,
75
+ ],
76
+ link: 'https://app.aave.com/?marketName=proto_polygon',
77
+ };
78
+ exports.avalancheV2Config = {
79
+ integratedOn: 1692489600000,
80
+ networkId: portfolio_core_1.NetworkId.avalanche,
81
+ contracts: [
82
+ exports.avalancheV2LendProvider,
83
+ exports.avalancheV2IncentiveProvider,
84
+ exports.avalancheV2DataProvider,
85
+ ],
86
+ link: 'https://app.aave.com/?marketName=proto_avalanche',
87
+ };
88
+ exports.lendingV2 = {
89
+ id: `${constants_1.platformId}_v2`,
90
+ platformId: constants_1.platformId,
91
+ name: 'Aave V2',
92
+ configs: [
93
+ exports.ethMainV2Config,
94
+ exports.ethAMMV2Config,
95
+ exports.polygonV2Config,
96
+ exports.avalancheV2Config,
97
+ ],
98
+ };
99
+ exports.v3LendProviderAddress = '0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb';
100
+ exports.avalancheV3LendProvider = {
101
+ address: exports.v3LendProviderAddress,
102
+ name: 'Aave V3 Lenging Pool Provider',
103
+ network: portfolio_core_1.NetworkId.avalanche,
104
+ };
105
+ exports.avalancheV3IncentiveProvider = {
106
+ address: '0x645654D59A5226CBab969b1f5431aA47CBf64ab8',
107
+ name: 'Aave V3 Incentive Provider',
108
+ network: portfolio_core_1.NetworkId.avalanche,
109
+ };
110
+ exports.avalancheV3DataProvider = {
111
+ address: '0x204f2Eb81D996729829debC819f7992DCEEfE7b1',
112
+ name: 'Aave V3 Data Provider',
113
+ network: portfolio_core_1.NetworkId.avalanche,
114
+ };
115
+ exports.polygonV3LendProvider = {
116
+ address: exports.v3LendProviderAddress,
117
+ name: 'Aave V3 Lenging Pool Provider',
118
+ network: portfolio_core_1.NetworkId.polygon,
119
+ };
120
+ exports.polygonV3IncentiveProvider = {
121
+ address: '0x874313A46e4957D29FAAC43BF5Eb2B144894f557',
122
+ name: 'Aave V3 Incentive Provider',
123
+ network: portfolio_core_1.NetworkId.polygon,
124
+ };
125
+ exports.polygonV3DataProvider = {
126
+ address: '0xC69728f11E9E6127733751c8410432913123acf1',
127
+ name: 'Aave V3 Data Provider',
128
+ network: portfolio_core_1.NetworkId.polygon,
129
+ };
130
+ exports.ethereumV3LendProvider = {
131
+ address: '0x2f39d218133AFaB8F2B819B1066c7E434Ad94E9e',
132
+ name: 'Aave V3 Lenging Pool Provider',
133
+ network: portfolio_core_1.NetworkId.ethereum,
134
+ };
135
+ exports.ethereumV3IncentiveProvider = {
136
+ address: '0x162A7AC02f547ad796CA549f757e2b8d1D9b10a6',
137
+ name: 'Aave V3 Incentive Provider',
138
+ network: portfolio_core_1.NetworkId.ethereum,
139
+ };
140
+ exports.ethereumV3DataProvider = {
141
+ address: '0x91c0eA31b49B69Ea18607702c5d9aC360bf3dE7d',
142
+ name: 'Aave V3 Data Provider',
143
+ network: portfolio_core_1.NetworkId.ethereum,
144
+ };
145
+ exports.avalancheV3Config = {
146
+ integratedOn: 1692489600000,
147
+ networkId: portfolio_core_1.NetworkId.avalanche,
148
+ contracts: [
149
+ exports.avalancheV3LendProvider,
150
+ exports.avalancheV3IncentiveProvider,
151
+ exports.avalancheV3DataProvider,
152
+ ],
153
+ link: 'https://app.aave.com/?marketName=proto_avalanche_v3',
154
+ };
155
+ exports.polygonV3Config = {
156
+ integratedOn: 1692489600000,
157
+ networkId: portfolio_core_1.NetworkId.polygon,
158
+ contracts: [
159
+ exports.polygonV3LendProvider,
160
+ exports.polygonV3IncentiveProvider,
161
+ exports.polygonV3DataProvider,
162
+ ],
163
+ link: 'https://app.aave.com/?marketName=proto_polygon_v3',
164
+ };
165
+ exports.ethereumV3Config = {
166
+ integratedOn: 1692489600000,
167
+ networkId: portfolio_core_1.NetworkId.ethereum,
168
+ contracts: [
169
+ exports.ethereumV3LendProvider,
170
+ exports.ethereumV3IncentiveProvider,
171
+ exports.ethereumV3DataProvider,
172
+ ],
173
+ link: 'https://app.aave.com/?marketName=proto_mainnet_v3',
174
+ };
175
+ exports.lendingV3 = {
176
+ id: `${constants_1.platformId}_v3`,
177
+ platformId: constants_1.platformId,
178
+ name: 'Aave V3',
179
+ configs: [exports.ethereumV3Config, exports.polygonV3Config, exports.avalancheV3Config],
180
+ };
181
+ //# sourceMappingURL=services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aave/services.ts"],"names":[],"mappings":";;;AAAA,+DAKoC;AACpC,2CAAyC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I,EAAE,qDAAqD;CAC5D,CAAC;AAEW,QAAA,eAAe,GAAkB;IAC5C,YAAY,EAAE,aAAa;IAC3B,SAAS,EAAE,0BAAS,CAAC,OAAO;IAC5B,SAAS,EAAE;QACT,6BAAqB;QACrB,kCAA0B;QAC1B,6BAAqB;KACtB;IACD,IAAI,EAAE,mDAAmD;CAC1D,CAAC;AAEW,QAAA,gBAAgB,GAAkB;IAC7C,YAAY,EAAE,aAAa;IAC3B,SAAS,EAAE,0BAAS,CAAC,QAAQ;IAC7B,SAAS,EAAE;QACT,8BAAsB;QACtB,mCAA2B;QAC3B,8BAAsB;KACvB;IACD,IAAI,EAAE,mDAAmD;CAC1D,CAAC;AAEW,QAAA,SAAS,GAAY;IAChC,EAAE,EAAE,GAAG,sBAAU,KAAK;IACtB,UAAU,EAAV,sBAAU;IACV,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,CAAC,wBAAgB,EAAE,uBAAe,EAAE,yBAAiB,CAAC;CAChE,CAAC"}
@@ -1,6 +1,9 @@
1
1
  import { Platform } from '@sonarwatch/portfolio-core';
2
2
  export declare const platformId = "aries";
3
3
  export declare const platform: Platform;
4
- export declare const programId = "0x9770fa9c725cbd97eb50b2be5f7416efdfd1f1554beb0750d4dae4c64e860da3";
5
- export declare const apiUrl = "https://api-v2.ariesmarkets.xyz/";
4
+ export declare const packageId = "0x9770fa9c725cbd97eb50b2be5f7416efdfd1f1554beb0750d4dae4c64e860da3";
5
+ export declare const profilesSummaryType = "0x9770fa9c725cbd97eb50b2be5f7416efdfd1f1554beb0750d4dae4c64e860da3::profile::Profiles";
6
+ export declare const profileType = "0x9770fa9c725cbd97eb50b2be5f7416efdfd1f1554beb0750d4dae4c64e860da3::profile::Profile";
7
+ export declare const reserveApiUrl = "https://api-v2.ariesmarkets.xyz/reserve.current";
6
8
  export declare const reservesKey = "reserves";
9
+ export declare const wadsDecimal = 18;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reservesKey = exports.apiUrl = exports.programId = exports.platform = exports.platformId = void 0;
3
+ exports.wadsDecimal = exports.reservesKey = exports.reserveApiUrl = exports.profileType = exports.profilesSummaryType = exports.packageId = exports.platform = exports.platformId = void 0;
4
4
  exports.platformId = 'aries';
5
5
  exports.platform = {
6
6
  id: exports.platformId,
@@ -10,7 +10,10 @@ exports.platform = {
10
10
  website: 'https://app.ariesmarkets.xyz/',
11
11
  twitter: 'https://twitter.com/AriesMarkets',
12
12
  };
13
- exports.programId = '0x9770fa9c725cbd97eb50b2be5f7416efdfd1f1554beb0750d4dae4c64e860da3';
14
- exports.apiUrl = 'https://api-v2.ariesmarkets.xyz/';
13
+ exports.packageId = '0x9770fa9c725cbd97eb50b2be5f7416efdfd1f1554beb0750d4dae4c64e860da3';
14
+ exports.profilesSummaryType = `${exports.packageId}::profile::Profiles`;
15
+ exports.profileType = `${exports.packageId}::profile::Profile`;
16
+ exports.reserveApiUrl = 'https://api-v2.ariesmarkets.xyz/reserve.current';
15
17
  exports.reservesKey = 'reserves';
18
+ exports.wadsDecimal = 18;
16
19
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,eAAe;IAC5B,OAAO,EAAE,+BAA+B;IACxC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAE1D,QAAA,MAAM,GAAG,kCAAkC,CAAC;AAC5C,QAAA,WAAW,GAAG,UAAU,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,eAAe;IAC5B,OAAO,EAAE,+BAA+B;IACxC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAC1D,QAAA,mBAAmB,GAAG,GAAG,iBAAS,qBAAqB,CAAC;AACxD,QAAA,WAAW,GAAG,GAAG,iBAAS,oBAAoB,CAAC;AAE/C,QAAA,aAAa,GAAG,iDAAiD,CAAC;AAClE,QAAA,WAAW,GAAG,UAAU,CAAC;AACzB,QAAA,WAAW,GAAG,EAAE,CAAC"}
@@ -13,116 +13,122 @@ 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 axios_1 = __importDefault(require("axios"));
17
16
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
18
17
  const constants_1 = require("./constants");
19
18
  const helpers_1 = require("./helpers");
20
19
  const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
20
+ const aptos_1 = require("../../utils/aptos");
21
+ const clients_1 = require("../../utils/clients");
21
22
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
22
- const profileRes = yield axios_1.default
23
- .get(`${constants_1.apiUrl}profile.find?input={"owner":"${owner}"}`, { timeout: 1000 })
24
- .catch(() => null);
25
- if (!profileRes || !profileRes.data)
23
+ var _a;
24
+ const client = (0, clients_1.getClientAptos)();
25
+ // Get deposit and borrow amounts for each profile
26
+ const profilesSummary = yield (0, aptos_1.getAccountResource)(client, owner, constants_1.profilesSummaryType);
27
+ if (!profilesSummary)
26
28
  return [];
29
+ const profilesAddresses = profilesSummary.profile_signers.data.map((d) => d.value.account);
30
+ if (profilesAddresses.length === 0)
31
+ return [];
32
+ const profiless = yield Promise.all(profilesAddresses.map((pAddress) => (0, aptos_1.getAccountResource)(client, pAddress, constants_1.profileType)));
33
+ const amountss = yield Promise.all(profiless.map((p) => (0, helpers_1.getProfileAmounts)(p, client)));
34
+ // Get TokenPrices
35
+ const tokenAddresses = [];
36
+ amountss.forEach((amounts) => {
37
+ amounts.deposits.forEach((deposit) => {
38
+ tokenAddresses.push(deposit.address);
39
+ });
40
+ amounts.borrows.forEach((borrow) => {
41
+ tokenAddresses.push(borrow.address);
42
+ });
43
+ });
44
+ const tokenPrices = yield cache.getTokenPricesAsMap(tokenAddresses, portfolio_core_1.NetworkId.aptos);
45
+ // Get Reserves
27
46
  const reserves = yield cache.getItem(constants_1.reservesKey, {
28
47
  prefix: constants_1.platformId,
29
48
  networkId: portfolio_core_1.NetworkId.aptos,
30
49
  });
31
- const ratesByCoin = new Map();
32
- if (reserves) {
33
- reserves.forEach((reserveData) => {
34
- ratesByCoin.set(reserveData.key, reserveData.rate);
35
- });
36
- }
37
- const { profiles } = profileRes.data.result.data;
38
- const mintsSet = new Set();
39
- for (const accountName in profiles) {
40
- if (profiles[accountName]) {
41
- for (const coin in profiles[accountName].deposits) {
42
- if (profiles[accountName].deposits[coin]) {
43
- mintsSet.add(coin);
44
- }
45
- }
46
- for (const coin in profiles[accountName].borrows) {
47
- if (profiles[accountName].borrows[coin]) {
48
- mintsSet.add(coin);
49
- }
50
- }
51
- }
52
- }
53
- const mints = Array.from(mintsSet);
54
- const tokenPrices = yield cache.getTokenPrices(mints, portfolio_core_1.NetworkId.aptos);
55
- const tokenById = new Map();
56
- tokenPrices.forEach((tokenPrice, index) => {
57
- if (tokenPrice) {
58
- tokenById.set(mints[index], tokenPrice);
59
- }
50
+ if (!reserves)
51
+ return [];
52
+ const reservesByAddress = new Map();
53
+ reserves.forEach((reserveData) => {
54
+ reservesByAddress.set(reserveData.key, reserveData);
60
55
  });
61
56
  const elements = [];
62
- for (const accountName in profiles) {
63
- if (profiles[accountName]) {
64
- const borrowedAssets = [];
65
- const borrowedYields = [];
66
- const suppliedAssets = [];
67
- const suppliedYields = [];
68
- const rewardAssets = [];
69
- const profile = profiles[accountName];
70
- const name = (0, helpers_1.getName)(accountName);
71
- for (const coin in profile.deposits) {
72
- if (profile.deposits[coin]) {
73
- const deposit = profile.deposits[coin];
74
- const amount = new bignumber_js_1.default(deposit.collateral_coins);
75
- if (amount.isZero())
76
- continue;
77
- const tokenPrice = tokenById.get(coin);
78
- if (!tokenPrice)
79
- continue;
80
- suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(coin, amount.dividedBy(Math.pow(10, tokenPrice.decimals)).toNumber(), portfolio_core_1.NetworkId.aptos, tokenPrice));
81
- const rates = ratesByCoin.get(coin);
82
- if (rates)
83
- suppliedYields.push([rates.depositYield]);
84
- }
85
- }
86
- for (const coin in profile.borrows) {
87
- if (profile.borrows[coin]) {
88
- const borrow = profile.borrows[coin];
89
- const amount = new bignumber_js_1.default(borrow.borrowed_coins);
90
- if (amount.isZero())
91
- continue;
92
- const tokenPrice = tokenById.get(coin);
93
- if (!tokenPrice)
94
- continue;
95
- borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(coin, amount.dividedBy(Math.pow(10, tokenPrice.decimals)).toNumber(), portfolio_core_1.NetworkId.aptos, tokenPrice));
96
- const rates = ratesByCoin.get(coin);
97
- if (rates)
98
- borrowedYields.push([rates.borrowYield]);
99
- }
100
- }
101
- if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
57
+ for (let i = 0; i < profiless.length; i++) {
58
+ const profile = profiless[i];
59
+ if (!profile)
60
+ continue;
61
+ const amounts = amountss[i];
62
+ const profileKey = (_a = profilesSummary.profile_signers.data.at(i)) === null || _a === void 0 ? void 0 : _a.key;
63
+ const name = profileKey ? (0, helpers_1.getName)(profileKey) : undefined;
64
+ const borrowedAssets = [];
65
+ const borrowedYields = [];
66
+ const suppliedAssets = [];
67
+ const suppliedYields = [];
68
+ const rewardAssets = [];
69
+ const suppliedLtvs = [];
70
+ const borrowedWeights = [];
71
+ for (let j = 0; j < amounts.deposits.length; j++) {
72
+ const deposit = amounts.deposits[j];
73
+ const { address, amount: amountStr } = deposit;
74
+ const tokenPrice = tokenPrices.get((0, portfolio_core_1.formatMoveTokenAddress)(address));
75
+ if (!tokenPrice)
102
76
  continue;
103
- const { borrowedValue, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets);
104
- elements.push({
105
- type: portfolio_core_1.PortfolioElementType.borrowlend,
106
- networkId: portfolio_core_1.NetworkId.aptos,
107
- platformId: constants_1.platformId,
108
- label: 'Lending',
109
- value,
110
- name,
111
- data: {
112
- borrowedAssets,
113
- borrowedValue,
114
- borrowedYields,
115
- suppliedAssets,
116
- suppliedValue,
117
- suppliedYields,
118
- collateralRatio: null,
119
- healthRatio: 1 - new bignumber_js_1.default(profile.riskFactor).toNumber(),
120
- rewardAssets,
121
- rewardValue,
122
- value,
123
- },
124
- });
77
+ const reserve = reservesByAddress.get(address);
78
+ if (!reserve)
79
+ continue;
80
+ suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(address, new bignumber_js_1.default(amountStr)
81
+ .dividedBy(Math.pow(10, tokenPrice.decimals))
82
+ .times(new bignumber_js_1.default(reserve.value.total_borrowed)
83
+ .plus(reserve.value.total_cash_available)
84
+ .minus(reserve.value.reserve_amount)
85
+ .div(reserve.value.total_lp_supply))
86
+ .toNumber(), portfolio_core_1.NetworkId.aptos, tokenPrice));
87
+ suppliedLtvs.push(Number(reserve.value.reserve_config.liquidation_threshold) / 100);
88
+ suppliedYields.push([reserve.rate.depositYield]);
89
+ }
90
+ for (let j = 0; j < amounts.borrows.length; j++) {
91
+ const borrow = amounts.borrows[j];
92
+ const { address, amount: amountStr } = borrow;
93
+ const tokenPrice = tokenPrices.get((0, portfolio_core_1.formatMoveTokenAddress)(address));
94
+ if (!tokenPrice)
95
+ continue;
96
+ const reserve = reservesByAddress.get(address);
97
+ if (!reserve)
98
+ continue;
99
+ borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(address, new bignumber_js_1.default(amountStr)
100
+ .times(new bignumber_js_1.default(reserve.value.total_borrowed).div(reserve.value.total_borrowed_share))
101
+ .dividedBy(Math.pow(10, (constants_1.wadsDecimal + tokenPrice.decimals)))
102
+ .toNumber(), portfolio_core_1.NetworkId.aptos, tokenPrice));
103
+ borrowedYields.push([reserve.rate.borrowYield]);
104
+ borrowedWeights.push(Number(reserve.value.reserve_config.borrow_factor) / 100);
125
105
  }
106
+ if (borrowedAssets.length === 0 &&
107
+ suppliedAssets.length === 0 &&
108
+ rewardAssets.length === 0)
109
+ continue;
110
+ const { borrowedValue, suppliedValue, value, rewardValue, healthRatio } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs, borrowedWeights);
111
+ elements.push({
112
+ type: portfolio_core_1.PortfolioElementType.borrowlend,
113
+ networkId: portfolio_core_1.NetworkId.aptos,
114
+ platformId: constants_1.platformId,
115
+ label: 'Lending',
116
+ value,
117
+ name,
118
+ data: {
119
+ borrowedAssets,
120
+ borrowedValue,
121
+ borrowedYields,
122
+ suppliedAssets,
123
+ suppliedValue,
124
+ suppliedYields,
125
+ collateralRatio: null,
126
+ healthRatio,
127
+ rewardAssets,
128
+ rewardValue,
129
+ value,
130
+ },
131
+ });
126
132
  }
127
133
  return elements;
128
134
  });