@sonarwatch/portfolio-plugins 0.11.189 → 0.11.190

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.11.190](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.189...plugins-0.11.190) (2024-04-26)
6
+
7
+
8
+
5
9
  ## [0.11.189](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.188...plugins-0.11.189) (2024-04-25)
6
10
 
7
11
 
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.190",
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.190"
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;IACpC,6CAA6C;CAC9C,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,6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C7C,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,4CAA4C,CAAC;AAC3D,QAAA,YAAY,GAAG,EAAE,CAAC;AAClB,QAAA,cAAc,GAAG,4CAA4C,CAAC;AAC9D,QAAA,eAAe,GAAG,EAAE,CAAC;AACrB,QAAA,cAAc,GAAG,4CAA4C,CAAC;AAC9D,QAAA,eAAe,GAAG,EAAE,CAAC;AACrB,QAAA,WAAW,GAAG,4CAA4C,CAAC;AAC3D,QAAA,YAAY,GA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BACE,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;AAE5B,QAAA,qBAAqB,GAAa;IAC7C,OAAO,EAAE,4CAA4C;IACrD,IAAI,EAAE,oCAAoC;IAC1C,OAAO,EAAE,0BAAS,CAAC,QAAQ;CAC5B,CAAC;AAEW,QAAA,oBAAoB,GAAa;IAC5C,OAAO,EAAE,4CAA4C;IACrD,IAAI,EAAE,mCAAmC;IACzC,OAAO,EAAE,0BAAS,CAAC,QAAQ;CAC5B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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
  });
@@ -1 +1 @@
1
- {"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,kDAA6C;AAC7C,gEAAqC;AAGrC,2CAA8D;AAE9D,uCAAoC;AACpC,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAA0C,MAAM,eAAK;SAClE,GAAG,CAAC,GAAG,kBAAM,gCAAgC,KAAK,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;SAC1E,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACrB,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAE/C,MAAM,QAAQ,GAAG,MAAM,KAA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,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,GACxD,IAAA,wCAAuB,EAAC,cAAc,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;YAExE,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,qCAAoB,CAAC,UAAU;gBACrC,SAAS,EAAE,0BAAS,CAAC,KAAK;gBAC1B,UAAU,EAAV,sBAAU;gBACV,KAAK,EAAE,SAAS;gBAChB,KAAK;gBACL,IAAI;gBACJ,IAAI,EAAE;oBACJ,cAAc;oBACd,aAAa;oBACb,cAAc;oBACd,cAAc;oBACd,aAAa;oBACb,cAAc;oBACd,eAAe,EAAE,IAAI;oBACrB,WAAW,EAAE,CAAC,GAAG,IAAI,sBAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;oBAC7D,YAAY;oBACZ,WAAW;oBACX,KAAK;iBACN;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,KAAK;IAC1B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAGrC,2CAMqB;AAErB,uCAAuD;AACvD,qGAA6E;AAC7E,6CAAuD;AACvD,iDAAqD;AAErD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAEhC,kDAAkD;IAClD,MAAM,eAAe,GAAG,MAAM,IAAA,0BAAkB,EAC9C,MAAM,EACN,KAAK,EACL,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C;QACJ,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,KAAK;YAC1B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK;YACL,IAAI;YACJ,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,eAAe,EAAE,IAAI;gBACrB,WAAW;gBACX,YAAY;gBACZ,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,KAAK;IAC1B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -1,5 +1,24 @@
1
1
  import BigNumber from 'bignumber.js';
2
- import { Reserve } from './types';
2
+ import { Profile, Reserve } from './types';
3
+ import { AptosClient } from '../../utils/clients/types';
3
4
  export declare function getName(accountName: string): string;
4
5
  export declare function getBorrowApr(utilization: BigNumber, borrowedAmount: BigNumber, availableAmount: BigNumber, reserveData: Reserve): number;
5
6
  export declare function getDepositApr(utilization: BigNumber, borrowApr: number, reserveData: Reserve): number;
7
+ export declare function getProfileAmounts(profile: Profile | null, client: AptosClient): Promise<{
8
+ deposits: {
9
+ address: string;
10
+ amount: string;
11
+ }[];
12
+ borrows: {
13
+ address: string;
14
+ amount: string;
15
+ }[];
16
+ }>;
17
+ export declare function getProfileBorrows(profile: Profile | null, client: AptosClient): Promise<{
18
+ address: string;
19
+ amount: string;
20
+ }[]>;
21
+ export declare function getProfileDeposits(profile: Profile | null, client: AptosClient): Promise<{
22
+ address: string;
23
+ amount: string;
24
+ }[]>;
@@ -1,14 +1,39 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
13
  };
