@sonarwatch/portfolio-plugins 0.11.82 → 0.11.84

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/CHANGELOG.md +1055 -1047
  2. package/README.md +3 -3
  3. package/package.json +2 -2
  4. package/src/index.js +8 -0
  5. package/src/index.js.map +1 -1
  6. package/src/plugins/accessprotocol/constants.d.ts +7 -0
  7. package/src/plugins/accessprotocol/constants.js +17 -0
  8. package/src/plugins/accessprotocol/constants.js.map +1 -0
  9. package/src/plugins/accessprotocol/filters.d.ts +2 -0
  10. package/src/plugins/accessprotocol/filters.js +16 -0
  11. package/src/plugins/accessprotocol/filters.js.map +1 -0
  12. package/src/plugins/accessprotocol/index.d.ts +6 -0
  13. package/src/plugins/accessprotocol/index.js +12 -0
  14. package/src/plugins/accessprotocol/index.js.map +1 -0
  15. package/src/plugins/accessprotocol/positionFetcher.d.ts +3 -0
  16. package/src/plugins/accessprotocol/positionFetcher.js +53 -0
  17. package/src/plugins/accessprotocol/positionFetcher.js.map +1 -0
  18. package/src/plugins/accessprotocol/structs.d.ts +25 -0
  19. package/src/plugins/accessprotocol/structs.js +30 -0
  20. package/src/plugins/accessprotocol/structs.js.map +1 -0
  21. package/src/plugins/aptin/constants.d.ts +5 -0
  22. package/src/plugins/aptin/constants.js +15 -0
  23. package/src/plugins/aptin/constants.js.map +1 -0
  24. package/src/plugins/aptin/depositsFetcher.d.ts +3 -0
  25. package/src/plugins/aptin/depositsFetcher.js +114 -0
  26. package/src/plugins/aptin/depositsFetcher.js.map +1 -0
  27. package/src/plugins/aptin/depositsJob.d.ts +3 -0
  28. package/src/plugins/aptin/depositsJob.js +43 -0
  29. package/src/plugins/aptin/depositsJob.js.map +1 -0
  30. package/src/plugins/aptin/helpers.d.ts +1 -0
  31. package/src/plugins/aptin/helpers.js +8 -0
  32. package/src/plugins/aptin/helpers.js.map +1 -0
  33. package/src/plugins/aptin/index.d.ts +6 -0
  34. package/src/plugins/aptin/index.js +13 -0
  35. package/src/plugins/aptin/index.js.map +1 -0
  36. package/src/plugins/aptin/types.d.ts +70 -0
  37. package/src/plugins/aptin/types.js +3 -0
  38. package/src/plugins/aptin/types.js.map +1 -0
  39. package/src/plugins/aries/constants.js +1 -1
  40. package/src/plugins/aries/constants.js.map +1 -1
  41. package/src/plugins/aries/depositsFetcher.js +1 -1
  42. package/src/plugins/aries/depositsFetcher.js.map +1 -1
  43. package/src/plugins/balancer/helpers/pools.js +21 -21
  44. package/src/plugins/bonkrewards/constants.js +2 -0
  45. package/src/plugins/bonkrewards/constants.js.map +1 -1
  46. package/src/plugins/foo/constants.js +3 -1
  47. package/src/plugins/foo/constants.js.map +1 -1
  48. package/src/plugins/goosefx/constants.d.ts +1 -1
  49. package/src/plugins/goosefx/constants.js +2 -2
  50. package/src/plugins/goosefx/constants.js.map +1 -1
  51. package/src/plugins/goosefx/index.js +1 -1
  52. package/src/plugins/goosefx/index.js.map +1 -1
  53. package/src/plugins/mango/collateralFetcher.js +2 -0
  54. package/src/plugins/mango/collateralFetcher.js.map +1 -1
  55. package/src/plugins/sushiswap/helpers.js +24 -24
  56. package/src/plugins/uniswap-v2/helpers.js +22 -22
  57. package/src/utils/aptos/getDecimals.d.ts +2 -0
  58. package/src/utils/aptos/getDecimals.js +23 -0
  59. package/src/utils/aptos/getDecimals.js.map +1 -0
  60. package/src/utils/sei/constants.js +8 -8
  61. 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.82",
