@sonarwatch/portfolio-plugins 0.12.84 → 0.12.86
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/AirdropFetcher.js +5 -5
- package/src/AirdropFetcher.js.map +1 -1
- package/src/Cache.d.ts +0 -12
- package/src/Cache.js +1 -42
- package/src/Cache.js.map +1 -1
- package/src/plugins/circuit/vaultsJob.js +5 -4
- package/src/plugins/circuit/vaultsJob.js.map +1 -1
- package/src/plugins/drift/constants.d.ts +1 -1
- package/src/plugins/drift/constants.js +2 -2
- package/src/plugins/drift/constants.js.map +1 -1
- package/src/plugins/drift/depositsFetcher.js +30 -32
- package/src/plugins/drift/depositsFetcher.js.map +1 -1
- package/src/plugins/drift/spotMarketsJob.js +7 -2
- package/src/plugins/drift/spotMarketsJob.js.map +1 -1
- package/src/plugins/instadapp/index.js +5 -1
- package/src/plugins/instadapp/index.js.map +1 -1
- package/src/plugins/instadapp/liteJob.js +3 -6
- package/src/plugins/instadapp/liteJob.js.map +1 -1
- package/src/plugins/liquiditypools-sei/constants.d.ts +1 -1
- package/src/plugins/liquiditypools-sei/constants.js +2 -2
- package/src/plugins/liquiditypools-sei/constants.js.map +1 -1
- package/src/plugins/liquiditypools-sei/fetcher.js +7 -7
- package/src/plugins/liquiditypools-sei/fetcher.js.map +1 -1
- package/src/plugins/liquiditypools-sei/job.js +7 -5
- package/src/plugins/liquiditypools-sei/job.js.map +1 -1
- package/src/plugins/tokens/fetchers/evms/index.js +0 -2
- package/src/plugins/tokens/fetchers/evms/index.js.map +1 -1
- package/src/plugins/yearn/getStakesBalancesFetcher.js +1 -1
- package/src/plugins/yearn/getStakesBalancesFetcher.js.map +1 -1
- package/src/plugins/yearn/getVaultsBalancesFetcher.js +1 -1
- package/src/plugins/yearn/getVaultsBalancesFetcher.js.map +1 -1
- package/src/plugins/yearn/getYearnStakeBalancesFetcher.js +1 -1
- package/src/plugins/yearn/getYearnStakeBalancesFetcher.js.map +1 -1
- package/src/plugins/yearn/helpers.d.ts +1 -1
- package/src/plugins/yearn/helpers.js +3 -3
- package/src/plugins/yearn/helpers.js.map +1 -1
- package/src/utils/evm/getEvmLpFetcher.d.ts +3 -0
- package/src/{plugins/tokens/fetchers/evms → utils/evm}/getEvmLpFetcher.js +8 -15
- package/src/utils/evm/getEvmLpFetcher.js.map +1 -0
- package/src/utils/misc/constants.d.ts +0 -1
- package/src/utils/misc/constants.js +1 -2
- package/src/utils/misc/constants.js.map +1 -1
- package/src/plugins/tokens/fetchers/evms/getEvmLpFetcher.d.ts +0 -3
- package/src/plugins/tokens/fetchers/evms/getEvmLpFetcher.js.map +0 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.12.86](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.85...plugins-0.12.86) (2024-07-23)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.12.85](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.84...plugins-0.12.85) (2024-07-22)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.12.84](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.83...plugins-0.12.84) (2024-07-22)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
package/src/AirdropFetcher.js
CHANGED
@@ -166,16 +166,16 @@ function internalRunAirdropFetcher(owner, fetcher, cache, useCache = true) {
|
|
166
166
|
}
|
167
167
|
const airdrop = yield fetcher.executor(owner, cache);
|
168
168
|
// TTL is 120000 ms (2min)
|
169
|
-
// If ineligible or claimed
|
170
|
-
// If not claimable yet
|
169
|
+
// If ineligible or claimed 240000 ms (4min)
|
170
|
+
// If not claimable yet 240000 ms (4min) or until claim start
|
171
171
|
let ttl = 120000;
|
172
172
|
const now = Date.now();
|
173
173
|
if (airdrop.items.every((i) => !(0, portfolio_core_1.isEligibleAmount)(i.amount)))
|
174
|
-
ttl =
|
174
|
+
ttl = 240000;
|
175
175
|
else if (airdrop.items.every((i) => i.isClaimed === true))
|
176
|
-
ttl =
|
176
|
+
ttl = 240000;
|
177
177
|
else if (airdrop.claimStart && airdrop.claimStart > now) {
|
178
|
-
ttl = Math.min(
|
178
|
+
ttl = Math.min(240000, airdrop.claimStart - now);
|
179
179
|
}
|
180
180
|
yield cache.setItem(`${fetcher.id}_${owner}`, airdrop, {
|
181
181
|
ttl,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AirdropFetcher.js","sourceRoot":"","sources":["../../../../packages/plugins/src/AirdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DA2BoC;AAEpC,iFAAyD;AAEzD,iGAAyE;AAa5D,QAAA,2BAA2B,GAAG,kBAAkB,CAAC;AAC9D,SAAsB,oBAAoB,CACxC,MAGG,EACH,SAAwB,EACxB,KAAY;;QAEZ,MAAM,KAAK,CAAC,QAAQ,CAClB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;YAChC,GAAG,EAAE,KAAK;YACV,KAAK,EAAE,KAAK;SACb,CAAC,CAAC,EACH;YACE,SAAS;YACT,MAAM,EAAE,mCAA2B;SACpC,CACF,CAAC;IACJ,CAAC;CAAA;AAlBD,oDAkBC;AAED,SAAe,oBAAoB,CACjC,MAAgB,EAChB,UAAyB,EACzB,KAAY;;QAEZ,MAAM,SAAS,GAA0B,IAAI,GAAG,EAAE,CAAC;QACnD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC;QAE1C,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAS,MAAM,EAAE;YAClD,SAAS,EAAE,UAAU;YACrB,MAAM,EAAE,mCAA2B;SACpC,CAAC,CAAC;QACH,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACtB,SAAS,C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SAAS,EACxB,SAAS,EACT,IAAI,CAAC,KAAK,IAAI,SAAS,EACvB,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,UAAU,EAAE,CACvD;oBACH,CAAC,CAAC;wBACE,IAAI,EAAE,mCAAkB,CAAC,OAAO;wBAChC,IAAI,EAAE;4BACJ,MAAM,EAAE,IAAI,CAAC,MAAM;4BACnB,KAAK,EAAE,IAAI,CAAC,KAAK;yBAClB;wBACD,IAAI,EAAE,IAAI,CAAC,KAAK;wBAChB,SAAS,EAAE,cAAc,CAAC,SAAS;wBACnC,UAAU,EAAE;4BACV,WAAW,EAAE,IAAI;4BACjB,WAAW,EAAE,OAAO,CAAC,UAAU;yBAChC;wBACD,KAAK,EAAE,IAAI,CAAC,KAAK;wBACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;qBACxB,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;YAEH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,EAAE,CAAC;YACnC,OAAO;gBACL;oBACE,SAAS,EAAE,cAAc,CAAC,SAAS;oBACnC,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE;wBACJ,MAAM;qBACP;oBACD,UAAU;oBACV,IAAI,EAAE,qCAAoB,CAAC,QAAQ;oBACnC,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;oBACjD,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,SAAS;iBAChC;aACF,CAAC;QACJ,CAAC,CAAA;KACF,CAAC;AACJ,CAAC;AApED,0DAoEC"}
|
package/src/Cache.d.ts
CHANGED
@@ -84,16 +84,6 @@ export declare class Cache {
|
|
84
84
|
private getTokenPriceSources;
|
85
85
|
private getTokenPricesSources;
|
86
86
|
getItems<K extends StorageValue>(keys: string[], opts: TransactionOptions): Promise<(K | undefined)[]>;
|
87
|
-
/**
|
88
|
-
* @deprecated
|
89
|
-
* This function has been deprecated. Use the getItems.
|
90
|
-
*/
|
91
|
-
getAllItems<K extends StorageValue>(opts: TransactionOptions): Promise<K[]>;
|
92
|
-
/**
|
93
|
-
* @deprecated
|
94
|
-
* This function has been deprecated. Use the getItems.
|
95
|
-
*/
|
96
|
-
getAllItemsAsMap<K extends StorageValue>(opts: TransactionOptions): Promise<Map<string, K>>;
|
97
87
|
setItem<K extends StorageValue>(key: string, value: K, opts: TransactionOptions & TransactionOptionsSetItem): Promise<void>;
|
98
88
|
setItems<K extends StorageValue>(items: {
|
99
89
|
key: string;
|
@@ -102,8 +92,6 @@ export declare class Cache {
|
|
102
92
|
setTokenPriceSource(source: TokenPriceSource): Promise<void>;
|
103
93
|
setTokenPriceSources(sources: (TokenPriceSource | null)[]): Promise<void>;
|
104
94
|
removeItem(key: string, opts: TransactionOptions): Promise<void>;
|
105
|
-
getKeys(opts: TransactionOptions): Promise<string[]>;
|
106
|
-
getTokenPriceAddresses(networkId: NetworkIdType): Promise<string[]>;
|
107
95
|
dispose(): Promise<void>;
|
108
96
|
}
|
109
97
|
export declare function getCacheConfig(): CacheConfig;
|
package/src/Cache.js
CHANGED
@@ -169,33 +169,6 @@ class Cache {
|
|
169
169
|
return res.map((r) => r.value);
|
170
170
|
});
|
171
171
|
}
|
172
|
-
/**
|
173
|
-
* @deprecated
|
174
|
-
* This function has been deprecated. Use the getItems.
|
175
|
-
*/
|
176
|
-
getAllItems(opts) {
|
177
|
-
return __awaiter(this, void 0, void 0, function* () {
|
178
|
-
const itemsMap = yield this.getAllItemsAsMap(opts);
|
179
|
-
return Array.from(itemsMap.values());
|
180
|
-
});
|
181
|
-
}
|
182
|
-
/**
|
183
|
-
* @deprecated
|
184
|
-
* This function has been deprecated. Use the getItems.
|
185
|
-
*/
|
186
|
-
getAllItemsAsMap(opts) {
|
187
|
-
return __awaiter(this, void 0, void 0, function* () {
|
188
|
-
const keys = yield this.getKeys(opts);
|
189
|
-
const itemsMap = new Map();
|
190
|
-
const items = yield this.getItems(keys, opts);
|
191
|
-
for (let i = 0; i < items.length; i += 1) {
|
192
|
-
const item = items[i];
|
193
|
-
if (item !== undefined)
|
194
|
-
itemsMap.set(keys[i], item);
|
195
|
-
}
|
196
|
-
return itemsMap;
|
197
|
-
});
|
198
|
-
}
|
199
172
|
setItem(key, value, opts) {
|
200
173
|
return __awaiter(this, void 0, void 0, function* () {
|
201
174
|
const fullKey = getFullKey(key, opts);
|
@@ -247,21 +220,6 @@ class Cache {
|
|
247
220
|
return this.storage.removeItem(fullKey);
|
248
221
|
});
|
249
222
|
}
|
250
|
-
getKeys(opts) {
|
251
|
-
return __awaiter(this, void 0, void 0, function* () {
|
252
|
-
const fullBase = getFullBase(opts);
|
253
|
-
const keys = yield this.storage.getKeys(fullBase);
|
254
|
-
return keys.map((s) => s.substring(fullBase.length));
|
255
|
-
});
|
256
|
-
}
|
257
|
-
getTokenPriceAddresses(networkId) {
|
258
|
-
return __awaiter(this, void 0, void 0, function* () {
|
259
|
-
return this.getKeys({
|
260
|
-
prefix: tokenPriceSourcePrefix,
|
261
|
-
networkId,
|
262
|
-
});
|
263
|
-
});
|
264
|
-
}
|
265
223
|
dispose() {
|
266
224
|
return __awaiter(this, void 0, void 0, function* () {
|
267
225
|
yield this.tokenPriceStorage.dispose();
|
@@ -275,6 +233,7 @@ function getFullKey(key, opts) {
|
|
275
233
|
const networkIdKeyPrefix = networkId ? `/${networkId.toString()}` : '';
|
276
234
|
return `/${prefix}${networkIdKeyPrefix}/${key}`;
|
277
235
|
}
|
236
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
278
237
|
function getFullBase(opts) {
|
279
238
|
const { networkId, prefix } = opts;
|
280
239
|
const networkIdBasePrefix = networkId ? `${networkId.toString()}:` : '';
|
package/src/Cache.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Cache.js","sourceR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ACrC,OAAO,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;AAChC,CAAC;AAHD,4BAGC"}
|
@@ -19,12 +19,13 @@ const structs_1 = require("./structs");
|
|
19
19
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
20
20
|
const client = (0, clients_1.getClientSolana)();
|
21
21
|
const vaults = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.vaultStruct, constants_2.circuitPid, filters_1.vaultFilter);
|
22
|
+
const spotMarkets = (yield cache.getItem(constants_1.keySpotMarkets, {
|
23
|
+
prefix: constants_1.platformId,
|
24
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
25
|
+
})) || [];
|
22
26
|
for (const vault of vaults) {
|
23
27
|
const name = (0, solana_1.u8ArrayToString)(vault.name);
|
24
|
-
const spotMarket =
|
25
|
-
prefix: constants_1.prefixSpotMarkets,
|
26
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
27
|
-
});
|
28
|
+
const spotMarket = spotMarkets.find((sm) => sm.marketIndex === vault.spotMarketIndex);
|
28
29
|
if (!spotMarket)
|
29
30
|
continue;
|
30
31
|
const mint = spotMarket.mint.toString();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/circuit/vaultsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAsD;AACtD,+CAA+E;AAC/E,
|
1
|
+
{"version":3,"file":"vaultsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/circuit/vaultsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAsD;AACtD,+CAA+E;AAC/E,kDAG4B;AAC5B,2CAAmE;AACnE,uCAAwC;AACxC,uCAAwC;AAIxC,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAwB,EAC3C,MAAM,EACN,qBAAW,EACX,sBAAU,EACV,qBAAW,CACZ,CAAC;IAEF,MAAM,WAAW,GACf,CAAC,MAAM,KAAK,CAAC,OAAO,CAAuB,0BAAc,EAAE;QACzD,MAAM,EAAE,sBAAe;QACvB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC,IAAI,EAAE,CAAC;IACZ,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,IAAA,wBAAe,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CACjC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,KAAK,KAAK,CAAC,eAAe,CACjD,CAAC;QACF,IAAI,CAAC,UAAU;YAAE,SAAS;QAE1B,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC;QAChC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACvC,MAAM,KAAK,CAAC,OAAO,CACjB,MAAM,EACN,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAChC,EAAE,MAAM,EAAE,wBAAY,EAAE,SAAS,EAAE,0BAAS,CAAC,MAAM,EAAE,CACtD,CAAC;IACJ,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"}
|
@@ -6,7 +6,7 @@ export declare const platformName = "Drift";
|
|
6
6
|
export declare const platformImage = "https://sonar.watch/img/platforms/drift.webp";
|
7
7
|
export declare const platformWebsite = "https://www.drift.trade/";
|
8
8
|
export declare const platform: Platform;
|
9
|
-
export declare const
|
9
|
+
export declare const keySpotMarkets = "spotMarkets";
|
10
10
|
export declare const driftProgram: PublicKey;
|
11
11
|
export declare const preMarketPriceKey = "premarketPrice";
|
12
12
|
export declare const perpMarketsIndexesKey = "perp-markets-indexes";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.airdropStatics = exports.driftMint = exports.driftDecimals = exports.airdropUrl = exports.oracleToMintKey = exports.perpMarketsIndexesKey = exports.preMarketPriceKey = exports.driftProgram = exports.
|
3
|
+
exports.airdropStatics = exports.driftMint = exports.driftDecimals = exports.airdropUrl = exports.oracleToMintKey = exports.perpMarketsIndexesKey = exports.preMarketPriceKey = exports.driftProgram = exports.keySpotMarkets = exports.platform = exports.platformWebsite = exports.platformImage = exports.platformName = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'drift';
|
6
6
|
exports.platformName = 'Drift';
|
@@ -13,7 +13,7 @@ exports.platform = {
|
|
13
13
|
defiLlamaId: 'drift',
|
14
14
|
website: exports.platformWebsite,
|
15
15
|
};
|
16
|
-
exports.
|
16
|
+
exports.keySpotMarkets = `spotMarkets`;
|
17
17
|
exports.driftProgram = new web3_js_1.PublicKey('dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH');
|
18
18
|
exports.preMarketPriceKey = 'premarketPrice';
|
19
19
|
exports.perpMarketsIndexesKey = 'perp-markets-indexes';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,YAAY,GAAG,OAAO,CAAC;AACvB,QAAA,aAAa,GAAG,8CAA8C,CAAC;AAC/D,QAAA,eAAe,GAAG,0BAA0B,CAAC;AAC7C,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,oBAAY;IAClB,KAAK,EAAE,qBAAa;IACpB,WAAW,EAAE,OAAO;IACpB,OAAO,EAAE,uBAAe;CACzB,CAAC;AACW,QAAA,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,YAAY,GAAG,OAAO,CAAC;AACvB,QAAA,aAAa,GAAG,8CAA8C,CAAC;AAC/D,QAAA,eAAe,GAAG,0BAA0B,CAAC;AAC7C,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,oBAAY;IAClB,KAAK,EAAE,qBAAa;IACpB,WAAW,EAAE,OAAO;IACpB,OAAO,EAAE,uBAAe;CACzB,CAAC;AACW,QAAA,cAAc,GAAG,aAAa,CAAC;AAE/B,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,iBAAiB,GAAG,gBAAgB,CAAC;AACrC,QAAA,qBAAqB,GAAG,sBAAsB,CAAC;AAC/C,QAAA,eAAe,GAAG,gBAAgB,CAAC;AAEnC,QAAA,UAAU,GAAG,0CAA0C,CAAC;AACxD,QAAA,aAAa,GAAG,CAAC,CAAC;AAClB,QAAA,SAAS,GAAG,8CAA8C,CAAC;AAE3D,QAAA,cAAc,GAAmB;IAC5C,EAAE,EAAE,iBAAiB;IACrB,SAAS,EAAE,0BAA0B;IACrC,KAAK,EAAE,qBAAa;IACpB,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,oBAAY;IACzB,WAAW,EAAE,uBAAe;IAC5B,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,aAAa;CACxB,CAAC"}
|
@@ -29,16 +29,15 @@ const getPerpMarket_1 = require("./perpHelpers/getPerpMarket");
|
|
29
29
|
const getMintFromOracle_1 = require("./perpHelpers/getMintFromOracle");
|
30
30
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
31
31
|
const client = (0, clients_1.getClientSolana)();
|
32
|
-
|
33
|
-
|
32
|
+
// Insurance
|
33
|
+
const spotMarketsItems = yield cache.getItem(constants_1.keySpotMarkets, {
|
34
|
+
prefix: constants_1.platformId,
|
34
35
|
networkId: portfolio_core_1.NetworkId.solana,
|
35
36
|
});
|
36
|
-
if (spotMarketsItems.length === 0)
|
37
|
-
return [];
|
38
37
|
const spotMarketByIndex = new Map();
|
39
38
|
const tokensMints = [];
|
40
39
|
const insuranceFundStakeAccountsAddresses = [];
|
41
|
-
for (const spotMarketItem of spotMarketsItems) {
|
40
|
+
for (const spotMarketItem of spotMarketsItems || []) {
|
42
41
|
insuranceFundStakeAccountsAddresses[spotMarketItem.marketIndex] =
|
43
42
|
(0, helpers_1.getUserInsuranceFundStakeAccountPublicKey)(constants_1.driftProgram, new web3_js_1.PublicKey(owner), spotMarketItem.marketIndex);
|
44
43
|
spotMarketByIndex.set(spotMarketItem.marketIndex, spotMarketItem);
|
@@ -49,34 +48,33 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
49
48
|
tokensPrices.forEach((tP) => (tP ? tokenPriceById.set(tP.address, tP) : []));
|
50
49
|
const insuranceAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, struct_1.insuranceFundStakeStruct, insuranceFundStakeAccountsAddresses);
|
51
50
|
const elements = [];
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
51
|
+
const insuranceAssets = [];
|
52
|
+
insuranceAccounts.forEach((account, i) => {
|
53
|
+
var _a;
|
54
|
+
if (!account || account.costBasis.isLessThan(0))
|
55
|
+
return;
|
56
|
+
const mint = (_a = spotMarketByIndex.get(i)) === null || _a === void 0 ? void 0 : _a.mint.toString();
|
57
|
+
if (!mint)
|
58
|
+
return;
|
59
|
+
const tokenPrice = tokenPriceById.get(mint);
|
60
|
+
if (!tokenPrice)
|
61
|
+
return;
|
62
|
+
insuranceAssets.push((0, tokenPriceToAssetToken_1.default)(mint, account.costBasis.dividedBy(Math.pow(10, tokenPrice.decimals)).toNumber(), portfolio_core_1.NetworkId.solana, tokenPrice));
|
63
|
+
});
|
64
|
+
if (insuranceAssets.length > 0) {
|
65
|
+
elements.push({
|
66
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
67
|
+
label: 'Staked',
|
68
|
+
name: 'Insurance Fund',
|
69
|
+
platformId: constants_1.platformId,
|
70
|
+
type: portfolio_core_1.PortfolioElementType.multiple,
|
71
|
+
value: (0, portfolio_core_1.getUsdValueSum)(insuranceAssets.map((a) => a.value)),
|
72
|
+
data: {
|
73
|
+
assets: insuranceAssets,
|
74
|
+
},
|
65
75
|
});
|
66
|
-
if (assets.length !== 0) {
|
67
|
-
elements.push({
|
68
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
69
|
-
label: 'Staked',
|
70
|
-
name: 'Insurance Fund',
|
71
|
-
platformId: constants_1.platformId,
|
72
|
-
type: portfolio_core_1.PortfolioElementType.multiple,
|
73
|
-
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
|
74
|
-
data: {
|
75
|
-
assets,
|
76
|
-
},
|
77
|
-
});
|
78
|
-
}
|
79
76
|
}
|
77
|
+
// Perps part
|
80
78
|
let id = 0;
|
81
79
|
const userAccounts = [];
|
82
80
|
let parsedAccount;
|
@@ -86,7 +84,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
86
84
|
userAccounts.push(...parsedAccount);
|
87
85
|
id += 10;
|
88
86
|
} while (parsedAccount[parsedAccount.length]);
|
89
|
-
if (!userAccounts)
|
87
|
+
if (!userAccounts || userAccounts.length === 0)
|
90
88
|
return elements;
|
91
89
|
const perpMarketIndexesArr = yield cache.getItem(constants_1.perpMarketsIndexesKey, {
|
92
90
|
prefix: constants_1.platformId,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAaoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,2CAKqB;AACrB,qCAKkB;AAClB,uCAMmB;AAEnB,+CAI4B;AAC5B,iDAAsD;AACtD,qGAA6E;AAC7E,qDAGgC;AAChC,uDAAqE;AACrE,+CAAwD;AACxD,iEAA8D;AAC9D,+DAA4D;AAC5D,uEAAoE;AAEpE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAaoC;AACpC,gEAAqC;AACrC,6CAA4C;AAG5C,2CAKqB;AACrB,qCAKkB;AAClB,uCAMmB;AAEnB,+CAI4B;AAC5B,iDAAsD;AACtD,qGAA6E;AAC7E,qDAGgC;AAChC,uDAAqE;AACrE,+CAAwD;AACxD,iEAA8D;AAC9D,+DAA4D;AAC5D,uEAAoE;AAEpE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,YAAY;IAEZ,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,OAAO,CAC1C,0BAAc,EACd;QACE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,C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AAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK;YACL,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,YAAY;gBACZ,WAAW;gBACX,WAAW;gBACX,SAAS,EAAE;oBACT,MAAM,EAAE,eAAe;oBACvB,KAAK,EAAE,cAAc;iBACtB;gBACD,KAAK;aACN;YACD,IAAI,EAAE,IAAA,wBAAe,EAAC,WAAW,CAAC,IAAI,CAAC;SACxC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -35,12 +35,13 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
35
|
prefix: constants_1.platformId,
|
36
36
|
networkId: portfolio_core_1.NetworkId.solana,
|
37
37
|
});
|
38
|
+
const spotMarkets = [];
|
38
39
|
for (let index = 0; index < spotMarketsAccount.length; index++) {
|
39
40
|
const spotMarketAccount = spotMarketsAccount[index];
|
40
41
|
const depositApr = (0, helpers_1.calculateDepositRate)(spotMarketAccount).toNumber();
|
41
42
|
const borrowApr = (0, helpers_1.calculateBorrowRate)(spotMarketAccount).toNumber();
|
42
|
-
|
43
|
-
borrowApr })
|
43
|
+
spotMarkets.push(Object.assign(Object.assign({}, spotMarketAccount), { depositApr,
|
44
|
+
borrowApr }));
|
44
45
|
const { decimals } = spotMarketAccount;
|
45
46
|
const precisionDecrease = new bignumber_js_1.default(10).pow(new bignumber_js_1.default(19 - decimals));
|
46
47
|
const tokenAddress = spotMarketAccount.mint.toString();
|
@@ -71,6 +72,10 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
72
|
networkId: portfolio_core_1.NetworkId.solana,
|
72
73
|
});
|
73
74
|
}
|
75
|
+
yield cache.setItem(constants_1.keySpotMarkets, spotMarkets, {
|
76
|
+
prefix: constants_1.platformId,
|
77
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
78
|
+
});
|
74
79
|
});
|
75
80
|
const job = {
|
76
81
|
id: `${constants_1.platformId}-spotMarkets`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"spotMarketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/spotMarketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AACrC,2CAKqB;AACrB,+CAA8D;AAC9D,qCAA4C;AAC5C,uCAAyC;AACzC,iDAAsD;AACtD,uCAKmB;AAKnB,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,kBAAkB,GAAG,MAAM,IAAA,iCAAwB,EACvD,MAAM,EACN,yBAAgB,EAChB,wBAAY,EACZ,sBAAY,CACb,CAAC;IACF,IAAI,CAAC,kBAAkB;QAAE,OAAO;IAEhC,iBAAiB;IACjB,MAAM,YAAY,GAAuB,EAAE,CAAC;IAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACnD,MAAM,GAAG,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;QAClC,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IACD,MAAM,KAAK,CAAC,OAAO,CAAC,2BAAe,EAAE,YAAY,EAAE;QACjD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,C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AAI,eAAe,IAAI,EAAE;YAAE,SAAS;QAE5D,MAAM,IAAI,GAAmB;YAC3B,YAAY;YACZ,WAAW,EAAE;gBACX,GAAG,EAAE,IAAA,yBAAQ,EAAC,SAAS,CAAC;gBACxB,GAAG,EAAE,SAAS;aACf;YACD,cAAc;YACd,YAAY,EAAE;gBACZ,GAAG,EAAE,IAAA,yBAAQ,EAAC,UAAU,CAAC;gBACzB,GAAG,EAAE,UAAU;aAChB;YACD,eAAe;YACf,UAAU,EAAV,sBAAU;YACV,QAAQ,EAAE,MAAM;SACjB,CAAC;QAEF,MAAM,KAAK,CAAC,OAAO,CACjB,GAAG,iBAAiB,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,YAAY,EAAE,EACvD,IAAI,EACJ;YACE,MAAM,EAAE,sCAAqB;YAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CACF,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,CAAC,OAAO,CAAuB,0BAAc,EAAE,WAAW,EAAE;QACrE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -4,9 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
7
8
|
const constants_1 = require("./constants");
|
8
9
|
const liteJob_1 = __importDefault(require("./liteJob"));
|
10
|
+
const getEvmLpFetcher_1 = __importDefault(require("../../utils/evm/getEvmLpFetcher"));
|
9
11
|
exports.platforms = [constants_1.platform];
|
10
12
|
exports.jobs = [liteJob_1.default];
|
11
|
-
exports.fetchers = [
|
13
|
+
exports.fetchers = [
|
14
|
+
(0, getEvmLpFetcher_1.default)(`${constants_1.platform.id}-lite-lp`, portfolio_core_1.NetworkId.ethereum, constants_1.liteConfigs.map((lc) => lc.address)),
|
15
|
+
];
|
12
16
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/instadapp/index.ts"],"names":[],"mappings":";;;;;;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/instadapp/index.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAiE;AAGjE,2CAAoD;AACpD,wDAAgC;AAChC,sFAA8D;AAEjD,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,iBAAO,CAAC,CAAC;AACxB,QAAA,QAAQ,GAAc;IACjC,IAAA,yBAAe,EACb,GAAG,oBAAQ,CAAC,EAAE,UAAU,EACxB,0BAAS,CAAC,QAAQ,EAClB,uBAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CACpC;CACF,CAAC"}
|
@@ -18,9 +18,9 @@ const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
18
18
|
const constants_1 = require("./constants");
|
19
19
|
const clients_1 = require("../../utils/clients");
|
20
20
|
const abis_1 = require("./abis");
|
21
|
-
const constants_2 = require("../../utils/misc/constants");
|
22
21
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
22
|
const client = (0, clients_1.getEvmClient)(portfolio_core_1.NetworkId.ethereum);
|
23
|
+
const sources = [];
|
24
24
|
for (let i = 0; i < constants_1.liteConfigs.length; i++) {
|
25
25
|
const config = constants_1.liteConfigs[i];
|
26
26
|
const uTokenPrice = yield cache.getTokenPrice(config.underlyingAddress, portfolio_core_1.NetworkId.ethereum);
|
@@ -47,7 +47,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
47
|
const ratio = new bignumber_js_1.default(exchangePrice.toString())
|
48
48
|
.dividedBy(Math.pow(10, 18))
|
49
49
|
.toNumber();
|
50
|
-
|
50
|
+
sources.push({
|
51
51
|
networkId: portfolio_core_1.NetworkId.ethereum,
|
52
52
|
platformId: constants_1.platformId,
|
53
53
|
price: ratio * uTokenPrice.price,
|
@@ -68,10 +68,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
68
|
decimals: config.decimals,
|
69
69
|
});
|
70
70
|
}
|
71
|
-
yield cache.
|
72
|
-
prefix: constants_2.lpAddressesCachePrefix,
|
73
|
-
networkId: portfolio_core_1.NetworkId.ethereum,
|
74
|
-
});
|
71
|
+
yield cache.setTokenPriceSources(sources);
|
75
72
|
});
|
76
73
|
const job = {
|
77
74
|
id: `${constants_1.platformId}-lite`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"liteJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/instadapp/liteJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"liteJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/instadapp/liteJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,+BAAkC;AAClC,gEAAqC;AACrC,2CAAsD;AAGtD,iDAAmD;AACnD,iCAA8C;AAE9C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,EAAC,0BAAS,CAAC,QAAQ,CAAC,CAAC;IAEhD,MAAM,OAAO,GAAuB,EAAE,CAAC;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,uBAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,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AK;oBAClB,SAAS,EAAE,WAAW,CAAC,SAAS;oBAChC,KAAK,EAAE,WAAW,CAAC,KAAK;oBACxB,QAAQ,EAAE,WAAW,CAAC,QAAQ;iBAC/B;aACF;YACD,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,EAAE,EAAE,GAAG,sBAAU,OAAO;YACxB,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,CAAC,CAAC;IACL,CAAC;IAED,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,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"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { Platform } from '@sonarwatch/portfolio-core';
|
2
2
|
import { TokensInfosGetter } from './helpers';
|
3
|
-
export declare const pluginId = "liquidityPools-sei";
|
4
3
|
export declare const seaswapPlatform: Platform;
|
5
4
|
export declare const astroportPlatform: Platform;
|
5
|
+
export declare const liquidityPoolsKey = "liquiditypools";
|
6
6
|
export declare const liquidityPoolsInfos: LiquidityPoolsInfo[];
|
7
7
|
type LiquidityPoolsInfo = {
|
8
8
|
platformId: string;
|
@@ -1,8 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.liquidityPoolsInfos = exports.
|
3
|
+
exports.liquidityPoolsInfos = exports.liquidityPoolsKey = exports.astroportPlatform = exports.seaswapPlatform = void 0;
|
4
4
|
const helpers_1 = require("./helpers");
|
5
|
-
exports.pluginId = 'liquidityPools-sei';
|
6
5
|
exports.seaswapPlatform = {
|
7
6
|
id: 'seaswap',
|
8
7
|
name: 'Seaswap',
|
@@ -18,6 +17,7 @@ exports.astroportPlatform = {
|
|
18
17
|
twitter: 'https://twitter.com/astroport_fi',
|
19
18
|
defiLlamaId: 'astroport',
|
20
19
|
};
|
20
|
+
exports.liquidityPoolsKey = 'liquiditypools';
|
21
21
|
exports.liquidityPoolsInfos = [
|
22
22
|
{
|
23
23
|
platformId: exports.astroportPlatform.id,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liquiditypools-sei/constants.ts"],"names":[],"mappings":";;;AACA,uCAImB;AAEN,QAAA,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liquiditypools-sei/constants.ts"],"names":[],"mappings":";;;AACA,uCAImB;AAEN,QAAA,eAAe,GAAa;IACvC,EAAE,EAAE,SAAS;IACb,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,gDAAgD;IACvD,WAAW,EAAE,SAAS;IACtB,OAAO,EAAE,qBAAqB;CAC/B,CAAC;AACW,QAAA,iBAAiB,GAAa;IACzC,EAAE,EAAE,WAAW;IACf,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,sBAAsB;IAC/B,OAAO,EAAE,kCAAkC;IAC3C,WAAW,EAAE,WAAW;CACzB,CAAC;AAEW,QAAA,iBAAiB,GAAG,gBAAgB,CAAC;AACrC,QAAA,mBAAmB,GAAyB;IACvD;QACE,UAAU,EAAE,yBAAiB,CAAC,EAAE;QAChC,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC;QACf,MAAM,EAAE,0BAAgB;KACzB;IACD;QACE,UAAU,EAAE,uBAAe,CAAC,EAAE;QAC9B,KAAK,EAAE,CAAC,EAAE,CAAC;QACX,YAAY,EAAE,CAAC,yBAAyB,CAAC;QACzC,MAAM,EAAE,0BAAgB;KACzB;CACF,CAAC"}
|
@@ -15,18 +15,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
16
|
const core_1 = require("@sei-js/core");
|
17
17
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
18
|
-
const constants_1 = require("
|
19
|
-
const constants_2 = require("../../utils/clients/constants");
|
18
|
+
const constants_1 = require("../../utils/clients/constants");
|
20
19
|
const tokenPriceToAssetTokens_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetTokens"));
|
21
20
|
const getQueryBalanceByOwner_1 = __importDefault(require("../../utils/sei/getQueryBalanceByOwner"));
|
21
|
+
const constants_2 = require("./constants");
|
22
22
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
-
const cosmWasmClient = yield (0, core_1.getCosmWasmClient)((0,
|
23
|
+
const cosmWasmClient = yield (0, core_1.getCosmWasmClient)((0, constants_1.getUrlEndpoint)(portfolio_core_1.NetworkId.sei));
|
24
24
|
const contractsByPlatform = new Map();
|
25
|
-
const platformsContracts = yield cache.
|
26
|
-
prefix:
|
25
|
+
const platformsContracts = yield cache.getItem(constants_2.liquidityPoolsKey, {
|
26
|
+
prefix: constants_2.liquidityPoolsKey,
|
27
27
|
networkId: portfolio_core_1.NetworkId.sei,
|
28
28
|
});
|
29
|
-
if (!platformsContracts)
|
29
|
+
if (!platformsContracts || platformsContracts.length === 0)
|
30
30
|
return [];
|
31
31
|
const tokenPriceById = yield cache.getTokenPricesAsMap(platformsContracts
|
32
32
|
.map((platformContracts) => platformContracts.contracts)
|
@@ -80,7 +80,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
80
80
|
return elements;
|
81
81
|
});
|
82
82
|
const fetcher = {
|
83
|
-
id:
|
83
|
+
id: 'sei-liquiditypools',
|
84
84
|
networkId: portfolio_core_1.NetworkId.sei,
|
85
85
|
executor,
|
86
86
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liquiditypools-sei/fetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,uCAAiD;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AC;QAC9B,CAAC;QACD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAEvC,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,eAAe;YACtB,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACtD,IAAI,EAAE;gBACJ,WAAW;aACZ;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,oBAAoB;IACxB,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -114,18 +114,20 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
114
114
|
}
|
115
115
|
}
|
116
116
|
}
|
117
|
+
const items = [];
|
117
118
|
for (const platform of pushedContractsByPlatform.keys()) {
|
118
119
|
const contracts = pushedContractsByPlatform.get(platform);
|
119
120
|
if (!contracts || contracts.length === 0)
|
120
121
|
continue;
|
121
|
-
|
122
|
-
prefix: constants_2.pluginId,
|
123
|
-
networkId: portfolio_core_1.NetworkId.sei,
|
124
|
-
});
|
122
|
+
items.push({ id: platform, contracts });
|
125
123
|
}
|
124
|
+
yield cache.setItem(constants_2.liquidityPoolsKey, items, {
|
125
|
+
prefix: constants_2.liquidityPoolsKey,
|
126
|
+
networkId: portfolio_core_1.NetworkId.sei,
|
127
|
+
});
|
126
128
|
});
|
127
129
|
const job = {
|
128
|
-
id:
|
130
|
+
id: 'sei-liquiditypools',
|
129
131
|
executor,
|
130
132
|
label: 'normal',
|
131
133
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liquiditypools-sei/job.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uCAAiD;AACjD,+DAAuD;AACvD,gEAAqC;AAGrC,6DAA+D;AAC/D,
|
1
|
+
{"version":3,"file":"job.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/liquiditypools-sei/job.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uCAAiD;AACjD,+DAAuD;AACvD,gEAAqC;AAGrC,6DAA+D;AAC/D,2CAAqE;AACrE,yCAKyB;AACzB,8EAAsD;AACtD,8EAA2E;AAC3E,mHAA2F;AAC3F,qGAA6E;AAG7E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,cAAc,GAAG,MAAM,IAAA,wBAAiB,EAAC,IAAA,0BAAc,EAAC,0BAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAE9E,MAAM,yBAAyB,GAA0B,IAAI,GAAG,EAAE,CAAC;IACnE,KAAK,MAAM,iBAAiB,IAAI,+BAAmB,EAAE,CAAC;QACpD,MAAM,EAAE,KAAK,EAAE,GAAG,iBAAiB,CAAC;QACpC,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,MAAM,EAAE,UAAU,EAAE,GAAG,iBAAiB,CAAC;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,MAAM,cAAc,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACnE,SAAS,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAErC,MAAM,WAAW,GAAG,iBAAiB,CAAC,YAAY,CAAC;QACnD,KAAK,MAAM,UAAU,IAAI,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utorGenerator"));
|
9
9
|
const evmNativeExecutorGenerator_1 = __importDefault(require("./evmNativeExecutorGenerator"));
|
10
10
|
const constants_1 = require("../../constants");
|
11
|
-
const getEvmLpFetcher_1 = __importDefault(require("./getEvmLpFetcher"));
|
12
11
|
const evmNativeNetworksIds = [
|
13
12
|
portfolio_core_1.NetworkId.ethereum,
|
14
13
|
portfolio_core_1.NetworkId.avalanche,
|
@@ -20,7 +19,6 @@ const evmNetworksIds = [
|
|
20
19
|
portfolio_core_1.NetworkId.polygon,
|
21
20
|
];
|
22
21
|
exports.fetchers = [
|
23
|
-
...evmNetworksIds.map((n) => (0, getEvmLpFetcher_1.default)(n)),
|
24
22
|
...evmNativeNetworksIds
|
25
23
|
.map((networkId) => [
|
26
24
|
{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/plugins/src/plugins/tokens/fetchers/evms/index.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAyE;AAEzE,kFAA2D;AAC3D,8FAAuE;AACvE,+CAAuD;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/plugins/src/plugins/tokens/fetchers/evms/index.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAyE;AAEzE,kFAA2D;AAC3D,8FAAuE;AACvE,+CAAuD;AAEvD,MAAM,oBAAoB,GAAuB;IAC/C,0BAAS,CAAC,QAAQ;IAClB,0BAAS,CAAC,SAAS;CACpB,CAAC;AACF,MAAM,cAAc,GAAuB;IACzC,0BAAS,CAAC,QAAQ;IAClB,0BAAS,CAAC,GAAG;IACb,0BAAS,CAAC,SAAS;IACnB,0BAAS,CAAC,OAAO;CAClB,CAAC;AAEW,QAAA,QAAQ,GAAc;IACjC,GAAG,oBAAoB;SACpB,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC;QAClB;YACE,EAAE,EAAE,GAAG,gCAAoB,CAAC,EAAE,IAAI,SAAS,SAAS;YACpD,SAAS;YACT,QAAQ,EAAE,IAAA,oCAA2B,EAAC,SAAS,CAAC;SACjD;KACF,CAAC;SACD,IAAI,EAAE;IACT,GAAG,cAAc;SACd,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC;QAClB;YACE,EAAE,EAAE,GAAG,gCAAoB,CAAC,EAAE,IAAI,SAAS,MAAM;YACjD,SAAS;YACT,QAAQ,EAAE,IAAA,8BAAqB,EAAC,SAAS,EAAE,IAAI,CAAC;SACjD;QACD;YACE,EAAE,EAAE,GAAG,gCAAoB,CAAC,EAAE,IAAI,SAAS,SAAS;YACpD,SAAS;YACT,QAAQ,EAAE,IAAA,8BAAqB,EAAC,SAAS,EAAE,KAAK,CAAC;SAClD;KACF,CAAC;SACD,IAAI,EAAE;CACV,CAAC"}
|
@@ -18,7 +18,7 @@ const helpers_1 = require("./helpers");
|
|
18
18
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
19
19
|
function getStakesBalancesFetcher(networkId, platformId, contracts) {
|
20
20
|
const executor = (owner, cache) => __awaiter(this, void 0, void 0, function* () {
|
21
|
-
const balances = yield (0, helpers_1.
|
21
|
+
const balances = yield (0, helpers_1.getBalancesYearn)(networkId, contracts.map((c) => c.address), owner);
|
22
22
|
const tokenAddresses = contracts.map((v) => v.underlying);
|
23
23
|
const tokensPrices = yield cache.getTokenPrices(tokenAddresses, networkId);
|
24
24
|
const tokenPriceById = new Map();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getStakesBalancesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/getStakesBalancesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAErC,
|
1
|
+
{"version":3,"file":"getStakesBalancesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/getStakesBalancesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC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AAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;qBAC7C,SAAS,CAAC,IAAI,sBAAS,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;qBACrD,QAAQ,EAAE,CAAC;gBAEd,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,UAAU,EACV,MAAM,EACN,SAAS,EACT,UAAU,CACX,CAAC;gBACF,WAAW,CAAC,IAAI,CAAC;oBACf,MAAM,EAAE,CAAC,KAAK,CAAC;oBACf,WAAW,EAAE,KAAK,CAAC,KAAK;oBACxB,YAAY,EAAE,EAAE;oBAChB,iBAAiB,EAAE,IAAI;oBACvB,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,MAAM,EAAE,EAAE;iBACX,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAExC,OAAO;YACL;gBACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;gBACpC,KAAK,EAAE,QAAQ;gBACf,SAAS;gBACT,UAAU;gBACV,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBACtD,IAAI,EAAE;oBACJ,WAAW;iBACZ;aACF;SACF,CAAC;IACJ,CAAC,CAAA,CAAC;IAEF,OAAO;QACL,SAAS;QACT,QAAQ;QACR,EAAE,EAAE,GAAG,UAAU,IAAI,SAAS,QAAQ;KACvC,CAAC;AACJ,CAAC;AArED,2CAqEC"}
|
@@ -25,7 +25,7 @@ function getVaultsBalancesFetcher(networkId, platformId) {
|
|
25
25
|
});
|
26
26
|
if (!vaults)
|
27
27
|
return [];
|
28
|
-
const balances = yield (0, helpers_1.
|
28
|
+
const balances = yield (0, helpers_1.getBalancesYearn)(networkId, vaults.map((v) => v.address), owner);
|
29
29
|
if (balances.length === 0)
|
30
30
|
return [];
|
31
31
|
const tokenAddresses = vaults
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getVaultsBalancesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/getVaultsBalancesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAErC,2CAAwC;AACxC,
|
1
|
+
{"version":3,"file":"getVaultsBalancesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/getVaultsBalancesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAErC,2CAAwC;AACxC,uCAA6C;AAG7C,qGAA6E;AAE7E,SAAwB,wBAAwB,CAC9C,SAA2B,EAC3B,UAAkB;IAElB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;QACtE,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,CAAc,qBAAS,EAAE;YACzD,MAAM,EAAE,UAAU;YAClB,SAAS;SACV,CAAC,CAAC;QACH,IAAI,CAAC,MAAM;YAAE,OAAO,EAAE,CAAC;QAEvB,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAgB,EACrC,SAAS,EACT,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAC5B,KAAK,CACN,CAAC;QACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAErC,MAAM,cAAc,GAAG,MAAM;aAC1B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aAC/C,IAAI,EAAE,CAAC;QACV,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,cAAc,CAAC,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21,7 @@ const clients_1 = require("../../utils/clients");
|
|
21
21
|
function getYearnStakeBalancesFetcher(networkId, platformId, contracts) {
|
22
22
|
const executor = (owner, cache) => __awaiter(this, void 0, void 0, function* () {
|
23
23
|
const client = (0, clients_1.getEvmClient)(networkId);
|
24
|
-
const balances = yield (0, helpers_1.
|
24
|
+
const balances = yield (0, helpers_1.getBalancesYearn)(networkId, contracts.map((c) => c.address), owner);
|
25
25
|
const toAssetContracts = balances.map((balance, index) => ({
|
26
26
|
abi: [abis_1.yearnStakeAbi.convertToAssets],
|
27
27
|
address: contracts[index].address,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getYearnStakeBalancesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/getYearnStakeBalancesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAErC,
|
1
|
+
{"version":3,"file":"getYearnStakeBalancesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/getYearnStakeBalancesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAErC,uCAA6C;AAG7C,qGAA6E;AAC7E,iCAAuC;AACvC,iDAAmD;AAEnD,SAAwB,4BAA4B,CAClD,SAA2B,EAC3B,UAAkB,EAClB,SAAqB;IAErB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;QACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,EAAC,SAAS,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAgB,EACrC,SAAS,EACT,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAC/B,KAAK,CACN,CAAC;QAEF,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CACnC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CACjB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AAU,CAAC,CAAC;gBAClD,IAAI,CAAC,UAAU;oBAAE,SAAS;gBAE1B,MAAM,MAAM,GAAG,IAAI,sBAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;qBAC7C,SAAS,CAAC,IAAI,sBAAS,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;qBACrD,QAAQ,EAAE,CAAC;gBAEd,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,UAAU,EACV,MAAM,EACN,SAAS,EACT,UAAU,CACX,CAAC;gBACF,WAAW,CAAC,IAAI,CAAC;oBACf,MAAM,EAAE,CAAC,KAAK,CAAC;oBACf,WAAW,EAAE,KAAK,CAAC,KAAK;oBACxB,YAAY,EAAE,EAAE;oBAChB,iBAAiB,EAAE,IAAI;oBACvB,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,MAAM,EAAE,EAAE;iBACX,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAExC,OAAO;YACL;gBACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;gBACpC,KAAK,EAAE,QAAQ;gBACf,SAAS;gBACT,UAAU;gBACV,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBACtD,IAAI,EAAE;oBACJ,WAAW;iBACZ;aACF;SACF,CAAC;IACJ,CAAC,CAAA,CAAC;IAEF,OAAO;QACL,SAAS;QACT,QAAQ;QACR,EAAE,EAAE,GAAG,UAAU,IAAI,SAAS,cAAc;KAC7C,CAAC;AACJ,CAAC;AArFD,+CAqFC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { EvmNetworkIdType } from '@sonarwatch/portfolio-core';
|
2
2
|
import { LockerInfo, VaultData, YearnConfig } from './types';
|
3
3
|
export declare function getVaults(config: YearnConfig): Promise<VaultData[]>;
|
4
|
-
export declare function
|
4
|
+
export declare function getBalancesYearn(evmNetworkId: EvmNetworkIdType, contracts: string[], owner: string): Promise<bigint[]>;
|
5
5
|
export declare function getLockersBalances(evmNetworkId: EvmNetworkIdType, contracts: string[], owner: string): Promise<LockerInfo[]>;
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
exports.getLockersBalances = exports.
|
15
|
+
exports.getLockersBalances = exports.getBalancesYearn = exports.getVaults = void 0;
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
17
17
|
const erc20Abi_1 = require("../../utils/evm/erc20Abi");
|
18
18
|
const clients_1 = require("../../utils/clients");
|
@@ -32,7 +32,7 @@ function getVaults(config) {
|
|
32
32
|
});
|
33
33
|
}
|
34
34
|
exports.getVaults = getVaults;
|
35
|
-
function
|
35
|
+
function getBalancesYearn(evmNetworkId, contracts, owner) {
|
36
36
|
return __awaiter(this, void 0, void 0, function* () {
|
37
37
|
const client = (0, clients_1.getEvmClient)(evmNetworkId);
|
38
38
|
const balanceOfBase = {
|
@@ -46,7 +46,7 @@ function getBalances(evmNetworkId, contracts, owner) {
|
|
46
46
|
return balancesRes.map((balance) => balance.status === 'failure' ? BigInt(0) : balance.result);
|
47
47
|
});
|
48
48
|
}
|
49
|
-
exports.
|
49
|
+
exports.getBalancesYearn = getBalancesYearn;
|
50
50
|
function getLockersBalances(evmNetworkId, contracts, owner) {
|
51
51
|
return __awaiter(this, void 0, void 0, function* () {
|
52
52
|
const client = (0, clients_1.getEvmClient)(evmNetworkId);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/yearn/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAA6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O,CAAC,MAAM,KAAK,SAAS;YAC1B,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE;YAC9C,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CACjE,CAAC;IACJ,CAAC;CAAA;AA3BD,gDA2BC"}
|
@@ -10,22 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
-
const
|
14
|
-
const
|
15
|
-
const
|
16
|
-
|
17
|
-
const getLiquidity_1 = require("../../../../utils/evm/getLiquidity");
|
18
|
-
function getEvmLpFetcher(networkId) {
|
13
|
+
const getLiquidity_1 = require("./getLiquidity");
|
14
|
+
const helpers_1 = require("../../plugins/tokens/helpers");
|
15
|
+
const getBalances_1 = require("./getBalances");
|
16
|
+
function getEvmLpFetcher(id, networkId, lpAddresses) {
|
19
17
|
return {
|
20
18
|
executor: (owner, cache) => __awaiter(this, void 0, void 0, function* () {
|
21
|
-
const res = yield cache.getAllItemsAsMap({
|
22
|
-
networkId,
|
23
|
-
prefix: constants_1.lpAddressesCachePrefix,
|
24
|
-
});
|
25
|
-
const lpAddresses = [...new Set(Array.from(res.values()).flat(1))];
|
26
19
|
if (lpAddresses.length === 0)
|
27
20
|
return [];
|
28
|
-
const balances = yield (0,
|
21
|
+
const balances = yield (0, getBalances_1.getBalances)(owner, lpAddresses, networkId);
|
29
22
|
const nonZeroAddresses = lpAddresses.filter((adress, i) => {
|
30
23
|
const balance = balances[i];
|
31
24
|
if (!balance)
|
@@ -46,7 +39,7 @@ function getEvmLpFetcher(networkId) {
|
|
46
39
|
if (!tokenPrice)
|
47
40
|
continue;
|
48
41
|
const liquidity = (0, getLiquidity_1.getLiquidity)(balance, tokenPrice);
|
49
|
-
const tag = (0,
|
42
|
+
const tag = (0, helpers_1.getLpTag)(tokenPrice.platformId, tokenPrice.elementName);
|
50
43
|
if (!liquiditiesByTag[tag]) {
|
51
44
|
liquiditiesByTag[tag] = [];
|
52
45
|
}
|
@@ -54,7 +47,7 @@ function getEvmLpFetcher(networkId) {
|
|
54
47
|
}
|
55
48
|
const elements = [];
|
56
49
|
for (const [tag, liquidities] of Object.entries(liquiditiesByTag)) {
|
57
|
-
const { platformId, elementName } = (0,
|
50
|
+
const { platformId, elementName } = (0, helpers_1.parseLpTag)(tag);
|
58
51
|
elements.push({
|
59
52
|
type: portfolio_core_1.PortfolioElementType.liquidity,
|
60
53
|
networkId,
|
@@ -69,7 +62,7 @@ function getEvmLpFetcher(networkId) {
|
|
69
62
|
}
|
70
63
|
return elements;
|
71
64
|
}),
|
72
|
-
id
|
65
|
+
id,
|
73
66
|
networkId,
|
74
67
|
};
|
75
68
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getEvmLpFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/evm/getEvmLpFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAMoC;AACpC,iDAA8C;AAG9C,0DAAoE;AACpE,+CAA4C;AAE5C,SAAwB,eAAe,CACrC,EAAU,EACV,SAA2B,EAC3B,WAAqB;IAErB,OAAO;QACL,QAAQ,EAAE,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;YAC9C,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,EAAE,CAAC;YAExC,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAW,EAAC,KAAK,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;YAClE,MAAM,gBAAgB,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACxD,MA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;gBAClE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,IAAA,oBAAU,EAAC,GAAG,CAAC,CAAC;gBACpD,QAAQ,CAAC,IAAI,CAAC;oBACZ,IAAI,EAAE,qCAAoB,CAAC,SAAS;oBACpC,SAAS;oBACT,UAAU;oBACV,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,eAAe;oBACtB,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;oBACtD,IAAI,EAAE;wBACJ,WAAW;qBACZ;iBACF,CAAC,CAAC;YACL,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAA;QACD,EAAE;QACF,SAAS;KACV,CAAC;AACJ,CAAC;AA3DD,kCA2DC"}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
2
2
|
export declare const zeroBigInt: bigint;
|
3
3
|
export declare const zeroBigNumber: BigNumber;
|
4
|
-
export declare const lpAddressesCachePrefix = "lp-addresses";
|
5
4
|
export declare const usdcLogoUri = "https://raw.githubusercontent.com/sonarwatch/token-lists/main/images/common/USDC.webp";
|
6
5
|
export declare const minimumReserveValue = 2500;
|
@@ -3,11 +3,10 @@ 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.minimumReserveValue = exports.usdcLogoUri = exports.
|
6
|
+
exports.minimumReserveValue = exports.usdcLogoUri = 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
|
-
exports.lpAddressesCachePrefix = 'lp-addresses';
|
11
10
|
exports.usdcLogoUri = 'https://raw.githubusercontent.com/sonarwatch/token-lists/main/images/common/USDC.webp';
|
12
11
|
exports.minimumReserveValue = 2500;
|
13
12
|
//# 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,
|
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,WAAW,GACtB,uFAAuF,CAAC;AAC7E,QAAA,mBAAmB,GAAG,IAAI,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getEvmLpFetcher.js","sourceRoot":"","sources":["../../../../../../../../packages/plugins/src/plugins/tokens/fetchers/evms/getEvmLpFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAMoC;AAGpC,gEAA0E;AAC1E,+CAAuD;AACvD,oDAAqD;AACrD,2CAAqD;AACrD,qEAAkE;AAElE,SAAwB,eAAe,CAAC,SAA2B;IACjE,OAAO;QACL,QAAQ,EAAE,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;YAC9C,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAW;gBACjD,SAAS;gBACT,MAAM,EAAE,kCAAsB;aAC/B,CAAC,CAAC;YACH,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,G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