5
14
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getDepositApr = exports.getBorrowApr = exports.getName = void 0;
15
+ exports.getProfileDeposits = exports.getProfileBorrows = exports.getProfileAmounts = exports.getDepositApr = exports.getBorrowApr = exports.getName = void 0;
7
16
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
+ const aptos_1 = require("../../utils/aptos");
18
+ const constants_1 = require("./constants");
8
19
  function getName(accountName) {
9
- return accountName.replace('profile', '');
20
+ if (accountName.startsWith('profile'))
21
+ return accountName.slice(7);
22
+ return accountName;
10
23
  }
11
24
  exports.getName = getName;
25
+ function hex2a(hex) {
26
+ let hexx = hex;
27
+ if (hex.startsWith('0x'))
28
+ hexx = hexx.slice(2);
29
+ let str = '';
30
+ for (let i = 0; i < hexx.length; i += 2)
31
+ str += String.fromCharCode(parseInt(hexx.substring(i, i + 2), 16));
32
+ return str;
33
+ }
34
+ function getTokenAddress(vec) {
35
+ return `${vec.account_address}::${hex2a(vec.module_name)}::${hex2a(vec.struct_name)}`;
36
+ }
12
37
  function getBorrowApr(utilization, borrowedAmount, availableAmount, reserveData) {
13
38
  const interestRateConfig = reserveData.value.interest_rate_config;
14
39
  const optimalUtilization = interestRateConfig.optimal_utilization / 100;
@@ -43,4 +68,71 @@ function getDepositApr(utilization, borrowApr, reserveData) {
43
68
  .toNumber();
44
69
  }
45
70
  exports.getDepositApr = getDepositApr;
71
+ function getProfileAmounts(profile, client) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ const [deposits, borrows] = yield Promise.all([
74
+ getProfileDeposits(profile, client),
75
+ getProfileBorrows(profile, client),
76
+ ]);
77
+ return {
78
+ deposits,
79
+ borrows,
80
+ };
81
+ });
82
+ }
83
+ exports.getProfileAmounts = getProfileAmounts;
84
+ function getProfileBorrows(profile, client) {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ const head = profile === null || profile === void 0 ? void 0 : profile.borrowed_reserves.head.vec.at(0);
87
+ const handle = profile === null || profile === void 0 ? void 0 : profile.borrowed_reserves.inner.inner.handle;
88
+ if (!head || !handle)
89
+ return [];
90
+ let nextVec = head;
91
+ let profileItem;
92
+ const amounts = [];
93
+ while (nextVec) {
94
+ profileItem = yield (0, aptos_1.getTableItem)(client, handle, {
95
+ key_type: '0x1::type_info::TypeInfo',
96
+ value_type: `${constants_1.packageId}::iterable_table::IterableValue<0x1::type_info::TypeInfo, ${constants_1.packageId}::profile::Loan>`,
97
+ key: nextVec,
98
+ });
99
+ if (profileItem) {
100
+ amounts.push({
101
+ address: getTokenAddress(nextVec),
102
+ amount: profileItem.val.borrowed_share.val,
103
+ });
104
+ }
105
+ nextVec = profileItem === null || profileItem === void 0 ? void 0 : profileItem.next.vec.at(0);
106
+ }
107
+ return amounts;
108
+ });
109
+ }
110
+ exports.getProfileBorrows = getProfileBorrows;
111
+ function getProfileDeposits(profile, client) {
112
+ return __awaiter(this, void 0, void 0, function* () {
113
+ const head = profile === null || profile === void 0 ? void 0 : profile.deposited_reserves.head.vec.at(0);
114
+ const handle = profile === null || profile === void 0 ? void 0 : profile.deposited_reserves.inner.inner.handle;
115
+ if (!head || !handle)
116
+ return [];
117
+ let nextVec = head;
118
+ let profileItem;
119
+ const amounts = [];
120
+ while (nextVec) {
121
+ profileItem = yield (0, aptos_1.getTableItem)(client, handle, {
122
+ key_type: '0x1::type_info::TypeInfo',
123
+ value_type: `${constants_1.packageId}::iterable_table::IterableValue<0x1::type_info::TypeInfo, ${constants_1.packageId}::profile::Deposit>`,
124
+ key: nextVec,
125
+ });
126
+ if (profileItem) {
127
+ amounts.push({
128
+ address: getTokenAddress(nextVec),
129
+ amount: profileItem.val.collateral_amount,
130
+ });
131
+ }
132
+ nextVec = profileItem === null || profileItem === void 0 ? void 0 : profileItem.next.vec.at(0);
133
+ }
134
+ return amounts;
135
+ });
136
+ }
137
+ exports.getProfileDeposits = getProfileDeposits;
46
138
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAGrC,SAAgB,OAAO,CAAC,WAAmB;IACzC,OAAO,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAC5C,CAAC;AAFD,0BAEC;AAED,SAAgB,YAAY,CAC1B,WAAsB,EACtB,cAAyB,EACzB,eAA0B,EAC1B,WAAoB;IAEpB,MAAM,kBAAkB,GAAG,WAAW,CAAC,KAAK,CAAC,oBAAoB,CAAC;IAClE,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,mBAAmB,GAAG,GAAG,CAAC;IACxE,MAAM,WAAW,GAAG,kBAAkB,CAAC,mBAAmB,GAAG,GAAG,CAAC;IACjE,MAAM,OAAO,GAAG,kBAAkB,CAAC,eAAe,GAAG,GAAG,CAAC;IACzD,MAAM,OAAO,GAAG,kBAAkB,CAAC,eAAe,GAAG,GAAG,CAAC;IAEzD,IAAI,cAAc,CAAC,MAAM,EAAE;QAAE,OAAO,OAAO,CAAC;IAC5C,IAAI,eAAe,CAAC,MAAM,EAAE;QAAE,OAAO,OAAO,CAAC;IAE7C,IAAI,WAAW,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC/C,MAAM,gBAAgB,GAAG,WAAW,CAAC;QACrC,MAAM,cAAc,GAAG,kBAAkB,CAAC;QAC1C,OAAO,gBAAgB;aACpB,SAAS,CAAC,cAAc,CAAC;aACzB,KAAK,CAAC,WAAW,CAAC;aAClB,QAAQ,EAAE,CAAC;IAChB,CAAC;IACD,MAAM,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAC/D,MAAM,cAAc,GAAG,IAAA,sBAAS,EAAC,CAAC,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAC9D,OAAO,gBAAgB;SACpB,SAAS,CAAC,cAAc,CAAC;SACzB,KAAK,CAAC,OAAO,CAAC;SACd,IAAI,CAAC,WAAW,CAAC;SACjB,QAAQ,EAAE,CAAC;AAChB,CAAC;AA9BD,oCA8BC;AAED,SAAgB,aAAa,CAC3B,WAAsB,EACtB,SAAiB,EACjB,WAAoB;IAEpB,OAAO,IAAA,sBAAS,EAAC,SAAS,CAAC;SACxB,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC;SAC3E,KAAK,CAAC,WAAW,CAAC;SAClB,QAAQ,EAAE,CAAC;AAChB,CAAC;AATD,sCASC"}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AASrC,6CAAiD;AACjD,2CAAwC;AAExC,SAAgB,OAAO,CAAC,WAAmB;IACzC,IAAI,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnE,OAAO,WAAW,CAAC;AACrB,CAAC;AAHD,0BAGC;AAED,SAAS,KAAK,CAAC,GAAW;IACxB,IAAI,IAAI,GAAG,GAAG,CAAC;IACf,IAAI,GAAG,CAAC,UAAU,CAAC,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AAO,EAAE,CAAC;QAEhC,IAAI,OAAO,GAA2B,IAAI,CAAC;QAC3C,IAAI,WAAsC,CAAC;QAC3C,MAAM,OAAO,GAA0C,EAAE,CAAC;QAC1D,OAAO,OAAO,EAAE,CAAC;YACf,WAAW,GAAG,MAAM,IAAA,oBAAY,EAAqB,MAAM,EAAE,MAAM,EAAE;gBACnE,QAAQ,EAAE,0BAA0B;gBACpC,UAAU,EAAE,GAAG,qBAAS,6DAA6D,qBAAS,qBAAqB;gBACnH,GAAG,EAAE,OAAO;aACb,CAAC,CAAC;YACH,IAAI,WAAW,EAAE,CAAC;gBAChB,OAAO,CAAC,IAAI,CAAC;oBACX,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC;oBACjC,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,iBAAiB;iBAC1C,CAAC,CAAC;YACL,CAAC;YACD,OAAO,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA;AA1BD,gDA0BC"}
@@ -19,7 +19,7 @@ const constants_1 = require("./constants");
19
19
  const helpers_1 = require("./helpers");
