@sonarwatch/portfolio-plugins 0.11.94 → 0.11.95
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +4 -0
- package/package.json +2 -2
- package/src/index.js +8 -0
- package/src/index.js.map +1 -1
- package/src/plugins/aurory/constants.d.ts +9 -0
- package/src/plugins/aurory/constants.js +19 -0
- package/src/plugins/aurory/constants.js.map +1 -0
- package/src/plugins/aurory/helpers.d.ts +2 -0
- package/src/plugins/aurory/helpers.js +21 -0
- package/src/plugins/aurory/helpers.js.map +1 -0
- package/src/plugins/aurory/index.d.ts +6 -0
- package/src/plugins/aurory/index.js +12 -0
- package/src/plugins/aurory/index.js.map +1 -0
- package/src/plugins/aurory/stakingFetcher.d.ts +3 -0
- package/src/plugins/aurory/stakingFetcher.js +47 -0
- package/src/plugins/aurory/stakingFetcher.js.map +1 -0
- package/src/plugins/aurory/structs.d.ts +10 -0
- package/src/plugins/aurory/structs.js +11 -0
- package/src/plugins/aurory/structs.js.map +1 -0
- package/src/plugins/kamino/constants.d.ts +3 -3
- package/src/plugins/kamino/constants.js +53 -44
- package/src/plugins/kamino/constants.js.map +1 -1
- package/src/plugins/kamino/helpers/pdas.d.ts +2 -2
- package/src/plugins/kamino/helpers/pdas.js +28 -15
- package/src/plugins/kamino/helpers/pdas.js.map +1 -1
- package/src/plugins/kamino/index.js +2 -1
- package/src/plugins/kamino/index.js.map +1 -1
- package/src/plugins/kamino/lendsFetcher.js +158 -140
- package/src/plugins/kamino/lendsFetcher.js.map +1 -1
- package/src/plugins/kamino/marketsJob.d.ts +3 -0
- package/src/plugins/kamino/marketsJob.js +29 -0
- package/src/plugins/kamino/marketsJob.js.map +1 -0
- package/src/plugins/kamino/types.d.ts +5 -0
- package/src/plugins/x-staking-solana/constants.d.ts +16 -0
- package/src/plugins/x-staking-solana/constants.js +64 -0
- package/src/plugins/x-staking-solana/constants.js.map +1 -0
- package/src/plugins/x-staking-solana/index.d.ts +6 -0
- package/src/plugins/x-staking-solana/index.js +15 -0
- package/src/plugins/x-staking-solana/index.js.map +1 -0
- package/src/plugins/x-staking-solana/stakingJob.d.ts +3 -0
- package/src/plugins/x-staking-solana/stakingJob.js +49 -0
- package/src/plugins/x-staking-solana/stakingJob.js.map +1 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.11.95](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.94...plugins-0.11.95) (2024-03-05)
|
6
|
+
|
7
|
+
|
8
|
+
|
5
9
|
## [0.11.94](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.93...plugins-0.11.94) (2024-03-05)
|
6
10
|
|
7
11
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.95",
|
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.95"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
package/src/index.js
CHANGED
@@ -89,6 +89,8 @@ const aptin_1 = require("./plugins/aptin");
|
|
89
89
|
const bskt_1 = require("./plugins/bskt");
|
90
90
|
const flowmatic_1 = require("./plugins/flowmatic");
|
91
91
|
const genesysgo_1 = require("./plugins/genesysgo");
|
92
|
+
const aurory_1 = require("./plugins/aurory");
|
93
|
+
const x_staking_solana_1 = require("./plugins/x-staking-solana");
|
92
94
|
var constants_1 = require("./plugins/tokens/constants");
|
93
95
|
Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
|
94
96
|
Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
|
@@ -168,6 +170,8 @@ exports.platforms = [
|
|
168
170
|
...bskt_1.platforms,
|
169
171
|
...flowmatic_1.platforms,
|
170
172
|
...genesysgo_1.platforms,
|
173
|
+
...aurory_1.platforms,
|
174
|
+
...x_staking_solana_1.platforms,
|
171
175
|
];
|
172
176
|
// JOBS //
|
173
177
|
exports.jobs = [
|
@@ -233,6 +237,8 @@ exports.jobs = [
|
|
233
237
|
...bskt_1.jobs,
|
234
238
|
...flowmatic_1.jobs,
|
235
239
|
...genesysgo_1.jobs,
|
240
|
+
...aurory_1.jobs,
|
241
|
+
...x_staking_solana_1.jobs,
|
236
242
|
];
|
237
243
|
// FETCHERS //
|
238
244
|
exports.fetchers = [
|
@@ -300,6 +306,8 @@ exports.fetchers = [
|
|
300
306
|
...bskt_1.fetchers,
|
301
307
|
...flowmatic_1.fetchers,
|
302
308
|
...genesysgo_1.fetchers,
|
309
|
+
...aurory_1.fetchers,
|
310
|
+
...x_staking_solana_1.fetchers,
|
303
311
|
];
|
304
312
|
exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
|
305
313
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACj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AG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
2
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
3
|
+
export declare const auroryPlatformId = "aurory";
|
4
|
+
export declare const platform: Platform;
|
5
|
+
export declare const programId: PublicKey;
|
6
|
+
export declare const auryMint = "AURYydfxJib1ZkTir1Jn1J9ECYUtjb6rKQVmtYaixWPP";
|
7
|
+
export declare const xAuryMint = "xAURp5XmAG7772mfkSy6vRAjGK9JofYjc3dmQDWdVDP";
|
8
|
+
export declare const decimals = 9;
|
9
|
+
export declare const vaultPubkey = "FysGks3izhgVhrUkub9QQWCTEVAdhkZKYSNK2F25maGD";
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.vaultPubkey = exports.decimals = exports.xAuryMint = exports.auryMint = exports.programId = exports.platform = exports.auroryPlatformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
exports.auroryPlatformId = 'aurory';
|
6
|
+
exports.platform = {
|
7
|
+
id: exports.auroryPlatformId,
|
8
|
+
name: 'Aurory',
|
9
|
+
image: 'https://sonar.watch/img/platforms/aurory.png',
|
10
|
+
// defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
11
|
+
website: 'https://app.aurory.io',
|
12
|
+
twitter: 'https://twitter.com/AuroryProject',
|
13
|
+
};
|
14
|
+
exports.programId = new web3_js_1.PublicKey('StKLLTf7CQ9n5BgXPSDXENovLTCuNc7N2ehvTb6JZ5x');
|
15
|
+
exports.auryMint = 'AURYydfxJib1ZkTir1Jn1J9ECYUtjb6rKQVmtYaixWPP';
|
16
|
+
exports.xAuryMint = 'xAURp5XmAG7772mfkSy6vRAjGK9JofYjc3dmQDWdVDP';
|
17
|
+
exports.decimals = 9;
|
18
|
+
exports.vaultPubkey = 'FysGks3izhgVhrUkub9QQWCTEVAdhkZKYSNK2F25maGD';
|
19
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aurory/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,gBAAgB,GAAG,QAAQ,CAAC;AAC5B,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,wBAAgB;IACpB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,8CAA8C;IACrD,qEAAqE;IACrE,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,mCAAmC;CAC7C,CAAC;AAEW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,QAAQ,GAAG,8CAA8C,CAAC;AAC1D,QAAA,SAAS,GAAG,6CAA6C,CAAC;AAC1D,QAAA,QAAQ,GAAG,CAAC,CAAC;AACb,QAAA,WAAW,GAAG,8CAA8C,CAAC"}
|
@@ -0,0 +1,21 @@
|
|
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.getStakingAccountAddress = void 0;
|
13
|
+
const web3_js_1 = require("@solana/web3.js");
|
14
|
+
const constants_1 = require("./constants");
|
15
|
+
function getStakingAccountAddress(owner) {
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
17
|
+
return web3_js_1.PublicKey.findProgramAddressSync([new web3_js_1.PublicKey(owner).toBuffer()], constants_1.programId)[0];
|
18
|
+
});
|
19
|
+
}
|
20
|
+
exports.getStakingAccountAddress = getStakingAccountAddress;
|
21
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aurory/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAC5C,2CAAwC;AAExC,SAAsB,wBAAwB,CAC5C,KAAa;;QAEb,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,EACjC,qBAAS,CACV,CAAC,CAAC,CAAC,CAAC;IACP,CAAC;CAAA;AAPD,4DAOC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const stakingFetcher_1 = __importDefault(require("./stakingFetcher"));
|
9
|
+
exports.platforms = [constants_1.platform];
|
10
|
+
exports.jobs = [];
|
11
|
+
exports.fetchers = [stakingFetcher_1.default];
|
12
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aurory/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const constants_1 = require("./constants");
|
17
|
+
const clients_1 = require("../../utils/clients");
|
18
|
+
const helpers_1 = require("./helpers");
|
19
|
+
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
20
|
+
const structs_1 = require("./structs");
|
21
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const client = (0, clients_1.getClientSolana)();
|
24
|
+
const stakingAccountAddress = yield (0, helpers_1.getStakingAccountAddress)(owner);
|
25
|
+
const stakingAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, structs_1.UserStakingAccountStruct, stakingAccountAddress);
|
26
|
+
if (!stakingAccount)
|
27
|
+
return [];
|
28
|
+
const tokenPrice = yield cache.getTokenPrice(constants_1.xAuryMint, portfolio_core_1.NetworkId.solana);
|
29
|
+
const asset = (0, tokenPriceToAssetToken_1.default)(constants_1.xAuryMint, stakingAccount.amount.dividedBy(Math.pow(10, constants_1.decimals)).toNumber(), portfolio_core_1.NetworkId.solana, tokenPrice);
|
30
|
+
return [
|
31
|
+
{
|
32
|
+
type: portfolio_core_1.PortfolioElementType.multiple,
|
33
|
+
label: 'Staked',
|
34
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
35
|
+
platformId: constants_1.auroryPlatformId,
|
36
|
+
data: { assets: [asset] },
|
37
|
+
value: asset.value,
|
38
|
+
},
|
39
|
+
];
|
40
|
+
});
|
41
|
+
const fetcher = {
|
42
|
+
id: `${constants_1.auroryPlatformId}-staking`,
|
43
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
44
|
+
executor,
|
45
|
+
};
|
46
|
+
exports.default = fetcher;
|
47
|
+
//# sourceMappingURL=stakingFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aurory/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAGpC,2CAAoE;AACpE,iDAAsD;AACtD,uCAAqD;AACrD,kFAA+E;AAC/E,uCAAqD;AACrD,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,qBAAqB,GAAG,MAAM,IAAA,kCAAwB,EAAC,KAAK,CAAC,CAAC;IAEpE,MAAM,cAAc,GAAG,MAAM,IAAA,2CAAoB,EAC/C,MAAM,EACN,kCAAwB,EACxB,qBAAqB,CACtB,CAAC;IAEF,IAAI,CAAC,cAAc;QAAE,OAAO,EAAE,CAAC;IAE/B,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,qBAAS,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IAE1E,MAAM,KAAK,GAAmB,IAAA,gCAAsB,EAClD,qBAAS,EACT,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,oBAAQ,CAAA,CAAC,CAAC,QAAQ,EAAE,EAC1D,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CAAC;IACF,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,QAAQ;YACf,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAE,4BAAgB;YAC5B,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE;YACzB,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,4BAAgB,UAAU;IACjC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import BigNumber from 'bignumber.js';
|
4
|
+
type UserStakingAccount = {
|
5
|
+
buffer: Buffer;
|
6
|
+
amount: BigNumber;
|
7
|
+
xAmount: BigNumber;
|
8
|
+
};
|
9
|
+
export declare const UserStakingAccountStruct: BeetStruct<UserStakingAccount, Partial<UserStakingAccount>>;
|
10
|
+
export {};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.UserStakingAccountStruct = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const solana_1 = require("../../utils/solana");
|
6
|
+
exports.UserStakingAccountStruct = new beet_1.BeetStruct([
|
7
|
+
['buffer', (0, solana_1.blob)(8)],
|
8
|
+
['amount', solana_1.u64],
|
9
|
+
['xAmount', solana_1.u64],
|
10
|
+
], (args) => args, 'UserStakingAccount');
|
11
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aurory/structs.ts"],"names":[],"mappings":";;;AAAA,oDAAuD;AAEvD,+CAA+C;AAQlC,QAAA,wBAAwB,GAAG,IAAI,iBAAU,CACpD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,SAAS,EAAE,YAAG,CAAC;CACjB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAA0B,EACpC,oBAAoB,CACrB,CAAC"}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
2
2
|
import { Platform } from '@sonarwatch/portfolio-core';
|
3
|
+
import { LendingMarketConfig } from './types';
|
3
4
|
export declare const platformId = "kamino";
|
4
5
|
export declare const kaminoPlatform: Platform;
|
5
6
|
export declare const programId: PublicKey;
|
6
7
|
export declare const klendProgramId: PublicKey;
|
7
8
|
export declare const farmProgramId: PublicKey;
|
8
9
|
export declare const farmsKey = "farms";
|
9
|
-
export declare const
|
10
|
-
export declare const
|
11
|
-
export declare const leveragePairs: string[][];
|
10
|
+
export declare const mainMarket = "7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF";
|
11
|
+
export declare const lendingConfigs: Map<string, LendingMarketConfig>;
|
12
12
|
export declare const marketsKey = "markets";
|
13
13
|
export declare const reservesKey = "reserves";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.reservesKey = exports.marketsKey = exports.
|
3
|
+
exports.reservesKey = exports.marketsKey = exports.lendingConfigs = exports.mainMarket = exports.farmsKey = exports.farmProgramId = exports.klendProgramId = exports.programId = exports.kaminoPlatform = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'kamino';
|
6
6
|
exports.kaminoPlatform = {
|
@@ -14,51 +14,60 @@ exports.programId = new web3_js_1.PublicKey('6LtLpnUFNByNXLyCoK9wA2MykKAmQNZKBdY
|
|
14
14
|
exports.klendProgramId = new web3_js_1.PublicKey('KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD');
|
15
15
|
exports.farmProgramId = new web3_js_1.PublicKey('FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr');
|
16
16
|
exports.farmsKey = 'farms';
|
17
|
-
exports.
|
18
|
-
exports.
|
17
|
+
exports.mainMarket = '7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF';
|
18
|
+
exports.lendingConfigs = new Map([
|
19
19
|
[
|
20
|
-
'
|
21
|
-
|
20
|
+
'7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF',
|
21
|
+
{
|
22
|
+
name: 'Main Market',
|
23
|
+
multiplyPairs: [
|
24
|
+
[
|
25
|
+
'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So',
|
26
|
+
'So11111111111111111111111111111111111111112',
|
27
|
+
],
|
28
|
+
[
|
29
|
+
'J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn',
|
30
|
+
'So11111111111111111111111111111111111111112',
|
31
|
+
],
|
32
|
+
[
|
33
|
+
'bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1',
|
34
|
+
'So11111111111111111111111111111111111111112',
|
35
|
+
],
|
36
|
+
],
|
37
|
+
leveragePairs: [
|
38
|
+
[
|
39
|
+
'6DNSN2BJsaPFdFFc1zP37kkeNe4Usc1Sqkzr9C9vPWcU',
|
40
|
+
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
41
|
+
],
|
42
|
+
[
|
43
|
+
'J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn',
|
44
|
+
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
45
|
+
],
|
46
|
+
[
|
47
|
+
'bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1',
|
48
|
+
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
49
|
+
],
|
50
|
+
[
|
51
|
+
'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So',
|
52
|
+
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
53
|
+
],
|
54
|
+
[
|
55
|
+
'So11111111111111111111111111111111111111112',
|
56
|
+
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
57
|
+
],
|
58
|
+
[
|
59
|
+
'7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs',
|
60
|
+
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
61
|
+
],
|
62
|
+
[
|
63
|
+
'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
|
64
|
+
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
65
|
+
],
|
66
|
+
],
|
67
|
+
},
|
22
68
|
],
|
23
|
-
[
|
24
|
-
|
25
|
-
'So11111111111111111111111111111111111111112',
|
26
|
-
],
|
27
|
-
[
|
28
|
-
'bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1',
|
29
|
-
'So11111111111111111111111111111111111111112',
|
30
|
-
],
|
31
|
-
];
|
32
|
-
exports.leveragePairs = [
|
33
|
-
[
|
34
|
-
'6DNSN2BJsaPFdFFc1zP37kkeNe4Usc1Sqkzr9C9vPWcU',
|
35
|
-
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
36
|
-
],
|
37
|
-
[
|
38
|
-
'J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn',
|
39
|
-
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
40
|
-
],
|
41
|
-
[
|
42
|
-
'bSo13r4TkiE4KumL71LsHTPpL2euBYLFx6h9HP3piy1',
|
43
|
-
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
44
|
-
],
|
45
|
-
[
|
46
|
-
'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So',
|
47
|
-
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
48
|
-
],
|
49
|
-
[
|
50
|
-
'So11111111111111111111111111111111111111112',
|
51
|
-
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
52
|
-
],
|
53
|
-
[
|
54
|
-
'7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs',
|
55
|
-
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
56
|
-
],
|
57
|
-
[
|
58
|
-
'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
|
59
|
-
'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
|
60
|
-
],
|
61
|
-
];
|
69
|
+
['DxXdAyU3kCjnyggvHmY5nAwg5cRbbmdyX3npfDMjjMek', { name: 'JLP Market' }],
|
70
|
+
]);
|
62
71
|
exports.marketsKey = `markets`;
|
63
72
|
exports.reservesKey = `reserves`;
|
64
73
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,cAAc,GAAa;IACtC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,qCAAqC,kBAAU,MAAM;IAC5D,OAAO,EAAE,yBAAyB;IAClC,WAAW,EAAE,uBAAuB;CACrC,CAAC;AACW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,cAAc,GAAG,IAAI,mBAAS,CACzC,6CAA6C,CAC9C,CAAC;AACW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,OAAO,CAAC;AACnB,QAAA,UAAU,GAAG,8CAA8C,CAAC;AAE5D,QAAA,cAAc,GAAqC,IAAI,GAAG,CAAC;IACtE;QACE,8CAA8C;QAC9C;YACE,IAAI,EAAE,aAAa;YACnB,aAAa,EAAE;gBACb;oBACE,6CAA6C;oBAC7C,6CAA6C;iBAC9C;gBACD;oBACE,8CAA8C;oBAC9C,6CAA6C;iBAC9C;gBACD;oBACE,6CAA6C;oBAC7C,6CAA6C;iBAC9C;aACF;YACD,aAAa,EAAE;gBACb;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,6CAA6C;oBAC7C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;gBACD;oBACE,8CAA8C;oBAC9C,8CAA8C;iBAC/C;aACF;SACF;KACF;IACD,CAAC,8CAA8C,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;CACzE,CAAC,CAAC;AAEU,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,WAAW,GAAG,UAAU,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
2
|
-
export declare function getLendingPda(owner: string): PublicKey;
|
3
|
-
export declare function getMultiplyPdas(owner: string): PublicKey[];
|
2
|
+
export declare function getLendingPda(owner: string, markets: string[]): PublicKey[];
|
3
|
+
export declare function getMultiplyPdas(owner: string, markets: string[]): PublicKey[];
|
4
4
|
export declare function getLeveragePdas(owner: string): PublicKey[];
|
@@ -3,34 +3,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getLeveragePdas = exports.getMultiplyPdas = exports.getLendingPda = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
const constants_1 = require("../constants");
|
6
|
-
function getLendingPda(owner) {
|
7
|
-
return web3_js_1.PublicKey.findProgramAddressSync([
|
6
|
+
function getLendingPda(owner, markets) {
|
7
|
+
return markets.map((market) => web3_js_1.PublicKey.findProgramAddressSync([
|
8
8
|
Buffer.from([0]),
|
9
9
|
Buffer.from([0]),
|
10
10
|
new web3_js_1.PublicKey(owner).toBuffer(),
|
11
|
-
new web3_js_1.PublicKey(
|
11
|
+
new web3_js_1.PublicKey(market).toBuffer(),
|
12
12
|
web3_js_1.PublicKey.default.toBuffer(),
|
13
13
|
web3_js_1.PublicKey.default.toBuffer(),
|
14
|
-
], constants_1.klendProgramId)[0];
|
14
|
+
], constants_1.klendProgramId)[0]);
|
15
15
|
}
|
16
16
|
exports.getLendingPda = getLendingPda;
|
17
|
-
function getMultiplyPdas(owner) {
|
18
|
-
return
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
17
|
+
function getMultiplyPdas(owner, markets) {
|
18
|
+
return markets
|
19
|
+
.map((market) => {
|
20
|
+
const config = constants_1.lendingConfigs.get(market);
|
21
|
+
if (!config || !config.multiplyPairs)
|
22
|
+
return [];
|
23
|
+
return config.multiplyPairs.map((pair) => web3_js_1.PublicKey.findProgramAddressSync([
|
24
|
+
Buffer.from([1]),
|
25
|
+
Buffer.from([0]),
|
26
|
+
new web3_js_1.PublicKey(owner).toBuffer(),
|
27
|
+
new web3_js_1.PublicKey(market).toBuffer(),
|
28
|
+
new web3_js_1.PublicKey(pair[0]).toBuffer(),
|
29
|
+
new web3_js_1.PublicKey(pair[1]).toBuffer(),
|
30
|
+
], constants_1.klendProgramId)[0]);
|
31
|
+
})
|
32
|
+
.flat();
|
26
33
|
}
|
27
34
|
exports.getMultiplyPdas = getMultiplyPdas;
|
28
35
|
function getLeveragePdas(owner) {
|
29
|
-
|
36
|
+
const mainMarketConfig = constants_1.lendingConfigs.get(constants_1.mainMarket);
|
37
|
+
if (!mainMarketConfig)
|
38
|
+
return [];
|
39
|
+
const { leveragePairs } = mainMarketConfig;
|
40
|
+
if (!leveragePairs)
|
41
|
+
return [];
|
42
|
+
return leveragePairs.map((tokens) => web3_js_1.PublicKey.findProgramAddressSync([
|
30
43
|
Buffer.from([3]),
|
31
44
|
Buffer.from([0]),
|
32
45
|
new web3_js_1.PublicKey(owner).toBuffer(),
|
33
|
-
new web3_js_1.PublicKey(constants_1.
|
46
|
+
new web3_js_1.PublicKey(constants_1.mainMarket).toBuffer(),
|
34
47
|
new web3_js_1.PublicKey(tokens[0]).toBuffer(),
|
35
48
|
new web3_js_1.PublicKey(tokens[1]).toBuffer(),
|
36
49
|
], constants_1.klendProgramId)[0]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pdas.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/kamino/helpers/pdas.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,
|
1
|
+
{"version":3,"file":"pdas.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/kamino/helpers/pdas.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C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AAC,CAAC,CAAC,CAAC,QAAQ,EAAE;SAClC,EACD,0BAAc,CACf,CAAC,CAAC,CAAC,CACP,CAAC;IACJ,CAAC,CAAC;SACD,IAAI,EAAE,CAAC;AACZ,CAAC;AAtBD,0CAsBC;AAED,SAAgB,eAAe,CAAC,KAAa;IAC3C,MAAM,gBAAgB,GAAG,0BAAc,CAAC,GAAG,CAAC,sBAAU,CAAC,CAAC;IACxD,IAAI,CAAC,gBAAgB;QAAE,OAAO,EAAE,CAAC;IAEjC,MAAM,EAAE,aAAa,EAAE,GAAG,gBAAgB,CAAC;IAC3C,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAE9B,OAAO,aAAa,CAAC,GAAG,CACtB,CAAC,MAAM,EAAE,EAAE,CACT,mBAAS,CAAC,sBAAsB,CAC9B;QACE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAChB,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;QAC/B,IAAI,mBAAS,CAAC,sBAAU,CAAC,CAAC,QAAQ,EAAE;QACpC,IAAI,mBAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;QACnC,IAAI,mBAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;KACpC,EACD,0BAAc,CACf,CAAC,CAAC,CAAC,CACP,CAAC;AACJ,CAAC;AArBD,0CAqBC"}
|
@@ -8,9 +8,10 @@ const constants_1 = require("./constants");
|
|
8
8
|
const poolsJob_1 = __importDefault(require("./poolsJob"));
|
9
9
|
const farmsJob_1 = __importDefault(require("./farmsJob"));
|
10
10
|
const reservesJob_1 = __importDefault(require("./reservesJob"));
|
11
|
+
const marketsJob_1 = __importDefault(require("./marketsJob"));
|
11
12
|
const lendsFetcher_1 = __importDefault(require("./lendsFetcher"));
|
12
13
|
const farmsFetcher_1 = __importDefault(require("./farmsFetcher"));
|
13
14
|
exports.platforms = [constants_1.kaminoPlatform];
|
14
|
-
exports.jobs = [poolsJob_1.default, reservesJob_1.default, farmsJob_1.default];
|
15
|
+
exports.jobs = [poolsJob_1.default, reservesJob_1.default, farmsJob_1.default, marketsJob_1.default];
|
15
16
|
exports.fetchers = [lendsFetcher_1.default, farmsFetcher_1.default];
|
16
17
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAA6C;AAC7C,0DAAkC;AAClC,0DAAkC;AAClC,gEAAwC;AACxC,kEAA0C;AAC1C,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,0BAAc,CAAC,CAAC;AACzC,QAAA,IAAI,GAAU,CAAC,kBAAQ,EAAE,qBAAW,EAAE,kBAAQ,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAA6C;AAC7C,0DAAkC;AAClC,0DAAkC;AAClC,gEAAwC;AACxC,8DAAsC;AACtC,kEAA0C;AAC1C,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,0BAAc,CAAC,CAAC;AACzC,QAAA,IAAI,GAAU,CAAC,kBAAQ,EAAE,qBAAW,EAAE,kBAAQ,EAAE,oBAAU,CAAC,CAAC;AAC5D,QAAA,QAAQ,GAAc,CAAC,sBAAY,EAAE,sBAAY,CAAC,CAAC"}
|
@@ -17,7 +17,6 @@ const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
17
17
|
const constants_1 = require("./constants");
|
18
18
|
const clients_1 = require("../../utils/clients");
|
19
19
|
const klend_1 = require("./structs/klend");
|
20
|
-
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
21
20
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
21
|
const solana_1 = require("../../utils/solana");
|
23
22
|
const pdas_1 = require("./helpers/pdas");
|
@@ -25,10 +24,18 @@ const zeroAdressValue = '11111111111111111111111111111111';
|
|
25
24
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
26
25
|
const client = (0, clients_1.getClientSolana)();
|
27
26
|
const networkId = portfolio_core_1.NetworkId.solana;
|
28
|
-
const
|
29
|
-
|
27
|
+
const markets = yield cache.getItem(constants_1.marketsKey, {
|
28
|
+
prefix: constants_1.platformId,
|
29
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
30
|
+
});
|
31
|
+
const lendingAccounts = markets
|
32
|
+
? yield (0, solana_1.getParsedMultipleAccountsInfo)(client, klend_1.obligationStruct, (0, pdas_1.getLendingPda)(owner, markets))
|
33
|
+
: undefined;
|
34
|
+
const multiplyAccounts = markets
|
35
|
+
? yield (0, solana_1.getParsedMultipleAccountsInfo)(client, klend_1.obligationStruct, (0, pdas_1.getMultiplyPdas)(owner, markets))
|
36
|
+
: undefined;
|
30
37
|
const leverageAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, klend_1.obligationStruct, (0, pdas_1.getLeveragePdas)(owner));
|
31
|
-
if (!
|
38
|
+
if (!lendingAccounts && !multiplyAccounts && !leverageAccounts)
|
32
39
|
return [];
|
33
40
|
const reserves = yield cache.getItem(constants_1.reservesKey, {
|
34
41
|
prefix: constants_1.platformId,
|
@@ -44,152 +51,163 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
44
51
|
// *************
|
45
52
|
// KLend : https://app.kamino.finance/lending
|
46
53
|
// *************
|
47
|
-
if (
|
48
|
-
const
|
49
|
-
|
50
|
-
const suppliedAssets = [];
|
51
|
-
const suppliedYields = [];
|
52
|
-
const rewardAssets = [];
|
53
|
-
const suppliedLtvs = [];
|
54
|
-
const borrowedWeights = [];
|
55
|
-
for (const deposit of lendingAccount.deposits) {
|
56
|
-
if (deposit.depositReserve.toString() === zeroAdressValue ||
|
57
|
-
deposit.depositedAmount.isLessThanOrEqualTo(0))
|
58
|
-
continue;
|
59
|
-
const amountRaw = deposit.depositedAmount;
|
60
|
-
const reserve = reserves[deposit.depositReserve.toString()];
|
61
|
-
if (!reserve)
|
62
|
-
continue;
|
63
|
-
const mint = reserve.liquidity.mintPubkey;
|
64
|
-
const tokenPrice = tokenPriceById.get(mint);
|
65
|
-
const amount = amountRaw
|
66
|
-
.dividedBy(new bignumber_js_1.default(10).pow(reserve.liquidity.mintDecimals))
|
67
|
-
.dividedBy(reserve.exchangeRate)
|
68
|
-
.toNumber();
|
69
|
-
suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(mint, amount, networkId, tokenPrice));
|
70
|
-
suppliedLtvs.push(reserve.config.liquidationThresholdPct / 100);
|
71
|
-
suppliedYields.push([
|
72
|
-
{ apr: reserve.supplyApr, apy: (0, portfolio_core_1.aprToApy)(reserve.supplyApr) },
|
73
|
-
]);
|
74
|
-
}
|
75
|
-
for (const borrow of lendingAccount.borrows) {
|
76
|
-
if (borrow.borrowReserve.toString() === zeroAdressValue ||
|
77
|
-
borrow.borrowedAmountSf.isLessThanOrEqualTo(0))
|
78
|
-
continue;
|
79
|
-
const amountRaw = borrow.borrowedAmountSf.dividedBy(borrow.cumulativeBorrowRateBsf.value0);
|
80
|
-
const reserve = reserves[borrow.borrowReserve.toString()];
|
81
|
-
if (!reserve)
|
54
|
+
if (lendingAccounts) {
|
55
|
+
for (const lendingAccount of lendingAccounts) {
|
56
|
+
if (!lendingAccount)
|
82
57
|
continue;
|
83
|
-
const
|
84
|
-
const
|
85
|
-
const
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
58
|
+
const lendingConfig = constants_1.lendingConfigs.get(lendingAccount.lendingMarket.toString());
|
59
|
+
const borrowedAssets = [];
|
60
|
+
const borrowedYields = [];
|
61
|
+
const suppliedAssets = [];
|
62
|
+
const suppliedYields = [];
|
63
|
+
const rewardAssets = [];
|
64
|
+
const suppliedLtvs = [];
|
65
|
+
const borrowedWeights = [];
|
66
|
+
for (const deposit of lendingAccount.deposits) {
|
67
|
+
if (deposit.depositReserve.toString() === zeroAdressValue ||
|
68
|
+
deposit.depositedAmount.isLessThanOrEqualTo(0))
|
69
|
+
continue;
|
70
|
+
const amountRaw = deposit.depositedAmount;
|
71
|
+
const reserve = reserves[deposit.depositReserve.toString()];
|
72
|
+
if (!reserve)
|
73
|
+
continue;
|
74
|
+
const mint = reserve.liquidity.mintPubkey;
|
75
|
+
const tokenPrice = tokenPriceById.get(mint);
|
76
|
+
const amount = amountRaw
|
77
|
+
.dividedBy(new bignumber_js_1.default(10).pow(reserve.liquidity.mintDecimals))
|
78
|
+
.dividedBy(reserve.exchangeRate)
|
79
|
+
.toNumber();
|
80
|
+
suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(mint, amount, networkId, tokenPrice));
|
81
|
+
suppliedLtvs.push(reserve.config.liquidationThresholdPct / 100);
|
82
|
+
suppliedYields.push([
|
83
|
+
{ apr: reserve.supplyApr, apy: (0, portfolio_core_1.aprToApy)(reserve.supplyApr) },
|
84
|
+
]);
|
85
|
+
}
|
86
|
+
for (const borrow of lendingAccount.borrows) {
|
87
|
+
if (borrow.borrowReserve.toString() === zeroAdressValue ||
|
88
|
+
borrow.borrowedAmountSf.isLessThanOrEqualTo(0))
|
89
|
+
continue;
|
90
|
+
const amountRaw = borrow.borrowedAmountSf.dividedBy(borrow.cumulativeBorrowRateBsf.value0);
|
91
|
+
const reserve = reserves[borrow.borrowReserve.toString()];
|
92
|
+
if (!reserve)
|
93
|
+
continue;
|
94
|
+
const mint = reserve.liquidity.mintPubkey;
|
95
|
+
const tokenPrice = tokenPriceById.get(mint);
|
96
|
+
const amount = amountRaw
|
97
|
+
.dividedBy(new bignumber_js_1.default(10).pow(reserve.liquidity.mintDecimals))
|
98
|
+
.toNumber();
|
99
|
+
borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(mint, amount, networkId, tokenPrice));
|
100
|
+
borrowedWeights.push(Number(reserve.config.borrowFactorPct) / 100);
|
101
|
+
borrowedYields.push([
|
102
|
+
{ apr: -reserve.borrowApr, apy: -(0, portfolio_core_1.aprToApy)(reserve.borrowApr) },
|
103
|
+
]);
|
104
|
+
}
|
105
|
+
if (suppliedAssets.length !== 0 || borrowedAssets.length !== 0) {
|
106
|
+
const { borrowedValue, suppliedValue, value, healthRatio } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs, borrowedWeights);
|
107
|
+
elements.push({
|
108
|
+
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
109
|
+
networkId,
|
110
|
+
platformId: constants_1.platformId,
|
111
|
+
label: 'Lending',
|
112
|
+
name: lendingConfig === null || lendingConfig === void 0 ? void 0 : lendingConfig.name,
|
112
113
|
value,
|
113
|
-
|
114
|
-
|
114
|
+
data: {
|
115
|
+
borrowedAssets,
|
116
|
+
borrowedValue,
|
117
|
+
borrowedYields,
|
118
|
+
suppliedAssets,
|
119
|
+
suppliedValue,
|
120
|
+
suppliedYields,
|
121
|
+
collateralRatio: null,
|
122
|
+
healthRatio,
|
123
|
+
rewardAssets,
|
124
|
+
value,
|
125
|
+
},
|
126
|
+
});
|
127
|
+
}
|
115
128
|
}
|
116
129
|
}
|
117
130
|
// ******
|
118
131
|
// Multiply : https://app.kamino.finance/lending/multiply
|
119
132
|
// ******
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
const borrowedAssets = [];
|
124
|
-
const borrowedYields = [];
|
125
|
-
const suppliedAssets = [];
|
126
|
-
const suppliedYields = [];
|
127
|
-
const rewardAssets = [];
|
128
|
-
const suppliedLtvs = [];
|
129
|
-
const borrowedWeights = [];
|
130
|
-
for (const deposit of multiplyAccount.deposits) {
|
131
|
-
if (deposit.depositReserve.toString() === zeroAdressValue ||
|
132
|
-
deposit.depositedAmount.isLessThanOrEqualTo(0))
|
133
|
-
continue;
|
134
|
-
const amountRaw = deposit.depositedAmount;
|
135
|
-
const reserve = reserves[deposit.depositReserve.toString()];
|
136
|
-
if (!reserve)
|
137
|
-
continue;
|
138
|
-
const mint = reserve.liquidity.mintPubkey;
|
139
|
-
const tokenPrice = tokenPriceById.get(mint);
|
140
|
-
const amount = amountRaw
|
141
|
-
.dividedBy(new bignumber_js_1.default(10).pow(reserve.liquidity.mintDecimals))
|
142
|
-
.dividedBy(reserve.exchangeRate)
|
143
|
-
.toNumber();
|
144
|
-
suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(mint, amount, networkId, tokenPrice));
|
145
|
-
suppliedLtvs.push(reserve.config.liquidationThresholdPct / 100);
|
146
|
-
suppliedYields.push([
|
147
|
-
{ apr: reserve.supplyApr, apy: (0, portfolio_core_1.aprToApy)(reserve.supplyApr) },
|
148
|
-
]);
|
149
|
-
}
|
150
|
-
for (const borrow of multiplyAccount.borrows) {
|
151
|
-
if (borrow.borrowReserve.toString() === zeroAdressValue ||
|
152
|
-
borrow.borrowedAmountSf.isLessThanOrEqualTo(0))
|
153
|
-
continue;
|
154
|
-
const amountRaw = borrow.borrowedAmountSf.dividedBy(borrow.cumulativeBorrowRateBsf.value0);
|
155
|
-
const reserve = reserves[borrow.borrowReserve.toString()];
|
156
|
-
if (!reserve)
|
133
|
+
if (multiplyAccounts)
|
134
|
+
for (const multiplyAccount of multiplyAccounts) {
|
135
|
+
if (!multiplyAccount)
|
157
136
|
continue;
|
158
|
-
const
|
159
|
-
const
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
]
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
137
|
+
const lendingConfig = constants_1.lendingConfigs.get(multiplyAccount.lendingMarket.toString());
|
138
|
+
const name = lendingConfig
|
139
|
+
? `Multiply ${lendingConfig.name}`
|
140
|
+
: 'Multiply';
|
141
|
+
const borrowedAssets = [];
|
142
|
+
const borrowedYields = [];
|
143
|
+
const suppliedAssets = [];
|
144
|
+
const suppliedYields = [];
|
145
|
+
const rewardAssets = [];
|
146
|
+
const suppliedLtvs = [];
|
147
|
+
const borrowedWeights = [];
|
148
|
+
for (const deposit of multiplyAccount.deposits) {
|
149
|
+
if (deposit.depositReserve.toString() === zeroAdressValue ||
|
150
|
+
deposit.depositedAmount.isLessThanOrEqualTo(0))
|
151
|
+
continue;
|
152
|
+
const amountRaw = deposit.depositedAmount;
|
153
|
+
const reserve = reserves[deposit.depositReserve.toString()];
|
154
|
+
if (!reserve)
|
155
|
+
continue;
|
156
|
+
const mint = reserve.liquidity.mintPubkey;
|
157
|
+
const tokenPrice = tokenPriceById.get(mint);
|
158
|
+
const amount = amountRaw
|
159
|
+
.dividedBy(new bignumber_js_1.default(10).pow(reserve.liquidity.mintDecimals))
|
160
|
+
.dividedBy(reserve.exchangeRate)
|
161
|
+
.toNumber();
|
162
|
+
suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(mint, amount, networkId, tokenPrice));
|
163
|
+
suppliedLtvs.push(reserve.config.liquidationThresholdPct / 100);
|
164
|
+
suppliedYields.push([
|
165
|
+
{ apr: reserve.supplyApr, apy: (0, portfolio_core_1.aprToApy)(reserve.supplyApr) },
|
166
|
+
]);
|
167
|
+
}
|
168
|
+
for (const borrow of multiplyAccount.borrows) {
|
169
|
+
if (borrow.borrowReserve.toString() === zeroAdressValue ||
|
170
|
+
borrow.borrowedAmountSf.isLessThanOrEqualTo(0))
|
171
|
+
continue;
|
172
|
+
const amountRaw = borrow.borrowedAmountSf.dividedBy(borrow.cumulativeBorrowRateBsf.value0);
|
173
|
+
const reserve = reserves[borrow.borrowReserve.toString()];
|
174
|
+
if (!reserve)
|
175
|
+
continue;
|
176
|
+
const mint = reserve.liquidity.mintPubkey;
|
177
|
+
const tokenPrice = tokenPriceById.get(mint);
|
178
|
+
const amount = amountRaw
|
179
|
+
.dividedBy(new bignumber_js_1.default(10).pow(reserve.liquidity.mintDecimals))
|
180
|
+
.toNumber();
|
181
|
+
borrowedAssets.push((0, tokenPriceToAssetToken_1.default)(mint, amount, networkId, tokenPrice));
|
182
|
+
borrowedWeights.push(Number(reserve.config.borrowFactorPct) / 100);
|
183
|
+
borrowedYields.push([
|
184
|
+
{ apr: -reserve.borrowApr, apy: -(0, portfolio_core_1.aprToApy)(reserve.borrowApr) },
|
185
|
+
]);
|
186
|
+
}
|
187
|
+
if (suppliedAssets.length !== 0 || borrowedAssets.length !== 0) {
|
188
|
+
const { borrowedValue, suppliedValue, value } = (0, portfolio_core_1.getElementLendingValues)(suppliedAssets, borrowedAssets, rewardAssets, suppliedLtvs, borrowedWeights);
|
189
|
+
elements.push({
|
190
|
+
type: portfolio_core_1.PortfolioElementType.borrowlend,
|
191
|
+
networkId,
|
192
|
+
platformId: constants_1.platformId,
|
193
|
+
label: 'Lending',
|
194
|
+
name,
|
188
195
|
value,
|
189
|
-
|
190
|
-
|
196
|
+
data: {
|
197
|
+
borrowedAssets,
|
198
|
+
borrowedValue,
|
199
|
+
borrowedYields,
|
200
|
+
suppliedAssets,
|
201
|
+
suppliedValue,
|
202
|
+
suppliedYields,
|
203
|
+
healthRatio: null,
|
204
|
+
collateralRatio: null,
|
205
|
+
rewardAssets,
|
206
|
+
value,
|
207
|
+
},
|
208
|
+
});
|
209
|
+
}
|
191
210
|
}
|
192
|
-
}
|
193
211
|
// ******
|
194
212
|
// Leverage : https://app.kamino.finance/lending/leverage
|
195
213
|
// ******
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lendsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/lendsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AACrC,2CAAsD;AAGtD,iDAAsD;AACtD,2CAAmD;AACnD,kFAA+E;AAC/E,qGAA6E;AAE7E,+CAAmE;AACnE,yCAIwB;AAExB,MAAM,eAAe,GAAG,kCAAkC,CAAC;AAE3D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,SAAS,GAAG,0BAAS,CAAC,MAAM,CAAC;IAEnC,MAAM,cAAc,GAAG,MAAM,IAAA,2CAAoB,EAC/C,MAAM,EACN,wBAAgB,EAChB,IAAA,oBAAa,EAAC,KAAK,CAAC,CACrB,CAAC;IAEF,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAA6B,EAC1D,MAAM,EACN,wBAAgB,EAChB,IAAA,sBAAe,EAAC,KAAK,CAAC,CACvB,CAAC;IAEF,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAA6B,EAC1D,MAAM,EACN,wBAAgB,EAChB,IAAA,sBAAe,EAAC,KAAK,CAAC,CACvB,CAAC;IAEF,IAAI,CAAC,cAAc,IAAI,CAAC,gBAAgB,IAAI,CAAC,gBAAgB;QAAE,OAAO,EAAE,CAAC;IAEzE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAClC,uBAAW,EACX;QACE,MAAM,EAAE,sBAAU;QAClB,SAAS;KACV,CACF,CAAC;IACF,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAEzB,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK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Ac;oBACd,cAAc;oBACd,aAAa;oBACb,cAAc;oBACd,eAAe,EAAE,IAAI;oBAErB,WAAW,EAAE,IAAI;oBACjB,YAAY;oBACZ,KAAK;iBACN;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,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"}
|
1
|
+
{"version":3,"file":"lendsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/lendsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AACrC,2CAKqB;AAGrB,iDAAsD;AACtD,2CAAmD;AACnD,qGAA6E;AAE7E,+CAAmE;AACnE,yCAIwB;AAExB,MAAM,eAAe,GAAG,kCAAkC,CAAC;AAE3D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,SAAS,GAAG,0BAAS,CAAC,MAAM,CAAC;IAEnC,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,CAAW,sBAAU,EAAE;QACxD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,OAAO;QAC7B,CAAC,CAAC,MAAM,IAAA,sCAA6B,EACjC,MAAM,EACN,wBAAgB,EAChB,IAAA,oBAAa,EAAC,KAAK,EAAE,OAAO,CAAC,CAC9B;QACH,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,gBAAgB,GAAG,OAAO;QAC9B,CAAC,CAAC,MAAM,IAAA,sCAA6B,EACjC,MAAM,EACN,wBAAgB,EAChB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CAAC;IACH,CAAC;IACD,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"}
|
@@ -0,0 +1,29 @@
|
|
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
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const clients_1 = require("../../utils/clients");
|
14
|
+
const solana_1 = require("../../utils/solana");
|
15
|
+
const filters_1 = require("../../utils/solana/filters");
|
16
|
+
const constants_1 = require("./constants");
|
17
|
+
const klend_1 = require("./structs/klend");
|
18
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
const client = (0, clients_1.getClientSolana)();
|
20
|
+
const lendingMarketAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, klend_1.lendingMarketStruct, constants_1.klendProgramId, (0, filters_1.dataSizeFilter)(klend_1.lendingMarketStruct.byteSize));
|
21
|
+
yield cache.setItem(constants_1.marketsKey, lendingMarketAccounts.map((acc) => acc.pubkey.toString()), { prefix: constants_1.platformId, networkId: portfolio_core_1.NetworkId.solana });
|
22
|
+
});
|
23
|
+
const job = {
|
24
|
+
id: `${constants_1.platformId}-markets`,
|
25
|
+
executor,
|
26
|
+
label: 'normal',
|
27
|
+
};
|
28
|
+
exports.default = job;
|
29
|
+
//# sourceMappingURL=marketsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/kamino/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAsD;AACtD,+CAA8D;AAC9D,wDAA4D;AAC5D,2CAAqE;AACrE,2CAAsD;AAEtD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,qBAAqB,GAAG,MAAM,IAAA,iCAAwB,EAC1D,MAAM,EACN,2BAAmB,EACnB,0BAAc,EACd,IAAA,wBAAc,EAAC,2BAAmB,CAAC,QAAQ,CAAC,CAC7C,CAAC;IAEF,MAAM,KAAK,CAAC,OAAO,CACjB,sBAAU,EACV,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EACzD,EAAE,MAAM,EAAE,sBAAU,EAAE,SAAS,EAAE,0BAAS,CAAC,MAAM,EAAE,CACpD,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
export declare const whalesMarketPlatformId = "whalesmarket";
|
3
|
+
export declare const whalesMarketPlatform: Platform;
|
4
|
+
export declare const stepFinancePlatformId = "stepfinance";
|
5
|
+
export declare const stepFinancePlatform: Platform;
|
6
|
+
export declare const allbridgePlatformId = "allbridge";
|
7
|
+
export declare const allbridgePlatform: Platform;
|
8
|
+
export declare const xStakingConfigs: StakingConfig[];
|
9
|
+
export type StakingConfig = {
|
10
|
+
mint: string;
|
11
|
+
decimals: number;
|
12
|
+
vault: string;
|
13
|
+
xMint: string;
|
14
|
+
xDecimals: number;
|
15
|
+
platformId: string;
|
16
|
+
};
|
@@ -0,0 +1,64 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.xStakingConfigs = exports.allbridgePlatform = exports.allbridgePlatformId = exports.stepFinancePlatform = exports.stepFinancePlatformId = exports.whalesMarketPlatform = exports.whalesMarketPlatformId = void 0;
|
4
|
+
const constants_1 = require("../aurory/constants");
|
5
|
+
exports.whalesMarketPlatformId = 'whalesmarket';
|
6
|
+
exports.whalesMarketPlatform = {
|
7
|
+
id: exports.whalesMarketPlatformId,
|
8
|
+
name: 'Whales Market',
|
9
|
+
image: 'https://sonar.watch/img/platforms/whalesmarket.png',
|
10
|
+
// defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
11
|
+
website: 'https://app.whales.market/',
|
12
|
+
twitter: 'https://twitter.com/WhalesMarket',
|
13
|
+
};
|
14
|
+
exports.stepFinancePlatformId = 'stepfinance';
|
15
|
+
exports.stepFinancePlatform = {
|
16
|
+
id: exports.stepFinancePlatformId,
|
17
|
+
name: 'Step Finance',
|
18
|
+
image: 'https://sonar.watch/img/platforms/stepfinance.png',
|
19
|
+
website: 'https://app.step.finance/',
|
20
|
+
twitter: 'https://twitter.com/StepFinance_',
|
21
|
+
};
|
22
|
+
exports.allbridgePlatformId = 'allbridge';
|
23
|
+
exports.allbridgePlatform = {
|
24
|
+
id: exports.allbridgePlatformId,
|
25
|
+
name: 'Step Finance',
|
26
|
+
image: 'https://sonar.watch/img/platforms/allbridge.png',
|
27
|
+
website: 'https://stake.allbridge.io/?chain=SOL',
|
28
|
+
twitter: 'https://twitter.com/Allbridge_io',
|
29
|
+
};
|
30
|
+
exports.xStakingConfigs = [
|
31
|
+
{
|
32
|
+
mint: constants_1.auryMint,
|
33
|
+
decimals: constants_1.decimals,
|
34
|
+
vault: constants_1.vaultPubkey,
|
35
|
+
xMint: constants_1.xAuryMint,
|
36
|
+
xDecimals: 9,
|
37
|
+
platformId: constants_1.auroryPlatformId,
|
38
|
+
},
|
39
|
+
{
|
40
|
+
mint: 'GTH3wG3NErjwcf7VGCoXEXkgXSHvYhx5gtATeeM5JAS1',
|
41
|
+
decimals: 6,
|
42
|
+
vault: 'Cm1KT2iqQ3LoxbmLy4WrQ9wE7WByJx6R512A28LbjGh9',
|
43
|
+
xMint: '3wCoTb3TArUdzmeTBPzPFyPBUP6EJXaW5LAzGsWCpySu',
|
44
|
+
xDecimals: 6,
|
45
|
+
platformId: exports.whalesMarketPlatformId,
|
46
|
+
},
|
47
|
+
{
|
48
|
+
mint: 'StepAscQoEioFxxWGnh2sLBDFp9d8rvKz2Yp39iDpyT',
|
49
|
+
decimals: 9,
|
50
|
+
vault: 'ANYxxG365hutGYaTdtUQG8u2hC4dFX9mFHKuzy9ABQJi',
|
51
|
+
xMint: 'xStpgUCss9piqeFUk2iLVcvJEGhAdJxJQuwLkXP555G',
|
52
|
+
xDecimals: 9,
|
53
|
+
platformId: exports.stepFinancePlatformId,
|
54
|
+
},
|
55
|
+
{
|
56
|
+
mint: 'a11bdAAuV8iB2fu7X6AxAvDTo1QZ8FXB3kk5eecdasp',
|
57
|
+
decimals: 9,
|
58
|
+
vault: '51dd7AuT32b5VCK2rBVrjLGvfuvZ3kMayNrZZbWuvas2',
|
59
|
+
xMint: 'xAx6d1sjmBvpWkVZQEqgUvPmGBNndEXPxYpr3QVp61H',
|
60
|
+
xDecimals: 9,
|
61
|
+
platformId: exports.allbridgePlatformId,
|
62
|
+
},
|
63
|
+
];
|
64
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","s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KAClC;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,8CAA8C;QACrD,KAAK,EAAE,6CAA6C;QACpD,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,2BAAmB;KAChC;CACF,CAAC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const stakingJob_1 = __importDefault(require("./stakingJob"));
|
9
|
+
exports.platforms = [
|
10
|
+
constants_1.whalesMarketPlatform,
|
11
|
+
constants_1.stepFinancePlatform,
|
12
|
+
];
|
13
|
+
exports.jobs = [stakingJob_1.default];
|
14
|
+
exports.fetchers = [];
|
15
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/x-staking-solana/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAwE;AACxE,8DAAuC;AAE1B,QAAA,SAAS,GAAe;IACnC,gCAAoB;IACpB,+BAAmB;CACpB,CAAC;AACW,QAAA,IAAI,GAAU,CAAC,oBAAW,CAAC,CAAC;AAC5B,QAAA,QAAQ,GAAc,EAAE,CAAC"}
|
@@ -0,0 +1,49 @@
|
|
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
|
+
const web3_js_1 = require("@solana/web3.js");
|
13
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
14
|
+
const clients_1 = require("../../utils/clients");
|
15
|
+
const solana_1 = require("../../utils/solana");
|
16
|
+
const constants_1 = require("./constants");
|
17
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
18
|
+
const client = (0, clients_1.getClientSolana)();
|
19
|
+
const vaultsAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.tokenAccountStruct, constants_1.xStakingConfigs.map((conf) => new web3_js_1.PublicKey(conf.vault)));
|
20
|
+
const tokensInfos = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, solana_1.mintAccountStruct, constants_1.xStakingConfigs.map((conf) => new web3_js_1.PublicKey(conf.xMint)));
|
21
|
+
const tokensPricesMap = yield cache.getTokenPricesAsMap(constants_1.xStakingConfigs.map((conf) => conf.mint), portfolio_core_1.NetworkId.solana);
|
22
|
+
for (let i = 0; i < constants_1.xStakingConfigs.length; i++) {
|
23
|
+
const config = constants_1.xStakingConfigs[i];
|
24
|
+
const tokenPrice = tokensPricesMap.get(config.mint);
|
25
|
+
const [tokenInfo, vaultAccount] = [tokensInfos[i], vaultsAccounts[i]];
|
26
|
+
if (!tokenInfo || !vaultAccount || !tokenPrice)
|
27
|
+
continue;
|
28
|
+
const xSupply = tokenInfo.supply.dividedBy(Math.pow(10, tokenInfo.decimals));
|
29
|
+
const vaultTokenAmount = vaultAccount.amount.dividedBy(Math.pow(10, config.decimals));
|
30
|
+
const xPrice = vaultTokenAmount.dividedBy(xSupply).times(tokenPrice.price);
|
31
|
+
yield cache.setTokenPriceSource({
|
32
|
+
address: config.xMint,
|
33
|
+
decimals: config.xDecimals,
|
34
|
+
id: config.vault,
|
35
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
36
|
+
platformId: config.platformId,
|
37
|
+
price: xPrice.toNumber(),
|
38
|
+
timestamp: Date.now(),
|
39
|
+
weight: 1,
|
40
|
+
});
|
41
|
+
}
|
42
|
+
});
|
43
|
+
const job = {
|
44
|
+
id: `x-staking-solana`,
|
45
|
+
executor,
|
46
|
+
label: 'normal',
|
47
|
+
};
|
48
|
+
exports.default = job;
|
49
|
+
//# sourceMappingURL=stakingJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"stakingJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/x-staking-solana/stakingJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6CAA4C;AAC5C,+DAAuD;AAGvD,iDAAsD;AACtD,+CAI4B;AAC5B,2CAA8C;AAE9C,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,cAAc,GAAG,MAAM,IAAA,sCAA6B,EACxD,MAAM,EACN,2BAAkB,EAClB,2BAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,mBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CACzD,CAAC;IAEF,MAAM,WAAW,GAAG,MAAM,IAAA,sCAA6B,EACrD,MAAM,EACN,0BAAiB,EACjB,2BAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,mBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CACzD,CAAC;IAEF,MAAM,eAAe,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACrD,2BAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EACxC,0BAAS,CAAC,MAAM,CACjB,CAAC;I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