@sonarwatch/portfolio-plugins 0.11.121 → 0.11.123
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1215 -1207
- package/README.md +3 -3
- package/package.json +2 -2
- package/src/Cache.d.ts +1 -0
- package/src/Cache.js +7 -0
- package/src/Cache.js.map +1 -1
- package/src/plugins/aftermath/poolsJob.js +1 -1
- package/src/plugins/aftermath/poolsJob.js.map +1 -1
- package/src/plugins/aries/constants.d.ts +1 -0
- package/src/plugins/aries/constants.js +2 -1
- package/src/plugins/aries/constants.js.map +1 -1
- package/src/plugins/aries/depositsFetcher.js +16 -0
- package/src/plugins/aries/depositsFetcher.js.map +1 -1
- package/src/plugins/aries/helpers.d.ts +4 -0
- package/src/plugins/aries/helpers.js +39 -1
- package/src/plugins/aries/helpers.js.map +1 -1
- package/src/plugins/aries/index.js +2 -1
- package/src/plugins/aries/index.js.map +1 -1
- package/src/plugins/aries/reservesJob.d.ts +3 -0
- package/src/plugins/aries/reservesJob.js +64 -0
- package/src/plugins/aries/reservesJob.js.map +1 -0
- package/src/plugins/aries/types.d.ts +53 -0
- package/src/plugins/auxexchange/aptosLpJob.js +1 -1
- package/src/plugins/auxexchange/aptosLpJob.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/fluxbeam/poolsJob.js +1 -1
- package/src/plugins/fluxbeam/poolsJob.js.map +1 -1
- package/src/plugins/jupiter/helpers.d.ts +1 -0
- package/src/plugins/jupiter/helpers.js +30 -1
- package/src/plugins/jupiter/helpers.js.map +1 -1
- package/src/plugins/jupiter/types.d.ts +10 -0
- package/src/plugins/lifinity/constants.d.ts +2 -0
- package/src/plugins/lifinity/constants.js +3 -1
- package/src/plugins/lifinity/constants.js.map +1 -1
- package/src/plugins/lifinity/index.js +2 -1
- package/src/plugins/lifinity/index.js.map +1 -1
- package/src/plugins/lifinity/lockerFetcher.js +7 -8
- package/src/plugins/lifinity/lockerFetcher.js.map +1 -1
- package/src/plugins/lifinity/xLfntyJob.d.ts +3 -0
- package/src/plugins/lifinity/xLfntyJob.js +43 -0
- package/src/plugins/lifinity/xLfntyJob.js.map +1 -0
- package/src/plugins/liquiditypools-sei/job.js +1 -1
- package/src/plugins/liquiditypools-sei/job.js.map +1 -1
- package/src/plugins/marginfi/fetcherExecutor.js +1 -1
- package/src/plugins/marginfi/fetcherExecutor.js.map +1 -1
- package/src/plugins/meteora/poolsJob.js +33 -46
- package/src/plugins/meteora/poolsJob.js.map +1 -1
- package/src/plugins/orca/lpTokensJob.js +1 -1
- package/src/plugins/orca/lpTokensJob.js.map +1 -1
- package/src/plugins/pancakeswap/aptosLpJob.js +1 -1
- package/src/plugins/pancakeswap/aptosLpJob.js.map +1 -1
- package/src/plugins/raydium/lpTokensJob.js +1 -1
- package/src/plugins/raydium/lpTokensJob.js.map +1 -1
- package/src/plugins/solend/obligationsFetcher.js +3 -1
- package/src/plugins/solend/obligationsFetcher.js.map +1 -1
- package/src/plugins/suilend/marketsJob.js +1 -1
- package/src/plugins/suilend/marketsJob.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/symmetry/basketsJob.js +10 -3
- package/src/plugins/symmetry/basketsJob.js.map +1 -1
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/clients/getClientSolana.d.ts +2 -2
- package/src/utils/clients/getClientSolana.js.map +1 -1
- package/src/utils/clients/types.d.ts +2 -0
- package/src/utils/misc/getLpUnderlyingTokenSource.d.ts +1 -1
- package/src/utils/misc/getLpUnderlyingTokenSource.js +1 -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 +8 -1
- package/src/utils/solana/pyth/helpers.js +56 -4
- package/src/utils/solana/pyth/helpers.js.map +1 -1
package/README.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
# @sonarwatch/portfolio-plugins
|
2
|
-
|
3
|
-
This library is @sonarwatch/portfolio-plugins
|
1
|
+
# @sonarwatch/portfolio-plugins
|
2
|
+
|
3
|
+
This library is @sonarwatch/portfolio-plugins
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.123",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"web3-v1": "npm:web3@^1.5.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
44
|
-
"@sonarwatch/portfolio-core": "0.11.
|
44
|
+
"@sonarwatch/portfolio-core": "0.11.123"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
package/src/Cache.d.ts
CHANGED
@@ -88,6 +88,7 @@ export declare class Cache {
|
|
88
88
|
getAllItemsAsMap<K extends StorageValue>(opts: TransactionOptions): Promise<Map<string, K>>;
|
89
89
|
setItem<K extends StorageValue>(key: string, value: K, opts: TransactionOptions & TransactionOptionsSetItem): Promise<void>;
|
90
90
|
setTokenPriceSource(source: TokenPriceSource): Promise<void>;
|
91
|
+
setTokenPriceSources(sources: (TokenPriceSource | null)[]): Promise<void>;
|
91
92
|
removeItem(key: string, opts: TransactionOptions): Promise<void>;
|
92
93
|
getKeys(opts: TransactionOptions): Promise<string[]>;
|
93
94
|
getTokenPriceAddresses(networkId: NetworkIdType): Promise<string[]>;
|
package/src/Cache.js
CHANGED
@@ -43,6 +43,7 @@ const http_1 = __importDefault(require("unstorage/drivers/http"));
|
|
43
43
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
44
44
|
const overlayDriver_1 = __importDefault(require("./overlayDriver"));
|
45
45
|
const memoryDriver_1 = __importStar(require("./memoryDriver"));
|
46
|
+
const runInBatch_1 = __importDefault(require("./utils/misc/runInBatch"));
|
46
47
|
const tokenPriceSourcePrefix = 'tokenpricesource';
|
47
48
|
class Cache {
|
48
49
|
constructor(cacheConfig) {
|
@@ -224,6 +225,12 @@ class Cache {
|
|
224
225
|
});
|
225
226
|
});
|
226
227
|
}
|
228
|
+
setTokenPriceSources(sources) {
|
229
|
+
return __awaiter(this, void 0, void 0, function* () {
|
230
|
+
const fSources = sources.filter((s) => s !== null);
|
231
|
+
yield (0, runInBatch_1.default)(fSources.map((source) => () => this.setTokenPriceSource(source)), 15);
|
232
|
+
});
|
233
|
+
}
|
227
234
|
removeItem(key, opts) {
|
228
235
|
return __awaiter(this, void 0, void 0, function* () {
|
229
236
|
const fullKey = getFullKey(key, opts);
|
package/src/Cache.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Cache.js","sourceRoot":"","sources":["../../../../packages/plugins/src/Cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAyE;AACzE,8DAA4C;AAC5C,oEAAkD;AAClD,kEAAgD;AAChD,+DAUoC;AACpC,oEAA4C;AAC5C,+DAGwB;
|
1
|
+
{"version":3,"file":"Cache.js","sourceRoot":"","sources":["../../../../packages/plugins/src/Cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAyE;AACzE,8DAA4C;AAC5C,oEAAkD;AAClD,kEAAgD;AAChD,+DAUoC;AACpC,oEAA4C;AAC5C,+DAGwB;AACxB,yEAAiD;AAiBjD,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAgElD,MAAa,KAAK;IAKhB,YAAY,WAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC;QACpD,IAAI,CAAC,OAAO,GAAG,IAAA,yBAAa,EAAC;YAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QACH,IAAI,CAAC,iBAAiB,GAAG,IAAA,yBAAa,EAAC;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|
118
118
|
const tokenPriceB = tokenPriceById.get(`0x${poolInfo.type_names[1]}`);
|
119
119
|
const reserveAmountRawA = new bignumber_js_1.default(poolInfo.normalized_balances[0]).dividedBy(poolInfo.decimal_scalars[0]);
|
120
120
|
const reserveAmountRawB = new bignumber_js_1.default(poolInfo.normalized_balances[1]).dividedBy(poolInfo.decimal_scalars[1]);
|
121
|
-
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(address,
|
121
|
+
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(address, networkId, {
|
122
122
|
address: `0x${poolInfo.type_names[0]}`,
|
123
123
|
decimals: poolInfo.coin_decimals[0],
|
124
124
|
reserveAmountRaw: reserveAmountRawA,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aftermath/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAIoC;AAGpC,iDAAmD;AACnD,2CAAuD;AAEvD,oFAA2E;AAC3E,6CAAoD;AACpD,6FAAoE;AACpE,6GAAqF;AACrF,+FAAuE;AACvE,uEAAoE;AACpE,qEAAkE;AAElE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,0BAAS,CAAC,GAAG,CAAC;IAChC,MAAM,gBAAgB,GAAG,MAAM,IAAA,mCAAgB,EAAC,MAAM,EAAE,wBAAY,CAAC,CAAC;IAEtE,MAAM,cAAc,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC/D,IAAI,CAAC,cAAc,CAAC,MAAM;QAAE,OAAO;IAEnC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAe,EAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC/D,MAAM,Q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,QAAQ,GAAG,IAAA,6BAAmB,EAClC,SAAS,EACT,OAAO,EACP,sBAAU,EACV,EAAE,EACF;gBACE,OAAO;gBACP,QAAQ,EAAE,QAAQ,CAAC,WAAW;gBAC9B,SAAS,EAAE,IAAI,sBAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;aAC1D,EACD;gBACE;oBACE,OAAO,EAAE,WAAW,CAAC,OAAO;oBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;oBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;oBACxB,gBAAgB,EAAE,iBAAiB;iBACpC;gBACD;oBACE,OAAO,EAAE,WAAW,CAAC,OAAO;oBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;oBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;oBACxB,gBAAgB,EAAE,iBAAiB;iBACpC;aACF,CACF,CAAC;YAEF,MAAM,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -3,3 +3,4 @@ export declare const platformId = "aries";
|
|
3
3
|
export declare const platform: Platform;
|
4
4
|
export declare const programId = "0x9770fa9c725cbd97eb50b2be5f7416efdfd1f1554beb0750d4dae4c64e860da3";
|
5
5
|
export declare const apiUrl = "https://api-v2.ariesmarkets.xyz/";
|
6
|
+
export declare const reservesKey = "reserves";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.apiUrl = exports.programId = exports.platform = exports.platformId = void 0;
|
3
|
+
exports.reservesKey = exports.apiUrl = exports.programId = exports.platform = exports.platformId = void 0;
|
4
4
|
exports.platformId = 'aries';
|
5
5
|
exports.platform = {
|
6
6
|
id: exports.platformId,
|
@@ -12,4 +12,5 @@ exports.platform = {
|
|
12
12
|
};
|
13
13
|
exports.programId = '0x9770fa9c725cbd97eb50b2be5f7416efdfd1f1554beb0750d4dae4c64e860da3';
|
14
14
|
exports.apiUrl = 'https://api-v2.ariesmarkets.xyz/';
|
15
|
+
exports.reservesKey = 'reserves';
|
15
16
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,eAAe;IAC5B,OAAO,EAAE,+BAA+B;IACxC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAE1D,QAAA,MAAM,GAAG,kCAAkC,CAAC"}
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,eAAe;IAC5B,OAAO,EAAE,+BAA+B;IACxC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAE1D,QAAA,MAAM,GAAG,kCAAkC,CAAC;AAC5C,QAAA,WAAW,GAAG,UAAU,CAAC"}
|
@@ -24,6 +24,16 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
24
24
|
.catch(() => null);
|
25
25
|
if (!profileRes || !profileRes.data)
|
26
26
|
return [];
|
27
|
+
const reserves = yield cache.getItem(constants_1.reservesKey, {
|
28
|
+
prefix: constants_1.platformId,
|
29
|
+
networkId: portfolio_core_1.NetworkId.aptos,
|
30
|
+
});
|
31
|
+
const ratesByCoin = new Map();
|
32
|
+
if (reserves) {
|
33
|
+
reserves.forEach((reserveData) => {
|
34
|
+
ratesByCoin.set(reserveData.key, reserveData.rate);
|
35
|
+
});
|
36
|
+
}
|
27
37
|
const { profiles } = profileRes.data.result.data;
|
28
38
|
const mintsSet = new Set();
|
29
39
|
for (const accountName in profiles) {
|
@@ -68,6 +78,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
68
78
|
if (!tokenPrice)
|
69
79
|
continue;
|
70
80
|
suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(coin, amount.dividedBy(Math.pow(10, tokenPrice.decimals)).toNumber(), portfolio_core_1.NetworkId.aptos, tokenPrice));
|
81
|
+
const rates = ratesByCoin.get(coin);
|
82
|
+
if (rates)
|
83
|
+
suppliedYields.push([rates.depositYield]);
|
71
84
|
}
|
72
85
|
}
|
73
86
|
for (const coin in profile.borrows) {
|
@@ -80,6 +93,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
80
93
|
if (!tokenPrice)
|
81
94
|
continue;
|
82
95
|
borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(coin, amount.dividedBy(Math.pow(10, tokenPrice.decimals)).toNumber(), portfolio_core_1.NetworkId.aptos, tokenPrice));
|
96
|
+
const rates = ratesByCoin.get(coin);
|
97
|
+
if (rates)
|
98
|
+
borrowedYields.push([rates.borrowYield]);
|
83
99
|
}
|
84
100
|
}
|
85
101
|
if (suppliedAssets.length === 0 && borrowedAssets.length === 0)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/depositsFetcher.ts"],"names":[],"mappings":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OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,KAAK;IAC1B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1 +1,5 @@
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
2
|
+
import { Reserve } from './types';
|
1
3
|
export declare function getName(accountName: string): string;
|
4
|
+
export declare function getBorrowApr(utilization: BigNumber, borrowedAmount: BigNumber, availableAmount: BigNumber, reserveData: Reserve): number;
|
5
|
+
export declare function getDepositApr(utilization: BigNumber, borrowApr: number, reserveData: Reserve): number;
|
@@ -1,8 +1,46 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getName = void 0;
|
6
|
+
exports.getDepositApr = exports.getBorrowApr = exports.getName = void 0;
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
4
8
|
function getName(accountName) {
|
5
9
|
return accountName.replace('profile', '');
|
6
10
|
}
|
7
11
|
exports.getName = getName;
|
12
|
+
function getBorrowApr(utilization, borrowedAmount, availableAmount, reserveData) {
|
13
|
+
const interestRateConfig = reserveData.value.interest_rate_config;
|
14
|
+
const optimalUtilization = interestRateConfig.optimal_utilization / 100;
|
15
|
+
const optimalRate = interestRateConfig.optimal_borrow_rate / 100;
|
16
|
+
const minRate = interestRateConfig.min_borrow_rate / 100;
|
17
|
+
const maxRate = interestRateConfig.max_borrow_rate / 100;
|
18
|
+
if (borrowedAmount.isZero())
|
19
|
+
return minRate;
|
20
|
+
if (availableAmount.isZero())
|
21
|
+
return maxRate;
|
22
|
+
if (utilization.isLessThan(optimalUtilization)) {
|
23
|
+
const utilizationDelta = utilization;
|
24
|
+
const utilStepsDelta = optimalUtilization;
|
25
|
+
return utilizationDelta
|
26
|
+
.dividedBy(utilStepsDelta)
|
27
|
+
.times(optimalRate)
|
28
|
+
.toNumber();
|
29
|
+
}
|
30
|
+
const utilizationDelta = utilization.minus(optimalUtilization);
|
31
|
+
const utilStepsDelta = (0, bignumber_js_1.default)(1).minus(optimalUtilization);
|
32
|
+
return utilizationDelta
|
33
|
+
.dividedBy(utilStepsDelta)
|
34
|
+
.times(maxRate)
|
35
|
+
.plus(optimalRate)
|
36
|
+
.toNumber();
|
37
|
+
}
|
38
|
+
exports.getBorrowApr = getBorrowApr;
|
39
|
+
function getDepositApr(utilization, borrowApr, reserveData) {
|
40
|
+
return (0, bignumber_js_1.default)(borrowApr)
|
41
|
+
.times(1 - Number(reserveData.value.reserve_config.reserve_ratio) / Math.pow(10, 2))
|
42
|
+
.times(utilization)
|
43
|
+
.toNumber();
|
44
|
+
}
|
45
|
+
exports.getDepositApr = getDepositApr;
|
8
46
|
//# sourceMappingURL=helpers.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/helpers.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAGrC,SAAgB,OAAO,CAAC,WAAmB;IACzC,OAAO,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAC5C,CAAC;AAFD,0BAEC;AAED,SAAgB,YAAY,CAC1B,WAAsB,EACtB,cAAyB,EACzB,eAA0B,EAC1B,WAAoB;IAEpB,MAAM,kBAAkB,GAAG,WAAW,CAAC,KAAK,CAAC,oBAAoB,CAAC;IAClE,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,mBAAmB,GAAG,GAAG,CAAC;IACxE,MAAM,WAAW,GAAG,kBAAkB,CAAC,mBAAmB,GAAG,GAAG,CAAC;IACjE,MAAM,OAAO,GAAG,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
|
const constants_1 = require("./constants");
|
8
8
|
const depositsFetcher_1 = __importDefault(require("./depositsFetcher"));
|
9
|
+
const reservesJob_1 = __importDefault(require("./reservesJob"));
|
9
10
|
exports.platforms = [constants_1.platform];
|
10
|
-
exports.jobs = [];
|
11
|
+
exports.jobs = [reservesJob_1.default];
|
11
12
|
exports.fetchers = [depositsFetcher_1.default];
|
12
13
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,wEAAgD;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,wEAAgD;AAChD,gEAAuC;AAE1B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,qBAAU,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAc,CAAC,yBAAe,CAAC,CAAC"}
|
@@ -0,0 +1,64 @@
|
|
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 bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
18
|
+
const constants_1 = require("./constants");
|
19
|
+
const helpers_1 = require("./helpers");
|
20
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
21
|
+
const reservesRes = yield axios_1.default
|
22
|
+
.get(`${constants_1.apiUrl}reserve.current`)
|
23
|
+
.catch(() => null);
|
24
|
+
if (!reservesRes)
|
25
|
+
return;
|
26
|
+
const promises = [];
|
27
|
+
const rates = [];
|
28
|
+
const reservesEnhanced = [];
|
29
|
+
for (const reserve of reservesRes.data.result.data.stats) {
|
30
|
+
const availableAmount = new bignumber_js_1.default(reserve.value.total_cash_available);
|
31
|
+
const borrowedAmount = new bignumber_js_1.default(reserve.value.total_borrowed);
|
32
|
+
const utilization = borrowedAmount.dividedBy(borrowedAmount.plus(availableAmount));
|
33
|
+
const borrowApr = (0, helpers_1.getBorrowApr)(utilization, borrowedAmount, availableAmount, reserve);
|
34
|
+
const depositApr = (0, helpers_1.getDepositApr)(utilization, borrowApr, reserve);
|
35
|
+
const rate = {
|
36
|
+
poolName: reserve.key,
|
37
|
+
borrowedAmount: borrowedAmount.toNumber(),
|
38
|
+
depositedAmount: borrowedAmount.plus(availableAmount).toNumber(),
|
39
|
+
platformId: constants_1.platformId,
|
40
|
+
tokenAddress: reserve.key,
|
41
|
+
utilizationRatio: utilization.toNumber(),
|
42
|
+
depositYield: { apr: depositApr, apy: (0, portfolio_core_1.aprToApy)(depositApr) },
|
43
|
+
borrowYield: { apr: borrowApr, apy: (0, portfolio_core_1.aprToApy)(borrowApr) },
|
44
|
+
};
|
45
|
+
rates.push(rate);
|
46
|
+
reservesEnhanced.push(Object.assign(Object.assign({}, reserve), { rate }));
|
47
|
+
promises.push(cache.setItem(`${reserve.key}`, rate, {
|
48
|
+
prefix: portfolio_core_1.borrowLendRatesPrefix,
|
49
|
+
networkId: portfolio_core_1.NetworkId.aptos,
|
50
|
+
}));
|
51
|
+
}
|
52
|
+
promises.push(cache.setItem(constants_1.reservesKey, reservesEnhanced, {
|
53
|
+
prefix: constants_1.platformId,
|
54
|
+
networkId: portfolio_core_1.NetworkId.aptos,
|
55
|
+
}));
|
56
|
+
yield Promise.allSettled(promises);
|
57
|
+
});
|
58
|
+
const job = {
|
59
|
+
id: `${constants_1.platformId}-reserves`,
|
60
|
+
executor,
|
61
|
+
label: 'normal',
|
62
|
+
};
|
63
|
+
exports.default = job;
|
64
|
+
//# sourceMappingURL=reservesJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"reservesJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/reservesJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,gEAAqC;AACrC,+DAKoC;AAGpC,2CAA8D;AAE9D,uCAAwD;AAExD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,WAAW,GAA0C,MAAM,eAAK;SACnE,GAAG,CAAC,GAAG,kBAAM,iBAAiB,CAAC;SAC/B,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAErB,IAAI,CAAC,WAAW;QAAE,OAAO;IACzB,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,MAAM,gBAAgB,GAAsB,EAAE,CAAC;IAC/C,KAAK,MAAM,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACzD,MAAM,eAAe,GAAG,IAAI,sBAAS,CAAC,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC1E,MAAM,cAAc,GAAG,IAAI,sBAAS,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACnE,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CAAC,CACH,CAAC;IAEF,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { BorrowLendRate } from '@sonarwatch/portfolio-core';
|
1
2
|
export type ProfileResponse = {
|
2
3
|
result: {
|
3
4
|
data: ProfileData;
|
@@ -36,3 +37,55 @@ export type ProfileData = {
|
|
36
37
|
};
|
37
38
|
total_equity: string;
|
38
39
|
};
|
40
|
+
export type ReserveResponse = {
|
41
|
+
result: {
|
42
|
+
data: {
|
43
|
+
id: string;
|
44
|
+
meta: {
|
45
|
+
module: string;
|
46
|
+
owner: string;
|
47
|
+
version: number;
|
48
|
+
timestamp: string;
|
49
|
+
};
|
50
|
+
stats: Reserve[];
|
51
|
+
};
|
52
|
+
};
|
53
|
+
};
|
54
|
+
export type Reserve = {
|
55
|
+
key: string;
|
56
|
+
value: ReserveData;
|
57
|
+
};
|
58
|
+
export type ReserveEnhanced = Reserve & {
|
59
|
+
rate: BorrowLendRate;
|
60
|
+
};
|
61
|
+
export type ReserveData = {
|
62
|
+
initial_exchange_rate: number;
|
63
|
+
reserve_amount: number;
|
64
|
+
total_borrowed: number;
|
65
|
+
total_borrowed_share: number;
|
66
|
+
total_cash_available: number;
|
67
|
+
total_lp_supply: number;
|
68
|
+
reserve_config: ReserveConfig;
|
69
|
+
interest_rate_config: InterestRateConfig;
|
70
|
+
};
|
71
|
+
export type InterestRateConfig = {
|
72
|
+
min_borrow_rate: number;
|
73
|
+
optimal_borrow_rate: number;
|
74
|
+
max_borrow_rate: number;
|
75
|
+
optimal_utilization: number;
|
76
|
+
};
|
77
|
+
export type ReserveConfig = {
|
78
|
+
loan_to_value: number;
|
79
|
+
liquidation_threshold: number;
|
80
|
+
liquidation_bonus_bips: number;
|
81
|
+
liquidation_fee_hundredth_bips: number;
|
82
|
+
borrow_factor: number;
|
83
|
+
reserve_ratio: number;
|
84
|
+
borrow_fee_hundredth_bips: number;
|
85
|
+
withdraw_fee_hundredth_bips: number;
|
86
|
+
deposit_limit: number;
|
87
|
+
borrow_limit: number;
|
88
|
+
allow_collateral: boolean;
|
89
|
+
allow_redeem: boolean;
|
90
|
+
flash_loan_fee_hundredth_bips: number;
|
91
|
+
};
|
@@ -76,7 +76,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
76
|
];
|
77
77
|
if (!decimalsX || !decimalsY)
|
78
78
|
continue;
|
79
|
-
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpType,
|
79
|
+
const underlyingSource = (0, getLpUnderlyingTokenSource_1.default)(lpType, portfolio_core_1.NetworkId.aptos, {
|
80
80
|
address: typeX,
|
81
81
|
decimals: decimalsX,
|
82
82
|
reserveAmountRaw: reserveAmountRawX,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/auxexchange/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAAuD;AAGvD,6CAM2B;AAC3B,iDAAqD;AACrD,2CAA+E;AAC/E,6FAAoE;AACpE,8EAA2E;AAC3E,6GAAqF;AACrF,+FAAuE;AAOvE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAChC,MAAM,SAAS,GAAG,MAAM,IAAA,2BAAmB,EAAC,MAAM,EAAE,0BAAc,CAAC,CAAC;IACpE,IAAI,CAAC,SAAS;QAAE,OAAO;IAEvB,MAAM,eAAe,GAAuC,IAAI,GAAG,EAAE,CAAC;IACtE,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,E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AW;YAAE,SAAS;QAC3C,MAAM,QAAQ,GAAG,IAAA,6BAAmB,EAClC,0BAAS,CAAC,KAAK,EACf,MAAM,EACN,sBAAU,EACV,EAAE,EACF;YACE,OAAO,EAAE,MAAM;YACf,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE,QAAQ;SACpB,EACD;YACE;gBACE,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,iBAAiB;aACpC;YACD;gBACE,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,iBAAiB;aACpC;SACF,CACF,CAAC;QACF,MAAM,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -36,27 +36,27 @@ exports.getBalancerPoolsV2 = void 0;
|
|
36
36
|
const graphql_request_1 = __importStar(require("graphql-request"));
|
37
37
|
function getBalancerPoolsV2(url) {
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
39
|
-
const query = (0, graphql_request_1.gql) `
|
40
|
-
query pools {
|
41
|
-
pools(
|
42
|
-
first: 1000
|
43
|
-
orderBy: totalLiquidity
|
44
|
-
orderDirection: desc
|
45
|
-
where: { totalLiquidity_gt: "500" }
|
46
|
-
) {
|
47
|
-
id
|
48
|
-
address
|
49
|
-
symbol
|
50
|
-
totalLiquidity
|
51
|
-
totalShares
|
52
|
-
tokens {
|
53
|
-
balance
|
54
|
-
decimals
|
55
|
-
symbol
|
56
|
-
address
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
39
|
+
const query = (0, graphql_request_1.gql) `
|
40
|
+
query pools {
|
41
|
+
pools(
|
42
|
+
first: 1000
|
43
|
+
orderBy: totalLiquidity
|
44
|
+
orderDirection: desc
|
45
|
+
where: { totalLiquidity_gt: "500" }
|
46
|
+
) {
|
47
|
+
id
|
48
|
+
address
|
49
|
+
symbol
|
50
|
+
totalLiquidity
|
51
|
+
totalShares
|
52
|
+
tokens {
|
53
|
+
balance
|
54
|
+
decimals
|
55
|
+
symbol
|
56
|
+
address
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
60
|
`;
|
61
61
|
const res = yield (0, graphql_request_1.default)(url, query);
|
62
62
|
const pools = res.pools;
|
@@ -71,7 +71,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
71
|
continue;
|
72
72
|
const tokenPriceA = tokenPrices.get(pool.tokenAMint.toString());
|
73
73
|
const tokenPriceB = tokenPrices.get(pool.tokenBMint.toString());
|
74
|
-
const underlyingsSource = (0, getLpUnderlyingTokenSource_1.default)(
|
74
|
+
const underlyingsSource = (0, getLpUnderlyingTokenSource_1.default)(pool.poolMint.toString(), portfolio_core_1.NetworkId.solana, {
|
75
75
|
address: pool.tokenAMint.toString(),
|
76
76
|
decimals: mintAccountA.decimals,
|
77
77
|
reserveAmountRaw: tokenAccountA.amount,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/fluxbeam/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,+DAAmE;AAGnE,2CAA2D;AAC3D,iDAAsD;AACtD,+CAQ4B;AAC5B,uCAAuC;AACvC,+FAAuE;AACvE,6GAAqF;AAErF,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,IA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AW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,aAAa,CAAC,MAAM;aACvC;YACD;gBACE,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,aAAa,CAAC,MAAM;aACvC;SACF,CACF,CAAC;QACF,MAAM,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
2
2
|
export declare function deriveClaimStatus(claimant: PublicKey, distributor: PublicKey, programId: PublicKey): [PublicKey, number];
|
3
3
|
export declare function getVotePda(owner: string): PublicKey;
|
4
|
+
export declare function getPrices(mints: PublicKey[], vsMint: PublicKey): Promise<Map<string, number>>;
|
@@ -1,7 +1,20 @@
|
|
1
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
|
+
};
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getVotePda = exports.deriveClaimStatus = void 0;
|
15
|
+
exports.getPrices = exports.getVotePda = exports.deriveClaimStatus = void 0;
|
4
16
|
const web3_js_1 = require("@solana/web3.js");
|
17
|
+
const axios_1 = __importDefault(require("axios"));
|
5
18
|
const constants_1 = require("./constants");
|
6
19
|
function deriveClaimStatus(claimant, distributor, programId) {
|
7
20
|
return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('ClaimStatus'), claimant.toBytes(), distributor.toBytes()], programId);
|
@@ -15,4 +28,20 @@ function getVotePda(owner) {
|
|
15
28
|
], constants_1.voteProgramId)[0];
|
16
29
|
}
|
17
30
|
exports.getVotePda = getVotePda;
|
31
|
+
function getPrices(mints, vsMint) {
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
33
|
+
const res = yield axios_1.default.get('https://price.jup.ag/v4/price', {
|
34
|
+
params: {
|
35
|
+
ids: mints.map((m) => m.toString()).join(','),
|
36
|
+
vsToken: vsMint.toString(),
|
37
|
+
},
|
38
|
+
});
|
39
|
+
const prices = new Map();
|
40
|
+
for (const [, value] of Object.entries(res.data.data)) {
|
41
|
+
prices.set(value.id, value.price);
|
42
|
+
}
|
43
|
+
return prices;
|
44
|
+
});
|
45
|
+
}
|
46
|
+
exports.getPrices = getPrices;
|
18
47
|
//# sourceMappingURL=helpers.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/helpers.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,kDAA6C;AAC7C,2CAA0D;AAG1D,SAAgB,iBAAiB,CAC/B,QAAmB,EACnB,WAAsB,EACtB,SAAoB;IAEpB,OAAO,mBAAS,CAAC,sBAA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