3
+ "version": "0.11.84",
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.82"
44
+ "@sonarwatch/portfolio-core": "0.11.84"
45
45
  },
46
46
  "main": "./src/index.js",
47
47
  "types": "./src/index.d.ts"
package/src/index.js CHANGED
@@ -84,6 +84,8 @@ const circuit_1 = require("./plugins/circuit");
84
84
  const aries_1 = require("./plugins/aries");
85
85
  const flash_1 = require("./plugins/flash");
86
86
  const bonkrewards_1 = require("./plugins/bonkrewards");
87
+ const accessprotocol_1 = require("./plugins/accessprotocol");
88
+ const aptin_1 = require("./plugins/aptin");
87
89
  var constants_1 = require("./plugins/tokens/constants");
88
90
  Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
89
91
  Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
@@ -158,6 +160,8 @@ exports.platforms = [
158
160
  ...aries_1.platforms,
159
161
  ...flash_1.platforms,
160
162
  ...bonkrewards_1.platforms,
163
+ ...accessprotocol_1.platforms,
164
+ ...aptin_1.platforms,
161
165
  ];
162
166
  // JOBS //
163
167
  exports.jobs = [
@@ -218,6 +222,8 @@ exports.jobs = [
218
222
  ...aries_1.jobs,
219
223
  ...flash_1.jobs,
220
224
  ...bonkrewards_1.jobs,
225
+ ...accessprotocol_1.jobs,
226
+ ...aptin_1.jobs,
221
227
  ];
222
228
  // FETCHERS //
223
229
  exports.fetchers = [
@@ -280,6 +286,8 @@ exports.fetchers = [
280
286
  ...aries_1.fetchers,
281
287
  ...flash_1.fetchers,
282
288
  ...bonkrewards_1.fetchers,
289
+ ...accessprotocol_1.fetchers,
290
+ ...aptin_1.fetchers,
283
291
  ];
284
292
  exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
285
293
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":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mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,wBAAoB;IACvB,GAAG,sBAAmB;IACtB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,iBAAc;IACjB,GAAG,6BAAyB;IAC5B,GAAG,iBAAc;IACjB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,sBAAkB;IACrB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,qBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,oBAAiB;IACpB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,kBAAe;IAClB,GAAG,eAAY;IACf,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,cAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,oBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,qBAAkB;IACrB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,gBAAa;IAChB,GAAG,gBAAa;IAChB,GAAG,sBAAmB;CACvB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;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C,gBAAQ,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import { Platform } from '@sonarwatch/portfolio-core';
3
+ export declare const platformId = "accessprotocol";
4
+ export declare const platform: Platform;
5
+ export declare const stakePid: PublicKey;
6
+ export declare const acsMint = "5MAYDfq5yxtudAhtfyuMBuHZjgAbaS9tbEyEQYAhDS5y";
7
+ export declare const acsDecimals = 6;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.acsDecimals = exports.acsMint = exports.stakePid = exports.platform = exports.platformId = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
5
+ exports.platformId = 'accessprotocol';
6
+ exports.platform = {
7
+ id: exports.platformId,
8
+ name: 'Access Protocol',
9
+ image: 'https://sonar.watch/img/platforms/accessprotocol.png',
10
+ twitter: 'https://twitter.com/AccessProtocol',
11
+ website: 'https://hub.accessprotocol.co',
12
+ // defiLlamaId: 'nothing yet',
13
+ };
14
+ exports.stakePid = new web3_js_1.PublicKey('6HW8dXjtiTGkD4jzXs7igdFmZExPpmwUrRN5195xGup');
15
+ exports.acsMint = '5MAYDfq5yxtudAhtfyuMBuHZjgAbaS9tbEyEQYAhDS5y';
16
+ exports.acsDecimals = 6;
17
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/accessprotocol/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,gBAAgB,CAAC;AAC9B,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,sDAAsD;IAC7D,OAAO,EAAE,oCAAoC;IAC7C,OAAO,EAAE,+BAA+B;IACxC,8BAA8B;CAC/B,CAAC;AACW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,6CAA6C,CAC9C,CAAC;AACW,QAAA,OAAO,GAAG,8CAA8C,CAAC;AACzD,QAAA,WAAW,GAAG,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { GetProgramAccountsFilter } from '@solana/web3.js';
2
+ export declare const stakeAccountStructFilter: (owner: string) => GetProgramAccountsFilter[];
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stakeAccountStructFilter = void 0;
4
+ const structs_1 = require("./structs");
5
+ // import { stakePool } from './constants';
6
+ const stakeAccountStructFilter = (owner) => [
7
+ {
8
+ memcmp: {
9
+ offset: 1,
10
+ bytes: owner,
11
+ },
12
+ },
13
+ { dataSize: structs_1.stakeAccountStruct.byteSize },
14
+ ];
15
+ exports.stakeAccountStructFilter = stakeAccountStructFilter;
16
+ //# sourceMappingURL=filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/accessprotocol/filters.ts"],"names":[],"mappings":";;;AACA,uCAA+C;AAC/C,2CAA2C;AAEpC,MAAM,wBAAwB,GAAG,CACtC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,4BAAkB,CAAC,QAAQ,EAAE;CAC1C,CAAC;AAVW,QAAA,wBAAwB,4BAUnC"}
@@ -0,0 +1,6 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ import { Fetcher } from '../../Fetcher';
3
+ import { Job } from '../../Job';
4
+ export declare const platforms: Platform[];
5
+ export declare const jobs: Job[];
6
+ export declare const fetchers: Fetcher[];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fetchers = exports.jobs = exports.platforms = void 0;
7
+ const constants_1 = require("./constants");
8
+ const positionFetcher_1 = __importDefault(require("./positionFetcher"));
9
+ exports.platforms = [constants_1.platform];
10
+ exports.jobs = [];
11
+ exports.fetchers = [positionFetcher_1.default];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/accessprotocol/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,wEAAgD;AAEnC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,yBAAe,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,53 @@
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
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
+ const constants_1 = require("./constants");
17
+ const clients_1 = require("../../utils/clients");
18
+ const solana_1 = require("../../utils/solana");
19
+ const structs_1 = require("./structs");
20
+ const filters_1 = require("./filters");
21
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
22
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
23
+ const client = (0, clients_1.getClientSolana)();
24
+ const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.stakeAccountStruct, constants_1.stakePid, (0, filters_1.stakeAccountStructFilter)(owner));
25
+ if (accounts.length === 0)
26
+ return [];
27
+ const acsTokenPrice = yield cache.getTokenPrice(constants_1.acsMint, portfolio_core_1.NetworkId.solana);
28
+ const assets = [];
29
+ for (const account of accounts) {
30
+ if (account.stakeAmount.isZero())
31
+ continue;
32
+ assets.push(Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(constants_1.acsMint, account.stakeAmount.dividedBy(Math.pow(10, constants_1.acsDecimals)).toNumber(), portfolio_core_1.NetworkId.solana, acsTokenPrice)), { attributes: {} }));
33
+ }
34
+ if (assets.length === 0)
35
+ return [];
36
+ return [
37
+ {
38
+ type: portfolio_core_1.PortfolioElementType.multiple,
39
+ label: 'Staked',
40
+ networkId: portfolio_core_1.NetworkId.solana,
41
+ platformId: constants_1.platformId,
42
+ data: { assets },
43
+ value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
44
+ },
45
+ ];
46
+ });
47
+ const fetcher = {
48
+ id: `${constants_1.platformId}-staking`,
49
+ networkId: portfolio_core_1.NetworkId.solana,
50
+ executor,
51
+ };
52
+ exports.default = fetcher;
53
+ //# sourceMappingURL=positionFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positionFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/accessprotocol/positionFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AAEpC,2CAAyE;AAEzE,iDAAsD;AACtD,+CAA8D;AAC9D,uCAA+C;AAC/C,uCAAqD;AACrD,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GA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AC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { BeetStruct } from '@metaplex-foundation/beet';
2
+ import { PublicKey } from '@metaplex-foundation/js';
3
+ import BigNumber from 'bignumber.js';
4
+ export declare enum Tag {
5
+ Uninitialized = 0,
6
+ StakePool = 1,
7
+ InactiveStakePool = 2,
8
+ StakeAccount = 3,
9
+ InactiveBondAccount = 4,
10
+ BondAccount = 5,
11
+ CentralState = 6,
12
+ Deleted = 7,
13
+ FrozenStakePool = 8,
14
+ FrozenStakeAccount = 9,
15
+ FrozenBondAccount = 10
16
+ }
17
+ export type StakeAccount = {
18
+ tag: Tag;
19
+ owner: PublicKey;
20
+ stakeAmount: BigNumber;
21
+ stakePool: PublicKey;
22
+ lastClaimedOffset: BigNumber;
23
+ poolMinimumAtCreation: BigNumber;
24
+ };
25
+ export declare const stakeAccountStruct: BeetStruct<StakeAccount, Partial<StakeAccount>>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stakeAccountStruct = exports.Tag = void 0;
4
+ const beet_1 = require("@metaplex-foundation/beet");
5
+ const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
+ const solana_1 = require("../../utils/solana");
7
+ var Tag;
8
+ (function (Tag) {
9
+ Tag[Tag["Uninitialized"] = 0] = "Uninitialized";
10
+ Tag[Tag["StakePool"] = 1] = "StakePool";
11
+ Tag[Tag["InactiveStakePool"] = 2] = "InactiveStakePool";
12
+ Tag[Tag["StakeAccount"] = 3] = "StakeAccount";
13
+ // Bond accounts are inactive until the buyer transfered the funds
14
+ Tag[Tag["InactiveBondAccount"] = 4] = "InactiveBondAccount";
15
+ Tag[Tag["BondAccount"] = 5] = "BondAccount";
16
+ Tag[Tag["CentralState"] = 6] = "CentralState";
17
+ Tag[Tag["Deleted"] = 7] = "Deleted";
18
+ Tag[Tag["FrozenStakePool"] = 8] = "FrozenStakePool";
19
+ Tag[Tag["FrozenStakeAccount"] = 9] = "FrozenStakeAccount";
20
+ Tag[Tag["FrozenBondAccount"] = 10] = "FrozenBondAccount";
21
+ })(Tag || (exports.Tag = Tag = {}));
22
+ exports.stakeAccountStruct = new beet_1.BeetStruct([
23
+ ['tag', beet_1.u8],
24
+ ['owner', beet_solana_1.publicKey],
25
+ ['stakeAmount', solana_1.u64],
26
+ ['stakePool', beet_solana_1.publicKey],
27
+ ['lastClaimedOffset', solana_1.u64],
28
+ ['poolMinimumAtCreation', solana_1.u64],
29
+ ], (args) => args);
30
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/accessprotocol/structs.ts"],"names":[],"mappings":";;;AAAA,oDAA2D;AAC3D,kEAA6D;AAG7D,+CAAyC;AAEzC,IAAY,GAaX;AAbD,WAAY,GAAG;IACb,+CAAiB,CAAA;IACjB,uCAAa,CAAA;IACb,uDAAqB,CAAA;IACrB,6CAAgB,CAAA;IAChB,kEAAkE;IAClE,2DAAuB,CAAA;IACvB,2CAAe,CAAA;IACf,6CAAgB,CAAA;IAChB,mCAAW,CAAA;IACX,mDAAmB,CAAA;IACnB,yDAAsB,CAAA;IACtB,wDAAsB,CAAA;AACxB,CAAC,EAbW,GAAG,mBAAH,GAAG,QAad;AAWY,QAAA,kBAAkB,GAAG,IAAI,iBAAU,CAC9C;IACE,CAAC,KAAK,EAAE,SAAE,CAAC;IACX,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,mBAAmB,EAAE,YAAG,CAAC;IAC1B,CAAC,uBAAuB,EAAE,YAAG,CAAC;CAC/B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAoB,CAC/B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ export declare const platformId = "aptin";
3
+ export declare const platform: Platform;
4
+ export declare const configStoresKey = "configStores";
5
+ export declare const poolPositionsType = "0x3c1d4a86594d681ff7e5d5a233965daeabdc6a15fe5672ceeda5260038857183::pool::Positions";
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.poolPositionsType = exports.configStoresKey = exports.platform = exports.platformId = void 0;
4
+ exports.platformId = 'aptin';
5
+ exports.platform = {
6
+ id: exports.platformId,
7
+ name: 'Aptin',
8
+ image: 'https://sonar.watch/img/platforms/aptin.png',
9
+ defiLlamaId: 'aptin-finance', // from https://defillama.com/docs/api
10
+ website: 'https://app.aptin.io/',
11
+ twitter: 'https://twitter.com/aptinlabs',
12
+ };
13
+ exports.configStoresKey = 'configStores';
14
+ exports.poolPositionsType = '0x3c1d4a86594d681ff7e5d5a233965daeabdc6a15fe5672ceeda5260038857183::pool::Positions';
15
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aptin/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,EAAE,sCAAsC;IACpE,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,+BAA+B;CACzC,CAAC;AAEW,QAAA,eAAe,GAAG,cAAc,CAAC;AACjC,QAAA,iBAAiB,GAC5B,qFAAqF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,114 @@
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
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
+ const constants_1 = require("./constants");
18
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
19
+ const clients_1 = require("../../utils/clients");
20
+ const aptos_1 = require("../../utils/aptos");
21
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
22
+ const client = (0, clients_1.getClientAptos)();
23
+ const poolPositions = yield (0, aptos_1.getAccountResource)(client, owner, constants_1.poolPositionsType);
24
+ if (!poolPositions)
25
+ return [];
26
+ if (poolPositions.data.supply_coins.length === 0 &&
27
+ poolPositions.data.borrow_coins.length === 0)
28
+ return [];
29
+ const configStores = yield cache.getItem(constants_1.configStoresKey, {
30
+ prefix: constants_1.platformId,
31
+ networkId: portfolio_core_1.NetworkId.aptos,
32
+ });
33
+ if (!configStores)
34
+ return [];
35
+ const supplyPositions = poolPositions.data.supply_coins.length === 0
36
+ ? []
37
+ : yield (0, aptos_1.getTableItemsByKeys)(client, poolPositions.data.supply_position.handle, poolPositions.data.supply_coins, '0x1::string::String', '0x3c1d4a86594d681ff7e5d5a233965daeabdc6a15fe5672ceeda5260038857183::pool::SupplyPosition');
38
+ const borrowPositions = poolPositions.data.borrow_coins.length === 0
39
+ ? []
40
+ : yield (0, aptos_1.getTableItemsByKeys)(client, poolPositions.data.borrow_position.handle, poolPositions.data.borrow_coins, '0x1::string::String', '0x3c1d4a86594d681ff7e5d5a233965daeabdc6a15fe5672ceeda5260038857183::pool::BorrowPosition');
41
+ const borrowedAssets = [];
42
+ const borrowedYields = [];
43
+ const suppliedAssets = [];
44
+ const suppliedYields = [];
45
+ const rewardAssets = [];
46
+ const suppliedLtvs = [];
47
+ // Token prices
48
+ const tokenPricesRes = yield cache.getTokenPrices([...poolPositions.data.supply_coins, ...poolPositions.data.borrow_coins], portfolio_core_1.NetworkId.aptos);
49
+ const tokenPrices = {};
50
+ tokenPricesRes.forEach((tp) => {
51
+ if (!tp)
52
+ return;
53
+ tokenPrices[tp === null || tp === void 0 ? void 0 : tp.address] = tp;
54
+ });
55
+ for (let i = 0; i < supplyPositions.length; i++) {
56
+ const supplyPosition = supplyPositions[i];
57
+ if (!supplyPosition)
58
+ continue;
59
+ if (supplyPosition.amount === '0')
60
+ continue;
61
+ const coinType = poolPositions.data.supply_coins[i];
62
+ const address = (0, portfolio_core_1.formatTokenAddress)(coinType, portfolio_core_1.NetworkId.aptos);
63
+ const { decimals, ltv } = configStores[coinType];
64
+ const amount = new bignumber_js_1.default(supplyPosition.amount)
65
+ .div(Math.pow(10, decimals))
66
+ .toNumber();
67
+ suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(coinType, amount, portfolio_core_1.NetworkId.aptos, tokenPrices[address] || undefined));
68
+ suppliedLtvs.push(ltv);
69
+ suppliedYields.push([]);
70
+ }
71
+ for (let i = 0; i < borrowPositions.length; i++) {
72
+ const borrowPosition = borrowPositions[i];
73
+ if (!borrowPosition)
74
+ continue;
75
+ if (borrowPosition.amount === '0')
76
+ continue;
77
+ const coinType = poolPositions.data.borrow_coins[i];
78
+ const address = (0, portfolio_core_1.formatTokenAddress)(coinType, portfolio_core_1.NetworkId.aptos);
79
+ const { decimals } = configStores[coinType];
80
+ const amount = new bignumber_js_1.default(borrowPosition.amount)
81
+ .div(Math.pow(10, decimals))
82
+ .toNumber();
83
+ borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(coinType, amount, portfolio_core_1.NetworkId.aptos, tokenPrices[address] || undefined));
84
+ borrowedYields.push([]);
85
+ }
86
+ const { borrowedValue, healthRatio, suppliedValue, value } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs);
87
+ const element = {
88
+ type: portfolio_core_1.PortfolioElementType.borrowlend,
89
+ networkId: portfolio_core_1.NetworkId.solana,
90
+ platformId: constants_1.platformId,
91
+ label: 'Lending',
92
+ value,
93
+ data: {
94
+ borrowedAssets,
95
+ borrowedValue,
96
+ borrowedYields,
97
+ suppliedAssets,
98
+ suppliedValue,
99
+ suppliedYields,
100
+ collateralRatio: null,
101
+ healthRatio,
102
+ rewardAssets,
103
+ value,
104
+ },
105
+ };
106
+ return [element];
107
+ });
108
+ const fetcher = {
109
+ id: `${constants_1.platformId}-deposits`,
110
+ networkId: portfolio_core_1.NetworkId.aptos,
111
+ executor,
112
+ };
113
+ exports.default = fetcher;
114
+ //# sourceMappingURL=depositsFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aptin/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAA6E;AAO7E,qGAA6E;AAC7E,iDAAqD;AACrD,6CAA4E;AAE5E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAEhC,MAAM,aAAa,GAAG,MAAM,IAAA,0BAAkB,EAC5C,MAAM,EACN,KAAK,EACL,6BAAiB,CAClB,CAAC;IACF,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAC9B,IACE,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAC5C,aAAa,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AAC;IACF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,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"}
@@ -0,0 +1,3 @@
1
+ import { Job } from '../../Job';
2
+ declare const job: Job;
3
+ export default job;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ //
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ var __importDefault = (this && this.__importDefault) || function (mod) {
13
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14
+ };
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
17
+ const axios_1 = __importDefault(require("axios"));
18
+ const constants_1 = require("./constants");
19
+ const clients_1 = require("../../utils/clients");
20
+ const getDecimals_1 = require("../../utils/aptos/getDecimals");
21
+ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
22
+ const res = yield axios_1.default.get('https://data.aptin.io/api/config-v2');
23
+ const configStores = {};
24
+ const client = (0, clients_1.getClientAptos)();
25
+ for (let i = 0; i < res.data.configStores.length; i++) {
26
+ const configStore = res.data.configStores[i];
27
+ const decimals = yield (0, getDecimals_1.getDecimals)(client, configStore.coin_name);
28
+ if (!decimals)
29
+ continue;
30
+ configStores[configStore.coin_name] = Object.assign(Object.assign({}, configStore), { decimals });
31
+ }
32
+ yield cache.setItem(constants_1.configStoresKey, configStores, {
33
+ prefix: constants_1.platformId,
34
+ networkId: portfolio_core_1.NetworkId.aptos,
35
+ });
36
+ });
37
+ const job = {
38
+ id: `${constants_1.platformId}-deposits`,
39
+ executor,
40
+ label: 'normal',
41
+ };
42
+ exports.default = job;
43
+ //# sourceMappingURL=depositsJob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depositsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aptin/depositsJob.ts"],"names":[],"mappings":";AAAA,EAAE;;;;;;;;;;;;;;AAEF,+DAAuD;AACvD,kDAA6C;AAG7C,2CAA0D;AAE1D,iDAAqD;AACrD,+DAA4D;AAE5D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,GAAG,GAAG,MAAM,eAAK,CAAC,GAAG,CACzB,qCAAqC,CACtC,CAAC;IACF,MAAM,YAAY,GAAiB,EAAE,CAAC;IACtC,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtD,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAW,EAAC,MAAM,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;QAClE,IAAI,CAAC,QAAQ;YAAE,SAAS;QACxB,YAAY,CAAC,WAAW,CAAC,SAAS,CAAC,mCAC9B,WAAW,KACd,QAAQ,GACT,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,CAAC,OAAO,CAAC,2BAAe,EAAE,YAAY,EAAE;QACjD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,KAAK;KAC3B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function getName(accountName: string): string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getName = void 0;
4
+ function getName(accountName) {
5
+ return accountName.replace('profile', '');
6
+ }
7
+ exports.getName = getName;
8
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aptin/helpers.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,WAAmB;IACzC,OAAO,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAC5C,CAAC;AAFD,0BAEC"}
@@ -0,0 +1,6 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ import { Fetcher } from '../../Fetcher';
3
+ import { Job } from '../../Job';
4
+ export declare const platforms: Platform[];
5
+ export declare const jobs: Job[];
6
+ export declare const fetchers: Fetcher[];
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fetchers = exports.jobs = exports.platforms = void 0;
7
+ const constants_1 = require("./constants");
8
+ const depositsFetcher_1 = __importDefault(require("./depositsFetcher"));
9
+ const depositsJob_1 = __importDefault(require("./depositsJob"));
10
+ exports.platforms = [constants_1.platform];
11
+ exports.jobs = [depositsJob_1.default];
12
+ exports.fetchers = [depositsFetcher_1.default];
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aptin/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,wEAAgD;AAChD,gEAAwC;AAE3B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,qBAAW,CAAC,CAAC;AAC5B,QAAA,QAAQ,GAAc,CAAC,yBAAe,CAAC,CAAC"}
@@ -0,0 +1,70 @@
1
+ export type PoolPositions = {
2
+ borrow_coins: string[];
3
+ borrow_position: {
4
+ handle: string;
5
+ };
6
+ registered: boolean;
7
+ slot: string;
8
+ supply_coins: string[];
9
+ supply_position: {
10
+ handle: string;
11
+ };
12
+ };
13
+ export type SupplyPosition = {
14
+ amount: string;
15
+ collateral: boolean;
16
+ index_interest: string;
17
+ interest: string;
18
+ last_update_time_interest: string;
19
+ last_update_time_reward: string;
20
+ reserve1: string;
21
+ reserve2: string;
22
+ reserve3: string;
23
+ reserve4: string;
24
+ reward: string;
25
+ };
26
+ export type BorrowPosition = {
27
+ amount: string;
28
+ index_interest: string;
29
+ interest: string;
30
+ last_update_time_interest: string;
31
+ last_update_time_reward: string;
32
+ reserve1: string;
33
+ reserve2: string;
34
+ reserve3: string;
35
+ reserve4: string;
36
+ reward: string;
37
+ };
38
+ export type PoolsConfig = {
39
+ poolHandle: string;
40
+ priceHandle: string;
41
+ configStores: ConfigStore[];
42
+ borrow_interest_rateVals: BorrowInterestRateVal[];
43
+ rewardHandle: string;
44
+ rewardTokenStart: RewardTokenStart[];
45
+ coins: string[];
46
+ };
47
+ export type BorrowInterestRateVal = {
48
+ a: string;
49
+ b: string;
50
+ c: string;
51
+ ct: string;
52
+ d: string;
53
+ k: string;
54
+ reserves: string;
55
+ };
56
+ export type ConfigStores = Record<string, ConfigStore & {
57
+ decimals: number;
58
+ }>;
59
+ export type ConfigStore = {
60
+ coin_name: string;
61
+ fees: number;
62
+ ltv: number;
63
+ max_deposit_limit: string;
64
+ min_deposit_limit: string;
65
+ weight: number;
66
+ };
67
+ export type RewardTokenStart = {
68
+ coin_name: string;
69
+ start: boolean;
70
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aptin/types.ts"],"names":[],"mappings":""}