@sonarwatch/portfolio-plugins 0.11.227 → 0.11.228
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/plugins/drift/airdropFetcher.js +3 -0
- package/src/plugins/drift/airdropFetcher.js.map +1 -1
- package/src/plugins/metadao/constants.d.ts +6 -0
- package/src/plugins/metadao/constants.js +16 -0
- package/src/plugins/metadao/constants.js.map +1 -0
- package/src/plugins/metadao/index.d.ts +6 -0
- package/src/plugins/metadao/index.js +13 -0
- package/src/plugins/metadao/index.js.map +1 -0
- package/src/plugins/metadao/poolsJob.d.ts +3 -0
- package/src/plugins/metadao/poolsJob.js +98 -0
- package/src/plugins/metadao/poolsJob.js.map +1 -0
- package/src/plugins/metadao/structs.d.ts +44 -0
- package/src/plugins/metadao/structs.js +45 -0
- package/src/plugins/metadao/structs.js.map +1 -0
- package/src/plugins/metadao/vaultsJob.d.ts +3 -0
- package/src/plugins/metadao/vaultsJob.js +113 -0
- package/src/plugins/metadao/vaultsJob.js.map +1 -0
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.228](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.227...plugins-0.11.228) (2024-05-30)
|
6
|
+
|
7
|
+
|
8
|
+
|
5
9
|
## [0.11.227](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.226...plugins-0.11.227) (2024-05-30)
|
6
10
|
|
7
11
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.228",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -42,7 +42,7 @@
|
|
42
42
|
"web3-v1": "npm:web3@^1.5.0"
|
43
43
|
},
|
44
44
|
"peerDependencies": {
|
45
|
-
"@sonarwatch/portfolio-core": "0.11.
|
45
|
+
"@sonarwatch/portfolio-core": "0.11.228"
|
46
46
|
},
|
47
47
|
"main": "./src/index.js",
|
48
48
|
"types": "./src/index.d.ts"
|
package/src/index.js
CHANGED
@@ -116,6 +116,7 @@ const bonfida_1 = require("./plugins/bonfida");
|
|
116
116
|
const cropper_1 = require("./plugins/cropper");
|
117
117
|
const hedgehog_1 = require("./plugins/hedgehog");
|
118
118
|
const whalesmarket_1 = require("./plugins/whalesmarket");
|
119
|
+
const metadao_1 = require("./plugins/metadao");
|
119
120
|
var constants_1 = require("./plugins/tokens/constants");
|
120
121
|
Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
|
121
122
|
Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
|
@@ -225,6 +226,7 @@ exports.platforms = [
|
|
225
226
|
...cropper_1.platforms,
|
226
227
|
...hedgehog_1.platforms,
|
227
228
|
...whalesmarket_1.platforms,
|
229
|
+
...metadao_1.platforms,
|
228
230
|
];
|
229
231
|
// JOBS //
|
230
232
|
exports.jobs = [
|
@@ -317,6 +319,7 @@ exports.jobs = [
|
|
317
319
|
...cropper_1.jobs,
|
318
320
|
...hedgehog_1.jobs,
|
319
321
|
...whalesmarket_1.jobs,
|
322
|
+
...metadao_1.jobs,
|
320
323
|
];
|
321
324
|
// FETCHERS //
|
322
325
|
exports.fetchers = [
|
@@ -411,6 +414,7 @@ exports.fetchers = [
|
|
411
414
|
...cropper_1.fetchers,
|
412
415
|
...hedgehog_1.fetchers,
|
413
416
|
...whalesmarket_1.fetchers,
|
417
|
+
...metadao_1.fetchers,
|
414
418
|
];
|
415
419
|
exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
|
416
420
|
exports.airdropFetchers = [
|
package/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAKyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEAIsC;AACtC,uDAI+B;AAC/B,mDAI6B;AAC7B,qDAG8B;AAC9B,uDAG+B;AAC/B,2CAIyB;AACzB,6CAI0B;AAC1B,6CAG0B;AAC1B,yCAIwB;AACxB,+CAI2B;AAC3B,uDAG+B;AAC/B,yCAGwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,6CAI0B;AAC1B,+CAI2B;AAC3B,qDAG8B;AAC9B,iDAI4B;AAC5B,iDAI4B;AAC5B,mDAG6B;AAC7B,yCAIwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,+CAI2B;AAC3B,yCAIwB;AACxB,2CAIyB;AACzB,mDAI6B;AAC7B,2CAIyB;AACzB,2CAIyB;AACzB,sCAIsB;AACtB,+CAI2B;AAC3B,yCAIwB;AACxB,iDAI4B;AAC5B,yCAIwB;AACxB,mDAI6B;AAC7B,qDAI8B;AAC9B,2CAIyB;AACzB,2CAKyB;AACzB,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,2CAIyB;AACzB,uDAI+B;AAC/B,6DAIkC;AAClC,2CAIyB;AACzB,yCAIwB;AACxB,mDAI6B;AAC7B,6CAI0B;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G,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,oBAAiB;IACpB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,gBAAa;IAChB,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,uBAAoB;IACvB,GAAG,kBAAe;CACnB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,sBAAmB;IACnB,sBAAmB;CACpB,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
|
@@ -18,7 +18,10 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
|
|
18
18
|
const helpersAirdrop_1 = require("./helpersAirdrop");
|
19
19
|
const helpers_1 = require("../jupiter/helpers");
|
20
20
|
const clients_1 = require("../../utils/clients");
|
21
|
+
const claimEnds = 1723831200000;
|
21
22
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
if (Date.now() > claimEnds)
|
24
|
+
return [];
|
22
25
|
const { amount, merkle } = yield (0, helpersAirdrop_1.fetchAirdropInfo)(owner);
|
23
26
|
if (amount === 0)
|
24
27
|
return [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAA8E;AAC9E,qGAA6E;AAC7E,qDAAgE;AAChE,gDAAuD;AACvD,iDAAsD;AAEtD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,iCAAgB,EAAC,KAAK,CAAC,CAAC;IACzD,IAAI,MAAM,K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C3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
1
|
+
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAA8E;AAC9E,qGAA6E;AAC7E,qDAAgE;AAChE,gDAAuD;AACvD,iDAAsD;AAEtD,MAAM,SAAS,GAAG,aAAa,CAAC;AAChC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;QAAE,OAAO,EAAE,CAAC;IAEtC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,iCAAgB,EAAC,KAAK,CAAC,CAAC;IACzD,IAAI,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE5B,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,WAAW,GAAG,IAAA,2BAAiB,EAAC,KAAK,EAAE,MAAM,EAAE,0BAAc,CAAC,CAAC;IACrE,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IACzD,IAAI,OAAO;QAAE,OAAO,EAAE,CAAC;IAEvB,MAAM,UAAU,GAAG,qBAAS;QAC1B,CAAC,CAAC,MAAM,KAAK,CAAC,aAAa,CAAC,qBAAS,EAAE,0BAAS,CAAC,MAAM,CAAC;QACxD,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,KAAK,GAAmB,UAAU;QACtC,CAAC,CAAC,IAAA,gCAAsB,EACpB,UAAU,CAAC,OAAO,EAClB,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX;QACH,CAAC,CAAC;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE;gBACJ,MAAM;gBACN,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,IAAI;gBACX,QAAQ,EAAE,oBAAQ,CAAC,KAAK;aACzB;YACD,UAAU,EAAE;gBACV,WAAW,EAAE,2BAAU;aACxB;YACD,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,KAAK,EAAE,IAAI;SACZ,CAAC;IAEN,OAAO;QACL;YACE,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;YACD,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,SAAS;SACjB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
2
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
3
|
+
export declare const platformId = "metadao";
|
4
|
+
export declare const platform: Platform;
|
5
|
+
export declare const vaultPid: PublicKey;
|
6
|
+
export declare const ammPid: PublicKey;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ammPid = exports.vaultPid = exports.platform = exports.platformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
exports.platformId = 'metadao';
|
6
|
+
exports.platform = {
|
7
|
+
id: exports.platformId,
|
8
|
+
name: 'Metadao',
|
9
|
+
image: 'https://sonar.watch/img/platforms/metadao.webp',
|
10
|
+
// defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
11
|
+
website: 'https://futarchy.metadao.fi/',
|
12
|
+
twitter: 'https://x.com/MetaDAOProject',
|
13
|
+
};
|
14
|
+
exports.vaultPid = new web3_js_1.PublicKey('VAU1T7S5UuEHmMvXtXMVmpEoQtZ2ya7eRb7gcN47wDp');
|
15
|
+
exports.ammPid = new web3_js_1.PublicKey('AMM5G2nxuKUwCLRYTW7qqEwuoqCtNSjtbipwEmm2g8bH');
|
16
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/metadao/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,qEAAqE;IACrE,OAAO,EAAE,8BAA8B;IACvC,OAAO,EAAE,8BAA8B;CACxC,CAAC;AAEW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,6CAA6C,CAC9C,CAAC;AACW,QAAA,MAAM,GAAG,IAAI,mBAAS,CACjC,8CAA8C,CAC/C,CAAC"}
|
@@ -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 vaultsJob_1 = __importDefault(require("./vaultsJob"));
|
9
|
+
const poolsJob_1 = __importDefault(require("./poolsJob"));
|
10
|
+
exports.platforms = [constants_1.platform];
|
11
|
+
exports.jobs = [vaultsJob_1.default, poolsJob_1.default];
|
12
|
+
exports.fetchers = [];
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/metadao/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,4DAAoC;AACpC,0DAAkC;AAErB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,mBAAS,EAAE,kBAAQ,CAAC,CAAC;AACpC,QAAA,QAAQ,GAAc,EAAE,CAAC"}
|
@@ -0,0 +1,98 @@
|
|
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 clients_1 = require("../../utils/clients");
|
14
|
+
const solana_1 = require("../../utils/solana");
|
15
|
+
const filters_1 = require("../../utils/solana/filters");
|
16
|
+
const constants_1 = require("./constants");
|
17
|
+
const structs_1 = require("./structs");
|
18
|
+
const getLpTokenSourceRaw_1 = require("../../utils/misc/getLpTokenSourceRaw");
|
19
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
20
|
+
var _a, _b;
|
21
|
+
const client = (0, clients_1.getClientSolana)();
|
22
|
+
const pools = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.ammStruct, constants_1.ammPid, (0, filters_1.dataSizeFilter)(224));
|
23
|
+
const mints = new Set();
|
24
|
+
const lpMints = [];
|
25
|
+
pools.forEach((pool) => {
|
26
|
+
if (pool.baseAmount.isZero() || pool.quoteAmount.isZero())
|
27
|
+
return;
|
28
|
+
mints.add(pool.quoteMint.toString());
|
29
|
+
mints.add(pool.baseMint.toString());
|
30
|
+
lpMints.push(pool.lpMint);
|
31
|
+
});
|
32
|
+
const [tokenPriceById, lpMintsAccounts] = yield Promise.all([
|
33
|
+
cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana),
|
34
|
+
(0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.mintAccountStruct, lpMints),
|
35
|
+
]);
|
36
|
+
const lpMintAccountById = new Map();
|
37
|
+
lpMintsAccounts.forEach((acc) => {
|
38
|
+
if (acc)
|
39
|
+
lpMintAccountById.set(acc.pubkey.toString(), acc);
|
40
|
+
});
|
41
|
+
const lpTokenSource = [];
|
42
|
+
for (const pool of pools) {
|
43
|
+
const [lpMint, baseMint, quoteMint] = [
|
44
|
+
pool.lpMint.toString(),
|
45
|
+
pool.baseMint.toString(),
|
46
|
+
pool.quoteMint.toString(),
|
47
|
+
];
|
48
|
+
const [basePrice, quotePrice, lpMintAccount] = [
|
49
|
+
tokenPriceById.get(pool.baseMint.toString()),
|
50
|
+
tokenPriceById.get(pool.quoteMint.toString()),
|
51
|
+
lpMintAccountById.get(lpMint),
|
52
|
+
];
|
53
|
+
if (!basePrice || !quotePrice || !lpMintAccount)
|
54
|
+
continue;
|
55
|
+
let lpTypeName;
|
56
|
+
if ((_a = basePrice.liquidityName) === null || _a === void 0 ? void 0 : _a.startsWith('p')) {
|
57
|
+
lpTypeName = `passLP ${basePrice.liquidityName.slice(1)}`;
|
58
|
+
}
|
59
|
+
else if ((_b = basePrice.liquidityName) === null || _b === void 0 ? void 0 : _b.startsWith('f')) {
|
60
|
+
lpTypeName = `failLP ${basePrice.liquidityName.slice(1)}`;
|
61
|
+
}
|
62
|
+
lpTokenSource.push(...(0, getLpTokenSourceRaw_1.getLpTokenSourceRaw)({
|
63
|
+
lpDetails: {
|
64
|
+
address: lpMint,
|
65
|
+
decimals: lpMintAccount.decimals,
|
66
|
+
supplyRaw: lpMintAccount.supply,
|
67
|
+
},
|
68
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
69
|
+
platformId: constants_1.platformId,
|
70
|
+
poolUnderlyingsRaw: [
|
71
|
+
{
|
72
|
+
address: baseMint,
|
73
|
+
decimals: pool.baseMintDecimals,
|
74
|
+
reserveAmountRaw: pool.baseAmount,
|
75
|
+
weight: 0.5,
|
76
|
+
tokenPrice: basePrice,
|
77
|
+
},
|
78
|
+
{
|
79
|
+
address: quoteMint,
|
80
|
+
decimals: pool.quoteMintDecimals,
|
81
|
+
reserveAmountRaw: pool.quoteAmount,
|
82
|
+
weight: 0.5,
|
83
|
+
tokenPrice: quotePrice,
|
84
|
+
},
|
85
|
+
],
|
86
|
+
sourceId: pool.pubkey.toString(),
|
87
|
+
liquidityName: lpTypeName,
|
88
|
+
}));
|
89
|
+
}
|
90
|
+
yield cache.setTokenPriceSources(lpTokenSource);
|
91
|
+
});
|
92
|
+
const job = {
|
93
|
+
id: `${constants_1.platformId}-pools`,
|
94
|
+
executor,
|
95
|
+
label: 'normal',
|
96
|
+
};
|
97
|
+
exports.default = job;
|
98
|
+
//# sourceMappingURL=poolsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/metadao/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AAIzE,iDAAsD;AACtD,+CAK4B;AAC5B,wDAA4D;AAC5D,2CAAiD;AACjD,uCAAsC;AACtC,8EAA2E;AAE3E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,KAAK,GAAG,MAAM,IAAA,iCAAwB,EAC1C,MAAM,EACN,mBAAS,EACT,kBAAM,EACN,IAAA,wBAAc,EAAC,GAAG,CAAC,CACpB,CAAC;IAEF,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;oBAClB,QAAQ,EAAE,IAAI,CAAC,iBAAiB;oBAChC,gBAAgB,EAAE,IAAI,CAAC,WAAW;oBAClC,MAAM,EAAE,GAAG;oBACX,UAAU,EAAE,UAAU;iBACvB;aACF;YACD,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;YAChC,aAAa,EAAE,UAAU;SAC1B,CAAC,CACH,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC;AAClD,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@metaplex-foundation/js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export declare enum VaultStatus {
|
6
|
+
Active = 0,
|
7
|
+
Finalized = 1,
|
8
|
+
Reverted = 2
|
9
|
+
}
|
10
|
+
export type ConditionnalVault = {
|
11
|
+
buffer: Buffer;
|
12
|
+
status: VaultStatus;
|
13
|
+
settlementAuthority: PublicKey;
|
14
|
+
underlyingTokenMint: PublicKey;
|
15
|
+
underlyingTokenAccount: PublicKey;
|
16
|
+
conditionalOnFinalizeTokenMint: PublicKey;
|
17
|
+
conditionalOnRevertTokenMint: PublicKey;
|
18
|
+
pdaBump: number;
|
19
|
+
decimals: number;
|
20
|
+
};
|
21
|
+
export declare const conditionnalVaultStruct: BeetStruct<ConditionnalVault, Partial<ConditionnalVault>>;
|
22
|
+
export type TwapOracle = {
|
23
|
+
lastUpdatedSlot: BigNumber;
|
24
|
+
lastPrice: BigNumber;
|
25
|
+
lastObservation: BigNumber;
|
26
|
+
aggregator: BigNumber;
|
27
|
+
maxObservationChangePerUpdate: BigNumber;
|
28
|
+
initialObservation: BigNumber;
|
29
|
+
};
|
30
|
+
export declare const twapOracleStruct: BeetStruct<TwapOracle, Partial<TwapOracle>>;
|
31
|
+
export type Amm = {
|
32
|
+
buffer: Buffer;
|
33
|
+
bump: number;
|
34
|
+
createdAtSlot: BigNumber;
|
35
|
+
lpMint: PublicKey;
|
36
|
+
baseMint: PublicKey;
|
37
|
+
quoteMint: PublicKey;
|
38
|
+
baseMintDecimals: number;
|
39
|
+
quoteMintDecimals: number;
|
40
|
+
baseAmount: BigNumber;
|
41
|
+
quoteAmount: BigNumber;
|
42
|
+
oracle: TwapOracle;
|
43
|
+
};
|
44
|
+
export declare const ammStruct: BeetStruct<Amm, Partial<Amm>>;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ammStruct = exports.twapOracleStruct = exports.conditionnalVaultStruct = exports.VaultStatus = 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 VaultStatus;
|
8
|
+
(function (VaultStatus) {
|
9
|
+
VaultStatus[VaultStatus["Active"] = 0] = "Active";
|
10
|
+
VaultStatus[VaultStatus["Finalized"] = 1] = "Finalized";
|
11
|
+
VaultStatus[VaultStatus["Reverted"] = 2] = "Reverted";
|
12
|
+
})(VaultStatus || (exports.VaultStatus = VaultStatus = {}));
|
13
|
+
exports.conditionnalVaultStruct = new beet_1.BeetStruct([
|
14
|
+
['buffer', (0, solana_1.blob)(8)],
|
15
|
+
['status', beet_1.u8],
|
16
|
+
['settlementAuthority', beet_solana_1.publicKey],
|
17
|
+
['underlyingTokenMint', beet_solana_1.publicKey],
|
18
|
+
['underlyingTokenAccount', beet_solana_1.publicKey],
|
19
|
+
['conditionalOnFinalizeTokenMint', beet_solana_1.publicKey],
|
20
|
+
['conditionalOnRevertTokenMint', beet_solana_1.publicKey],
|
21
|
+
['pdaBump', beet_1.u8],
|
22
|
+
['decimals', beet_1.u8],
|
23
|
+
], (args) => args);
|
24
|
+
exports.twapOracleStruct = new beet_1.BeetStruct([
|
25
|
+
['lastUpdatedSlot', solana_1.u64],
|
26
|
+
['lastPrice', solana_1.u128],
|
27
|
+
['lastObservation', solana_1.u128],
|
28
|
+
['aggregator', solana_1.u128],
|
29
|
+
['maxObservationChangePerUpdate', solana_1.u128],
|
30
|
+
['initialObservation', solana_1.u128],
|
31
|
+
], (args) => args);
|
32
|
+
exports.ammStruct = new beet_1.BeetStruct([
|
33
|
+
['buffer', (0, solana_1.blob)(8)],
|
34
|
+
['bump', beet_1.u8],
|
35
|
+
['createdAtSlot', solana_1.u64],
|
36
|
+
['lpMint', beet_solana_1.publicKey],
|
37
|
+
['baseMint', beet_solana_1.publicKey],
|
38
|
+
['quoteMint', beet_solana_1.publicKey],
|
39
|
+
['baseMintDecimals', beet_1.u8],
|
40
|
+
['quoteMintDecimals', beet_1.u8],
|
41
|
+
['baseAmount', solana_1.u64],
|
42
|
+
['quoteAmount', solana_1.u64],
|
43
|
+
['oracle', exports.twapOracleStruct],
|
44
|
+
], (args) => args);
|
45
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/metadao/structs.ts"],"names":[],"mappings":";;;AAAA,oDAA2D;AAE3D,kEAA6D;AAE7D,+CAAqD;AAErD,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,iDAAM,CAAA;IACN,uDAAS,CAAA;IACT,qDAAQ,CAAA;AACV,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAcY,QAAA,uBAAuB,GAAG,IAAI,iBAAU,CACnD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,QAAQ,EAAE,SAAE,CAAC;IACd,C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+
"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 clients_1 = require("../../utils/clients");
|
14
|
+
const solana_1 = require("../../utils/solana");
|
15
|
+
const filters_1 = require("../../utils/solana/filters");
|
16
|
+
const constants_1 = require("./constants");
|
17
|
+
const structs_1 = require("./structs");
|
18
|
+
const constants_2 = require("../tokens/constants");
|
19
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
20
|
+
const client = (0, clients_1.getClientSolana)();
|
21
|
+
const vaults = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.conditionnalVaultStruct, constants_1.vaultPid, (0, filters_1.dataSizeFilter)(171));
|
22
|
+
const mints = new Set();
|
23
|
+
const tokenAccountsPkeys = [];
|
24
|
+
const passAndFailMints = [];
|
25
|
+
vaults.forEach((vault) => {
|
26
|
+
mints.add(vault.underlyingTokenMint.toString());
|
27
|
+
tokenAccountsPkeys.push(vault.underlyingTokenAccount);
|
28
|
+
passAndFailMints.push(...[
|
29
|
+
vault.conditionalOnFinalizeTokenMint,
|
30
|
+
vault.conditionalOnRevertTokenMint,
|
31
|
+
]);
|
32
|
+
});
|
33
|
+
const [tokenPriceById, tokenAccounts, passAndFailsMintAccounts, tokenList] = yield Promise.all([
|
34
|
+
cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana),
|
35
|
+
(0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, tokenAccountsPkeys),
|
36
|
+
(0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.mintAccountStruct, passAndFailMints),
|
37
|
+
cache.getItems(Array.from(mints), {
|
38
|
+
prefix: constants_2.tokenListsDetailsPrefix,
|
39
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
40
|
+
}),
|
41
|
+
]);
|
42
|
+
const tokenAccountById = new Map();
|
43
|
+
const passAndFailMintsAccountById = new Map();
|
44
|
+
tokenAccounts.forEach((account) => {
|
45
|
+
if (account)
|
46
|
+
tokenAccountById.set(account.pubkey.toString(), account);
|
47
|
+
});
|
48
|
+
passAndFailsMintAccounts.forEach((account) => {
|
49
|
+
if (account)
|
50
|
+
passAndFailMintsAccountById.set(account.pubkey.toString(), account);
|
51
|
+
});
|
52
|
+
const tokensDetailsById = new Map();
|
53
|
+
tokenList.forEach((tD) => tD ? tokensDetailsById.set(tD.address, tD) : undefined);
|
54
|
+
const tokenPriceSources = [];
|
55
|
+
for (const vault of vaults) {
|
56
|
+
const tokenPrice = tokenPriceById.get(vault.underlyingTokenMint.toString());
|
57
|
+
if (!tokenPrice)
|
58
|
+
continue;
|
59
|
+
const underlyingAccount = tokenAccountById.get(vault.underlyingTokenAccount.toString());
|
60
|
+
if (!underlyingAccount || underlyingAccount.amount.isZero())
|
61
|
+
continue;
|
62
|
+
const passMint = vault.conditionalOnFinalizeTokenMint.toString();
|
63
|
+
const failMint = vault.conditionalOnRevertTokenMint.toString();
|
64
|
+
const underlyingValue = underlyingAccount.amount
|
65
|
+
.times(tokenPrice.price)
|
66
|
+
.dividedBy(Math.pow(10, vault.decimals));
|
67
|
+
const [passMintAccount, failMintAccount] = [
|
68
|
+
passAndFailMintsAccountById.get(passMint),
|
69
|
+
passAndFailMintsAccountById.get(failMint),
|
70
|
+
];
|
71
|
+
if (!passMintAccount || !failMintAccount)
|
72
|
+
continue;
|
73
|
+
const passPrice = underlyingValue.dividedBy(passMintAccount.supply.dividedBy(Math.pow(10, passMintAccount.decimals)));
|
74
|
+
const failPrice = underlyingValue.dividedBy(failMintAccount.supply.dividedBy(Math.pow(10, failMintAccount.decimals)));
|
75
|
+
const underlyingTokenDetail = tokensDetailsById.get(vault.underlyingTokenMint.toString());
|
76
|
+
tokenPriceSources.push(...[
|
77
|
+
{
|
78
|
+
address: passMint,
|
79
|
+
decimals: passMintAccount.decimals,
|
80
|
+
id: vault.pubkey.toString(),
|
81
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
82
|
+
platformId: constants_1.platformId,
|
83
|
+
price: passPrice.toNumber(),
|
84
|
+
timestamp: Date.now(),
|
85
|
+
weight: 1,
|
86
|
+
liquidityName: underlyingTokenDetail
|
87
|
+
? `p${underlyingTokenDetail.symbol}`
|
88
|
+
: undefined,
|
89
|
+
},
|
90
|
+
{
|
91
|
+
address: failMint,
|
92
|
+
decimals: failMintAccount.decimals,
|
93
|
+
id: vault.pubkey.toString(),
|
94
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
95
|
+
platformId: constants_1.platformId,
|
96
|
+
price: failPrice.toNumber(),
|
97
|
+
timestamp: Date.now(),
|
98
|
+
weight: 1,
|
99
|
+
liquidityName: underlyingTokenDetail
|
100
|
+
? `f${underlyingTokenDetail.symbol}`
|
101
|
+
: undefined,
|
102
|
+
},
|
103
|
+
]);
|
104
|
+
}
|
105
|
+
yield cache.setTokenPriceSources(tokenPriceSources);
|
106
|
+
});
|
107
|
+
const job = {
|
108
|
+
id: `${constants_1.platformId}-vaults`,
|
109
|
+
executor,
|
110
|
+
label: 'normal',
|
111
|
+
};
|
112
|
+
exports.default = job;
|
113
|
+
//# sourceMappingURL=vaultsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"vaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/metadao/vaultsJob.ts"],"names":[],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