@sonarwatch/portfolio-plugins 0.12.177 → 0.12.179
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/index.js +12 -0
- package/src/index.js.map +1 -1
- package/src/plugins/adrena/constants.d.ts +8 -0
- package/src/plugins/adrena/constants.js +18 -0
- package/src/plugins/adrena/constants.js.map +1 -0
- package/src/plugins/adrena/custodiesJob.d.ts +3 -0
- package/src/plugins/adrena/custodiesJob.js +34 -0
- package/src/plugins/adrena/custodiesJob.js.map +1 -0
- package/src/plugins/adrena/filters.d.ts +3 -0
- package/src/plugins/adrena/filters.js +21 -0
- package/src/plugins/adrena/filters.js.map +1 -0
- package/src/plugins/adrena/helpers.d.ts +5 -0
- package/src/plugins/adrena/helpers.js +22 -0
- package/src/plugins/adrena/helpers.js.map +1 -0
- package/src/plugins/adrena/index.d.ts +6 -0
- package/src/plugins/adrena/index.js +14 -0
- package/src/plugins/adrena/index.js.map +1 -0
- package/src/plugins/adrena/positionsFetcher.d.ts +3 -0
- package/src/plugins/adrena/positionsFetcher.js +49 -0
- package/src/plugins/adrena/positionsFetcher.js.map +1 -0
- package/src/plugins/adrena/stakingFetcher.d.ts +3 -0
- package/src/plugins/adrena/stakingFetcher.js +69 -0
- package/src/plugins/adrena/stakingFetcher.js.map +1 -0
- package/src/plugins/adrena/structs.d.ts +187 -0
- package/src/plugins/adrena/structs.js +175 -0
- package/src/plugins/adrena/structs.js.map +1 -0
- package/src/plugins/adrena/types.d.ts +9 -0
- package/src/plugins/adrena/types.js +3 -0
- package/src/plugins/adrena/types.js.map +1 -0
- package/src/plugins/elemental/depositFetcher.js +0 -8
- package/src/plugins/elemental/depositFetcher.js.map +1 -1
- package/src/plugins/flash/helpers.js +16 -1
- package/src/plugins/flash/helpers.js.map +1 -1
- package/src/plugins/flash/types.d.ts +5 -0
- package/src/plugins/hawksight/positionsFetcher.js +4 -0
- package/src/plugins/hawksight/positionsFetcher.js.map +1 -1
- package/src/plugins/joule/constants.d.ts +6 -0
- package/src/plugins/joule/constants.js +16 -0
- package/src/plugins/joule/constants.js.map +1 -0
- package/src/plugins/joule/depositFetcher.d.ts +3 -0
- package/src/plugins/joule/depositFetcher.js +71 -0
- package/src/plugins/joule/depositFetcher.js.map +1 -0
- package/src/plugins/joule/index.d.ts +6 -0
- package/src/plugins/joule/index.js +13 -0
- package/src/plugins/joule/index.js.map +1 -0
- package/src/plugins/joule/marketsJob.d.ts +3 -0
- package/src/plugins/joule/marketsJob.js +33 -0
- package/src/plugins/joule/marketsJob.js.map +1 -0
- package/src/plugins/joule/structs.d.ts +19 -0
- package/src/plugins/joule/structs.js +22 -0
- package/src/plugins/joule/structs.js.map +1 -0
- package/src/plugins/joule/types.d.ts +50 -0
- package/src/plugins/joule/types.js +3 -0
- package/src/plugins/joule/types.js.map +1 -0
- package/src/plugins/jupiter/exchange/constants.d.ts +1 -0
- package/src/plugins/jupiter/exchange/constants.js +2 -1
- package/src/plugins/jupiter/exchange/constants.js.map +1 -1
- package/src/plugins/jupiter/exchange/filters.d.ts +1 -0
- package/src/plugins/jupiter/exchange/filters.js +11 -1
- package/src/plugins/jupiter/exchange/filters.js.map +1 -1
- package/src/plugins/jupiter/exchange/lockFetcher.d.ts +3 -0
- package/src/plugins/jupiter/exchange/lockFetcher.js +47 -0
- package/src/plugins/jupiter/exchange/lockFetcher.js.map +1 -0
- package/src/plugins/jupiter/exchange/structs.d.ts +19 -0
- package/src/plugins/jupiter/exchange/structs.js +19 -1
- package/src/plugins/jupiter/exchange/structs.js.map +1 -1
- package/src/plugins/jupiter/index.js +2 -0
- package/src/plugins/jupiter/index.js.map +1 -1
- package/src/plugins/meso/constants.d.ts +7 -0
- package/src/plugins/meso/constants.js +17 -0
- package/src/plugins/meso/constants.js.map +1 -0
- package/src/plugins/meso/depositFetcher.d.ts +3 -0
- package/src/plugins/meso/depositFetcher.js +93 -0
- package/src/plugins/meso/depositFetcher.js.map +1 -0
- package/src/plugins/meso/index.d.ts +6 -0
- package/src/plugins/meso/index.js +13 -0
- package/src/plugins/meso/index.js.map +1 -0
- package/src/plugins/meso/marketsJob.d.ts +3 -0
- package/src/plugins/meso/marketsJob.js +37 -0
- package/src/plugins/meso/marketsJob.js.map +1 -0
- package/src/plugins/meso/structs.d.ts +19 -0
- package/src/plugins/meso/structs.js +22 -0
- package/src/plugins/meso/structs.js.map +1 -0
- package/src/plugins/meso/types.d.ts +100 -0
- package/src/plugins/meso/types.js +9 -0
- package/src/plugins/meso/types.js.map +1 -0
- package/src/plugins/navi/collateralFetcher.js +42 -81
- package/src/plugins/navi/collateralFetcher.js.map +1 -1
- package/src/plugins/orca/getWhirlpoolPositions.js +4 -0
- package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
- package/src/utils/elementbuilder/ElementBorrowlendBuilder.js +1 -1
- package/src/utils/elementbuilder/ElementBorrowlendBuilder.js.map +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/joule/types.ts"],"names":[],"mappings":""}
|
@@ -7,6 +7,7 @@ export declare const valueAverageProgramId: PublicKey;
|
|
7
7
|
export declare const limitProgramId: PublicKey;
|
8
8
|
export declare const limitV2ProgramId: PublicKey;
|
9
9
|
export declare const dcaProgramId: PublicKey;
|
10
|
+
export declare const lockProgramId: PublicKey;
|
10
11
|
export declare const jlpPool: PublicKey;
|
11
12
|
export declare const jlpToken: PublicKey;
|
12
13
|
export declare const custodiesKey = "custodies";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.perpPoolsKey = exports.custodiesKey = exports.jlpToken = exports.jlpPool = exports.dcaProgramId = exports.limitV2ProgramId = exports.limitProgramId = exports.valueAverageProgramId = exports.perpsProgramId = exports.platform = exports.platformId = void 0;
|
3
|
+
exports.perpPoolsKey = exports.custodiesKey = exports.jlpToken = exports.jlpPool = exports.lockProgramId = exports.dcaProgramId = exports.limitV2ProgramId = exports.limitProgramId = exports.valueAverageProgramId = exports.perpsProgramId = exports.platform = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'jupiter-exchange';
|
6
6
|
exports.platform = {
|
@@ -16,6 +16,7 @@ exports.valueAverageProgramId = new web3_js_1.PublicKey('JVAp1DSLnM4Qh8qM1QasQ8x
|
|
16
16
|
exports.limitProgramId = new web3_js_1.PublicKey('jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu');
|
17
17
|
exports.limitV2ProgramId = new web3_js_1.PublicKey('j1o2qRpjcyUwEvwtcfhEQefh773ZgjxcVRry7LDqg5X');
|
18
18
|
exports.dcaProgramId = new web3_js_1.PublicKey('DCA265Vj8a9CEuX1eb1LWRnDT7uK6q1xMipnNyatn23M');
|
19
|
+
exports.lockProgramId = new web3_js_1.PublicKey('LocpQgucEQHbqNABEYvBvwoxCPsSbG91A1QaQhQQqjn');
|
19
20
|
exports.jlpPool = new web3_js_1.PublicKey('5BUwFW4nRbftYTDMbgxykoFWqWHPzahFSNAaaaJtVKsq');
|
20
21
|
exports.jlpToken = new web3_js_1.PublicKey('27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4');
|
21
22
|
exports.custodiesKey = 'custodies';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,UAAU,GAAG,kBAAkB,CAAC;AAChC,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,gDAAgD;IACvD,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,qBAAqB,GAAG,IAAI,mBAAS,CAChD,6CAA6C,CAC9C,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,gBAAgB,GAAG,IAAI,mBAAS,CAC3C,6CAA6C,CAC9C,CAAC;AACW,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,8CAA8C,CAC/C,CAAC;AACW,QAAA,YAAY,GAAG,WAAW,CAAC;AAC3B,QAAA,YAAY,GAAG,WAAW,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,UAAU,GAAG,kBAAkB,CAAC;AAChC,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,gDAAgD;IACvD,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,qCAAqC;CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,qBAAqB,GAAG,IAAI,mBAAS,CAChD,6CAA6C,CAC9C,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,gBAAgB,GAAG,IAAI,mBAAS,CAC3C,6CAA6C,CAC9C,CAAC;AACW,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,8CAA8C,CAC/C,CAAC;AACW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,8CAA8C,CAC/C,CAAC;AACW,QAAA,YAAY,GAAG,WAAW,CAAC;AAC3B,QAAA,YAAY,GAAG,WAAW,CAAC"}
|
@@ -2,3 +2,4 @@ import { GetProgramAccountsFilter } from '@solana/web3.js';
|
|
2
2
|
export declare const limitFilters: (owner: string) => GetProgramAccountsFilter[];
|
3
3
|
export declare const DCAFilters: (owner: string) => GetProgramAccountsFilter[];
|
4
4
|
export declare const valueAverageFilters: (owner: string) => GetProgramAccountsFilter[];
|
5
|
+
export declare const lockFilters: (owner: string) => GetProgramAccountsFilter[];
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.valueAverageFilters = exports.DCAFilters = exports.limitFilters = void 0;
|
3
|
+
exports.lockFilters = exports.valueAverageFilters = exports.DCAFilters = exports.limitFilters = void 0;
|
4
4
|
const structs_1 = require("./structs");
|
5
5
|
const limitFilters = (owner) => [
|
6
6
|
{
|
@@ -37,4 +37,14 @@ const valueAverageFilters = (owner) => [
|
|
37
37
|
{ dataSize: 339 },
|
38
38
|
];
|
39
39
|
exports.valueAverageFilters = valueAverageFilters;
|
40
|
+
const lockFilters = (owner) => [
|
41
|
+
{
|
42
|
+
memcmp: {
|
43
|
+
offset: 8,
|
44
|
+
bytes: owner,
|
45
|
+
},
|
46
|
+
},
|
47
|
+
{ dataSize: 296 },
|
48
|
+
];
|
49
|
+
exports.lockFilters = lockFilters;
|
40
50
|
//# sourceMappingURL=filters.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/filters.ts"],"names":[],"mappings":";;;AACA,uCAAsC;AAE/B,MAAM,YAAY,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,aAAa;SACrB;KACF;IACD;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;CACF,CAAC;AAbW,QAAA,YAAY,gBAavB;AAEK,MAAM,UAAU,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACvE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,mBAAS,CAAC,QAAQ,EAAE;CACjC,CAAC;AARW,QAAA,UAAU,cAQrB;AAEK,MAAM,mBAAmB,GAAG,CACjC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,mBAAmB,uBAU9B"}
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/filters.ts"],"names":[],"mappings":";;;AACA,uCAAsC;AAE/B,MAAM,YAAY,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,aAAa;SACrB;KACF;IACD;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;CACF,CAAC;AAbW,QAAA,YAAY,gBAavB;AAEK,MAAM,UAAU,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACvE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,mBAAS,CAAC,QAAQ,EAAE;CACjC,CAAC;AARW,QAAA,UAAU,cAQrB;AAEK,MAAM,mBAAmB,GAAG,CACjC,KAAa,EACe,EAAE,CAAC;IAC/B;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AAVW,QAAA,mBAAmB,uBAU9B;AAEK,MAAM,WAAW,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACxE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AARW,QAAA,WAAW,eAQtB"}
|
@@ -0,0 +1,47 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const constants_1 = require("./constants");
|
14
|
+
const clients_1 = require("../../../utils/clients");
|
15
|
+
const solana_1 = require("../../../utils/solana");
|
16
|
+
const structs_1 = require("./structs");
|
17
|
+
const filters_1 = require("./filters");
|
18
|
+
const ElementRegistry_1 = require("../../../utils/elementbuilder/ElementRegistry");
|
19
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
20
|
+
const client = (0, clients_1.getClientSolana)();
|
21
|
+
const vestingEscrowAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.vestingEscrowStruct, constants_1.lockProgramId, (0, filters_1.lockFilters)(owner));
|
22
|
+
if (vestingEscrowAccounts.length === 0)
|
23
|
+
return [];
|
24
|
+
const registry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
25
|
+
const element = registry.addElementMultiple({
|
26
|
+
label: 'Vesting',
|
27
|
+
name: 'lock',
|
28
|
+
});
|
29
|
+
for (const lock of vestingEscrowAccounts) {
|
30
|
+
const endTime = lock.vestingStartTime.plus(lock.numberOfPeriod.times(lock.frequency));
|
31
|
+
element.addAsset({
|
32
|
+
address: lock.tokenMint,
|
33
|
+
amount: lock.amountPerPeriod
|
34
|
+
.times(lock.numberOfPeriod)
|
35
|
+
.minus(lock.totalClaimedAmount),
|
36
|
+
attributes: { lockedUntil: endTime.toNumber() },
|
37
|
+
});
|
38
|
+
}
|
39
|
+
return registry.getElements(cache);
|
40
|
+
});
|
41
|
+
const fetcher = {
|
42
|
+
id: `${constants_1.platformId}-lock`,
|
43
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
44
|
+
executor,
|
45
|
+
};
|
46
|
+
exports.default = fetcher;
|
47
|
+
//# sourceMappingURL=lockFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"lockFetcher.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/lockFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAwD;AACxD,oDAAyD;AACzD,kDAAiE;AACjE,uCAAgD;AAChD,uCAAwC;AACxC,mFAAgF;AAEhF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,qBAAqB,GAAG,MAAM,IAAA,iCAAwB,EAC1D,MAAM,EACN,6BAAmB,EACnB,yBAAa,EACb,IAAA,qBAAW,EAAC,KAAK,CAAC,CACnB,CAAC;IACF,IAAI,qBAAqB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAElD,MAAM,QAAQ,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IACnE,MAAM,OAAO,GAAG,QAAQ,CAAC,kBAAkB,CAAC;QAC1C,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,MAAM;KACb,CAAC,CAAC;IAEH,KAAK,MAAM,IAAI,IAAI,qBAAqB,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CACxC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAC1C,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,MAAM,EAAE,IAAI,CAAC,eAAe;iBACzB,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC;iBAC1B,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC;YACjC,UAAU,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -95,6 +95,25 @@ export type ValueAverage = {
|
|
95
95
|
outBalanceBeforeSwap: BigNumber;
|
96
96
|
};
|
97
97
|
export declare const valueAverageStruct: BeetStruct<ValueAverage, Partial<ValueAverage>>;
|
98
|
+
export type VestingEscrow = {
|
99
|
+
buffer: Buffer;
|
100
|
+
recipient: PublicKey;
|
101
|
+
tokenMint: PublicKey;
|
102
|
+
creator: PublicKey;
|
103
|
+
base: PublicKey;
|
104
|
+
escrowBump: number;
|
105
|
+
updateRecipientMode: number;
|
106
|
+
padding0: number[];
|
107
|
+
cliffTime: BigNumber;
|
108
|
+
frequency: BigNumber;
|
109
|
+
cliffUnlockAmount: BigNumber;
|
110
|
+
amountPerPeriod: BigNumber;
|
111
|
+
numberOfPeriod: BigNumber;
|
112
|
+
totalClaimedAmount: BigNumber;
|
113
|
+
vestingStartTime: BigNumber;
|
114
|
+
padding: BigNumber[];
|
115
|
+
};
|
116
|
+
export declare const vestingEscrowStruct: BeetStruct<VestingEscrow, Partial<VestingEscrow>>;
|
98
117
|
export type Limit = {
|
99
118
|
maxAumUsd: BigNumber;
|
100
119
|
maxIndividualLpToken: BigNumber;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.positionStruct = exports.Side = exports.custodyStruct = exports.fundingRateStateStruct = exports.assetsStruct = exports.permissionsStruct = exports.pricingParamsStruct = exports.oracleParamsStruct = exports.OracleType = exports.perpetualPoolStruct = exports.feesStruct = exports.poolAprStruct = exports.limitStruct = exports.valueAverageStruct = exports.dcaStruct = exports.limitOrderV2Struct = exports.limitOrderStruct = void 0;
|
3
|
+
exports.positionStruct = exports.Side = exports.custodyStruct = exports.fundingRateStateStruct = exports.assetsStruct = exports.permissionsStruct = exports.pricingParamsStruct = exports.oracleParamsStruct = exports.OracleType = exports.perpetualPoolStruct = exports.feesStruct = exports.poolAprStruct = exports.limitStruct = exports.vestingEscrowStruct = exports.valueAverageStruct = exports.dcaStruct = exports.limitOrderV2Struct = exports.limitOrderStruct = void 0;
|
4
4
|
const beet_1 = require("@metaplex-foundation/beet");
|
5
5
|
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
6
|
const solana_1 = require("../../../utils/solana");
|
@@ -93,6 +93,24 @@ exports.valueAverageStruct = new beet_1.BeetStruct([
|
|
93
93
|
['nextOrderAt', solana_1.i64],
|
94
94
|
['outBalanceBeforeSwap', solana_1.u64],
|
95
95
|
], (args) => args);
|
96
|
+
exports.vestingEscrowStruct = new beet_1.BeetStruct([
|
97
|
+
['buffer', (0, solana_1.blob)(8)],
|
98
|
+
['recipient', beet_solana_1.publicKey],
|
99
|
+
['tokenMint', beet_solana_1.publicKey],
|
100
|
+
['creator', beet_solana_1.publicKey],
|
101
|
+
['base', beet_solana_1.publicKey],
|
102
|
+
['escrowBump', beet_1.u8],
|
103
|
+
['updateRecipientMode', beet_1.u8],
|
104
|
+
['padding0', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 6)],
|
105
|
+
['cliffTime', solana_1.u64],
|
106
|
+
['frequency', solana_1.u64],
|
107
|
+
['cliffUnlockAmount', solana_1.u64],
|
108
|
+
['amountPerPeriod', solana_1.u64],
|
109
|
+
['numberOfPeriod', solana_1.u64],
|
110
|
+
['totalClaimedAmount', solana_1.u64],
|
111
|
+
['vestingStartTime', solana_1.u64],
|
112
|
+
['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u128, 6)],
|
113
|
+
], (args) => args);
|
96
114
|
exports.limitStruct = new beet_1.BeetStruct([
|
97
115
|
['maxAumUsd', solana_1.u128],
|
98
116
|
['maxIndividualLpToken', solana_1.u128],
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/structs.ts"],"names":[],"mappings":";;;AAAA,oDAQmC;AACnC,kEAA6D;AAG7D,kDAA6D;AAqBhD,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,SAAS,E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,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,4BAA4B,EAAE,aAAI,CAAC;IACpC,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,MAAM,EAAE,SAAE,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC"}
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/structs.ts"],"names":[],"mappings":";;;AAAA,oDAQmC;AACnC,kEAA6D;AAG7D,kDAA6D;AAqBhD,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,SAAS,EAAE,WAAI,CAAC;IACjB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,oBAAoB,EAAE,uBAAS,CAAC;IACjC,CAAC,SAAS,EAAE,u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,EAAE,YAAG,CAAC;IACvB,CAAC,QAAQ,EAAE,oBAAY,CAAC;IACxB,CAAC,kBAAkB,EAAE,8BAAsB,CAAC;IAC5C,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,kBAAkB,EAAE,SAAE,CAAC;IACxB,CAAC,SAAS,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;CACrB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAe,CAC1B,CAAC;AAEF,IAAY,IAIX;AAJD,WAAY,IAAI;IACd,+BAAI,CAAA;IACJ,+BAAI,CAAA;IACJ,iCAAK,CAAA;AACP,CAAC,EAJW,IAAI,oBAAJ,IAAI,QAIf;AAoBY,QAAA,cAAc,GAAG,IAAI,iBAAU,CAC1C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,mBAAmB,EAAE,uBAAS,CAAC;IAChC,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,4BAA4B,EAAE,aAAI,CAAC;IACpC,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,MAAM,EAAE,SAAE,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC"}
|
@@ -8,6 +8,7 @@ const perpetualFetcher_1 = __importDefault(require("./exchange/perpetualFetcher"
|
|
8
8
|
const valueAverageFetcher_1 = __importDefault(require("./exchange/valueAverageFetcher"));
|
9
9
|
const limitFetcher_1 = __importDefault(require("./exchange/limitFetcher"));
|
10
10
|
const dcaFetcher_1 = __importDefault(require("./exchange/dcaFetcher"));
|
11
|
+
const lockFetcher_1 = __importDefault(require("./exchange/lockFetcher"));
|
11
12
|
const custodiesJob_1 = __importDefault(require("./exchange/custodiesJob"));
|
12
13
|
const constants_1 = require("./launchpad/constants");
|
13
14
|
const voteFetcher_1 = __importDefault(require("./governance/voteFetcher"));
|
@@ -27,6 +28,7 @@ exports.fetchers = [
|
|
27
28
|
valueAverageFetcher_1.default,
|
28
29
|
limitFetcher_1.default,
|
29
30
|
dcaFetcher_1.default,
|
31
|
+
lockFetcher_1.default,
|
30
32
|
voteFetcher_1.default,
|
31
33
|
asrAirdropFetcher_1.fetcher,
|
32
34
|
...launchpad_1.lfgFetchers,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/index.ts"],"names":[],"mappings":";;;;;;AAGA,mFAA2D;AAC3D,yFAAiE;AACjE,2EAAmD;AACnD,uEAA+C;AAC/C,2EAAmD;AAEnD,qDAAsE;AACtE,2EAAmD;AACnD,sDAAwE;AACxE,8DAAsC;AACtC,oDAAoE;AAEpE,sEAGwC;AACxC,2CAA8D;AAEjD,QAAA,SAAS,GAAe;IACnC,oBAAiB;IACjB,oBAAkB;IAClB,oBAAgB;CACjB,CAAC;AACW,QAAA,IAAI,GAAU,CAAC,sBAAY,EAAE,oBAAU,CAAC,CAAC;AACzC,QAAA,QAAQ,GAAc;IACjC,0BAAgB;IAChB,6BAAmB;IACnB,sBAAY;IACZ,oBAAU;IACV,qBAAW;IACX,2BAAU;IACV,GAAG,uBAAW;CACf,CAAC;AACW,QAAA,eAAe,GAAqB;IAC/C,kCAAiB;IACjB,GAAG,8BAAkB;CACtB,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/index.ts"],"names":[],"mappings":";;;;;;AAGA,mFAA2D;AAC3D,yFAAiE;AACjE,2EAAmD;AACnD,uEAA+C;AAC/C,yEAAiD;AACjD,2EAAmD;AAEnD,qDAAsE;AACtE,2EAAmD;AACnD,sDAAwE;AACxE,8DAAsC;AACtC,oDAAoE;AAEpE,sEAGwC;AACxC,2CAA8D;AAEjD,QAAA,SAAS,GAAe;IACnC,oBAAiB;IACjB,oBAAkB;IAClB,oBAAgB;CACjB,CAAC;AACW,QAAA,IAAI,GAAU,CAAC,sBAAY,EAAE,oBAAU,CAAC,CAAC;AACzC,QAAA,QAAQ,GAAc;IACjC,0BAAgB;IAChB,6BAAmB;IACnB,sBAAY;IACZ,oBAAU;IACV,qBAAW;IACX,qBAAW;IACX,2BAAU;IACV,GAAG,uBAAW;CACf,CAAC;AACW,QAAA,eAAe,GAAqB;IAC/C,kCAAiB;IACjB,GAAG,8BAAkB;CACtB,CAAC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
export declare const platformId = "meso";
|
3
|
+
export declare const platform: Platform;
|
4
|
+
export declare const marketsCacheKey = "markets";
|
5
|
+
export declare const userPositionType = "0x68476f9d437e3f32fd262ba898b5e3ee0a23a1d586a6cf29a28add35f253f6f7::lending_pool::UserPosition";
|
6
|
+
export declare const lendingPoolType = "0x68476f9d437e3f32fd262ba898b5e3ee0a23a1d586a6cf29a28add35f253f6f7::lending_pool::LendingPool";
|
7
|
+
export declare const poolsApi = "https://api.meso.finance/api/v1/pool?page=1&limit=1000";
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.poolsApi = exports.lendingPoolType = exports.userPositionType = exports.marketsCacheKey = exports.platform = exports.platformId = void 0;
|
4
|
+
exports.platformId = 'meso';
|
5
|
+
exports.platform = {
|
6
|
+
id: exports.platformId,
|
7
|
+
name: 'Meso',
|
8
|
+
image: 'https://sonar.watch/img/platforms/meso.webp',
|
9
|
+
website: 'https://app.meso.finance/',
|
10
|
+
twitter: 'https://x.com/Meso_Finance',
|
11
|
+
defiLlamaId: 'meso-finance', // from https://defillama.com/docs/api
|
12
|
+
};
|
13
|
+
exports.marketsCacheKey = `markets`;
|
14
|
+
exports.userPositionType = '0x68476f9d437e3f32fd262ba898b5e3ee0a23a1d586a6cf29a28add35f253f6f7::lending_pool::UserPosition';
|
15
|
+
exports.lendingPoolType = '0x68476f9d437e3f32fd262ba898b5e3ee0a23a1d586a6cf29a28add35f253f6f7::lending_pool::LendingPool';
|
16
|
+
exports.poolsApi = 'https://api.meso.finance/api/v1/pool?page=1&limit=1000';
|
17
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meso/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,6CAA6C;IACpD,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,4BAA4B;IACrC,WAAW,EAAE,cAAc,EAAE,sCAAsC;CACpE,CAAC;AAEW,QAAA,eAAe,GAAG,SAAS,CAAC;AAC5B,QAAA,gBAAgB,GAC3B,gGAAgG,CAAC;AACtF,QAAA,eAAe,GAC1B,+FAA+F,CAAC;AACrF,QAAA,QAAQ,GACnB,wDAAwD,CAAC"}
|
@@ -0,0 +1,93 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const constants_1 = require("./constants");
|
14
|
+
const aptos_1 = require("../../utils/aptos");
|
15
|
+
const clients_1 = require("../../utils/clients");
|
16
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
17
|
+
const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
|
18
|
+
const poolsMemo = new MemoizedCache_1.MemoizedCache(constants_1.marketsCacheKey, {
|
19
|
+
prefix: constants_1.platformId,
|
20
|
+
networkId: portfolio_core_1.NetworkId.aptos,
|
21
|
+
});
|
22
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const client = (0, clients_1.getClientAptos)();
|
24
|
+
const userPosition = yield (0, aptos_1.getAccountResource)(client, owner, constants_1.userPositionType);
|
25
|
+
if (!userPosition)
|
26
|
+
return [];
|
27
|
+
const poolsData = yield poolsMemo.getItem(cache);
|
28
|
+
let lendingPools;
|
29
|
+
const tokenByInner = new Map();
|
30
|
+
const poolDataByInner = new Map();
|
31
|
+
if (!poolsData) {
|
32
|
+
lendingPools = yield Promise.all([
|
33
|
+
...userPosition.debt_shares.data.map((debt) => (0, aptos_1.getAccountResource)(client, debt.key.inner, constants_1.lendingPoolType)),
|
34
|
+
...userPosition.deposit_shares.data.map((dep) => (0, aptos_1.getAccountResource)(client, dep.key.inner, constants_1.lendingPoolType)),
|
35
|
+
]);
|
36
|
+
lendingPools.forEach((lP) => {
|
37
|
+
if (lP) {
|
38
|
+
tokenByInner.set(lP.extend_ref.self, lP.token);
|
39
|
+
}
|
40
|
+
});
|
41
|
+
}
|
42
|
+
else {
|
43
|
+
poolsData.forEach((pD) => poolDataByInner.set(pD.poolAddress, pD));
|
44
|
+
}
|
45
|
+
const registry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.aptos, constants_1.platformId);
|
46
|
+
const element = registry.addElementBorrowlend({
|
47
|
+
label: 'Lending',
|
48
|
+
});
|
49
|
+
for (const lendingPos of userPosition.deposit_shares.data) {
|
50
|
+
const poolData = poolDataByInner.get(lendingPos.key.inner);
|
51
|
+
const address = (poolData === null || poolData === void 0 ? void 0 : poolData.token) || tokenByInner.get(lendingPos.key.inner);
|
52
|
+
if (!address)
|
53
|
+
continue;
|
54
|
+
element.addSuppliedAsset({
|
55
|
+
address,
|
56
|
+
amount: Number(lendingPos.value),
|
57
|
+
});
|
58
|
+
if (!poolData)
|
59
|
+
continue;
|
60
|
+
element.addSuppliedYield([
|
61
|
+
{
|
62
|
+
apr: (0, portfolio_core_1.apyToApr)(poolData.depositApy / 100),
|
63
|
+
apy: poolData.depositApy / 100,
|
64
|
+
},
|
65
|
+
]);
|
66
|
+
}
|
67
|
+
for (const borrowPos of userPosition.debt_shares.data) {
|
68
|
+
const poolData = poolDataByInner.get(borrowPos.key.inner);
|
69
|
+
const address = (poolData === null || poolData === void 0 ? void 0 : poolData.token) || tokenByInner.get(borrowPos.key.inner);
|
70
|
+
if (!address)
|
71
|
+
continue;
|
72
|
+
element.addBorrowedAsset({
|
73
|
+
address,
|
74
|
+
amount: Number(borrowPos.value),
|
75
|
+
});
|
76
|
+
if (!poolData)
|
77
|
+
continue;
|
78
|
+
element.addBorrowedYield([
|
79
|
+
{
|
80
|
+
apr: (0, portfolio_core_1.apyToApr)(poolData.borrowApy / 100),
|
81
|
+
apy: poolData.borrowApy / 100,
|
82
|
+
},
|
83
|
+
]);
|
84
|
+
}
|
85
|
+
return registry.getElements(cache);
|
86
|
+
});
|
87
|
+
const fetcher = {
|
88
|
+
id: `${constants_1.platformId}-deposits`,
|
89
|
+
networkId: portfolio_core_1.NetworkId.aptos,
|
90
|
+
executor,
|
91
|
+
};
|
92
|
+
exports.default = fetcher;
|
93
|
+
//# sourceMappingURL=depositFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meso/depositFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAiE;AAGjE,2CAKqB;AAErB,6CAAuD;AACvD,iDAAqD;AACrD,gFAA6E;AAC7E,kEAA+D;AAE/D,MAAM,SAAS,GAAG,IAAI,6BAAa,CAAa,2BAAe,EAAE;IAC/D,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,KAAK;CAC3B,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAEhC,MAAM,YAAY,GAAG,MAAM,IAAA,0BAAkB,EAC3C,MAAM,EACN,KAAK,EACL,4BAAgB,CACjB,CAAC;IACF,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAE7B,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACjD,IAAI,YAAY,CAAC;IACjB,MAAM,YAAY,GAAwB,IAAI,GAAG,EAAE,CAAC;IACpD,MAAM,eAAe,GAA0B,IAAI,GAAG,EAAE,CAAC;IAEzD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,YAAY,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC/B,GAAG,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAC5C,IAAA,0BAAkB,EAAc,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,2BAAe,CAAC,CACzE;YACD,GAAG,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,C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|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const marketsJob_1 = __importDefault(require("./marketsJob"));
|
9
|
+
const depositFetcher_1 = __importDefault(require("./depositFetcher"));
|
10
|
+
exports.platforms = [constants_1.platform];
|
11
|
+
exports.jobs = [marketsJob_1.default];
|
12
|
+
exports.fetchers = [depositFetcher_1.default];
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meso/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,8DAAsC;AACtC,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,oBAAU,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
|
@@ -0,0 +1,37 @@
|
|
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 axios_1 = __importDefault(require("axios"));
|
16
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
|
+
const constants_1 = require("./constants");
|
18
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
const pools = yield axios_1.default.get(constants_1.poolsApi);
|
20
|
+
const poolsData = pools.data.datas.map((pool) => ({
|
21
|
+
borrowApy: pool.borrowApy,
|
22
|
+
depositApy: pool.supplyApy,
|
23
|
+
poolAddress: pool.poolAddress,
|
24
|
+
token: pool.tokenAddress,
|
25
|
+
}));
|
26
|
+
yield cache.setItem(constants_1.marketsCacheKey, poolsData, {
|
27
|
+
prefix: constants_1.platformId,
|
28
|
+
networkId: portfolio_core_1.NetworkId.aptos,
|
29
|
+
});
|
30
|
+
});
|
31
|
+
const job = {
|
32
|
+
id: `${constants_1.platformId}-markets`,
|
33
|
+
executor,
|
34
|
+
label: 'normal',
|
35
|
+
};
|
36
|
+
exports.default = job;
|
37
|
+
//# sourceMappingURL=marketsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meso/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,+DAAuD;AAGvD,2CAAoE;AAGpE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,KAAK,GAAmC,MAAM,eAAK,CAAC,GAAG,CAAC,oBAAQ,CAAC,CAAC;IAExE,MAAM,SAAS,GAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC5D,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,UAAU,EAAE,IAAI,CAAC,SAAS;QAC1B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,KAAK,EAAE,IAAI,CAAC,YAAY;KACzB,CAAC,CAAC,CAAC;IAEJ,MAAM,KAAK,CAAC,OAAO,CAAC,2BAAe,EAAE,SAAS,EAAE;QAC9C,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,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export declare enum State {
|
6
|
+
Uninitialized = 0,
|
7
|
+
StakePool = 1,
|
8
|
+
InactiveStakePool = 2,
|
9
|
+
StakeAccount = 3
|
10
|
+
}
|
11
|
+
export type Liquidity = {
|
12
|
+
buffer: Buffer;
|
13
|
+
state: State;
|
14
|
+
mint: PublicKey;
|
15
|
+
owner: PublicKey;
|
16
|
+
amountDeposited: BigNumber;
|
17
|
+
space: number[];
|
18
|
+
};
|
19
|
+
export declare const liquidityStruct: BeetStruct<Liquidity, Partial<Liquidity>>;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.liquidityStruct = exports.State = 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 State;
|
8
|
+
(function (State) {
|
9
|
+
State[State["Uninitialized"] = 0] = "Uninitialized";
|
10
|
+
State[State["StakePool"] = 1] = "StakePool";
|
11
|
+
State[State["InactiveStakePool"] = 2] = "InactiveStakePool";
|
12
|
+
State[State["StakeAccount"] = 3] = "StakeAccount";
|
13
|
+
})(State || (exports.State = State = {}));
|
14
|
+
exports.liquidityStruct = new beet_1.BeetStruct([
|
15
|
+
['buffer', (0, solana_1.blob)(8)],
|
16
|
+
['state', beet_1.u8],
|
17
|
+
['mint', beet_solana_1.publicKey],
|
18
|
+
['owner', beet_solana_1.publicKey],
|
19
|
+
['amountDeposited', solana_1.u64],
|
20
|
+
['space', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 128)],
|
21
|
+
], (args) => args);
|
22
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meso/structs.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AACnC,kEAA6D;AAG7D,+CAA+C;AAE/C,IAAY,KAKX;AALD,WAAY,KAAK;IACf,mDAAa,CAAA;IACb,2CAAS,CAAA;IACT,2DAAiB,CAAA;IACjB,iDAAY,CAAA;AACd,CAAC,EALW,KAAK,qBAAL,KAAK,QAKhB;AAWY,QAAA,eAAe,GAAG,IAAI,iBAAU,CAC3C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,SAAE,CAAC;IACb,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,OAAO,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,GAAG,CAAC,CAAC;CAC1C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC"}
|
@@ -0,0 +1,100 @@
|
|
1
|
+
export type UserPosition = {
|
2
|
+
debt_shares: ShareData;
|
3
|
+
deposit_shares: ShareData;
|
4
|
+
emode_id: string;
|
5
|
+
};
|
6
|
+
export type ShareData = {
|
7
|
+
data: ShareInfo[];
|
8
|
+
};
|
9
|
+
export type ShareInfo = {
|
10
|
+
key: Key;
|
11
|
+
value: string;
|
12
|
+
};
|
13
|
+
export type Key = {
|
14
|
+
inner: string;
|
15
|
+
};
|
16
|
+
export type LendingPool = {
|
17
|
+
borrow_rewards_pool: BorrowRewardsPool;
|
18
|
+
emode_id: string;
|
19
|
+
extend_ref: ExtendRef;
|
20
|
+
fungible_asset: BorrowRewardsPool;
|
21
|
+
supply_rewards_pool: BorrowRewardsPool;
|
22
|
+
token: string;
|
23
|
+
};
|
24
|
+
export type BorrowRewardsPool = {
|
25
|
+
inner: string;
|
26
|
+
};
|
27
|
+
export type ExtendRef = {
|
28
|
+
self: string;
|
29
|
+
};
|
30
|
+
export type PoolApiResponse = {
|
31
|
+
datas: Pool[];
|
32
|
+
total: number;
|
33
|
+
totalPages: number;
|
34
|
+
};
|
35
|
+
export type Pool = {
|
36
|
+
_id: string;
|
37
|
+
poolAddress: string;
|
38
|
+
__v: number;
|
39
|
+
baseBps: number;
|
40
|
+
borrowApy: number;
|
41
|
+
borrowCap: number;
|
42
|
+
borrowFeeBps: number;
|
43
|
+
borrowRewardsPool: string;
|
44
|
+
closeFactorBps: number;
|
45
|
+
createdAt: Date;
|
46
|
+
emodeBps: number;
|
47
|
+
emodeId: string;
|
48
|
+
emodeLiquidationThresholdBps: number;
|
49
|
+
fungibleAsset: string;
|
50
|
+
incentiveBorrowApy: number;
|
51
|
+
incentiveSupplyApy: number;
|
52
|
+
isPaused: boolean;
|
53
|
+
liquidationFeeBps: number;
|
54
|
+
liquidationThresholdBps: number;
|
55
|
+
maxBps: number;
|
56
|
+
normaBps: number;
|
57
|
+
optimalBps: number;
|
58
|
+
optimalUtilizationBps: number;
|
59
|
+
poolSupply: number;
|
60
|
+
protocolInterestFeeBps: number;
|
61
|
+
protocolLiquidationFeeBps: number;
|
62
|
+
supplyApy: number;
|
63
|
+
supplyCap: number;
|
64
|
+
supplyRewardsPool: string;
|
65
|
+
token: Token;
|
66
|
+
tokenAddress: string;
|
67
|
+
totalDebt: number;
|
68
|
+
totalDebtShares: number;
|
69
|
+
totalFees: number;
|
70
|
+
totalReserves: number;
|
71
|
+
totalSupplyShares: number;
|
72
|
+
updatedAt: Date;
|
73
|
+
stakingApr: number;
|
74
|
+
orderValue?: number;
|
75
|
+
};
|
76
|
+
export type Token = {
|
77
|
+
_id: string;
|
78
|
+
symbol: string;
|
79
|
+
name: string;
|
80
|
+
address: string;
|
81
|
+
decimals: number;
|
82
|
+
type: Type;
|
83
|
+
wrapAddress: string;
|
84
|
+
createdAt: Date;
|
85
|
+
updatedAt: Date;
|
86
|
+
__v: number;
|
87
|
+
price: number;
|
88
|
+
icon_uri?: string;
|
89
|
+
project_uri?: string;
|
90
|
+
};
|
91
|
+
export declare enum Type {
|
92
|
+
Coin = "COIN",
|
93
|
+
FungibleAsset = "FUNGIBLE_ASSET"
|
94
|
+
}
|
95
|
+
export type PoolData = {
|
96
|
+
borrowApy: number;
|
97
|
+
depositApy: number;
|
98
|
+
poolAddress: string;
|
99
|
+
token: string;
|
100
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Type = void 0;
|
4
|
+
var Type;
|
5
|
+
(function (Type) {
|
6
|
+
Type["Coin"] = "COIN";
|
7
|
+
Type["FungibleAsset"] = "FUNGIBLE_ASSET";
|
8
|
+
})(Type || (exports.Type = Type = {}));
|
9
|
+
//# sourceMappingURL=types.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/meso/types.ts"],"names":[],"mappings":";;;AAoGA,IAAY,IAGX;AAHD,WAAY,IAAI;IACd,qBAAa,CAAA;IACb,wCAAgC,CAAA;AAClC,CAAC,EAHW,IAAI,oBAAJ,IAAI,QAGf"}
|