@sonarwatch/portfolio-plugins 0.12.35 → 0.12.37
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +10 -2
- package/package.json +1 -1
- package/src/index.js +8 -0
- package/src/index.js.map +1 -1
- package/src/orphanPlatorms.js +0 -8
- package/src/orphanPlatorms.js.map +1 -1
- package/src/plugins/01/depostisFetcher.js +1 -1
- package/src/plugins/01/depostisFetcher.js.map +1 -1
- package/src/plugins/aave/helpers.js +6 -1
- package/src/plugins/aave/helpers.js.map +1 -1
- package/src/plugins/allbridge/constants.d.ts +11 -0
- package/src/plugins/allbridge/constants.js +25 -0
- package/src/plugins/allbridge/constants.js.map +1 -0
- package/src/plugins/allbridge/helpers.d.ts +5 -0
- package/src/plugins/allbridge/helpers.js +25 -0
- package/src/plugins/allbridge/helpers.js.map +1 -0
- package/src/plugins/allbridge/idl.d.ts +58 -0
- package/src/plugins/allbridge/idl.js +476 -0
- package/src/plugins/allbridge/idl.js.map +1 -0
- package/src/plugins/allbridge/index.d.ts +6 -0
- package/src/plugins/allbridge/index.js +13 -0
- package/src/plugins/allbridge/index.js.map +1 -0
- package/src/plugins/allbridge/poolsJob.d.ts +3 -0
- package/src/plugins/allbridge/poolsJob.js +40 -0
- package/src/plugins/allbridge/poolsJob.js.map +1 -0
- package/src/plugins/allbridge/positionsFetcher.js +92 -0
- package/src/plugins/allbridge/positionsFetcher.js.map +1 -0
- package/src/plugins/allbridge/types.d.ts +38 -0
- package/src/plugins/allbridge/types.js +3 -0
- package/src/plugins/allbridge/types.js.map +1 -0
- package/src/plugins/aptin/depositsFetcher.js +6 -1
- package/src/plugins/aptin/depositsFetcher.js.map +1 -1
- package/src/plugins/aries/depositsFetcher.js +7 -1
- package/src/plugins/aries/depositsFetcher.js.map +1 -1
- package/src/plugins/banx/constants.d.ts +0 -1
- package/src/plugins/banx/constants.js +1 -2
- package/src/plugins/banx/constants.js.map +1 -1
- package/src/plugins/banx/{calculateLoanRepayValue.d.ts → helpers.d.ts} +1 -0
- package/src/plugins/banx/{calculateLoanRepayValue.js → helpers.js} +29 -2
- package/src/plugins/banx/helpers.js.map +1 -0
- package/src/plugins/banx/idl.d.ts +15 -7
- package/src/plugins/banx/idl.js +199 -268
- package/src/plugins/banx/idl.js.map +1 -1
- package/src/plugins/banx/loansFetcher.js +33 -28
- package/src/plugins/banx/loansFetcher.js.map +1 -1
- package/src/plugins/banx/offersFetcher.js +15 -16
- package/src/plugins/banx/offersFetcher.js.map +1 -1
- package/src/plugins/bucket/collateralFetcher.js +1 -1
- package/src/plugins/bucket/collateralFetcher.js.map +1 -1
- package/src/plugins/citrus/collectionsJob.js.map +1 -1
- package/src/plugins/citrus/constants.d.ts +0 -1
- package/src/plugins/citrus/constants.js +1 -2
- package/src/plugins/citrus/constants.js.map +1 -1
- package/src/plugins/citrus/loansFetcher.js +18 -20
- package/src/plugins/citrus/loansFetcher.js.map +1 -1
- package/src/plugins/clone/depositsFetcher.js +2 -2
- package/src/plugins/clone/depositsFetcher.js.map +1 -1
- package/src/plugins/compound/getPositionsV2Fetcher.js +1 -1
- package/src/plugins/compound/getPositionsV2Fetcher.js.map +1 -1
- package/src/plugins/compound/getPositionsV3Fetcher.js +5 -1
- package/src/plugins/compound/getPositionsV3Fetcher.js.map +1 -1
- package/src/plugins/drift/depositsFetcher.d.ts +3 -0
- package/src/plugins/drift/{deposits.js → depositsFetcher.js} +4 -4
- package/src/plugins/drift/depositsFetcher.js.map +1 -0
- package/src/plugins/drift/index.js +2 -2
- package/src/plugins/drift/index.js.map +1 -1
- package/src/plugins/flash/perpetualFetcher.js +1 -1
- package/src/plugins/flash/perpetualFetcher.js.map +1 -1
- package/src/plugins/flexlend/depositsFetcher.js +2 -2
- package/src/plugins/flexlend/depositsFetcher.js.map +1 -1
- package/src/plugins/jupiter/exchange/constants.d.ts +1 -0
- package/src/plugins/jupiter/exchange/constants.js +2 -1
- package/src/plugins/jupiter/exchange/constants.js.map +1 -1
- package/src/plugins/jupiter/exchange/limitFetcher.js +9 -6
- package/src/plugins/jupiter/exchange/limitFetcher.js.map +1 -1
- package/src/plugins/jupiter/exchange/perpetualFetcher.js +8 -8
- package/src/plugins/jupiter/exchange/perpetualFetcher.js.map +1 -1
- package/src/plugins/jupiter/exchange/structs.d.ts +21 -0
- package/src/plugins/jupiter/exchange/structs.js +21 -1
- package/src/plugins/jupiter/exchange/structs.js.map +1 -1
- package/src/plugins/jupiter/pricingJob.js +7 -22
- package/src/plugins/jupiter/pricingJob.js.map +1 -1
- package/src/plugins/kamino/lendsFetcher.js +21 -3
- package/src/plugins/kamino/lendsFetcher.js.map +1 -1
- package/src/plugins/maker/vaultsFetcher.js +1 -1
- package/src/plugins/maker/vaultsFetcher.js.map +1 -1
- package/src/plugins/mango/boostFetcher.js +1 -1
- package/src/plugins/mango/boostFetcher.js.map +1 -1
- package/src/plugins/mango/collateralFetcher.js +1 -1
- package/src/plugins/mango/collateralFetcher.js.map +1 -1
- package/src/plugins/mango/redeemFetcher.js +1 -1
- package/src/plugins/mango/redeemFetcher.js.map +1 -1
- package/src/plugins/maple/ethereumFetcher.js +1 -1
- package/src/plugins/maple/ethereumFetcher.js.map +1 -1
- package/src/plugins/marginfi/helpers.js +7 -1
- package/src/plugins/marginfi/helpers.js.map +1 -1
- package/src/plugins/mole/farmsFetcher.js +5 -1
- package/src/plugins/mole/farmsFetcher.js.map +1 -1
- package/src/plugins/morpho/aaveV3CollateralFetcher.js +1 -1
- package/src/plugins/morpho/aaveV3CollateralFetcher.js.map +1 -1
- package/src/plugins/native-stake/solana/solanaFetcher.js +2 -0
- package/src/plugins/native-stake/solana/solanaFetcher.js.map +1 -1
- package/src/plugins/navi/collateralFetcher.js +6 -1
- package/src/plugins/navi/collateralFetcher.js.map +1 -1
- package/src/plugins/nosana/stakingFetcher.js +8 -2
- package/src/plugins/nosana/stakingFetcher.js.map +1 -1
- package/src/plugins/port/obligationsFetcher.js +1 -1
- package/src/plugins/port/obligationsFetcher.js.map +1 -1
- package/src/plugins/rain/collectionsJob.js +6 -10
- package/src/plugins/rain/collectionsJob.js.map +1 -1
- package/src/plugins/rain/helpers.js +3 -1
- package/src/plugins/rain/helpers.js.map +1 -1
- package/src/plugins/rain/index.js +2 -1
- package/src/plugins/rain/index.js.map +1 -1
- package/src/plugins/rain/loansFetcher.js +61 -26
- package/src/plugins/rain/loansFetcher.js.map +1 -1
- package/src/plugins/rain/poolsFetcher.js +1 -1
- package/src/plugins/rain/poolsFetcher.js.map +1 -1
- package/src/plugins/rain/types.d.ts +3 -0
- package/src/plugins/sanctum/constants.d.ts +4 -0
- package/src/plugins/sanctum/constants.js +14 -0
- package/src/plugins/sanctum/constants.js.map +1 -0
- package/src/plugins/sanctum/index.d.ts +6 -0
- package/src/plugins/sanctum/index.js +12 -0
- package/src/plugins/sanctum/index.js.map +1 -0
- package/src/plugins/sanctum/lstsJob.d.ts +3 -0
- package/src/plugins/sanctum/lstsJob.js +36 -0
- package/src/plugins/sanctum/lstsJob.js.map +1 -0
- package/src/plugins/scallop/lendingsFetcher.js +1 -1
- package/src/plugins/scallop/lendingsFetcher.js.map +1 -1
- package/src/plugins/scallop/obligationsFetcher.js +1 -1
- package/src/plugins/scallop/obligationsFetcher.js.map +1 -1
- package/src/plugins/sharky/constants.d.ts +0 -1
- package/src/plugins/sharky/constants.js +3 -4
- package/src/plugins/sharky/constants.js.map +1 -1
- package/src/plugins/sharky/loansFetcher.js +21 -20
- package/src/plugins/sharky/loansFetcher.js.map +1 -1
- package/src/plugins/solend/helpers.js +7 -1
- package/src/plugins/solend/helpers.js.map +1 -1
- package/src/plugins/suilend/obligationsFetcher.js +7 -1
- package/src/plugins/suilend/obligationsFetcher.js.map +1 -1
- package/src/plugins/thala/vaultsFetcher.js +1 -1
- package/src/plugins/thala/vaultsFetcher.js.map +1 -1
- package/src/plugins/zeta/airdropFetcher.d.ts +3 -0
- package/src/plugins/zeta/airdropFetcher.js +105 -0
- package/src/plugins/zeta/airdropFetcher.js.map +1 -0
- package/src/plugins/zeta/constants.d.ts +3 -0
- package/src/plugins/zeta/constants.js +4 -1
- package/src/plugins/zeta/constants.js.map +1 -1
- package/src/plugins/zeta/index.js +2 -1
- package/src/plugins/zeta/index.js.map +1 -1
- package/src/plugins/zeta/types.d.ts +14 -0
- package/src/plugins/zeta/types.js +3 -0
- package/src/plugins/zeta/types.js.map +1 -0
- package/src/utils/misc/MemoizedCache.d.ts +12 -0
- package/src/utils/misc/MemoizedCache.js +35 -0
- package/src/utils/misc/MemoizedCache.js.map +1 -0
- package/src/utils/misc/arrayToMap.d.ts +1 -0
- package/src/utils/misc/arrayToMap.js +12 -0
- package/src/utils/misc/arrayToMap.js.map +1 -0
- package/src/utils/misc/pick.d.ts +2 -0
- package/src/utils/misc/pick.js +16 -0
- package/src/utils/misc/pick.js.map +1 -0
- package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js +8 -3
- package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js.map +1 -1
- package/src/plugins/banx/calculateLoanRepayValue.js.map +0 -1
- package/src/plugins/drift/deposits.js.map +0 -1
- /package/src/plugins/{drift/deposits.d.ts → allbridge/positionsFetcher.d.ts} +0 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
export type UserDeposit = {
|
2
|
+
userAddress: string;
|
3
|
+
mint: string;
|
4
|
+
lpAmount: string;
|
5
|
+
rewardDebt: string;
|
6
|
+
};
|
7
|
+
export type Pools = {
|
8
|
+
bridgeAddress: string;
|
9
|
+
swapAddress: string;
|
10
|
+
tokens: TokenPool[];
|
11
|
+
};
|
12
|
+
export type TokenPool = {
|
13
|
+
apr: string;
|
14
|
+
apr7d: string;
|
15
|
+
apr30d: string;
|
16
|
+
cctpAddress: string;
|
17
|
+
cctpFeeShare: string;
|
18
|
+
decimals: number;
|
19
|
+
feeShare: string;
|
20
|
+
lpRate: string;
|
21
|
+
name: string;
|
22
|
+
poolAddress: string;
|
23
|
+
poolInfo: PoolInfo;
|
24
|
+
symbol: string;
|
25
|
+
tokenAddress: string;
|
26
|
+
};
|
27
|
+
export type PoolInfo = {
|
28
|
+
aValue: string;
|
29
|
+
accRewardPerShareP: string;
|
30
|
+
dValue: string;
|
31
|
+
p: number;
|
32
|
+
tokenBalance: string;
|
33
|
+
totalLpAmount: string;
|
34
|
+
vUsdBalance: string;
|
35
|
+
};
|
36
|
+
export type PoolsRes = {
|
37
|
+
SOL: Pools;
|
38
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/allbridge/types.ts"],"names":[],"mappings":""}
|
@@ -83,7 +83,12 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
83
83
|
borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(coinType, amount, portfolio_core_1.NetworkId.aptos, tokenPrices[address] || undefined));
|
84
84
|
borrowedYields.push([]);
|
85
85
|
}
|
86
|
-
const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)(
|
86
|
+
const { borrowedValue, healthRatio, suppliedValue, value, rewardValue } = (0, portfolio_core_1.getElementLendingValues)({
|
87
|
+
suppliedAssets,
|
88
|
+
borrowedAssets,
|
89
|
+
rewardAssets,
|
90
|
+
suppliedLtvs,
|
91
|
+
});
|
87
92
|
const element = {
|
88
93
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
89
94
|
networkId: portfolio_core_1.NetworkId.aptos,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aptin/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAMqB;AAOrB,qGAA6E;AAC7E,iDAAqD;AACrD,6CAA4E;AAE5E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAEhC,MAAM,aAAa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B,CAAC,UAAU;QACrC,SAAS,EAAE,0BAAS,CAAC,KAAK;QAC1B,UAAU,EAAV,sBAAU;QACV,KAAK,EAAE,SAAS;QAChB,KAAK;QACL,IAAI,EAAE;YACJ,cAAc;YACd,aAAa;YACb,cAAc;YACd,cAAc;YACd,aAAa;YACb,cAAc;YACd,WAAW;YACX,YAAY;YACZ,WAAW;YACX,KAAK;SACN;KACF,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,KAAK;IAC1B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -107,7 +107,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
107
107
|
suppliedAssets.length === 0 &&
|
108
108
|
rewardAssets.length === 0)
|
109
109
|
continue;
|
110
|
-
const { borrowedValue, suppliedValue, value, rewardValue, healthRatio } = (0, portfolio_core_1.getElementLendingValues)(
|
110
|
+
const { borrowedValue, suppliedValue, value, rewardValue, healthRatio } = (0, portfolio_core_1.getElementLendingValues)({
|
111
|
+
suppliedAssets,
|
112
|
+
borrowedAssets,
|
113
|
+
rewardAssets,
|
114
|
+
suppliedLtvs,
|
115
|
+
borrowedWeights,
|
116
|
+
});
|
111
117
|
elements.push({
|
112
118
|
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
113
119
|
networkId: portfolio_core_1.NetworkId.aptos,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAGrC,2CAMqB;AAErB,uCAAuD;AACvD,qGAA6E;AAC7E,6CAAuD;AACvD,iDAAqD;AAErD,MAAM,QAAQ,GAAoB,C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zB,SAAS;QACX,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aries/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAGrC,2CAMqB;AAErB,uCAAuD;AACvD,qGAA6E;AAC7E,6CAAuD;AACvD,iDAAqD;AAErD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAEhC,kDAAkD;IAClD,MAAM,eAAe,GAAG,MAAM,IAAA,0BAAkB,EAC9C,MAAM,EACN,KAAK,EACL,+BAAmB,CACpB,CAAC;IACF,IAAI,CAAC,eAAe;QAAE,OAAO,EAAE,CAAC;IAChC,MAAM,iBAAiB,GAAG,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAChE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CACvB,CAAC;IACF,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAC9C,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CACjC,iBAAiB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACjC,IAAA,0BAAkB,EAAU,MAAM,EAAE,QAAQ,EAAE,uBAAW,CAAC,CAC3D,CACF,CAAC;IACF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,2BAAiB,EAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CACnD,CAAC;IAEF,kBAAkB;IAClB,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,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AAK,EACf,UAAU,CACX,CACF,CAAC;YACF,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;YAChD,eAAe,CAAC,IAAI,CAClB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,GAAG,CACzD,CAAC;QACJ,CAAC;QAED,IACE,cAAc,CAAC,MAAM,KAAK,CAAC;YAC3B,cAAc,CAAC,MAAM,KAAK,CAAC;YAC3B,YAAY,CAAC,MAAM,KAAK,CAAC;YAEzB,SAAS;QACX,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EAAC;YACtB,cAAc;YACd,cAAc;YACd,YAAY;YACZ,YAAY;YACZ,eAAe;SAChB,CAAC,CAAC;QACL,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,UAAU;YACrC,SAAS,EAAE,0BAAS,CAAC,KAAK;YAC1B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK;YACL,IAAI;YACJ,IAAI,EAAE;gBACJ,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,cAAc;gBACd,aAAa;gBACb,cAAc;gBACd,WAAW;gBACX,YAAY;gBACZ,WAAW;gBACX,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,KAAK;IAC1B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -12,5 +12,4 @@ export declare const collectionsCacheKey = "banx-collections";
|
|
12
12
|
export declare const cachePrefix = "banx";
|
13
13
|
export declare const bondOfferDataSize = 208;
|
14
14
|
export declare const bondTradeTransactionV3DataSize = 336;
|
15
|
-
export declare const collectionRefreshInterval = 3600000;
|
16
15
|
export declare const banxIdlItem: IdlItem;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.banxIdlItem = exports.
|
3
|
+
exports.banxIdlItem = exports.bondTradeTransactionV3DataSize = exports.bondOfferDataSize = exports.cachePrefix = exports.collectionsCacheKey = exports.banxApiCollectionsUrl = exports.banxApiUrl = exports.banxDecimals = exports.banxMint = exports.banxPid = exports.platform = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
const idl_1 = require("./idl");
|
6
6
|
exports.platformId = 'banx';
|
@@ -21,7 +21,6 @@ exports.collectionsCacheKey = `${exports.platformId}-collections`;
|
|
21
21
|
exports.cachePrefix = `${exports.platformId}`;
|
22
22
|
exports.bondOfferDataSize = 208;
|
23
23
|
exports.bondTradeTransactionV3DataSize = 336;
|
24
|
-
exports.collectionRefreshInterval = 3600000;
|
25
24
|
exports.banxIdlItem = {
|
26
25
|
programId: exports.banxPid.toString(),
|
27
26
|
idl: idl_1.BanxIDL,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/banx/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG5C,+BAAgC;AAEnB,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,MAAM,EAAE,sCAAsC;IAC3D,OAAO,EAAE,kBAAkB;IAC3B,OAAO,EAAE,6BAA6B;CACvC,CAAC;AAEW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,8CAA8C,CAAC;AAC1D,QAAA,YAAY,GAAG,CAAC,CAAC;AACjB,QAAA,UAAU,GAAG,iDAAiD,CAAC;AAE/D,QAAA,qBAAqB,GAChC,+DAA+D,CAAC;AAErD,QAAA,mBAAmB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAClD,QAAA,WAAW,GAAG,GAAG,kBAAU,EAAE,CAAC;AAE9B,QAAA,iBAAiB,GAAG,GAAG,CAAC;AACxB,QAAA,8BAA8B,GAAG,GAAG,CAAC;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/banx/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG5C,+BAAgC;AAEnB,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,MAAM,EAAE,sCAAsC;IAC3D,OAAO,EAAE,kBAAkB;IAC3B,OAAO,EAAE,6BAA6B;CACvC,CAAC;AAEW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,8CAA8C,CAAC;AAC1D,QAAA,YAAY,GAAG,CAAC,CAAC;AACjB,QAAA,UAAU,GAAG,iDAAiD,CAAC;AAE/D,QAAA,qBAAqB,GAChC,+DAA+D,CAAC;AAErD,QAAA,mBAAmB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAClD,QAAA,WAAW,GAAG,GAAG,kBAAU,EAAE,CAAC;AAE9B,QAAA,iBAAiB,GAAG,GAAG,CAAC;AACxB,QAAA,8BAA8B,GAAG,GAAG,CAAC;AAErC,QAAA,WAAW,GAAG;IACzB,SAAS,EAAE,eAAO,CAAC,QAAQ,EAAE;IAC7B,GAAG,EAAE,aAAO;IACZ,OAAO,EAAE,QAAQ;CACP,CAAC"}
|
@@ -2,3 +2,4 @@ import BigNumber from 'bignumber.js';
|
|
2
2
|
import { ParsedAccount } from '../../utils/solana';
|
3
3
|
import { BondTradeTransactionV3 } from './types';
|
4
4
|
export declare const calculateLoanRepayValue: (acc: ParsedAccount<BondTradeTransactionV3>) => BigNumber;
|
5
|
+
export declare const calculateDebtValue: (acc: ParsedAccount<BondTradeTransactionV3>) => BigNumber;
|
@@ -3,7 +3,7 @@ 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.calculateLoanRepayValue = void 0;
|
6
|
+
exports.calculateDebtValue = exports.calculateLoanRepayValue = void 0;
|
7
7
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
8
8
|
const BONDS = {
|
9
9
|
PROGRAM_PUBKEY: '4tdmkuY6EStxbS6Y8s5ueznL3VPMSugrvQuDeAHGZhSt',
|
@@ -34,4 +34,31 @@ const calculateLoanRepayValue = (acc) => {
|
|
34
34
|
return new bignumber_js_1.default(loanValue).plus(calculatedInterest);
|
35
35
|
};
|
36
36
|
exports.calculateLoanRepayValue = calculateLoanRepayValue;
|
37
|
-
|
37
|
+
const getInterestRepaid = (acc) => {
|
38
|
+
const currentLoanValue = Number(acc.solAmount) + Number(acc.feeAmount);
|
39
|
+
return new bignumber_js_1.default(acc.redeemedAt !== '0'
|
40
|
+
? calculateCurrentInterestSolPure({
|
41
|
+
loanValue: currentLoanValue,
|
42
|
+
startTime: acc.soldAt,
|
43
|
+
currentTime: Number(acc.redeemedAt),
|
44
|
+
rateBasePoints: acc.amountOfBonds,
|
45
|
+
})
|
46
|
+
: 0);
|
47
|
+
};
|
48
|
+
const calculateDebtValue = (acc) => {
|
49
|
+
const loanValue = Number(acc.solAmount);
|
50
|
+
const calculatedInterest = calculateCurrentInterestSolPure({
|
51
|
+
loanValue,
|
52
|
+
startTime: Number(acc.soldAt),
|
53
|
+
currentTime: Date.now() / 1000,
|
54
|
+
rateBasePoints: Number(acc.amountOfBonds) + BONDS.PROTOCOL_REPAY_FEE,
|
55
|
+
});
|
56
|
+
const repaid = getInterestRepaid(acc);
|
57
|
+
const principal = new bignumber_js_1.default(acc.solAmount);
|
58
|
+
return principal
|
59
|
+
.minus(repaid.toNumber())
|
60
|
+
.plus(calculatedInterest)
|
61
|
+
.plus(Number(acc.feeAmount));
|
62
|
+
};
|
63
|
+
exports.calculateDebtValue = calculateDebtValue;
|
64
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/banx/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAIrC,MAAM,KAAK,GAAG;IACZ,cAAc,EAAE,8CAA8C;IAC9D,YAAY,EAAE,6CAA6C;IAC3D,oBAAoB,EAAE,GAAG,EAAE,gBAAgB;IAC3C,kBAAkB,EAAE,GAAG,EAAE,gBAAgB;CAC1C,CAAC;AAEF,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,eAAe,GAAG,QAAQ,CAAC;AACjC,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;AAEvE,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAEvE,MAAM,gBAAgB,GAAG,CAAC,UAAkB,EAAE,EAAE,CAC9C,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,GAAG,OAAO,CAAC,GAAG,WAAW,CAAC,CAAC;AAEnD,MAAM,+BAA+B,GAAG,CAAC,EACvC,SAAS,EACT,SAAS,EACT,WAAW,EAC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AAE,GAAG,CAAC,aAAa;SAClC,CAAC;QACJ,CAAC,CAAC,CAAC,CACN,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,kBAAkB,GAAG,CAChC,GAA0C,EAC/B,EAAE;IACb,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAExC,MAAM,kBAAkB,GAAG,+BAA+B,CAAC;QACzD,SAAS;QACT,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;QAC7B,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI;QAC9B,cAAc,EAAE,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,kBAAkB;KACrE,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAEtC,MAAM,SAAS,GAAG,IAAI,sBAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAE/C,OAAO,SAAS;SACb,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;SACxB,IAAI,CAAC,kBAAkB,CAAC;SACxB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;AACjC,CAAC,CAAC;AApBW,QAAA,kBAAkB,sBAoB7B"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export declare const BanxIDL: {
|
2
2
|
version: string;
|
3
3
|
name: string;
|
4
|
-
accounts:
|
4
|
+
accounts: {
|
5
5
|
name: string;
|
6
6
|
type: {
|
7
7
|
kind: string;
|
@@ -9,28 +9,36 @@ export declare const BanxIDL: {
|
|
9
9
|
name: string;
|
10
10
|
type: {
|
11
11
|
defined: string;
|
12
|
+
array?: undefined;
|
13
|
+
};
|
14
|
+
} | {
|
15
|
+
name: string;
|
16
|
+
type: {
|
17
|
+
array: (string | number)[];
|
18
|
+
defined?: undefined;
|
12
19
|
};
|
13
20
|
} | {
|
14
21
|
name: string;
|
15
22
|
type: string;
|
16
23
|
})[];
|
17
24
|
};
|
18
|
-
}
|
25
|
+
}[];
|
26
|
+
types: ({
|
19
27
|
name: string;
|
20
28
|
type: {
|
21
29
|
kind: string;
|
22
30
|
fields: ({
|
23
|
-
name: string;
|
24
|
-
type: string;
|
25
|
-
} | {
|
26
31
|
name: string;
|
27
32
|
type: {
|
28
33
|
array: (string | number)[];
|
29
34
|
};
|
35
|
+
} | {
|
36
|
+
name: string;
|
37
|
+
type: string;
|
30
38
|
})[];
|
39
|
+
variants?: undefined;
|
31
40
|
};
|
32
|
-
}
|
33
|
-
types: ({
|
41
|
+
} | {
|
34
42
|
name: string;
|
35
43
|
type: {
|
36
44
|
kind: string;
|