@sonarwatch/portfolio-plugins 0.12.28 → 0.12.29
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1810 -1806
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- 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/futarchy/constants.js +3 -0
- package/src/plugins/futarchy/constants.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 +4 -3
- 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/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
@@ -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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;AAEF,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"}
|
@@ -34,6 +34,7 @@ export type Offer = {
|
|
34
34
|
};
|
35
35
|
export declare const offerStruct: BeetStruct<Offer, Partial<Offer>>;
|
36
36
|
export type Order = {
|
37
|
+
buffer: Buffer;
|
37
38
|
version: number;
|
38
39
|
id: BigNumber;
|
39
40
|
config: PublicKey;
|
@@ -56,3 +57,31 @@ export type ExToken = {
|
|
56
57
|
vaultTokenBump: number;
|
57
58
|
};
|
58
59
|
export declare const exTokenStruct: BeetStruct<ExToken, Partial<ExToken>>;
|
60
|
+
export declare enum TokenCategory {
|
61
|
+
Point = 0,
|
62
|
+
PreMarket = 1
|
63
|
+
}
|
64
|
+
export declare enum TokenStatus {
|
65
|
+
Active = 0,
|
66
|
+
Settle = 1,
|
67
|
+
Inactive = 2
|
68
|
+
}
|
69
|
+
export type TokenConfig = {
|
70
|
+
buffer: Buffer;
|
71
|
+
version: number;
|
72
|
+
id: number;
|
73
|
+
bump: number;
|
74
|
+
settleTime: BigNumber;
|
75
|
+
settleDuration: BigNumber;
|
76
|
+
pledgeRate: BigNumber;
|
77
|
+
status: TokenStatus;
|
78
|
+
token: PublicKey;
|
79
|
+
config: PublicKey;
|
80
|
+
vaultToken: PublicKey;
|
81
|
+
vaultTokenBump: number;
|
82
|
+
settleRate: BigNumber;
|
83
|
+
category: TokenCategory;
|
84
|
+
feeRefund: BigNumber;
|
85
|
+
feeSettle: BigNumber;
|
86
|
+
};
|
87
|
+
export declare const tokenConfigStruct: BeetStruct<TokenConfig, Partial<TokenConfig>>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.exTokenStruct = exports.orderStruct = exports.offerStruct = exports.OrderStatus = exports.OfferType = exports.OfferStatus = void 0;
|
3
|
+
exports.tokenConfigStruct = exports.TokenStatus = exports.TokenCategory = exports.exTokenStruct = exports.orderStruct = exports.offerStruct = exports.OrderStatus = exports.OfferType = exports.OfferStatus = 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");
|
@@ -38,6 +38,7 @@ exports.offerStruct = new beet_1.BeetStruct([
|
|
38
38
|
['config', beet_solana_1.publicKey],
|
39
39
|
], (args) => args);
|
40
40
|
exports.orderStruct = new beet_1.BeetStruct([
|
41
|
+
['buffer', (0, solana_1.blob)(8)],
|
41
42
|
['version', beet_1.u8],
|
42
43
|
['id', solana_1.u64],
|
43
44
|
['config', beet_solana_1.publicKey],
|
@@ -58,4 +59,33 @@ exports.exTokenStruct = new beet_1.BeetStruct([
|
|
58
59
|
['vaultToken', beet_solana_1.publicKey],
|
59
60
|
['vaultTokenBump', beet_1.u8],
|
60
61
|
], (args) => args);
|
62
|
+
var TokenCategory;
|
63
|
+
(function (TokenCategory) {
|
64
|
+
TokenCategory[TokenCategory["Point"] = 0] = "Point";
|
65
|
+
TokenCategory[TokenCategory["PreMarket"] = 1] = "PreMarket";
|
66
|
+
})(TokenCategory || (exports.TokenCategory = TokenCategory = {}));
|
67
|
+
var TokenStatus;
|
68
|
+
(function (TokenStatus) {
|
69
|
+
TokenStatus[TokenStatus["Active"] = 0] = "Active";
|
70
|
+
TokenStatus[TokenStatus["Settle"] = 1] = "Settle";
|
71
|
+
TokenStatus[TokenStatus["Inactive"] = 2] = "Inactive";
|
72
|
+
})(TokenStatus || (exports.TokenStatus = TokenStatus = {}));
|
73
|
+
exports.tokenConfigStruct = new beet_1.BeetStruct([
|
74
|
+
['buffer', (0, solana_1.blob)(8)],
|
75
|
+
['version', beet_1.u8],
|
76
|
+
['id', beet_1.u16],
|
77
|
+
['bump', beet_1.u8],
|
78
|
+
['settleTime', solana_1.i64],
|
79
|
+
['settleDuration', solana_1.i64],
|
80
|
+
['pledgeRate', solana_1.u64],
|
81
|
+
['status', beet_1.u8],
|
82
|
+
['token', beet_solana_1.publicKey],
|
83
|
+
['config', beet_solana_1.publicKey],
|
84
|
+
['vaultToken', beet_solana_1.publicKey],
|
85
|
+
['vaultTokenBump', beet_1.u8],
|
86
|
+
['settleRate', solana_1.u64],
|
87
|
+
['category', beet_1.u8],
|
88
|
+
['feeRefund', solana_1.u64],
|
89
|
+
['feeSettle', solana_1.u64],
|
90
|
+
], (args) => args);
|
61
91
|
//# sourceMappingURL=structs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/structs.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/structs.ts"],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CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,QAAQ,EAAE,SAAE,CAAC;IACd,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,gBAAgB,EAAE,SAAE,CAAC;IACtB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,UAAU,EAAE,SAAE,CAAC;IAChB,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,WAAW,EAAE,YAAG,CAAC;CACnB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAmB,CAC9B,CAAC"}
|
@@ -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
|
+
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 minToTake = 200;
|
19
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
20
|
+
const lastCount = yield cache.getItem(constants_1.lastCountKey, {
|
21
|
+
prefix: constants_1.platformId,
|
22
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
23
|
+
});
|
24
|
+
const apiRes = yield axios_1.default
|
25
|
+
.get(constants_1.whalesApi, {
|
26
|
+
params: { take: lastCount || minToTake, chain_id: 666666 },
|
27
|
+
})
|
28
|
+
.catch(() => null);
|
29
|
+
if (apiRes === null || apiRes === void 0 ? void 0 : apiRes.data.data) {
|
30
|
+
const tokens = apiRes.data.data.list;
|
31
|
+
yield cache.setItem(constants_1.tokensKey, tokens, {
|
32
|
+
prefix: constants_1.platformId,
|
33
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
34
|
+
});
|
35
|
+
yield cache.setItem(constants_1.lastCountKey, apiRes.data.data.count, {
|
36
|
+
prefix: constants_1.platformId,
|
37
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
38
|
+
});
|
39
|
+
}
|
40
|
+
});
|
41
|
+
const job = {
|
42
|
+
id: `${constants_1.platformId}-tokens`,
|
43
|
+
executor,
|
44
|
+
label: 'normal',
|
45
|
+
};
|
46
|
+
exports.default = job;
|
47
|
+
//# sourceMappingURL=tokensJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tokensJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/tokensJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,+DAAuD;AAGvD,2CAA6E;AAG7E,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,OAAO,CAAS,wBAAY,EAAE;QAC1D,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IAEH,MAAM,MAAM,GAAyC,MAAM,eAAK;SAC7D,GAAG,CAAC,qBAAS,EAAE;QACd,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,IAAI,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE;KAC3D,CAAC;SACD,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAErB,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,IAAI,EAAE,CAAC;QACtB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QACrC,MAAM,KAAK,CAAC,OAAO,CAAC,qBAAS,EAAE,MAAM,EAAE;YACrC,MAAM,EAAE,sBAAU;YAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC,CAAC;QACH,MAAM,KAAK,CAAC,OAAO,CAAC,wBAAY,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACxD,MAAM,EAAE,sBAAU;YAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,SAAS;IAC1B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,111 @@
|
|
1
|
+
export type TokensResponse = {
|
2
|
+
messages: string;
|
3
|
+
data: Data;
|
4
|
+
status_code: number;
|
5
|
+
};
|
6
|
+
export type Data = {
|
7
|
+
count: number;
|
8
|
+
list: Token[];
|
9
|
+
};
|
10
|
+
export type Token = {
|
11
|
+
id: string;
|
12
|
+
created_at: Date;
|
13
|
+
address: null | string;
|
14
|
+
settle_time: number | null;
|
15
|
+
settle_duration: number | null;
|
16
|
+
pledge_rate: number | null;
|
17
|
+
status: ListStatus;
|
18
|
+
symbol: string;
|
19
|
+
name: string;
|
20
|
+
icon: string;
|
21
|
+
price: number | null;
|
22
|
+
last_price: number;
|
23
|
+
coin_gecko_id: null | string;
|
24
|
+
decimals: number | null;
|
25
|
+
type: Type;
|
26
|
+
token_id: null | string;
|
27
|
+
category: Category;
|
28
|
+
price_change: PriceChange;
|
29
|
+
volume: Volume;
|
30
|
+
volume_change: VolumeChange;
|
31
|
+
settle_type: SettleType;
|
32
|
+
chain_id: number;
|
33
|
+
network_icon: string;
|
34
|
+
network_name: string;
|
35
|
+
network_url: string;
|
36
|
+
website: null | string;
|
37
|
+
twitter: null | string;
|
38
|
+
start_time: number | null;
|
39
|
+
banner_url: null | string;
|
40
|
+
priority: number | null;
|
41
|
+
metadata: Metadata | null;
|
42
|
+
unit: Unit | null;
|
43
|
+
settle_rate: number | null;
|
44
|
+
total_volume: number;
|
45
|
+
};
|
46
|
+
export declare enum Category {
|
47
|
+
PointMarket = "point_market",
|
48
|
+
PreMarket = "pre_market",
|
49
|
+
RuneMarket = "rune_market"
|
50
|
+
}
|
51
|
+
export type Metadata = {
|
52
|
+
title: string;
|
53
|
+
description: string;
|
54
|
+
background_image: string;
|
55
|
+
cta: Cta;
|
56
|
+
icon?: string;
|
57
|
+
status?: MetadataStatus;
|
58
|
+
priority?: number;
|
59
|
+
};
|
60
|
+
export type Cta = {
|
61
|
+
text: string;
|
62
|
+
url: string;
|
63
|
+
};
|
64
|
+
export declare enum MetadataStatus {
|
65
|
+
Inactive = "inactive"
|
66
|
+
}
|
67
|
+
export type PriceChange = {
|
68
|
+
h24: number;
|
69
|
+
};
|
70
|
+
export declare enum SettleType {
|
71
|
+
Manual = "manual",
|
72
|
+
System = "system"
|
73
|
+
}
|
74
|
+
export declare enum ListStatus {
|
75
|
+
Active = "active",
|
76
|
+
Draft = "draft",
|
77
|
+
Ended = "ended",
|
78
|
+
Settling = "settling"
|
79
|
+
}
|
80
|
+
export declare enum Type {
|
81
|
+
Currency = "currency",
|
82
|
+
PreMarket = "pre_market"
|
83
|
+
}
|
84
|
+
export type Unit = {
|
85
|
+
prefix_icon: PrefixIcon;
|
86
|
+
icon: string;
|
87
|
+
symbol: symbol;
|
88
|
+
};
|
89
|
+
export declare enum PrefixIcon {
|
90
|
+
Diamonds = "Diamonds",
|
91
|
+
Empty = "",
|
92
|
+
Pearl = "Pearl",
|
93
|
+
Shards = "Shards"
|
94
|
+
}
|
95
|
+
export declare enum Symbol {
|
96
|
+
Diamond = "Diamond",
|
97
|
+
Empty = "",
|
98
|
+
EzPoint = "ezPoint",
|
99
|
+
Mile = "Mile",
|
100
|
+
Pearl = "Pearl",
|
101
|
+
Score = "Score",
|
102
|
+
Shard = "Shard"
|
103
|
+
}
|
104
|
+
export type Volume = {
|
105
|
+
h24: number;
|
106
|
+
total_vol?: number;
|
107
|
+
};
|
108
|
+
export type VolumeChange = {
|
109
|
+
h24: number;
|
110
|
+
total_vol_day30?: number;
|
111
|
+
};
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Symbol = exports.PrefixIcon = exports.Type = exports.ListStatus = exports.SettleType = exports.MetadataStatus = exports.Category = void 0;
|
4
|
+
var Category;
|
5
|
+
(function (Category) {
|
6
|
+
Category["PointMarket"] = "point_market";
|
7
|
+
Category["PreMarket"] = "pre_market";
|
8
|
+
Category["RuneMarket"] = "rune_market";
|
9
|
+
})(Category || (exports.Category = Category = {}));
|
10
|
+
var MetadataStatus;
|
11
|
+
(function (MetadataStatus) {
|
12
|
+
MetadataStatus["Inactive"] = "inactive";
|
13
|
+
})(MetadataStatus || (exports.MetadataStatus = MetadataStatus = {}));
|
14
|
+
var SettleType;
|
15
|
+
(function (SettleType) {
|
16
|
+
SettleType["Manual"] = "manual";
|
17
|
+
SettleType["System"] = "system";
|
18
|
+
})(SettleType || (exports.SettleType = SettleType = {}));
|
19
|
+
var ListStatus;
|
20
|
+
(function (ListStatus) {
|
21
|
+
ListStatus["Active"] = "active";
|
22
|
+
ListStatus["Draft"] = "draft";
|
23
|
+
ListStatus["Ended"] = "ended";
|
24
|
+
ListStatus["Settling"] = "settling";
|
25
|
+
})(ListStatus || (exports.ListStatus = ListStatus = {}));
|
26
|
+
var Type;
|
27
|
+
(function (Type) {
|
28
|
+
Type["Currency"] = "currency";
|
29
|
+
Type["PreMarket"] = "pre_market";
|
30
|
+
})(Type || (exports.Type = Type = {}));
|
31
|
+
var PrefixIcon;
|
32
|
+
(function (PrefixIcon) {
|
33
|
+
PrefixIcon["Diamonds"] = "Diamonds";
|
34
|
+
PrefixIcon["Empty"] = "";
|
35
|
+
PrefixIcon["Pearl"] = "Pearl";
|
36
|
+
PrefixIcon["Shards"] = "Shards";
|
37
|
+
})(PrefixIcon || (exports.PrefixIcon = PrefixIcon = {}));
|
38
|
+
var Symbol;
|
39
|
+
(function (Symbol) {
|
40
|
+
Symbol["Diamond"] = "Diamond";
|
41
|
+
Symbol["Empty"] = "";
|
42
|
+
Symbol["EzPoint"] = "ezPoint";
|
43
|
+
Symbol["Mile"] = "Mile";
|
44
|
+
Symbol["Pearl"] = "Pearl";
|
45
|
+
Symbol["Score"] = "Score";
|
46
|
+
Symbol["Shard"] = "Shard";
|
47
|
+
})(Symbol || (exports.Symbol = Symbol = {}));
|
48
|
+
//# sourceMappingURL=types.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/types.ts"],"names":[],"mappings":";;;AAgDA,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,wCAA4B,CAAA;IAC5B,oCAAwB,CAAA;IACxB,sCAA0B,CAAA;AAC5B,CAAC,EAJW,QAAQ,wBAAR,QAAQ,QAInB;AAiBD,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,uCAAqB,CAAA;AACvB,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAMD,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;AACnB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAED,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,mCAAqB,CAAA;AACvB,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAED,IAAY,IAGX;AAHD,WAAY,IAAI;IACd,6BAAqB,CAAA;IACrB,gCAAwB,CAAA;AAC1B,CAAC,EAHW,IAAI,oBAAJ,IAAI,QAGf;AAQD,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,wBAAU,CAAA;IACV,6BAAe,CAAA;IACf,+BAAiB,CAAA;AACnB,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAED,IAAY,MAQX;AARD,WAAY,MAAM;IAChB,6BAAmB,CAAA;IACnB,oBAAU,CAAA;IACV,6BAAmB,CAAA;IACnB,uBAAa,CAAA;IACb,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,yBAAe,CAAA;AACjB,CAAC,EARW,MAAM,sBAAN,MAAM,QAQjB"}
|
@@ -3,3 +3,4 @@ export declare const zeroBigInt: bigint;
|
|
3
3
|
export declare const zeroBigNumber: BigNumber;
|
4
4
|
export declare const lpAddressesCachePrefix = "lp-addresses";
|
5
5
|
export declare const usdcLogoUri = "https://raw.githubusercontent.com/sonarwatch/token-lists/main/images/common/USDC.png";
|
6
|
+
export declare const minimumReserveValue = 2500;
|
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.usdcLogoUri = exports.lpAddressesCachePrefix = exports.zeroBigNumber = exports.zeroBigInt = void 0;
|
6
|
+
exports.minimumReserveValue = exports.usdcLogoUri = exports.lpAddressesCachePrefix = exports.zeroBigNumber = exports.zeroBigInt = void 0;
|
7
7
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
8
8
|
exports.zeroBigInt = BigInt(0);
|
9
9
|
exports.zeroBigNumber = (0, bignumber_js_1.default)(0);
|
10
10
|
exports.lpAddressesCachePrefix = 'lp-addresses';
|
11
11
|
exports.usdcLogoUri = 'https://raw.githubusercontent.com/sonarwatch/token-lists/main/images/common/USDC.png';
|
12
|
+
exports.minimumReserveValue = 2500;
|
12
13
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/constants.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAExB,QAAA,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,QAAA,aAAa,GAAG,IAAA,sBAAS,EAAC,CAAC,CAAC,CAAC;AAC7B,QAAA,sBAAsB,GAAG,cAAc,CAAC;AACxC,QAAA,WAAW,GACtB,sFAAsF,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/constants.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAExB,QAAA,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,QAAA,aAAa,GAAG,IAAA,sBAAS,EAAC,CAAC,CAAC,CAAC;AAC7B,QAAA,sBAAsB,GAAG,cAAc,CAAC;AACxC,QAAA,WAAW,GACtB,sFAAsF,CAAC;AAC5E,QAAA,mBAAmB,GAAG,IAAI,CAAC"}
|