@sonarwatch/portfolio-plugins 0.11.191 → 0.11.193
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +9 -1
- package/package.json +2 -2
- package/src/index.js +5 -0
- package/src/index.js.map +1 -1
- package/src/orphanPlatorms.js +0 -8
- package/src/orphanPlatorms.js.map +1 -1
- package/src/plugins/aftermath/constants.d.ts +2 -0
- package/src/plugins/aftermath/constants.js +3 -1
- package/src/plugins/aftermath/constants.js.map +1 -1
- package/src/plugins/aftermath/index.js +2 -1
- package/src/plugins/aftermath/index.js.map +1 -1
- package/src/plugins/aftermath/stakingFetcher.d.ts +3 -0
- package/src/plugins/aftermath/stakingFetcher.js +102 -0
- package/src/plugins/aftermath/stakingFetcher.js.map +1 -0
- package/src/plugins/aftermath/types.d.ts +17 -0
- package/src/plugins/drift/airdropFetcher.d.ts +3 -0
- package/src/plugins/drift/airdropFetcher.js +79 -0
- package/src/plugins/drift/airdropFetcher.js.map +1 -0
- package/src/plugins/drift/constants.d.ts +2 -0
- package/src/plugins/drift/constants.js +3 -1
- package/src/plugins/drift/constants.js.map +1 -1
- package/src/plugins/drift/index.js +2 -1
- package/src/plugins/drift/index.js.map +1 -1
- package/src/plugins/drift/types.d.ts +12 -0
- package/src/plugins/flash/stakeFetcher.js +9 -10
- package/src/plugins/flash/stakeFetcher.js.map +1 -1
- package/src/plugins/flexlend/constants.js +4 -4
- package/src/plugins/flexlend/constants.js.map +1 -1
- package/src/plugins/jito/airdropFetcher.js +1 -2
- package/src/plugins/jito/airdropFetcher.js.map +1 -1
- package/src/plugins/jupiter/launchpad/allocationsFetcher.js +1 -1
- package/src/plugins/kamino/airdropFetcher.js +1 -1
- package/src/plugins/parcl/airdropFetcher.js +1 -2
- package/src/plugins/parcl/airdropFetcher.js.map +1 -1
- package/src/plugins/sandglass/constants.d.ts +6 -0
- package/src/plugins/sandglass/constants.js +16 -0
- package/src/plugins/sandglass/constants.js.map +1 -0
- package/src/plugins/sandglass/depositFetcher.d.ts +3 -0
- package/src/plugins/sandglass/depositFetcher.js +82 -0
- package/src/plugins/sandglass/depositFetcher.js.map +1 -0
- package/src/plugins/sandglass/filters.d.ts +3 -0
- package/src/plugins/sandglass/filters.js +21 -0
- package/src/plugins/sandglass/filters.js.map +1 -0
- package/src/plugins/sandglass/index.d.ts +6 -0
- package/src/plugins/sandglass/index.js +13 -0
- package/src/plugins/sandglass/index.js.map +1 -0
- package/src/plugins/{jupiter/exchange/poolJob.d.ts → sandglass/marketsJob.d.ts} +1 -1
- package/src/plugins/sandglass/marketsJob.js +96 -0
- package/src/plugins/sandglass/marketsJob.js.map +1 -0
- package/src/plugins/sandglass/structs.d.ts +150 -0
- package/src/plugins/sandglass/structs.js +144 -0
- package/src/plugins/sandglass/structs.js.map +1 -0
- package/src/plugins/sandglass/types.d.ts +7 -0
- package/src/plugins/sandglass/types.js +3 -0
- package/src/plugins/sandglass/types.js.map +1 -0
- package/src/plugins/tensor/airdropPowerUsersFetcher.d.ts +3 -0
- package/src/plugins/tensor/airdropPowerUsersFetcher.js +45 -0
- package/src/plugins/tensor/airdropPowerUsersFetcher.js.map +1 -0
- package/src/plugins/tensor/constants.d.ts +2 -0
- package/src/plugins/tensor/constants.js +3 -1
- package/src/plugins/tensor/constants.js.map +1 -1
- package/src/plugins/tensor/helpers.d.ts +1 -0
- package/src/plugins/tensor/helpers.js +16 -0
- package/src/plugins/tensor/helpers.js.map +1 -0
- package/src/plugins/tensor/index.js +6 -1
- package/src/plugins/tensor/index.js.map +1 -1
- package/src/plugins/tensor/powerUsers.json +2898 -0
- package/src/plugins/wormhole/airdropFetcher.js +1 -2
- package/src/plugins/wormhole/airdropFetcher.js.map +1 -1
- package/src/plugins/jupiter/exchange/poolJob.js +0 -77
- package/src/plugins/jupiter/exchange/poolJob.js.map +0 -1
@@ -31,10 +31,9 @@ function getPositionsV2Fetcher(networkId) {
|
|
31
31
|
return [
|
32
32
|
{
|
33
33
|
type: portfolio_core_1.PortfolioElementType.multiple,
|
34
|
-
label: '
|
34
|
+
label: 'Airdrop',
|
35
35
|
networkId: portfolio_core_1.NetworkId.solana,
|
36
36
|
platformId: constants_1.platformId,
|
37
|
-
name: 'Airdrop',
|
38
37
|
data: {
|
39
38
|
assets: [Object.assign(Object.assign({}, asset), { attributes: { isClaimable: true } })],
|
40
39
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/wormhole/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAAgD;AAChD,iDAAsD;AACtD,uCAA4D;AAC5D,qGAA6E;AAE7E,SAAwB,qBAAqB,CAC3C,SAAwB;IAExB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;QACtE,MAAM,UAAU,GAAG,MAAM,IAAA,uBAAa,EAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACzD,IAAI,UAAU,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAEhC,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;QACjC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,IAAA,0BAAgB,EAAC,KAAK,CAAC,CAAC,CAAC;QAErE,IAAI,OAAO;YAAE,OAAO,EAAE,CAAC;QAEvB,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,iBAAK,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;QACtE,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,iBAAK,EACL,UAAU,EACV,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CAAC;QAEF,OAAO;YACL;gBACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;gBACnC,KAAK,EAAE,SAAS;gBAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;gBAC3B,UAAU,EAAV,sBAAU;gBACV,IAAI,EAAE
|
1
|
+
{"version":3,"file":"airdropFetcher.js","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Q;KACT,CAAC;AACJ,CAAC;AAvCD,wCAuCC"}
|
@@ -1,77 +0,0 @@
|
|
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 clients_1 = require("../../../utils/clients");
|
18
|
-
const solana_1 = require("../../../utils/solana");
|
19
|
-
const structs_1 = require("./structs");
|
20
|
-
const constants_1 = require("./constants");
|
21
|
-
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
-
const client = (0, clients_1.getClientSolana)();
|
23
|
-
const poolAccount = (yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.perpetualPoolStruct, [constants_1.jlpPool]))[0];
|
24
|
-
if (!poolAccount)
|
25
|
-
return;
|
26
|
-
const custodiesAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.custodyStruct, poolAccount.custodies);
|
27
|
-
const mints = [];
|
28
|
-
const tokensAccountsAddresses = [];
|
29
|
-
custodiesAccounts.forEach((acc) => {
|
30
|
-
if (acc) {
|
31
|
-
mints.push(acc.mint.toString());
|
32
|
-
tokensAccountsAddresses.push(acc.tokenAccount);
|
33
|
-
}
|
34
|
-
});
|
35
|
-
if (poolAccount.custodies.length !== mints.length)
|
36
|
-
return;
|
37
|
-
const tokensPricesRaw = yield cache.getTokenPrices(mints, portfolio_core_1.NetworkId.solana);
|
38
|
-
const tokensPrices = [];
|
39
|
-
tokensPricesRaw.forEach((tP) => (tP ? tokensPrices.push(tP) : []));
|
40
|
-
if (tokensPrices.length !== mints.length)
|
41
|
-
return;
|
42
|
-
const tokensAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, tokensAccountsAddresses);
|
43
|
-
const tokensAmounts = tokensAccounts
|
44
|
-
.map((tA, i) => tA ? tA.amount.dividedBy(Math.pow(10, tokensPrices[i].decimals)) : [])
|
45
|
-
.flat();
|
46
|
-
const lpTokenSupply = yield client.getTokenSupply(constants_1.jlpToken);
|
47
|
-
const lpAmount = new bignumber_js_1.default(lpTokenSupply.value.amount).dividedBy(Math.pow(10, lpTokenSupply.value.decimals));
|
48
|
-
const price = poolAccount.aumUsd.dividedBy(Math.pow(10, 6)).dividedBy(lpAmount);
|
49
|
-
const underlyingsAmounts = tokensAmounts
|
50
|
-
.map((amount) => amount.dividedBy(lpAmount))
|
51
|
-
.flat();
|
52
|
-
const basePrice = tokensAmounts
|
53
|
-
.map((amount, i) => amount.multipliedBy(tokensPrices[i].price))
|
54
|
-
.reduce((sum, current) => current.plus(sum), new bignumber_js_1.default(0))
|
55
|
-
.dividedBy(lpAmount);
|
56
|
-
const factor = price.dividedBy(basePrice);
|
57
|
-
const underlyings = (0, portfolio_core_1.getTokenPricesUnderlyingsFromTokensPrices)(tokensPrices, underlyingsAmounts.map((a) => a.multipliedBy(factor).toNumber()));
|
58
|
-
yield cache.setTokenPriceSource({
|
59
|
-
address: constants_1.jlpToken.toString(),
|
60
|
-
decimals: 6,
|
61
|
-
id: constants_1.platformId,
|
62
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
63
|
-
elementName: 'JLP Pool',
|
64
|
-
platformId: constants_1.platformId,
|
65
|
-
price: price.toNumber(),
|
66
|
-
timestamp: Date.now(),
|
67
|
-
weight: 1,
|
68
|
-
underlyings,
|
69
|
-
});
|
70
|
-
});
|
71
|
-
const job = {
|
72
|
-
id: `${constants_1.platformId}-pool`,
|
73
|
-
executor,
|
74
|
-
label: 'normal',
|
75
|
-
};
|
76
|
-
exports.default = job;
|
77
|
-
//# sourceMappingURL=poolJob.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"poolJob.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/jupiter/exchange/poolJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAIrC,oDAAyD;AACzD,kDAG+B;AAC/B,uCAA+D;AAC/D,2CAA4D;AAE5D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,WAAW,GAAG,CAClB,MAAM,IAAA,sCAA6B,EAAC,MAAM,EAAE,6BAAmB,EAAE,CAAC,mBAAO,CAAC,CAAC,CAC5E,CAAC,CAAC,CAAC,CAAC;IACL,IAAI,CAAC,WAAW;QAAE,OAAO;IAEzB,MAAM,iBAAiB,GAAG,MAAM,IAAA,sCAA6B,EAC3D,MAAM,EACN,uBAAa,EACb,WAAW,CAAC,SAAS,CACtB,CAAC;IAEF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,uBAAuB,GAAgB,EAAE,CAAC;IAChD,iBAAiB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,IAAI,GAAG,EAAE,CAAC;YACR,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAChC,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACjD,CAAC;IACH,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