20
20
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
21
21
  const reservesRes = yield axios_1.default
22
- .get(`${constants_1.apiUrl}reserve.current`)
22
+ .get(constants_1.reserveApiUrl)
23
23
  .catch(() => null);
24
24
  if (!reservesRes)
25
25
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"reservesJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/reservesJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,gEAAqC;AACrC,+DAKoC;AAGpC,2CAA8D;AAE9D,uCAAwD;AAExD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,WAAW,GAA0C,MAAM,eAAK;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AAC,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE;YACpC,MAAM,EAAE,sCAAqB;YAC7B,SAAS,EAAE,0BAAS,CAAC,KAAK;SAC3B,CAAC,CACH,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,IAAI,CACX,KAAK,CAAC,OAAO,CAAC,uBAAW,EAAE,gBAAgB,EAAE;QAC3C,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,KAAK;KAC3B,CAAC,CACH,CAAC;IAEF,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AACrC,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,41 +1,64 @@
1
1
  import { BorrowLendRate } from '@sonarwatch/portfolio-core';
2
- export type ProfileResponse = {
3
- result: {
4
- data: ProfileData;
2
+ export type ProfilesSummary = {
3
+ profile_signers: {
4
+ data: [
5
+ {
6
+ key: string;
7
+ value: {
8
+ account: string;
9
+ };
10
+ }
11
+ ];
5
12
  };
6
13
  };
7
- export type ProfileData = {
8
- profiles: {
9
- [accountName: string]: {
10
- id: string;
11
- meta: {
12
- module: string;
13
- owner: string;
14
- version: number;
15
- timestamp: string;
16
- };
17
- profileAddress: string;
18
- deposits: {
19
- [coin: string]: {
20
- collateral_amount: string;
21
- collateral_coins: string;
22
- collateral_value: string;
23
- };
24
- };
25
- borrows: {
26
- [coin: string]: {
27
- borrowed_amount: string;
28
- borrowed_coins: string;
29
- borrowed_value: string;
30
- };
31
- };
32
- equity: string;
33
- collateralValue: string;
34
- loanValue: string;
35
- riskFactor: string;
14
+ export type Profile = {
15
+ borrow_farms: ProfileSub;
16
+ borrowed_reserves: ProfileSub;
17
+ deposit_farms: ProfileSub;
18
+ deposited_reserves: ProfileSub;
19
+ };
20
+ export type ProfileVec = {
21
+ account_address: string;
22
+ module_name: string;
23
+ struct_name: string;
24
+ };
25
+ export type ProfileSub = {
26
+ head: {
27
+ vec: ProfileVec[];
28
+ };
29
+ inner: {
30
+ inner: {
31
+ handle: string;
32
+ };
33
+ length: string;
34
+ };
35
+ tail: {
36
+ vec: ProfileVec[];
37
+ };
38
+ };
39
+ export type ProfileDepositItem = {
40
+ next: {
41
+ vec: [ProfileVec] | [];
42
+ };
43
+ prev: {
44
+ vec: [ProfileVec] | [];
45
+ };
46
+ val: {
47
+ collateral_amount: string;
48
+ };
49
+ };
50
+ export type ProfileBorrowItem = {
51
+ next: {
52
+ vec: [ProfileVec] | [];
53
+ };
54
+ prev: {
55
+ vec: [ProfileVec] | [];
56
+ };
57
+ val: {
58
+ borrowed_share: {
59
+ val: string;
36
60
  };
37
61
  };
38
- total_equity: string;
39
62
  };
40
63
  export type ReserveResponse = {
41
64
  result: {
@@ -7,7 +7,7 @@ exports.platform = {
7
7
  name: 'Saber',
8
8
  image: 'https://sonar.watch/img/platforms/saber.png',
9
9
  defiLlamaId: 'saber',
10
- website: 'https://app.saber.so/',
10
+ website: 'https://saberdao.io/',
11
11
  };
12
12
  exports.SABER_SWAPS = 'https://raw.githubusercontent.com/saber-hq/saber-registry-dist/master/data/swaps.mainnet.json';
13
13
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/saber/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,OAAO;IACpB,OAAO,EAAE,uBAAuB;CACjC,CAAC;AACW,QAAA,WAAW,GACtB,+FAA+F,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/saber/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,OAAO;IACpB,OAAO,EAAE,sBAAsB;CAChC,CAAC;AACW,QAAA,WAAW,GACtB,+FAA+F,CAAC"}
@@ -1,2 +1,2 @@
1
1
  import { AptosClient } from '../clients/types';
2
- export declare function getTableItemsByKeys<T>(client: AptosClient, handle: string, keys: string[], keyType: string, valueType: string): Promise<(Awaited<NonNullable<Awaited<T>>> | null)[]>;
2
+ export declare function getTableItemsByKeys<T>(client: AptosClient, handle: string, keys: (object | string)[], keyType: string, valueType: string): Promise<(Awaited<NonNullable<Awaited<T>>> | null)[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"getTableItemsByKeys.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getTableItemsByKeys.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iDAA8C;AAE9C,MAAM,GAAG,GAAG,EAAE,CAAC;AAEf,SAAsB,mBAAmB,CACvC,MAAmB,EACnB,MAAc,EACd,IAAc,EACd,OAAe,EACf,SAAiB;;QAEjB,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;QAC9B,OAAO,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YACnD,MAAM,SAAS,GAAG,MAAM,oBAAoB,CAC1C,MAAM,EACN,MAAM,EACN,eAAe,EACf,OAAO,EACP,SAAS,CACV,CAAC;YACF,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CAAA;AArBD,kDAqBC;AAED,SAAe,oBAAoB,CACjC,MAAmB,EACnB,MAAc,EACd,IAAc,EACd,OAAe,EACf,SAAiB;;QAEjB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAChC,IAAA,2BAAY,EAAI,MAAM,EAAE,MAAM,EAAE;YAC9B,GAAG;YACH,QAAQ,EAAE,OAAO;YACjB,UAAU,EAAE,SAAS;SACtB,CAAC,CACH,CAAC;QACF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACnD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAC5B,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU;gBAAE,OAAO,IAAI,CAAC;YAC9C,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;CAAA"}
1
+ {"version":3,"file":"getTableItemsByKeys.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getTableItemsByKeys.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iDAA8C;AAE9C,MAAM,GAAG,GAAG,EAAE,CAAC;AAEf,SAAsB,mBAAmB,CACvC,MAAmB,EACnB,MAAc,EACd,IAAyB,EACzB,OAAe,EACf,SAAiB;;QAEjB,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;QAC9B,OAAO,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YACnD,MAAM,SAAS,GAAG,MAAM,oBAAoB,CAC1C,MAAM,EACN,MAAM,EACN,eAAe,EACf,OAAO,EACP,SAAS,CACV,CAAC;YACF,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;QAC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