@sonarwatch/portfolio-plugins 0.14.152 → 0.14.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2236 -2228
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/defituna/lendingPoolsJob.js +33 -0
- package/src/plugins/defituna/lendingPoolsJob.js.map +1 -1
- package/src/plugins/drift/spotMarketsJob.js +0 -1
- package/src/plugins/drift/spotMarketsJob.js.map +1 -1
- package/src/plugins/ensofi/index.js +2 -1
- package/src/plugins/ensofi/index.js.map +1 -1
- package/src/plugins/ensofi/solanaLoansJob.d.ts +3 -0
- package/src/plugins/ensofi/solanaLoansJob.js +63 -0
- package/src/plugins/ensofi/solanaLoansJob.js.map +1 -0
- package/src/plugins/ensofi/structs.js +2 -2
- package/src/plugins/ensofi/structs.js.map +1 -1
- package/src/plugins/kamino/reservesJob.js +35 -0
- package/src/plugins/kamino/reservesJob.js.map +1 -1
- package/src/plugins/loopscale/constants.d.ts +2 -3
- package/src/plugins/loopscale/constants.js +3 -4
- package/src/plugins/loopscale/constants.js.map +1 -1
- package/src/plugins/loopscale/helpers.d.ts +6 -33
- package/src/plugins/loopscale/helpers.js +39 -142
- package/src/plugins/loopscale/helpers.js.map +1 -1
- package/src/plugins/loopscale/index.js +10 -3
- package/src/plugins/loopscale/index.js.map +1 -1
- package/src/plugins/loopscale/lendFetcher.js +57 -0
- package/src/plugins/loopscale/lendFetcher.js.map +1 -0
- package/src/plugins/loopscale/lendVaultsFetcher.d.ts +6 -0
- package/src/plugins/loopscale/lendVaultsFetcher.js +68 -0
- package/src/plugins/loopscale/lendVaultsFetcher.js.map +1 -0
- package/src/plugins/loopscale/loansFetcher.d.ts +3 -0
- package/src/plugins/loopscale/loansFetcher.js +79 -0
- package/src/plugins/loopscale/loansFetcher.js.map +1 -0
- package/src/plugins/loopscale/structs.d.ts +116 -86
- package/src/plugins/loopscale/structs.js +101 -79
- package/src/plugins/loopscale/structs.js.map +1 -1
- package/src/plugins/loopscale/types.d.ts +6 -0
- package/src/plugins/loopscale/types.js +3 -0
- package/src/plugins/loopscale/types.js.map +1 -0
- package/src/plugins/loopscale/vaultsJob.d.ts +3 -0
- package/src/plugins/loopscale/vaultsJob.js +121 -0
- package/src/plugins/loopscale/vaultsJob.js.map +1 -0
- package/src/plugins/lulo/depositsFetcher.js +9 -29
- package/src/plugins/lulo/depositsFetcher.js.map +1 -1
- package/src/plugins/marginfi/banksJob.js +6 -2
- package/src/plugins/marginfi/banksJob.js.map +1 -1
- package/src/plugins/marginfi/constants.d.ts +5 -3
- package/src/plugins/marginfi/constants.js +8 -7
- package/src/plugins/marginfi/constants.js.map +1 -1
- package/src/plugins/marginfi/depositsFetcher.js +50 -27
- package/src/plugins/marginfi/depositsFetcher.js.map +1 -1
- package/src/plugins/marginfi/getMarginFiAccounts.d.ts +6 -0
- package/src/plugins/marginfi/getMarginFiAccounts.js +44 -0
- package/src/plugins/marginfi/getMarginFiAccounts.js.map +1 -0
- package/src/plugins/marginfi/helpers.d.ts +0 -5
- package/src/plugins/marginfi/helpers.js +1 -81
- package/src/plugins/marginfi/helpers.js.map +1 -1
- package/src/plugins/marginfi/structs/MarginfiAccount.d.ts +5 -0
- package/src/plugins/marginfi/structs/MarginfiAccount.js.map +1 -1
- package/src/plugins/suilend/helpers.js +2 -0
- package/src/plugins/suilend/helpers.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/misc/getLendingMarketAprs.d.ts +3 -1
- package/src/utils/misc/getLendingMarketAprs.js +24 -1
- package/src/utils/misc/getLendingMarketAprs.js.map +1 -1
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/plugins/loopscale/filters.d.ts +0 -9
- package/src/plugins/loopscale/filters.js +0 -62
- package/src/plugins/loopscale/filters.js.map +0 -1
- package/src/plugins/loopscale/positionsFetcher.js +0 -119
- package/src/plugins/loopscale/positionsFetcher.js.map +0 -1
- package/src/plugins/marginfi/filters.d.ts +0 -5
- package/src/plugins/marginfi/filters.js +0 -45
- package/src/plugins/marginfi/filters.js.map +0 -1
- /package/src/plugins/loopscale/{positionsFetcher.d.ts → lendFetcher.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,gEAAqC;AACrC,yEAAsE;AAEtE,iDAA+D;AAExD,MAAM,iBAAiB,GAAG,CAC/B,KAA8B,EAC9B,SAAoB,EACpB,EAAE;IACF,MAAM,CAAC,GAAG,CAAC,GAAG,mBAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACjE,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AANW,QAAA,iBAAiB,qBAM5B;AAEF,SAAgB,eAAe,CAAC,KAAiB;IAC/C,IAAI,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACvB,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,sCAAsC;QACtC,MAAM,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AARD,0CAQC;AAED,SAAsB,yBAAyB,CAC7C,OAAkB,EAClB,KAAY;;QAEZ,MAAM,gBAAgB,GAAG,MAAM,IAAA,yCAAmB,EAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;QAE9E,IAAI,cAAc,GAAG,CAAC,CAAC;QACvB,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC/B,IAAI,CAAC,GAAG;gBAAE,OAAO;YACjB,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAC/B,IAAI,CAAC,OAAO;oBAAE,OAAO;gBACrB,MAAM,YAAY,GAAG,IAAA,kCAAwB,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC;gBAEnE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;gBACzB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;oBACvB,MAAM,UAAU,GAAG,IAAA,kCAAwB,EAAC;wBAC1C,KAAK,EAAE,IAAI,sBAAS,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC;qBACjD,CAAC,CAAC;oBACH,MAAM,UAAU,GAAG,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;oBACzD,cAAc,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;gBAC1C,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,cAAc,CAAC;IACxB,CAAC;CAAA;AAxBD,8DAwBC"}
|
|
@@ -5,8 +5,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
|
7
7
|
const constants_1 = require("./constants");
|
|
8
|
-
const
|
|
8
|
+
const lendVaultsFetcher_1 = __importDefault(require("./lendVaultsFetcher"));
|
|
9
|
+
const vaultsJob_1 = __importDefault(require("./vaultsJob"));
|
|
10
|
+
const lendFetcher_1 = __importDefault(require("./lendFetcher"));
|
|
11
|
+
const loansFetcher_1 = __importDefault(require("./loansFetcher"));
|
|
9
12
|
exports.platforms = [constants_1.platform];
|
|
10
|
-
exports.jobs = [];
|
|
11
|
-
exports.fetchers = [
|
|
13
|
+
exports.jobs = [vaultsJob_1.default];
|
|
14
|
+
exports.fetchers = [
|
|
15
|
+
lendVaultsFetcher_1.default,
|
|
16
|
+
lendFetcher_1.default,
|
|
17
|
+
loansFetcher_1.default,
|
|
18
|
+
];
|
|
12
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,4EAAoD;AACpD,4DAAoC;AACpC,gEAAwC;AACxC,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,mBAAS,CAAC,CAAC;AAC1B,QAAA,QAAQ,GAAc;IACjC,2BAAiB;IACjB,qBAAW;IACX,sBAAY;CACb,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
16
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
17
|
+
const bn_js_1 = __importDefault(require("bn.js"));
|
|
18
|
+
const constants_1 = require("./constants");
|
|
19
|
+
const clients_1 = require("../../utils/clients");
|
|
20
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
|
21
|
+
const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
|
|
22
|
+
const structs_1 = require("./structs");
|
|
23
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
+
const connection = (0, clients_1.getClientSolana)();
|
|
25
|
+
const strategys = yield ParsedGpa_1.ParsedGpa.build(connection, structs_1.strategyStruct, constants_1.loopscaleProgramId)
|
|
26
|
+
.addFilter('accountDiscriminator', [174, 110, 39, 119, 82, 106, 169, 102])
|
|
27
|
+
.addFilter('lender', new web3_js_1.PublicKey(owner))
|
|
28
|
+
.run();
|
|
29
|
+
if (!strategys.length)
|
|
30
|
+
return [];
|
|
31
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
|
32
|
+
strategys.forEach((strategy) => {
|
|
33
|
+
const amount = new bn_js_1.default(strategy.external_yield_amount.array.reverse()).toNumber() +
|
|
34
|
+
new bn_js_1.default(strategy.current_deployed_amount.array.reverse()).toNumber() +
|
|
35
|
+
new bn_js_1.default(strategy.token_balance.array.reverse()).toNumber();
|
|
36
|
+
if (strategy.principal_mint === web3_js_1.PublicKey.default) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const element = elementRegistry.addElementBorrowlend({
|
|
40
|
+
label: 'Lending',
|
|
41
|
+
ref: strategy.pubkey,
|
|
42
|
+
link: 'https://app.loopscale.com/lend',
|
|
43
|
+
});
|
|
44
|
+
element.addSuppliedAsset({
|
|
45
|
+
address: strategy.principal_mint,
|
|
46
|
+
amount,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
return elementRegistry.getElements(cache);
|
|
50
|
+
});
|
|
51
|
+
const fetcher = {
|
|
52
|
+
id: `${constants_1.platformId}-lend`,
|
|
53
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
|
54
|
+
executor,
|
|
55
|
+
};
|
|
56
|
+
exports.default = fetcher;
|
|
57
|
+
//# sourceMappingURL=lendFetcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lendFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/lendFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAC5C,kDAAuB;AAEvB,2CAA6D;AAE7D,iDAAsD;AACtD,gFAA6E;AAC7E,kEAA+D;AAC/D,uCAA2C;AAE3C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,SAAS,GAAG,MAAM,qBAAS,CAAC,KAAK,CACrC,UAAU,EACV,wBAAc,EACd,8BAAkB,CACnB;SACE,SAAS,CAAC,sBAAsB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;SACzE,SAAS,CAAC,QAAQ,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC;SACzC,GAAG,EAAE,CAAC;IAET,IAAI,CAAC,SAAS,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEjC,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IAE1E,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC7B,MAAM,MAAM,GACV,IAAI,eAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;YACjE,IAAI,eAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;YACnE,IAAI,eAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC5D,IAAI,QAAQ,CAAC,cAAc,KAAK,mBAAS,CAAC,OAAO,EAAE,CAAC;YAClD,OAAO;QACT,CAAC;QAED,MAAM,OAAO,GAAG,eAAe,CAAC,oBAAoB,CAAC;YACnD,KAAK,EAAE,SAAS;YAChB,GAAG,EAAE,QAAQ,CAAC,MAAM;YACpB,IAAI,EAAE,gCAAgC;SACvC,CAAC,CAAC;QACH,OAAO,CAAC,gBAAgB,CAAC;YACvB,OAAO,EAAE,QAAQ,CAAC,cAAc;YAChC,MAAM;SACP,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Fetcher } from '../../Fetcher';
|
|
2
|
+
import { MemoizedCache } from '../../utils/misc/MemoizedCache';
|
|
3
|
+
import { CachedVault } from './types';
|
|
4
|
+
export declare const vaultsMemo: MemoizedCache<CachedVault[], Map<string, CachedVault>>;
|
|
5
|
+
declare const fetcher: Fetcher;
|
|
6
|
+
export default fetcher;
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.vaultsMemo = void 0;
|
|
13
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
14
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
15
|
+
const constants_1 = require("./constants");
|
|
16
|
+
const clients_1 = require("../../utils/clients");
|
|
17
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
|
18
|
+
const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
|
|
19
|
+
const structs_1 = require("./structs");
|
|
20
|
+
const helpers_1 = require("./helpers");
|
|
21
|
+
const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
|
|
22
|
+
const arrayToMap_1 = require("../../utils/misc/arrayToMap");
|
|
23
|
+
exports.vaultsMemo = new MemoizedCache_1.MemoizedCache(constants_1.vaultsCacheKey, {
|
|
24
|
+
prefix: constants_1.platformId,
|
|
25
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
|
26
|
+
}, (arr) => (0, arrayToMap_1.arrayToMap)(arr || [], 'pubkey'));
|
|
27
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
const connection = (0, clients_1.getClientSolana)();
|
|
29
|
+
const userVaultStakes = yield ParsedGpa_1.ParsedGpa.build(connection, structs_1.vaultStakeStruct, constants_1.loopscaleProgramId)
|
|
30
|
+
.addFilter('accountDiscriminator', [225, 34, 128, 53, 167, 239, 182, 107])
|
|
31
|
+
.addFilter('user', new web3_js_1.PublicKey(owner))
|
|
32
|
+
.run();
|
|
33
|
+
if (!userVaultStakes.length)
|
|
34
|
+
return [];
|
|
35
|
+
const vaults = yield exports.vaultsMemo.getItem(cache);
|
|
36
|
+
if (!vaults.size)
|
|
37
|
+
throw new Error('Vaults not cached');
|
|
38
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
|
39
|
+
userVaultStakes.forEach((stakeAccount) => {
|
|
40
|
+
const vault = vaults.get(stakeAccount.vault.toString());
|
|
41
|
+
if (!vault)
|
|
42
|
+
return;
|
|
43
|
+
const amount = (0, helpers_1.bytesToNumberLE)(new Uint8Array(stakeAccount.amount.array));
|
|
44
|
+
const element = elementRegistry.addElementMultiple({
|
|
45
|
+
label: 'Deposit',
|
|
46
|
+
ref: stakeAccount.pubkey,
|
|
47
|
+
sourceRefs: [
|
|
48
|
+
{
|
|
49
|
+
name: 'Vault',
|
|
50
|
+
address: vault.pubkey.toString(),
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
link: `https://app.loopscale.com/vault/AXanCP4dJHtWd7zY4X7nwxN5t5Gysfy2uG3XTxSmXdaB${vault.pubkey}`,
|
|
54
|
+
});
|
|
55
|
+
element.addAsset({
|
|
56
|
+
address: vault.lp_mint,
|
|
57
|
+
amount,
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
return elementRegistry.getElements(cache);
|
|
61
|
+
});
|
|
62
|
+
const fetcher = {
|
|
63
|
+
id: `${constants_1.platformId}-lend-vaults`,
|
|
64
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
|
65
|
+
executor,
|
|
66
|
+
};
|
|
67
|
+
exports.default = fetcher;
|
|
68
|
+
//# sourceMappingURL=lendVaultsFetcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lendVaultsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/lendVaultsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAE5C,2CAA6E;AAE7E,iDAAsD;AACtD,gFAA6E;AAC7E,kEAA+D;AAC/D,uCAA6C;AAC7C,uCAA4C;AAC5C,kEAA+D;AAE/D,4DAAyD;AAG5C,QAAA,UAAU,GAAG,IAAI,6BAAa,CAIzC,0BAAc,EACd;IACE,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,uBAAU,EAAC,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,CACzC,CAAC;AAEF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,eAAe,GAAG,MAAM,qBAAS,CAAC,KAAK,CAC3C,UAAU,EACV,0BAAgB,EAChB,8BAAkB,CACnB;SACE,SAAS,CAAC,sBAAsB,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;SACzE,SAAS,CAAC,MAAM,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC;SACvC,GAAG,EAAE,CAAC;IAET,IAAI,CAAC,eAAe,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEvC,MAAM,MAAM,GAAG,MAAM,kBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,MAAM,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAEvD,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IAE1E,eAAe,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;QACvC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,MAAM,MAAM,GAAG,IAAA,yBAAe,EAAC,IAAI,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1E,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;YACjD,KAAK,EAAE,SAAS;YAChB,GAAG,EAAE,YAAY,CAAC,MAAM;YACxB,UAAU,EAAE;gBACV;oBACE,IAAI,EAAE,OAAO;oBACb,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE;iBACjC;aACF;YACD,IAAI,EAAE,+EAA+E,KAAK,CAAC,MAAM,EAAE;SACpG,CAAC,CAAC;QACH,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,MAAM;SACP,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
16
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
17
|
+
const bn_js_1 = __importDefault(require("bn.js"));
|
|
18
|
+
const constants_1 = require("./constants");
|
|
19
|
+
const clients_1 = require("../../utils/clients");
|
|
20
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
|
21
|
+
const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
|
|
22
|
+
const structs_1 = require("./structs");
|
|
23
|
+
const helpers_1 = require("./helpers");
|
|
24
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
+
const connection = (0, clients_1.getClientSolana)();
|
|
26
|
+
const accounts = yield ParsedGpa_1.ParsedGpa.build(connection, structs_1.loanStruct, constants_1.loopscaleProgramId)
|
|
27
|
+
.addFilter('accountDiscriminator', [20, 195, 70, 117, 165, 227, 182, 1])
|
|
28
|
+
.addFilter('borrower', new web3_js_1.PublicKey(owner))
|
|
29
|
+
.run();
|
|
30
|
+
if (!accounts.length)
|
|
31
|
+
return [];
|
|
32
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
|
33
|
+
accounts.forEach((account) => {
|
|
34
|
+
const element = elementRegistry.addElementBorrowlend({
|
|
35
|
+
label: 'Lending',
|
|
36
|
+
ref: account.pubkey,
|
|
37
|
+
link: `https://app.loopscale.com/loan/${account.pubkey}`,
|
|
38
|
+
});
|
|
39
|
+
account.collateral.forEach((collateralData, i) => {
|
|
40
|
+
if (collateralData.asset_identifier.toString() ===
|
|
41
|
+
web3_js_1.PublicKey.default.toString()) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
element.addSuppliedAsset({
|
|
45
|
+
address: collateralData.asset_identifier,
|
|
46
|
+
amount: new bn_js_1.default(collateralData.amount.array.reverse()).toNumber(),
|
|
47
|
+
});
|
|
48
|
+
element.addSuppliedLtv((0, helpers_1.bytesToNumberLE)(new Uint8Array(account.ltv_matrix[i][0].array)));
|
|
49
|
+
});
|
|
50
|
+
account.ledgers.forEach((ledger, i) => {
|
|
51
|
+
if (ledger.principal_mint.toString() === web3_js_1.PublicKey.default.toString()) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
element.addBorrowedAsset({
|
|
55
|
+
address: ledger.principal_mint,
|
|
56
|
+
amount: new bn_js_1.default(ledger.principal_due.array.reverse()).toNumber() -
|
|
57
|
+
new bn_js_1.default(ledger.principal_repaid.array.reverse()).toNumber() +
|
|
58
|
+
new bn_js_1.default(ledger.interest_due.array.reverse()).toNumber() -
|
|
59
|
+
new bn_js_1.default(ledger.interest_repaid.array.reverse()).toNumber(),
|
|
60
|
+
});
|
|
61
|
+
element.addBorrowedWeight((0, helpers_1.bytesToNumberLE)(new Uint8Array(account.weight_matrix[i][0].array)));
|
|
62
|
+
const apy = (0, helpers_1.bytesToNumberLE)(new Uint8Array(ledger.apy.array)) / 1000000;
|
|
63
|
+
element.addBorrowedYield([
|
|
64
|
+
{
|
|
65
|
+
apy,
|
|
66
|
+
apr: (0, portfolio_core_1.apyToApr)(apy),
|
|
67
|
+
},
|
|
68
|
+
]);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
return elementRegistry.getElements(cache);
|
|
72
|
+
});
|
|
73
|
+
const fetcher = {
|
|
74
|
+
id: `${constants_1.platformId}-loans`,
|
|
75
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
|
76
|
+
executor,
|
|
77
|
+
};
|
|
78
|
+
exports.default = fetcher;
|
|
79
|
+
//# sourceMappingURL=loansFetcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/loansFetcher.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,102 +1,132 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
|
3
2
|
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
|
4
3
|
import { PublicKey } from '@solana/web3.js';
|
|
5
4
|
import BigNumber from 'bignumber.js';
|
|
6
|
-
import { BeetStruct
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
user: PublicKey;
|
|
10
|
-
organization: PublicKey;
|
|
11
|
-
type: number;
|
|
5
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
|
6
|
+
export type PodU32 = {
|
|
7
|
+
array: number[];
|
|
12
8
|
};
|
|
13
|
-
export declare const
|
|
14
|
-
export type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
lender: PublicKey;
|
|
18
|
-
borrower: PublicKey;
|
|
19
|
-
collateral: PublicKey;
|
|
20
|
-
debt_note: PublicKey;
|
|
21
|
-
credit_note: PublicKey;
|
|
22
|
-
credit_claimed: boolean;
|
|
23
|
-
debt_claimed: boolean;
|
|
24
|
-
loan_start_time: BigNumber;
|
|
25
|
-
num_fees_outstanding: BigNumber;
|
|
26
|
-
fees_received: BigNumber;
|
|
9
|
+
export declare const podU32Struct: BeetStruct<PodU32, Partial<PodU32>>;
|
|
10
|
+
export type Duration = {
|
|
11
|
+
duration: PodU32;
|
|
12
|
+
duration_type: number;
|
|
27
13
|
};
|
|
28
|
-
export declare const
|
|
29
|
-
export type
|
|
30
|
-
|
|
31
|
-
organization_identifier: PublicKey;
|
|
32
|
-
num_escrowed: BigNumber;
|
|
33
|
-
nonce: PublicKey;
|
|
34
|
-
origination_cap: BigNumber;
|
|
35
|
-
cumulative_amount_originated: BigNumber;
|
|
36
|
-
external_yield_source: number;
|
|
14
|
+
export declare const durationStruct: BeetStruct<Duration, Partial<Duration>>;
|
|
15
|
+
export type PodDecimal = {
|
|
16
|
+
array: number[];
|
|
37
17
|
};
|
|
38
|
-
export declare const
|
|
39
|
-
export type
|
|
40
|
-
|
|
41
|
-
|
|
18
|
+
export declare const podDecimalStruct: BeetStruct<PodDecimal, Partial<PodDecimal>>;
|
|
19
|
+
export type PodU128 = {
|
|
20
|
+
array: number[];
|
|
21
|
+
};
|
|
22
|
+
export declare const podU128Struct: BeetStruct<PodU128, Partial<PodU128>>;
|
|
23
|
+
export type PodU32CBPS = {
|
|
24
|
+
array: number[];
|
|
25
|
+
};
|
|
26
|
+
export declare const podU32CBPSStruct: BeetStruct<PodU32CBPS, Partial<PodU32CBPS>>;
|
|
27
|
+
export type PodU64 = {
|
|
28
|
+
array: number[];
|
|
29
|
+
};
|
|
30
|
+
export declare const podU64Struct: BeetStruct<PodU64, Partial<PodU64>>;
|
|
31
|
+
export type PodU64CBPS = {
|
|
32
|
+
array: number[];
|
|
33
|
+
};
|
|
34
|
+
export declare const podU64CBPSStruct: BeetStruct<PodU64CBPS, Partial<PodU64CBPS>>;
|
|
35
|
+
export type PodBool = {
|
|
36
|
+
value: number;
|
|
37
|
+
};
|
|
38
|
+
export declare const podBoolStruct: BeetStruct<PodBool, Partial<PodBool>>;
|
|
39
|
+
export type Vault = {
|
|
40
|
+
accountDiscriminator: number[];
|
|
41
|
+
manager: PublicKey;
|
|
42
42
|
nonce: PublicKey;
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
bump: number;
|
|
44
|
+
lp_supply: PodU64;
|
|
45
|
+
lp_mint: PublicKey;
|
|
45
46
|
principal_mint: PublicKey;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
maker_role: number;
|
|
50
|
-
last_updated_slot: BigNumber;
|
|
51
|
-
max_outstanding_payments: BigNumber;
|
|
52
|
-
last_payment_id: BigNumber;
|
|
53
|
-
final_payment_id: BigNumber;
|
|
54
|
-
final_payment_time_offset: BigNumber;
|
|
55
|
-
status: number;
|
|
56
|
-
default_type: number;
|
|
57
|
-
created_at: BigNumber;
|
|
58
|
-
funding_type: number;
|
|
59
|
-
allow_early_repayments: boolean;
|
|
60
|
-
origination_fee: BigNumber;
|
|
61
|
-
liquidation_manager: PublicKey;
|
|
62
|
-
market_manager: PublicKey;
|
|
63
|
-
liquidation_threshold: BigNumber;
|
|
64
|
-
refinance_enabled: boolean;
|
|
65
|
-
max_refinance_apy: BigNumber;
|
|
66
|
-
refinance_duration: BigNumber;
|
|
67
|
-
refinance_duration_type: number;
|
|
47
|
+
cumulative_principal_deposited: PodU64;
|
|
48
|
+
deposits_enabled: PodBool;
|
|
49
|
+
max_early_unstake_fee: PodU64CBPS;
|
|
68
50
|
};
|
|
69
|
-
export declare const
|
|
51
|
+
export declare const vaultStruct: BeetStruct<Vault, Partial<Vault>>;
|
|
52
|
+
export type VaultStake = {
|
|
53
|
+
accountDiscriminator: number[];
|
|
54
|
+
vault: PublicKey;
|
|
55
|
+
nonce: PublicKey;
|
|
56
|
+
bump: number;
|
|
57
|
+
user: PublicKey;
|
|
58
|
+
amount: PodU64;
|
|
59
|
+
duration: Duration;
|
|
60
|
+
start_time: PodU64;
|
|
61
|
+
end_time: PodU64;
|
|
62
|
+
unstake_time: PodU64;
|
|
63
|
+
unstake_fee_applied: PodU64;
|
|
64
|
+
};
|
|
65
|
+
export declare const vaultStakeStruct: BeetStruct<VaultStake, Partial<VaultStake>>;
|
|
70
66
|
export type Ledger = {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
reserve: number[];
|
|
67
|
+
status: number;
|
|
68
|
+
strategy: PublicKey;
|
|
69
|
+
principal_mint: PublicKey;
|
|
70
|
+
market_information: PublicKey;
|
|
71
|
+
principal_due: PodU64;
|
|
72
|
+
principal_repaid: PodU64;
|
|
73
|
+
interest_due: PodU64;
|
|
74
|
+
interest_repaid: PodU64;
|
|
75
|
+
duration: Duration;
|
|
76
|
+
interest_per_second: PodDecimal;
|
|
77
|
+
start_time: PodU64;
|
|
78
|
+
end_time: PodU64;
|
|
79
|
+
apy: PodU64CBPS;
|
|
85
80
|
};
|
|
86
81
|
export declare const ledgerStruct: BeetStruct<Ledger, Partial<Ledger>>;
|
|
87
|
-
export type
|
|
88
|
-
|
|
82
|
+
export type Strategy = {
|
|
83
|
+
accountDiscriminator: number[];
|
|
89
84
|
version: number;
|
|
90
|
-
order: PublicKey;
|
|
91
|
-
ledgers: Ledger[];
|
|
92
|
-
};
|
|
93
|
-
export declare const orderLedgerStruct: FixableBeetStruct<OrderLedger, Partial<OrderLedger>>;
|
|
94
|
-
export type Lockbox = {
|
|
95
|
-
buffer: Buffer;
|
|
96
85
|
nonce: PublicKey;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
86
|
+
bump: number;
|
|
87
|
+
principal_mint: PublicKey;
|
|
88
|
+
lender: PublicKey;
|
|
89
|
+
originations_enabled: PodBool;
|
|
90
|
+
external_yield_source: number;
|
|
91
|
+
interest_per_second: PodDecimal;
|
|
92
|
+
last_accrued_timestamp: PodU64;
|
|
93
|
+
liquidity_buffer: PodU64CBPS;
|
|
94
|
+
token_balance: PodU64;
|
|
95
|
+
interest_fee: PodU64CBPS;
|
|
96
|
+
principal_fee: PodU64CBPS;
|
|
97
|
+
origination_fee: PodU64CBPS;
|
|
98
|
+
origination_cap: PodU64;
|
|
99
|
+
external_yield_amount: PodU64;
|
|
100
|
+
current_deployed_amount: PodU64;
|
|
101
|
+
outstanding_interest_amount: PodU64;
|
|
102
|
+
fee_claimable: PodU64;
|
|
103
|
+
cumulative_principal_originated: PodU128;
|
|
104
|
+
cumulative_interest_accrued: PodU128;
|
|
105
|
+
cumulative_loan_count: PodU64;
|
|
106
|
+
active_loan_count: PodU64;
|
|
107
|
+
market_information: PublicKey;
|
|
108
|
+
collateral_map: PodU64[][];
|
|
109
|
+
};
|
|
110
|
+
export declare const strategyStruct: BeetStruct<Strategy, Partial<Strategy>>;
|
|
111
|
+
export type CollateralData = {
|
|
112
|
+
asset_mint: PublicKey;
|
|
113
|
+
amount: PodU64;
|
|
114
|
+
asset_type: number;
|
|
115
|
+
asset_identifier: PublicKey;
|
|
116
|
+
};
|
|
117
|
+
export declare const collateralDataStruct: BeetStruct<CollateralData, Partial<CollateralData>>;
|
|
118
|
+
export type Loan = {
|
|
119
|
+
accountDiscriminator: number[];
|
|
120
|
+
version: number;
|
|
121
|
+
bump: number;
|
|
122
|
+
loan_type: number;
|
|
123
|
+
borrower: PublicKey;
|
|
124
|
+
nonce: BigNumber;
|
|
125
|
+
start_time: PodU64;
|
|
126
|
+
ledgers: Ledger[];
|
|
127
|
+
collateral: CollateralData[];
|
|
128
|
+
weight_matrix: PodU32CBPS[][];
|
|
129
|
+
ltv_matrix: PodU32CBPS[][];
|
|
130
|
+
lqt_matrix: PodU32CBPS[][];
|
|
101
131
|
};
|
|
102
|
-
export declare const
|
|
132
|
+
export declare const loanStruct: BeetStruct<Loan, Partial<Loan>>;
|