@sonarwatch/portfolio-plugins 0.12.27 → 0.12.29
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1810 -1802
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/bluefin/positionFetcher.js +5 -5
- package/src/plugins/bluefin/positionFetcher.js.map +1 -1
- package/src/plugins/bonfida/airdropFetcher.d.ts +3 -0
- package/src/plugins/bonfida/airdropFetcher.js +59 -0
- package/src/plugins/bonfida/airdropFetcher.js.map +1 -0
- package/src/plugins/bonfida/constants.d.ts +4 -0
- package/src/plugins/bonfida/constants.js +5 -1
- package/src/plugins/bonfida/constants.js.map +1 -1
- package/src/plugins/bonfida/filters.d.ts +2 -0
- package/src/plugins/bonfida/filters.js +15 -0
- package/src/plugins/bonfida/filters.js.map +1 -0
- package/src/plugins/bonfida/index.js +2 -1
- package/src/plugins/bonfida/index.js.map +1 -1
- package/src/plugins/bonfida/types.d.ts +6 -0
- package/src/plugins/bonfida/types.js +3 -0
- package/src/plugins/bonfida/types.js.map +1 -0
- package/src/plugins/flash/perpetualFetcher.js +8 -13
- package/src/plugins/flash/perpetualFetcher.js.map +1 -1
- package/src/plugins/flash/poolJob.js +1 -1
- package/src/plugins/flash/poolJob.js.map +1 -1
- package/src/plugins/flash/structs.d.ts +2 -2
- package/src/plugins/flash/structs.js +2 -2
- package/src/plugins/flash/structs.js.map +1 -1
- package/src/plugins/futarchy/constants.js +3 -0
- package/src/plugins/futarchy/constants.js.map +1 -1
- 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/custodiesJob.js +11 -4
- package/src/plugins/jupiter/exchange/custodiesJob.js.map +1 -1
- package/src/plugins/jupiter/exchange/filters.js +1 -6
- package/src/plugins/jupiter/exchange/filters.js.map +1 -1
- package/src/plugins/jupiter/exchange/perpetualFetcher.js +54 -45
- package/src/plugins/jupiter/exchange/perpetualFetcher.js.map +1 -1
- package/src/plugins/jupiter/exchange/structs.d.ts +1 -0
- package/src/plugins/jupiter/exchange/structs.js +1 -0
- package/src/plugins/jupiter/exchange/structs.js.map +1 -1
- package/src/plugins/jupiter/types.d.ts +27 -2
- package/src/plugins/jupiter/types.js.map +1 -1
- package/src/plugins/kamino/constants.js +4 -0
- package/src/plugins/kamino/constants.js.map +1 -1
- package/src/plugins/meteora/dlmmPositionsFetcher.js +8 -9
- package/src/plugins/meteora/dlmmPositionsFetcher.js.map +1 -1
- package/src/plugins/parcl/marginFetcher.js +4 -2
- package/src/plugins/parcl/marginFetcher.js.map +1 -1
- package/src/plugins/pyth/stakingFetcher.js +4 -2
- package/src/plugins/pyth/stakingFetcher.js.map +1 -1
- package/src/plugins/raydium/clmmJob.js +114 -15
- package/src/plugins/raydium/clmmJob.js.map +1 -1
- package/src/plugins/raydium/cpmmJob.js +79 -65
- package/src/plugins/raydium/cpmmJob.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/whalesmarket/constants.d.ts +3 -0
- package/src/plugins/whalesmarket/constants.js +4 -1
- package/src/plugins/whalesmarket/constants.js.map +1 -1
- package/src/plugins/whalesmarket/depositFetcher.js +119 -26
- package/src/plugins/whalesmarket/depositFetcher.js.map +1 -1
- package/src/plugins/whalesmarket/filters.d.ts +20 -0
- package/src/plugins/whalesmarket/filters.js +25 -1
- package/src/plugins/whalesmarket/filters.js.map +1 -1
- package/src/plugins/whalesmarket/index.js +2 -1
- package/src/plugins/whalesmarket/index.js.map +1 -1
- package/src/plugins/whalesmarket/structs.d.ts +29 -0
- package/src/plugins/whalesmarket/structs.js +31 -1
- package/src/plugins/whalesmarket/structs.js.map +1 -1
- package/src/plugins/whalesmarket/tokensJob.d.ts +3 -0
- package/src/plugins/whalesmarket/tokensJob.js +47 -0
- package/src/plugins/whalesmarket/tokensJob.js.map +1 -0
- package/src/plugins/whalesmarket/types.d.ts +111 -0
- package/src/plugins/whalesmarket/types.js +48 -0
- package/src/plugins/whalesmarket/types.js.map +1 -0
- package/src/utils/misc/constants.d.ts +1 -0
- package/src/utils/misc/constants.js +2 -1
- package/src/utils/misc/constants.js.map +1 -1
- package/src/utils/misc/getLpUnderlyingTokenSource.js +2 -1
- package/src/utils/misc/getLpUnderlyingTokenSource.js.map +1 -1
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/solana/pyth/helpers.d.ts +2 -2
- package/src/utils/solana/pyth/helpers.js +13 -7
- package/src/utils/solana/pyth/helpers.js.map +1 -1
@@ -18,74 +18,88 @@ const cpmm_1 = require("./structs/cpmm");
|
|
18
18
|
const getLpTokenSourceRaw_1 = require("../../utils/misc/getLpTokenSourceRaw");
|
19
19
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
20
20
|
const client = (0, clients_1.getClientSolana)();
|
21
|
-
const
|
22
|
-
|
23
|
-
|
24
|
-
clmmPoolsInfo.forEach((pI) => {
|
25
|
-
mints.add(pI.token0Mint.toString());
|
26
|
-
mints.add(pI.token1Mint.toString());
|
27
|
-
tokenAccountsPkeys.push(...[pI.token0Vault, pI.token1Vault]);
|
28
|
-
});
|
29
|
-
const [tokenAccounts, tokenPriceById] = yield Promise.all([
|
30
|
-
(0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, tokenAccountsPkeys),
|
31
|
-
cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana),
|
32
|
-
]);
|
33
|
-
const tokenAccountsMap = new Map();
|
34
|
-
tokenAccounts.forEach((tA) => {
|
35
|
-
if (!tA)
|
36
|
-
return;
|
37
|
-
tokenAccountsMap.set(tA.pubkey.toString(), tA);
|
21
|
+
const allPoolsPubkeys = yield client.getProgramAccounts(constants_1.cpmmProgramId, {
|
22
|
+
filters: filters_1.cpmmPoolsStateFilter,
|
23
|
+
dataSlice: { offset: 0, length: 0 },
|
38
24
|
});
|
25
|
+
const step = 100;
|
39
26
|
const tokenPriceSources = [];
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
const
|
45
|
-
const
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
];
|
58
|
-
const
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
27
|
+
let cpmmPoolsInfo;
|
28
|
+
let tokenAccounts;
|
29
|
+
let tokenPriceById;
|
30
|
+
for (let offset = 0; offset < allPoolsPubkeys.length; offset += step) {
|
31
|
+
const tokenAccountsPkeys = [];
|
32
|
+
const mints = new Set();
|
33
|
+
cpmmPoolsInfo = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, cpmm_1.poolStateStruct, allPoolsPubkeys.slice(offset, offset + step).map((res) => res.pubkey));
|
34
|
+
cpmmPoolsInfo.forEach((pI) => {
|
35
|
+
if (!pI)
|
36
|
+
return;
|
37
|
+
mints.add(pI.token0Mint.toString());
|
38
|
+
mints.add(pI.token1Mint.toString());
|
39
|
+
tokenAccountsPkeys.push(...[pI.token0Vault, pI.token1Vault]);
|
40
|
+
});
|
41
|
+
[tokenAccounts, tokenPriceById] = yield Promise.all([
|
42
|
+
(0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, tokenAccountsPkeys),
|
43
|
+
cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana),
|
44
|
+
]);
|
45
|
+
const tokenAccountsMap = new Map();
|
46
|
+
tokenAccounts.forEach((tA) => {
|
47
|
+
if (!tA)
|
48
|
+
return;
|
49
|
+
tokenAccountsMap.set(tA.pubkey.toString(), tA);
|
50
|
+
});
|
51
|
+
for (let id = 0; id < cpmmPoolsInfo.length; id++) {
|
52
|
+
const poolState = cpmmPoolsInfo[id];
|
53
|
+
if (!poolState)
|
54
|
+
continue;
|
55
|
+
const mintA = poolState.token0Mint.toString();
|
56
|
+
const mintB = poolState.token1Mint.toString();
|
57
|
+
const tokenAccountA = tokenAccountsMap.get(poolState.token0Vault.toString());
|
58
|
+
const tokenAccountB = tokenAccountsMap.get(poolState.token1Vault.toString());
|
59
|
+
if (!tokenAccountA || !tokenAccountB)
|
60
|
+
continue;
|
61
|
+
const decimalsA = poolState.mint0Decimals;
|
62
|
+
const decimalsB = poolState.mint1Decimals;
|
63
|
+
const tokenAmountARaw = tokenAccountA.amount;
|
64
|
+
const tokenAmountBRaw = tokenAccountB.amount;
|
65
|
+
if (tokenAmountARaw.isZero() && tokenAmountBRaw.isZero())
|
66
|
+
continue;
|
67
|
+
const [tokenPriceA, tokenPriceB] = [
|
68
|
+
tokenPriceById.get(mintA),
|
69
|
+
tokenPriceById.get(mintB),
|
70
|
+
];
|
71
|
+
const { lpMint, lpMintDecimals, lpSupply } = poolState;
|
72
|
+
if (lpSupply.isZero())
|
73
|
+
continue;
|
74
|
+
tokenPriceSources.push(...(0, getLpTokenSourceRaw_1.getLpTokenSourceRaw)({
|
75
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
76
|
+
lpDetails: {
|
77
|
+
address: lpMint.toString(),
|
78
|
+
decimals: lpMintDecimals,
|
79
|
+
supplyRaw: lpSupply,
|
82
80
|
},
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
81
|
+
poolUnderlyingsRaw: [
|
82
|
+
{
|
83
|
+
address: mintA,
|
84
|
+
decimals: decimalsA,
|
85
|
+
tokenPrice: tokenPriceA,
|
86
|
+
reserveAmountRaw: tokenAmountARaw,
|
87
|
+
weight: 0.5,
|
88
|
+
},
|
89
|
+
{
|
90
|
+
address: mintB,
|
91
|
+
decimals: decimalsB,
|
92
|
+
tokenPrice: tokenPriceB,
|
93
|
+
reserveAmountRaw: tokenAmountBRaw,
|
94
|
+
weight: 0.5,
|
95
|
+
},
|
96
|
+
],
|
97
|
+
sourceId: poolState.pubkey.toString(),
|
98
|
+
elementName: 'CPMM',
|
99
|
+
platformId: constants_1.platformId,
|
100
|
+
priceUnderlyings: true,
|
101
|
+
}));
|
102
|
+
}
|
89
103
|
}
|
90
104
|
yield cache.setTokenPriceSources(tokenPriceSources);
|
91
105
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpmmJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/cpmmJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAEvD,2CAAwD;AACxD,+
|
1
|
+
{"version":3,"file":"cpmmJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/cpmmJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAEvD,2CAAwD;AACxD,+CAI4B;AAC5B,iDAAsD;AAGtD,uCAAiD;AACjD,yCAA4D;AAC5D,8EAA2E;AAE3E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,eAAe,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,yBAAa,EAAE;QACrE,OAAO,EAAE,8BAAoB;QAC7B,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;KACpC,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,GAAG,CAAC;IACjB,MAAM,iBAAiB,GAAG,EAAE,CAAC;IAC7B,IAAI,aAAkD,CAAC;IACvD,IAAI,aAAa,CAAC;IAClB,IAAI,cAAc,CAAC;IACnB,KAAK,IAAI,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AAG,IAAA,yCAAmB,EAAC;gBACrB,SAAS,EAAE,0BAAS,CAAC,MAAM;gBAC3B,SAAS,EAAE;oBACT,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE;oBAC1B,QAAQ,EAAE,cAAc;oBACxB,SAAS,EAAE,QAAQ;iBACpB;gBACD,kBAAkB,EAAE;oBAClB;wBACE,OAAO,EAAE,KAAK;wBACd,QAAQ,EAAE,SAAS;wBACnB,UAAU,EAAE,WAAW;wBACvB,gBAAgB,EAAE,eAAe;wBACjC,MAAM,EAAE,GAAG;qBACZ;oBACD;wBACE,OAAO,EAAE,KAAK;wBACd,QAAQ,EAAE,SAAS;wBACnB,UAAU,EAAE,WAAW;wBACvB,gBAAgB,EAAE,eAAe;wBACjC,MAAM,EAAE,GAAG;qBACZ;iBACF;gBACD,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACrC,WAAW,EAAE,MAAM;gBACnB,UAAU,EAAV,sBAAU;gBACV,gBAAgB,EAAE,IAAI;aACvB,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AACtD,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
|
|
54
54
|
}
|
55
55
|
function getV3PairsAddresses(url, length = 300) {
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const query = (0, graphql_request_1.gql) `
|
58
|
-
{
|
59
|
-
pools(
|
60
|
-
orderBy: totalValueLockedUSD
|
61
|
-
first: ${length}
|
62
|
-
orderDirection: desc
|
63
|
-
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
-
) {
|
65
|
-
id
|
66
|
-
token0Price
|
67
|
-
token1Price
|
68
|
-
liquidity
|
69
|
-
token0 {
|
70
|
-
id
|
71
|
-
totalSupply
|
72
|
-
decimals
|
73
|
-
}
|
74
|
-
token1 {
|
75
|
-
id
|
76
|
-
totalSupply
|
77
|
-
decimals
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
57
|
+
const query = (0, graphql_request_1.gql) `
|
58
|
+
{
|
59
|
+
pools(
|
60
|
+
orderBy: totalValueLockedUSD
|
61
|
+
first: ${length}
|
62
|
+
orderDirection: desc
|
63
|
+
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
+
) {
|
65
|
+
id
|
66
|
+
token0Price
|
67
|
+
token1Price
|
68
|
+
liquidity
|
69
|
+
token0 {
|
70
|
+
id
|
71
|
+
totalSupply
|
72
|
+
decimals
|
73
|
+
}
|
74
|
+
token1 {
|
75
|
+
id
|
76
|
+
totalSupply
|
77
|
+
decimals
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
81
|
`;
|
82
82
|
const res = yield (0, graphql_request_1.default)(url, query);
|
83
83
|
const pools = res.pools;
|
@@ -40,28 +40,28 @@ function getPairKey(version) {
|
|
40
40
|
exports.getPairKey = getPairKey;
|
41
41
|
function getPairsV2FromTheGraph(url, length = 300) {
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
43
|
-
const query = (0, graphql_request_1.gql) `
|
44
|
-
{
|
45
|
-
pairs(
|
46
|
-
orderBy: reserveUSD
|
47
|
-
first: ${length}
|
48
|
-
orderDirection: desc
|
49
|
-
where: { trackedReserveETH_not: "0" }
|
50
|
-
) {
|
51
|
-
id
|
52
|
-
reserve0
|
53
|
-
reserve1
|
54
|
-
totalSupply
|
55
|
-
token0 {
|
56
|
-
id
|
57
|
-
decimals
|
58
|
-
}
|
59
|
-
token1 {
|
60
|
-
id
|
61
|
-
decimals
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
43
|
+
const query = (0, graphql_request_1.gql) `
|
44
|
+
{
|
45
|
+
pairs(
|
46
|
+
orderBy: reserveUSD
|
47
|
+
first: ${length}
|
48
|
+
orderDirection: desc
|
49
|
+
where: { trackedReserveETH_not: "0" }
|
50
|
+
) {
|
51
|
+
id
|
52
|
+
reserve0
|
53
|
+
reserve1
|
54
|
+
totalSupply
|
55
|
+
token0 {
|
56
|
+
id
|
57
|
+
decimals
|
58
|
+
}
|
59
|
+
token1 {
|
60
|
+
id
|
61
|
+
decimals
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
65
|
`;
|
66
66
|
const res = yield (0, graphql_request_1.default)(url, query);
|
67
67
|
const pairs = res.pairs;
|
@@ -3,3 +3,6 @@ import { Platform } from '@sonarwatch/portfolio-core';
|
|
3
3
|
export declare const platformId = "whalesmarket";
|
4
4
|
export declare const platform: Platform;
|
5
5
|
export declare const pid: PublicKey;
|
6
|
+
export declare const whalesApi = "https://api-v2.whales.market/v2/tokens/";
|
7
|
+
export declare const tokensKey = "tokens";
|
8
|
+
export declare const lastCountKey = "lastCount";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.pid = exports.platform = exports.platformId = void 0;
|
3
|
+
exports.lastCountKey = exports.tokensKey = exports.whalesApi = exports.pid = exports.platform = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'whalesmarket';
|
6
6
|
exports.platform = {
|
@@ -12,4 +12,7 @@ exports.platform = {
|
|
12
12
|
twitter: 'https://twitter.com/WhalesMarket',
|
13
13
|
};
|
14
14
|
exports.pid = new web3_js_1.PublicKey('stPdYNaJNsV3ytS9Xtx4GXXXRcVqVS6x66ZFa26K39S');
|
15
|
+
exports.whalesApi = 'https://api-v2.whales.market/v2/tokens/';
|
16
|
+
exports.tokensKey = 'tokens';
|
17
|
+
exports.lastCountKey = 'lastCount';
|
15
18
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,cAAc,CAAC;AAC5B,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,oDAAoD;IAC3D,WAAW,EAAE,eAAe,EAAE,sCAAsC;IACpE,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,GAAG,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,cAAc,CAAC;AAC5B,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,oDAAoD;IAC3D,WAAW,EAAE,eAAe,EAAE,sCAAsC;IACpE,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,GAAG,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AACnE,QAAA,SAAS,GAAG,yCAAyC,CAAC;AACtD,QAAA,SAAS,GAAG,QAAQ,CAAC;AACrB,QAAA,YAAY,GAAG,WAAW,CAAC"}
|
@@ -13,61 +13,154 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
15
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const web3_js_1 = require("@solana/web3.js");
|
16
17
|
const constants_1 = require("./constants");
|
17
18
|
const clients_1 = require("../../utils/clients");
|
18
19
|
const solana_1 = require("../../utils/solana");
|
19
20
|
const structs_1 = require("./structs");
|
20
21
|
const filters_1 = require("./filters");
|
21
22
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
23
|
+
const types_1 = require("./types");
|
22
24
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
25
|
const client = (0, clients_1.getClientSolana)();
|
24
|
-
const offers
|
26
|
+
const [offers, buyOrders, sellOrders, tokensInfo] = yield Promise.all([
|
27
|
+
(0, solana_1.getParsedProgramAccounts)(client, structs_1.offerStruct, constants_1.pid, (0, filters_1.offerFilter)(owner)),
|
28
|
+
(0, solana_1.getParsedProgramAccounts)(client, structs_1.orderStruct, constants_1.pid, (0, filters_1.buyOrderFilter)(owner)),
|
29
|
+
(0, solana_1.getParsedProgramAccounts)(client, structs_1.orderStruct, constants_1.pid, (0, filters_1.sellOrderFilter)(owner)),
|
30
|
+
cache.getItem(constants_1.tokensKey, {
|
31
|
+
prefix: constants_1.platformId,
|
32
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
33
|
+
}),
|
34
|
+
]);
|
35
|
+
const orders = [...sellOrders, ...buyOrders];
|
36
|
+
if (offers.length === 0 && orders.length === 0)
|
37
|
+
return [];
|
38
|
+
if (!tokensInfo)
|
39
|
+
return [];
|
40
|
+
const sideOffers = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.offerStruct, orders.map((order) => order.offer));
|
41
|
+
const offerById = new Map();
|
25
42
|
const mints = new Set();
|
26
|
-
|
43
|
+
const tokenConfigs = new Set();
|
44
|
+
sideOffers.forEach((sideOffer) => {
|
45
|
+
if (sideOffer) {
|
46
|
+
offerById.set(sideOffer.pubkey.toString(), sideOffer);
|
47
|
+
mints.add(sideOffer.exToken.toString());
|
48
|
+
tokenConfigs.add(sideOffer.tokenConfig.toString());
|
49
|
+
}
|
50
|
+
});
|
51
|
+
offers.forEach((offer) => {
|
52
|
+
tokenConfigs.add(offer.tokenConfig.toString());
|
53
|
+
mints.add(offer.exToken.toString());
|
54
|
+
});
|
55
|
+
const tokensInfoById = new Map();
|
56
|
+
tokensInfo.forEach((token) => {
|
57
|
+
if (token.token_id)
|
58
|
+
tokensInfoById.set(token.token_id, token);
|
59
|
+
});
|
60
|
+
const tokenConfigsAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.tokenConfigStruct, Array.from(tokenConfigs).map((str) => new web3_js_1.PublicKey(str)));
|
61
|
+
if (tokenConfigsAccounts.length === 0)
|
62
|
+
return [];
|
63
|
+
const tokenConfigById = new Map();
|
64
|
+
tokenConfigsAccounts.forEach((tA) => {
|
65
|
+
if (tA)
|
66
|
+
tokenConfigById.set(tA.pubkey.toString(), tA);
|
67
|
+
});
|
27
68
|
const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
|
28
|
-
const
|
29
|
-
const sellOfferAssets = [];
|
69
|
+
const assetsById = new Map();
|
30
70
|
for (const offer of offers) {
|
31
|
-
|
71
|
+
const tokenConfig = tokenConfigById.get(offer.tokenConfig.toString());
|
72
|
+
if (!tokenConfig)
|
73
|
+
continue;
|
74
|
+
const { id } = tokenConfig;
|
75
|
+
const tokenInfo = tokensInfoById.get(id.toString());
|
76
|
+
if (!tokenInfo)
|
77
|
+
continue;
|
78
|
+
const isEnded = tokenInfo.status === 'ended';
|
79
|
+
if (isEnded && offer.status === structs_1.OfferStatus.Closed)
|
32
80
|
continue;
|
33
81
|
const mint = offer.exToken.toString();
|
34
82
|
const tokenPrice = tokenPriceById.get(mint);
|
35
83
|
if (!tokenPrice)
|
36
84
|
continue;
|
37
|
-
const
|
85
|
+
const collateral = offer.collateral
|
38
86
|
.dividedBy(Math.pow(10, tokenPrice.decimals))
|
39
87
|
.toNumber();
|
40
|
-
const
|
41
|
-
|
42
|
-
|
88
|
+
const fill = `${offer.filledAmount
|
89
|
+
.dividedBy(offer.totalAmount)
|
90
|
+
.times(100)
|
91
|
+
.toString()}% Filled`;
|
92
|
+
const collatAsset = (0, tokenPriceToAssetToken_1.default)(mint, collateral, portfolio_core_1.NetworkId.solana, tokenPrice, undefined, {
|
93
|
+
tags: [`${structs_1.OfferType[offer.offerType]} Offer`, fill],
|
94
|
+
isClaimable: isEnded ? true : undefined,
|
95
|
+
});
|
96
|
+
const existingAssets = assetsById.get(id);
|
97
|
+
if (!existingAssets) {
|
98
|
+
assetsById.set(id, [collatAsset]);
|
43
99
|
}
|
44
100
|
else {
|
45
|
-
|
101
|
+
existingAssets.push(collatAsset);
|
102
|
+
assetsById.set(id, existingAssets);
|
46
103
|
}
|
47
104
|
}
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
105
|
+
for (const order of orders) {
|
106
|
+
const offer = offerById.get(order.offer.toString());
|
107
|
+
if (!offer)
|
108
|
+
continue;
|
109
|
+
if (offer.authority.toString() === owner)
|
110
|
+
continue;
|
111
|
+
const tokenConfig = tokenConfigById.get(offer.tokenConfig.toString());
|
112
|
+
if (!tokenConfig)
|
113
|
+
continue;
|
114
|
+
const { id } = tokenConfig;
|
115
|
+
const tokenInfo = tokensInfoById.get(id.toString());
|
116
|
+
if (!tokenInfo)
|
117
|
+
continue;
|
118
|
+
const isEnded = tokenInfo.status === 'ended';
|
119
|
+
if (isEnded && offer.status === structs_1.OfferStatus.Closed)
|
120
|
+
continue;
|
121
|
+
const mint = offer.exToken.toString();
|
122
|
+
const tokenPrice = tokenPriceById.get(mint);
|
123
|
+
if (!tokenPrice)
|
124
|
+
continue;
|
125
|
+
const collateral = offer.collateral.dividedBy(Math.pow(10, tokenPrice.decimals));
|
126
|
+
const amountToCollatAmount = collateral.dividedBy(offer.totalAmount);
|
127
|
+
const amount = order.amount.times(amountToCollatAmount).toNumber();
|
128
|
+
const side = offer.offerType === structs_1.OfferType.Buy ? 'Sell Order' : 'Buy Order';
|
129
|
+
const collatAsset = (0, tokenPriceToAssetToken_1.default)(mint, amount, portfolio_core_1.NetworkId.solana, tokenPrice, undefined, {
|
130
|
+
tags: [side],
|
60
131
|
});
|
132
|
+
const existingAssets = assetsById.get(id);
|
133
|
+
if (!existingAssets) {
|
134
|
+
assetsById.set(id, [collatAsset]);
|
135
|
+
}
|
136
|
+
else {
|
137
|
+
existingAssets.push(collatAsset);
|
138
|
+
assetsById.set(id, existingAssets);
|
139
|
+
}
|
61
140
|
}
|
62
|
-
if (
|
141
|
+
if (assetsById.size === 0)
|
142
|
+
return [];
|
143
|
+
const elements = [];
|
144
|
+
for (const id of assetsById.keys()) {
|
145
|
+
const info = tokensInfoById.get(id.toString());
|
146
|
+
const assets = assetsById.get(id);
|
147
|
+
if (!assets || !info)
|
148
|
+
continue;
|
149
|
+
let type;
|
150
|
+
if (info.category === types_1.Category.PointMarket) {
|
151
|
+
type = 'Points';
|
152
|
+
}
|
153
|
+
else if (info.category === types_1.Category.PreMarket) {
|
154
|
+
type = 'Pre-market';
|
155
|
+
}
|
63
156
|
elements.push({
|
64
157
|
type: portfolio_core_1.PortfolioElementType.multiple,
|
65
158
|
label: 'Deposit',
|
66
|
-
name:
|
159
|
+
name: `${type} : ${info.symbol} (${info.status})`,
|
67
160
|
networkId: portfolio_core_1.NetworkId.solana,
|
68
161
|
platformId: constants_1.platformId,
|
69
|
-
data: { assets
|
70
|
-
value: (0, portfolio_core_1.getUsdValueSum)(
|
162
|
+
data: { assets },
|
163
|
+
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
|
71
164
|
});
|
72
165
|
}
|
73
166
|
return elements;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/depositFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/depositFetc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MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -8,3 +8,23 @@ export declare const offerFilter: (owner: string) => ({
|
|
8
8
|
dataSize: number;
|
9
9
|
memcmp?: undefined;
|
10
10
|
})[];
|
11
|
+
export declare const buyOrderFilter: (owner: string) => ({
|
12
|
+
memcmp: {
|
13
|
+
offset: number;
|
14
|
+
bytes: string;
|
15
|
+
};
|
16
|
+
dataSize?: undefined;
|
17
|
+
} | {
|
18
|
+
dataSize: number;
|
19
|
+
memcmp?: undefined;
|
20
|
+
})[];
|
21
|
+
export declare const sellOrderFilter: (owner: string) => ({
|
22
|
+
memcmp: {
|
23
|
+
offset: number;
|
24
|
+
bytes: string;
|
25
|
+
};
|
26
|
+
dataSize?: undefined;
|
27
|
+
} | {
|
28
|
+
dataSize: number;
|
29
|
+
memcmp?: undefined;
|
30
|
+
})[];
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.offerFilter = void 0;
|
3
|
+
exports.sellOrderFilter = exports.buyOrderFilter = exports.offerFilter = void 0;
|
4
4
|
const offerFilter = (owner) => [
|
5
5
|
{
|
6
6
|
memcmp: {
|
@@ -13,4 +13,28 @@ const offerFilter = (owner) => [
|
|
13
13
|
},
|
14
14
|
];
|
15
15
|
exports.offerFilter = offerFilter;
|
16
|
+
const buyOrderFilter = (owner) => [
|
17
|
+
{
|
18
|
+
memcmp: {
|
19
|
+
offset: 146,
|
20
|
+
bytes: owner,
|
21
|
+
},
|
22
|
+
},
|
23
|
+
{
|
24
|
+
dataSize: 187,
|
25
|
+
},
|
26
|
+
];
|
27
|
+
exports.buyOrderFilter = buyOrderFilter;
|
28
|
+
const sellOrderFilter = (owner) => [
|
29
|
+
{
|
30
|
+
memcmp: {
|
31
|
+
offset: 115,
|
32
|
+
bytes: owner,
|
33
|
+
},
|
34
|
+
},
|
35
|
+
{
|
36
|
+
dataSize: 187,
|
37
|
+
},
|
38
|
+
];
|
39
|
+
exports.sellOrderFilter = sellOrderFilter;
|
16
40
|
//# sourceMappingURL=filters.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/filters.ts"],"names":[],"mappings":";;;AAAO,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC;IAC5C;QACE,MAAM,EAAE;YACN,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,GAAG;KACd;CACF,CAAC;AAVW,QAAA,WAAW,eAUtB"}
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/filters.ts"],"names":[],"mappings":";;;AAAO,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC;IAC5C;QACE,MAAM,EAAE;YACN,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,GAAG;KACd;CACF,CAAC;AAVW,QAAA,WAAW,eAUtB;AAEK,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC;IAC/C;QACE,MAAM,EAAE;YACN,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,GAAG;KACd;CACF,CAAC;AAVW,QAAA,cAAc,kBAUzB;AAEK,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC;IAChD;QACE,MAAM,EAAE;YACN,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,GAAG;KACd;CACF,CAAC;AAVW,QAAA,eAAe,mBAU1B"}
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
7
|
const constants_1 = require("./constants");
|
8
8
|
const depositFetcher_1 = __importDefault(require("./depositFetcher"));
|
9
|
+
const tokensJob_1 = __importDefault(require("./tokensJob"));
|
9
10
|
exports.platforms = [constants_1.platform];
|
10
|
-
exports.jobs = [];
|
11
|
+
exports.jobs = [tokensJob_1.default];
|
11
12
|
exports.fetchers = [depositFetcher_1.default];
|
12
13
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;AAC9C,4DAAoC;AAEvB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,mBAAS,CAAC,CAAC;AAC1B,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
|