@sonarwatch/portfolio-plugins 0.14.151 → 0.14.153
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 +8 -0
- package/package.json +1 -1
- package/src/plugins/allbridge/constants.d.ts +0 -6
- package/src/plugins/allbridge/constants.js +1 -9
- package/src/plugins/allbridge/constants.js.map +1 -1
- package/src/plugins/allbridge/helpers.d.ts +1 -1
- package/src/plugins/allbridge/helpers.js +1 -3
- package/src/plugins/allbridge/helpers.js.map +1 -1
- package/src/plugins/allbridge/positionsFetcher.js +2 -1
- package/src/plugins/allbridge/positionsFetcher.js.map +1 -1
- package/src/plugins/allbridge/structs.d.ts +13 -0
- package/src/plugins/allbridge/structs.js +14 -0
- package/src/plugins/allbridge/structs.js.map +1 -0
- package/src/plugins/allbridge/types.d.ts +0 -6
- package/src/plugins/bonfida/constants.js +1 -1
- package/src/plugins/bonfida/constants.js.map +1 -1
- package/src/plugins/divvy/constants.d.ts +0 -2
- package/src/plugins/divvy/constants.js +1 -7
- package/src/plugins/divvy/constants.js.map +1 -1
- package/src/plugins/divvy/houseJob.js +6 -3
- package/src/plugins/divvy/houseJob.js.map +1 -1
- package/src/plugins/divvy/housePoolFetcher.js +9 -11
- package/src/plugins/divvy/housePoolFetcher.js.map +1 -1
- package/src/plugins/divvy/stakingFetcher.js +7 -12
- package/src/plugins/divvy/stakingFetcher.js.map +1 -1
- package/src/plugins/divvy/structs.d.ts +57 -0
- package/src/plugins/divvy/structs.js +57 -0
- package/src/plugins/divvy/structs.js.map +1 -0
- package/src/plugins/drift/spotMarketsJob.js +0 -1
- package/src/plugins/drift/spotMarketsJob.js.map +1 -1
- package/src/plugins/elemental/constants.d.ts +4 -2
- package/src/plugins/elemental/constants.js +3 -7
- package/src/plugins/elemental/constants.js.map +1 -1
- package/src/plugins/elemental/filters.d.ts +0 -1
- package/src/plugins/elemental/filters.js +1 -6
- package/src/plugins/elemental/filters.js.map +1 -1
- package/src/plugins/elemental/helpers.js +2 -2
- package/src/plugins/elemental/helpers.js.map +1 -1
- package/src/plugins/elemental/poolsJob.js +4 -4
- package/src/plugins/elemental/poolsJob.js.map +1 -1
- package/src/plugins/ensofi/constants.d.ts +4 -2
- package/src/plugins/ensofi/constants.js +3 -7
- package/src/plugins/ensofi/constants.js.map +1 -1
- package/src/plugins/ensofi/idl.d.ts +149 -6
- package/src/plugins/ensofi/idl.js +1074 -61
- package/src/plugins/ensofi/idl.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/solanaLoansFetcher.js +23 -37
- package/src/plugins/ensofi/solanaLoansFetcher.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.d.ts +58 -0
- package/src/plugins/ensofi/structs.js +60 -0
- package/src/plugins/ensofi/structs.js.map +1 -0
- package/src/plugins/jupiter/governance/constants.js +3 -3
- package/src/plugins/jupiter/governance/constants.js.map +1 -1
- package/src/plugins/jupiter/launchpad/constants.d.ts +1 -0
- package/src/plugins/jupiter/launchpad/constants.js +8 -7
- package/src/plugins/jupiter/launchpad/constants.js.map +1 -1
- package/src/plugins/jupiter/pricingJob.js +2 -1
- package/src/plugins/jupiter/pricingJob.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.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/orca/getWhirlpoolPositions.js +7 -7
- package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
- package/src/plugins/orca/types.d.ts +2 -0
- package/src/plugins/picasso/constants.d.ts +0 -2
- package/src/plugins/picasso/constants.js +1 -7
- package/src/plugins/picasso/constants.js.map +1 -1
- package/src/plugins/picasso/helpers.js +7 -4
- package/src/plugins/picasso/helpers.js.map +1 -1
- package/src/plugins/picasso/structs.d.ts +39 -0
- package/src/plugins/picasso/structs.js +37 -0
- package/src/plugins/picasso/structs.js.map +1 -0
- package/src/plugins/picasso/unstakingNftsJob.js +2 -1
- package/src/plugins/picasso/unstakingNftsJob.js.map +1 -1
- package/src/plugins/picasso/unstakingPositionsFetcher.js +4 -4
- package/src/plugins/picasso/unstakingPositionsFetcher.js.map +1 -1
- package/src/plugins/raydium/ammV2ApiJob.js +24 -0
- package/src/plugins/raydium/ammV2ApiJob.js.map +1 -1
- package/src/plugins/raydium/constants.d.ts +1 -0
- package/src/plugins/raydium/constants.js +2 -1
- package/src/plugins/raydium/constants.js.map +1 -1
- package/src/plugins/raydium/getRaydiumCLMMPositions.js +9 -5
- package/src/plugins/raydium/getRaydiumCLMMPositions.js.map +1 -1
- package/src/plugins/raydium/types.d.ts +14 -4
- package/src/plugins/sanctum/s1AirdropFetcher.js +2 -2
- package/src/plugins/sanctum/s1AirdropFetcher.js.map +1 -1
- package/src/plugins/sharky/collectionsJob.js +8 -9
- package/src/plugins/sharky/collectionsJob.js.map +1 -1
- package/src/plugins/sharky/constants.d.ts +0 -2
- package/src/plugins/sharky/constants.js +1 -7
- package/src/plugins/sharky/constants.js.map +1 -1
- package/src/plugins/sharky/loansFetcher.js +25 -19
- package/src/plugins/sharky/loansFetcher.js.map +1 -1
- package/src/plugins/sharky/structs.d.ts +96 -0
- package/src/plugins/sharky/structs.js +103 -0
- package/src/plugins/sharky/structs.js.map +1 -0
- package/src/plugins/sharky/types.d.ts +0 -15
- package/src/plugins/sharky/types.js +0 -8
- package/src/plugins/sharky/types.js.map +1 -1
- package/src/plugins/stabble/constants.d.ts +0 -3
- package/src/plugins/stabble/constants.js +1 -13
- package/src/plugins/stabble/constants.js.map +1 -1
- package/src/plugins/stabble/poolsJob.js +14 -9
- package/src/plugins/stabble/poolsJob.js.map +1 -1
- package/src/plugins/stabble/structs.d.ts +43 -0
- package/src/plugins/stabble/structs.js +42 -0
- package/src/plugins/stabble/structs.js.map +1 -0
- package/src/plugins/suilend/helpers.js +2 -0
- package/src/plugins/suilend/helpers.js.map +1 -1
- 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/solana/beets/ParsedGpa.d.ts +1 -0
- package/src/utils/solana/beets/ParsedGpa.js +9 -0
- package/src/utils/solana/beets/ParsedGpa.js.map +1 -1
- package/src/plugins/divvy/types.d.ts +0 -28
- package/src/plugins/divvy/types.js.map +0 -1
- 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/picasso/types.d.ts +0 -17
- package/src/plugins/picasso/types.js +0 -3
- package/src/plugins/picasso/types.js.map +0 -1
- package/src/plugins/sharky/filters.d.ts +0 -8
- package/src/plugins/sharky/filters.js +0 -43
- package/src/plugins/sharky/filters.js.map +0 -1
- package/src/plugins/stabble/filters.d.ts +0 -5
- package/src/plugins/stabble/filters.js +0 -20
- package/src/plugins/stabble/filters.js.map +0 -1
- package/src/plugins/stabble/types.d.ts +0 -40
- package/src/plugins/stabble/types.js +0 -3
- package/src/plugins/stabble/types.js.map +0 -1
- /package/src/plugins/loopscale/{positionsFetcher.d.ts → lendFetcher.d.ts} +0 -0
- /package/src/plugins/{divvy → loopscale}/types.js +0 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.14.153](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.152...plugins-0.14.153) (2025-03-25)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.14.152](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.151...plugins-0.14.152) (2025-03-24)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.14.151](https://github.com/sonarwatch/portfolio/compare/plugins-0.14.150...plugins-0.14.151) (2025-03-20)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
@@ -1,13 +1,7 @@
|
|
1
|
-
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
2
|
-
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
3
1
|
import { Platform } from '@sonarwatch/portfolio-core';
|
4
|
-
import { PublicKey } from '@solana/web3.js';
|
5
|
-
import { IdlItem } from '@solanafm/explorer-kit-idls';
|
6
2
|
export declare const platformId = "allbridge";
|
7
3
|
export declare const platform: Platform;
|
8
4
|
export declare const apiPoolInfoUrl = "https://core.api.allbridgecoreapi.net/token-info";
|
9
5
|
export declare const poolsCacheKey = "allbridge-pools";
|
10
6
|
export declare const cachePrefix = "allbridge";
|
11
|
-
export declare const allbridgeProgram: PublicKey;
|
12
7
|
export declare const SYSTEM_PRECISION = 3;
|
13
|
-
export declare const allbridgeIdlItem: IdlItem;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
const web3_js_1 = require("@solana/web3.js");
|
5
|
-
const idl_1 = require("./idl");
|
3
|
+
exports.SYSTEM_PRECISION = exports.cachePrefix = exports.poolsCacheKey = exports.apiPoolInfoUrl = exports.platform = exports.platformId = void 0;
|
6
4
|
exports.platformId = 'allbridge';
|
7
5
|
exports.platform = {
|
8
6
|
id: exports.platformId,
|
@@ -21,11 +19,5 @@ exports.platform = {
|
|
21
19
|
exports.apiPoolInfoUrl = `https://core.api.allbridgecoreapi.net/token-info`;
|
22
20
|
exports.poolsCacheKey = `${exports.platformId}-pools`;
|
23
21
|
exports.cachePrefix = `${exports.platformId}`;
|
24
|
-
exports.allbridgeProgram = new web3_js_1.PublicKey('BrdgN2RPzEMWF96ZbnnJaUtQDQx7VRXYaHHbYCBvceWB');
|
25
22
|
exports.SYSTEM_PRECISION = 3;
|
26
|
-
exports.allbridgeIdlItem = {
|
27
|
-
programId: exports.allbridgeProgram.toString(),
|
28
|
-
idl: idl_1.AllbridgeIDL,
|
29
|
-
idlType: 'anchor',
|
30
|
-
};
|
31
23
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/allbridge/constants.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/allbridge/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EACH,+EAA+E;IACjF,OAAO,EAAE,iCAAiC;IAC1C,OAAO,EAAE,kCAAkC;IAC3C,WAAW,EAAE,gBAAgB,EAAE,sCAAsC;IACrE,OAAO,EAAE,uCAAuC;IAChD,WAAW,EACT,wGAAwG;IAC1G,aAAa,EAAE,iCAAiC;IAChD,MAAM,EAAE,iCAAiC;IACzC,MAAM,EAAE,+BAA+B;IACvC,QAAQ,EAAE,iCAAiC;CAC5C,CAAC;AAEW,QAAA,cAAc,GAAG,kDAAkD,CAAC;AAEpE,QAAA,aAAa,GAAG,GAAG,kBAAU,QAAQ,CAAC;AACtC,QAAA,WAAW,GAAG,GAAG,kBAAU,EAAE,CAAC;AAE9B,QAAA,gBAAgB,GAAG,CAAC,CAAC"}
|
@@ -3,5 +3,5 @@
|
|
3
3
|
import BigNumber from 'bignumber.js';
|
4
4
|
import { PublicKey } from '@solana/web3.js';
|
5
5
|
import { Pools } from './types';
|
6
|
-
export declare const getEarned: (
|
6
|
+
export declare const getEarned: (userLpAmountBN: BigNumber, userRewardDebtBN: BigNumber, accRewardPerShareP: string, p: number) => BigNumber;
|
7
7
|
export declare const getUserDepositPublicKeys: (poolInfo: Pools, owner: string) => PublicKey[];
|
@@ -6,10 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getUserDepositPublicKeys = exports.getEarned = void 0;
|
7
7
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
8
8
|
const web3_js_1 = require("@solana/web3.js");
|
9
|
-
const getEarned = (
|
10
|
-
const userLpAmountBN = new bignumber_js_1.default(userLpAmount);
|
9
|
+
const getEarned = (userLpAmountBN, userRewardDebtBN, accRewardPerShareP, p) => {
|
11
10
|
const accRewardPerSharePBN = new bignumber_js_1.default(accRewardPerShareP);
|
12
|
-
const userRewardDebtBN = new bignumber_js_1.default(userRewardDebt);
|
13
11
|
const rewards = userLpAmountBN
|
14
12
|
.multipliedBy(accRewardPerSharePBN)
|
15
13
|
.dividedBy(Math.pow(10, p));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/allbridge/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,6CAA4C;AAGrC,MAAM,SAAS,GAAG,CACvB,
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/allbridge/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,6CAA4C;AAGrC,MAAM,SAAS,GAAG,CACvB,cAAyB,EACzB,gBAA2B,EAC3B,kBAA0B,EAC1B,CAAS,EACE,EAAE;IACb,MAAM,oBAAoB,GAAG,IAAI,sBAAS,CAAC,kBAAkB,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,cAAc;SAC3B,YAAY,CAAC,oBAAoB,CAAC;SAClC,SAAS,CAAC,SAAA,EAAE,EAAI,CAAC,CAAA,CAAC,CAAC;IAEtB,OAAO,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACzC,CAAC,CAAC;AAZW,QAAA,SAAS,aAYpB;AAEK,MAAM,wBAAwB,GAAG,CAAC,QAAe,EAAE,KAAa,EAAE,EAAE,CACzE,QAAQ,CAAC,MAAM,CAAC,GAAG,CACjB,CAAC,EAAE,EAAE,EAAE,CACL,mBAAS,CAAC,sBAAsB,CAC9B;IACE,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC;IACpC,IAAI,mBAAS,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;IACzC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;CAChC,EACD,IAAI,mBAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CACpC,CAAC,CAAC,CAAC,CACP,CAAC;AAXS,QAAA,wBAAwB,4BAWjC"}
|
@@ -20,6 +20,7 @@ const solana_1 = require("../../utils/solana");
|
|
20
20
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
21
21
|
const helpers_1 = require("./helpers");
|
22
22
|
const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
|
23
|
+
const structs_1 = require("./structs");
|
23
24
|
const poolInfoMemo = new MemoizedCache_1.MemoizedCache(constants_1.poolsCacheKey, {
|
24
25
|
prefix: constants_1.cachePrefix,
|
25
26
|
networkId: portfolio_core_1.NetworkId.solana,
|
@@ -30,7 +31,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
30
31
|
if (!poolInfo)
|
31
32
|
throw new Error('Pool info not cached');
|
32
33
|
const userDepositPublicKeys = (0, helpers_1.getUserDepositPublicKeys)(poolInfo, owner);
|
33
|
-
const userDeposits = (yield (0, solana_1.
|
34
|
+
const userDeposits = (yield (0, solana_1.getParsedMultipleAccountsInfo)(connection, structs_1.userDepositStruct, userDepositPublicKeys)).filter((userDeposit) => userDeposit !== null && !(userDeposit === null || userDeposit === void 0 ? void 0 : userDeposit.lpAmount.isZero()));
|
34
35
|
if (userDeposits.length === 0)
|
35
36
|
return [];
|
36
37
|
const tokenPrices = yield cache.getTokenPricesAsMap(poolInfo.tokens.map((pi) => pi.tokenAddress), portfolio_core_1.NetworkId.solana);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/allbridge/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAErC,
|
1
|
+
{"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/allbridge/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAErC,2CAKqB;AAErB,iDAAsD;AACtD,+CAG4B;AAC5B,qGAA6E;AAE7E,uCAAgE;AAChE,kEAA+D;AAC/D,uCAA2D;AAE3D,MAAM,YAAY,GAAG,IAAI,6BAAa,CAAQ,yBAAa,EAAE;IAC3D,MAAM,EAAE,uBAAW;IACnB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAEnD,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAEvD,MAAM,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CAAC,GAAG,CAAC;6BAC3B;yBACF;wBACD,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE;wBAClC,UAAU,EAAE;4BACV;gCACE,OAAO,EAAE,SAAS,CAAC,WAAW;gCAC9B,IAAI,EAAE,MAAM;6BACb;yBACF;wBACD,IAAI,EAAE,2CAA2C;qBAClD;iBACF;aACF;YACD,IAAI,EAAE,SAAS,CAAC,IAAI;SACrB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
2
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
import { FixableBeetStruct } from '@metaplex-foundation/beet';
|
5
|
+
import BigNumber from 'bignumber.js';
|
6
|
+
export type UserDeposit = {
|
7
|
+
accountDiscriminator: number[];
|
8
|
+
userAddress: PublicKey;
|
9
|
+
mint: PublicKey;
|
10
|
+
lpAmount: BigNumber;
|
11
|
+
rewardDebt: BigNumber;
|
12
|
+
};
|
13
|
+
export declare const userDepositStruct: FixableBeetStruct<UserDeposit, Partial<UserDeposit>>;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.userDepositStruct = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
+
const solana_1 = require("../../utils/solana");
|
7
|
+
exports.userDepositStruct = new beet_1.FixableBeetStruct([
|
8
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
9
|
+
['userAddress', beet_solana_1.publicKey],
|
10
|
+
['mint', beet_solana_1.publicKey],
|
11
|
+
['lpAmount', solana_1.u64],
|
12
|
+
['rewardDebt', solana_1.u64],
|
13
|
+
], (args) => args);
|
14
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/allbridge/structs.ts"],"names":[],"mappings":";;;AACA,oDAImC;AACnC,kEAA6D;AAE7D,+CAAyC;AAU5B,QAAA,iBAAiB,GAAG,IAAI,wBAAiB,CACpD;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,YAAY,EAAE,YAAG,CAAC;CACpB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAmB,CAC9B,CAAC"}
|
@@ -6,7 +6,7 @@ exports.platformId = 'bonfida';
|
|
6
6
|
exports.fidaMint = 'EchesyfXePKdLtoiZSL8pBe8Myagyy8ZRqsACNCFGnvp';
|
7
7
|
exports.platform = {
|
8
8
|
id: exports.platformId,
|
9
|
-
name: '
|
9
|
+
name: 'SNS',
|
10
10
|
image: 'https://sonarwatch.github.io/portfolio/assets/images/platforms/bonfida.webp',
|
11
11
|
website: 'https://www.sns.id/',
|
12
12
|
twitter: 'https://twitter.com/bonfida',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bonfida/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAG,8CAA8C,CAAC;AAC1D,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/bonfida/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAG,8CAA8C,CAAC;AAC1D,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,KAAK;IACX,KAAK,EACH,6EAA6E;IAC/E,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,6BAA6B;IACtC,WAAW,EAAE,qBAAqB,EAAE,sCAAsC;IAC1E,WAAW,EAAE,4BAA4B;IACzC,MAAM,EAAE,4BAA4B;IACpC,OAAO,EAAE,uDAAuD;IAChE,aAAa,EAAE,gCAAgC;IAC/C,QAAQ,EAAE,wBAAwB;IAClC,MAAM,EAAE,CAAC,gBAAQ,CAAC;CACnB,CAAC;AAEW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,UAAU,GAAG,IAAI,mBAAS,CACrC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,UAAU,GACrB,yFAAyF,CAAC;AAC/E,QAAA,YAAY,GAAG,CAAC,CAAC"}
|
@@ -1,11 +1,9 @@
|
|
1
1
|
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
2
2
|
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
3
3
|
import { Platform } from '@sonarwatch/portfolio-core';
|
4
|
-
import { IdlItem } from '@solanafm/explorer-kit-idls';
|
5
4
|
import { PublicKey } from '@solana/web3.js';
|
6
5
|
export declare const platformId = "divvy";
|
7
6
|
export declare const dvyMint = "8fdi18UQNGg8mFEzjf79GUkzTg9YHSeojzCcarVxCX2y";
|
8
7
|
export declare const platform: Platform;
|
9
8
|
export declare const divvyProgram: PublicKey;
|
10
|
-
export declare const divvyIdlItem: IdlItem;
|
11
9
|
export declare const houseCacheKey = "houses";
|
@@ -1,8 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.houseCacheKey = exports.
|
3
|
+
exports.houseCacheKey = exports.divvyProgram = exports.platform = exports.dvyMint = exports.platformId = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
|
-
const idl_1 = require("./idl");
|
6
5
|
exports.platformId = 'divvy';
|
7
6
|
exports.dvyMint = '8fdi18UQNGg8mFEzjf79GUkzTg9YHSeojzCcarVxCX2y';
|
8
7
|
exports.platform = {
|
@@ -18,10 +17,5 @@ exports.platform = {
|
|
18
17
|
description: 'Frictionless betting experience powered by Solana with no signups or deposits',
|
19
18
|
};
|
20
19
|
exports.divvyProgram = new web3_js_1.PublicKey('dvyFwAPniptQNb1ey4eM12L8iLHrzdiDsPPDndd6xAR');
|
21
|
-
exports.divvyIdlItem = {
|
22
|
-
programId: exports.divvyProgram.toString(),
|
23
|
-
idl: idl_1.DivvyIdl,
|
24
|
-
idlType: 'anchor',
|
25
|
-
};
|
26
20
|
exports.houseCacheKey = 'houses';
|
27
21
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/divvy/constants.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/divvy/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE/B,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,OAAO,GAAG,8CAA8C,CAAC;AACzD,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EACH,2EAA2E;IAC7E,WAAW,EAAE,WAAW;IACxB,OAAO,EAAE,wBAAwB;IACjC,OAAO,EAAE,qCAAqC;IAC9C,aAAa,EACX,yEAAyE;IAC3E,OAAO,EAAE,8BAA8B;IACvC,MAAM,EAAE,CAAC,eAAO,CAAC;IACjB,WAAW,EACT,+EAA+E;CAClF,CAAC;AAEW,QAAA,YAAY,GAAG,IAAI,mBAAS,CACvC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,aAAa,GAAG,QAAQ,CAAC"}
|
@@ -15,12 +15,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
16
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
17
|
const constants_1 = require("./constants");
|
18
|
-
const solana_1 = require("../../utils/solana");
|
19
18
|
const clients_1 = require("../../utils/clients");
|
19
|
+
const structs_1 = require("./structs");
|
20
|
+
const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
|
20
21
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
21
22
|
const connection = (0, clients_1.getClientSolana)();
|
22
|
-
const houses = yield (
|
23
|
-
|
23
|
+
const houses = yield ParsedGpa_1.ParsedGpa.build(connection, structs_1.houseStruct, constants_1.divvyProgram)
|
24
|
+
.addFilter('accountDiscriminator', [21, 145, 94, 109, 254, 199, 210, 151])
|
25
|
+
.run();
|
26
|
+
const tokenPrices = yield cache.getTokenPricesAsMap(houses.map((h) => h.currency.toString()), portfolio_core_1.NetworkId.solana);
|
24
27
|
const tokenPriceSources = [];
|
25
28
|
houses.forEach((house) => {
|
26
29
|
const tokenPrice = tokenPrices.get(house.currency.toString());
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"houseJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/divvy/houseJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,gEAAqC;AAGrC,2CAAsE;AACtE
|
1
|
+
{"version":3,"file":"houseJob.js","sourceRoot":"","sources":["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EAAE;YAC9B,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;YAC/C,WAAW,EAAE;gBACX;oBACE,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE;oBAClC,WAAW,EAAE,KAAK,CAAC,QAAQ,EAAE;oBAC7B,QAAQ,EAAE,KAAK,CAAC,gBAAgB;oBAChC,SAAS,EAAE,UAAU,CAAC,SAAS;oBAC/B,KAAK,EAAE,UAAU,CAAC,KAAK;iBACxB;aACF;YACD,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,MAAM,EAAE,CAAC;SACV,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;QAC7C,KAAK,CAAC,OAAO,CAAC,yBAAa,EAAE,MAAM,EAAE;YACnC,MAAM,EAAE,sBAAU;YAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC;KACH,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,MAAM,EAAE,CAAC,QAAQ,CAAC;CACnB,CAAC;AAEF,kBAAe,GAAG,CAAC"}
|
@@ -10,27 +10,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const web3_js_1 = require("@solana/web3.js");
|
13
14
|
const constants_1 = require("./constants");
|
14
15
|
const clients_1 = require("../../utils/clients");
|
15
|
-
const solana_1 = require("../../utils/solana");
|
16
16
|
const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
|
17
17
|
const arrayToMap_1 = require("../../utils/misc/arrayToMap");
|
18
18
|
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
19
|
+
const structs_1 = require("./structs");
|
20
|
+
const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
|
19
21
|
const housesMemo = new MemoizedCache_1.MemoizedCache(constants_1.houseCacheKey, {
|
20
22
|
prefix: constants_1.platformId,
|
21
23
|
networkId: portfolio_core_1.NetworkId.solana,
|
22
24
|
}, (arr) => (0, arrayToMap_1.arrayToMap)(arr || [], 'pubkey'));
|
23
25
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
26
|
const connection = (0, clients_1.getClientSolana)();
|
25
|
-
const accounts = yield (
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
offset: 40,
|
31
|
-
},
|
32
|
-
},
|
33
|
-
]);
|
27
|
+
const accounts = yield ParsedGpa_1.ParsedGpa.build(connection, structs_1.positionStruct, constants_1.divvyProgram)
|
28
|
+
.addFilter('accountDiscriminator', [170, 188, 143, 228, 122, 64, 247, 208])
|
29
|
+
.addFilter('user', new web3_js_1.PublicKey(owner))
|
30
|
+
.debug()
|
31
|
+
.run();
|
34
32
|
if (accounts.length === 0)
|
35
33
|
return [];
|
36
34
|
const houses = yield housesMemo.getItem(cache);
|
@@ -43,7 +41,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
43
41
|
link: 'https://app.divvy.bet/housepool/?house=SOL',
|
44
42
|
});
|
45
43
|
accounts.forEach((account) => {
|
46
|
-
const house = houses.get(account.house);
|
44
|
+
const house = houses.get(account.house.toString());
|
47
45
|
if (!house)
|
48
46
|
return;
|
49
47
|
element.addAsset({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"housePoolFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/divvy/housePoolFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;
|
1
|
+
{"version":3,"file":"housePoolFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/divvy/housePoolFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAE5C,2CAAsE;AAEtE,iDAAsD;AAEtD,kEAA+D;AAC/D,4DAAyD;AACzD,gFAA6E;AAC7E,uCAAkD;AAClD,kEAA+D;AAE/D,MAAM,UAAU,GAAG,IAAI,6BAAa,CAIlC,yBAAa,EACb;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;IAErC,MAAM,QAAQ,GAAG,MAAM,qBAAS,CAAC,KAAK,CACpC,UAAU,EACV,wBAAc,EACd,wBAAY,CACb;SACE,SAAS,CAAC,sBAAsB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;SAC1E,SAAS,CAAC,MAAM,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC;SACvC,KAAK,EAAE;SACP,GAAG,EAAE,CAAC;IAET,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAElD,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;QACjD,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,4CAA4C;KACnD,CAAC,CAAC;IAEH,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,KAAK,CAAC,QAAQ;YACvB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,GAAG,EAAE,OAAO,CAAC,MAAM;YACnB,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;SACjE,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,aAAa;IAC9B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -10,23 +10,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const web3_js_1 = require("@solana/web3.js");
|
13
14
|
const constants_1 = require("./constants");
|
14
15
|
const clients_1 = require("../../utils/clients");
|
15
|
-
const solana_1 = require("../../utils/solana");
|
16
16
|
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
17
|
+
const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
|
18
|
+
const structs_1 = require("./structs");
|
17
19
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
18
20
|
const connection = (0, clients_1.getClientSolana)();
|
19
|
-
const accounts = yield (
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
{
|
24
|
-
memcmp: {
|
25
|
-
bytes: owner,
|
26
|
-
offset: 41,
|
27
|
-
},
|
28
|
-
},
|
29
|
-
]);
|
21
|
+
const accounts = yield ParsedGpa_1.ParsedGpa.build(connection, structs_1.minerStruct, constants_1.divvyProgram)
|
22
|
+
.addFilter('accountDiscriminator', [223, 113, 15, 54, 123, 122, 140, 100])
|
23
|
+
.addFilter('authority', new web3_js_1.PublicKey(owner))
|
24
|
+
.run();
|
30
25
|
if (accounts.length === 0)
|
31
26
|
return [];
|
32
27
|
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/divvy/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/divvy/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAE5C,2CAAgE;AAEhE,iDAAsD;AACtD,gFAA6E;AAC7E,kEAA+D;AAC/D,uCAAwC;AAExC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,QAAQ,GAAG,MAAM,qBAAS,CAAC,KAAK,CAAC,UAAU,EAAE,qBAAW,EAAE,wBAAY,CAAC;SAC1E,SAAS,CAAC,sBAAsB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;SACzE,SAAS,CAAC,WAAW,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC;SAC5C,GAAG,EAAE,CAAC;IAET,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;QACjD,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,0CAA0C;KACjD,CAAC,CAAC;IAEH,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3B,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,mBAAO;YAChB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,GAAG,EAAE,OAAO,CAAC,MAAM;SACpB,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,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
2
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
3
|
+
import { FixableBeetStruct } from '@metaplex-foundation/beet';
|
4
|
+
import { PublicKey } from '@solana/web3.js';
|
5
|
+
import BigNumber from 'bignumber.js';
|
6
|
+
export type House = {
|
7
|
+
accountDiscriminator: number[];
|
8
|
+
admin: PublicKey;
|
9
|
+
foreman: PublicKey;
|
10
|
+
beneficiary: PublicKey;
|
11
|
+
houseMint: PublicKey;
|
12
|
+
currency: PublicKey;
|
13
|
+
currencyDecimals: number;
|
14
|
+
beneficiaryFeeBps: number;
|
15
|
+
dvypassFeeBps: number;
|
16
|
+
maxUtilizationBps: number;
|
17
|
+
houseTokenSupply: BigNumber;
|
18
|
+
liquidity: BigNumber;
|
19
|
+
maxPayoutAmount: BigNumber;
|
20
|
+
betAmount: BigNumber;
|
21
|
+
activeSlips: BigNumber;
|
22
|
+
authorityBump: number;
|
23
|
+
paused: boolean;
|
24
|
+
beneficiaryLiquidity: BigNumber;
|
25
|
+
dvypassLiquidity: BigNumber;
|
26
|
+
dvypassRewardRemaining: BigNumber;
|
27
|
+
dvypassRewardPerStake: BigNumber;
|
28
|
+
dvypassTotalStake: number;
|
29
|
+
dvypassNextTotalStake: number;
|
30
|
+
dvypassCollection: PublicKey | null;
|
31
|
+
utilizedAmount: BigNumber;
|
32
|
+
};
|
33
|
+
export declare const houseStruct: FixableBeetStruct<House, Partial<House>>;
|
34
|
+
export declare enum PositionStatus {
|
35
|
+
Deposit = 0,
|
36
|
+
Withdraw = 1
|
37
|
+
}
|
38
|
+
export type Position = {
|
39
|
+
accountDiscriminator: number[];
|
40
|
+
house: PublicKey;
|
41
|
+
user: PublicKey;
|
42
|
+
amount: BigNumber;
|
43
|
+
minAmountOut: BigNumber;
|
44
|
+
createdTs: number;
|
45
|
+
status: PositionStatus;
|
46
|
+
};
|
47
|
+
export declare const positionStruct: FixableBeetStruct<Position, Partial<Position>>;
|
48
|
+
export type Miner = {
|
49
|
+
accountDiscriminator: number[];
|
50
|
+
isBoosted: boolean;
|
51
|
+
rewarder: PublicKey;
|
52
|
+
authority: PublicKey;
|
53
|
+
amount: BigNumber;
|
54
|
+
rewards: BigNumber;
|
55
|
+
revshares: number;
|
56
|
+
};
|
57
|
+
export declare const minerStruct: FixableBeetStruct<Miner, Partial<Miner>>;
|
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.minerStruct = exports.positionStruct = exports.PositionStatus = exports.houseStruct = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
+
const solana_1 = require("../../utils/solana");
|
7
|
+
exports.houseStruct = new beet_1.FixableBeetStruct([
|
8
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
9
|
+
['admin', beet_solana_1.publicKey],
|
10
|
+
['foreman', beet_solana_1.publicKey],
|
11
|
+
['beneficiary', beet_solana_1.publicKey],
|
12
|
+
['houseMint', beet_solana_1.publicKey],
|
13
|
+
['currency', beet_solana_1.publicKey],
|
14
|
+
['currencyDecimals', beet_1.u8],
|
15
|
+
['beneficiaryFeeBps', beet_1.u16],
|
16
|
+
['dvypassFeeBps', beet_1.u16],
|
17
|
+
['maxUtilizationBps', beet_1.u16],
|
18
|
+
['houseTokenSupply', solana_1.u64],
|
19
|
+
['liquidity', solana_1.u64],
|
20
|
+
['maxPayoutAmount', solana_1.u64],
|
21
|
+
['betAmount', solana_1.u64],
|
22
|
+
['activeSlips', solana_1.u64],
|
23
|
+
['authorityBump', beet_1.u8],
|
24
|
+
['paused', beet_1.bool],
|
25
|
+
['beneficiaryLiquidity', solana_1.u64],
|
26
|
+
['dvypassLiquidity', solana_1.u64],
|
27
|
+
['dvypassRewardRemaining', solana_1.u64],
|
28
|
+
['dvypassRewardPerStake', solana_1.u64],
|
29
|
+
['dvypassTotalStake', beet_1.u16],
|
30
|
+
['dvypassNextTotalStake', beet_1.u16],
|
31
|
+
['dvypassCollection', beet_solana_1.publicKey],
|
32
|
+
['utilizedAmount', solana_1.u64],
|
33
|
+
], (args) => args);
|
34
|
+
var PositionStatus;
|
35
|
+
(function (PositionStatus) {
|
36
|
+
PositionStatus[PositionStatus["Deposit"] = 0] = "Deposit";
|
37
|
+
PositionStatus[PositionStatus["Withdraw"] = 1] = "Withdraw";
|
38
|
+
})(PositionStatus || (exports.PositionStatus = PositionStatus = {}));
|
39
|
+
exports.positionStruct = new beet_1.FixableBeetStruct([
|
40
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
41
|
+
['house', beet_solana_1.publicKey],
|
42
|
+
['user', beet_solana_1.publicKey],
|
43
|
+
['amount', solana_1.u64],
|
44
|
+
['minAmountOut', solana_1.u64],
|
45
|
+
['createdTs', beet_1.u32],
|
46
|
+
['status', beet_1.u8],
|
47
|
+
], (args) => args);
|
48
|
+
exports.minerStruct = new beet_1.FixableBeetStruct([
|
49
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
50
|
+
['isBoosted', beet_1.bool],
|
51
|
+
['rewarder', beet_solana_1.publicKey],
|
52
|
+
['authority', beet_solana_1.publicKey],
|
53
|
+
['amount', solana_1.u64],
|
54
|
+
['rewards', solana_1.u64],
|
55
|
+
['revshares', beet_1.u8],
|
56
|
+
], (args) => args);
|
57
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/divvy/structs.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AACnC,kEAA6D;AAG7D,+CAAyC;AA8B5B,QAAA,WAAW,GAAG,IAAI,wBAAiB,CAC9C;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,UAAU,EAAE,uBAAS,CAAC;IACvB,CAAC,kBAAkB,EAAE,SAAE,CAAC;IACxB,CA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AAC,IAAgB,CAC3B,CAAC;AAYW,QAAA,WAAW,GAAG,IAAI,wBAAiB,CAC9C;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,WAAW,EAAE,WAAI,CAAC;IACnB,CAAC,UAAU,EAAE,uBAAS,CAAC;IACvB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,WAAW,EAAE,SAAE,CAAC;CAClB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC"}
|
@@ -65,7 +65,6 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
65
|
},
|
66
66
|
depositedAmount,
|
67
67
|
platformId: constants_1.platformId,
|
68
|
-
poolName: 'Main',
|
69
68
|
};
|
70
69
|
yield cache.setItem(`${spotMarketAccount.vault.toString()}-${tokenAddress}`, rate, {
|
71
70
|
prefix: portfolio_core_1.borrowLendRatesPrefix,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"spotMarketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/spotMarketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AACrC,2CAKqB;AACrB,+CAA8D;AAC9D,qCAA4C;AAC5C,uCAAyC;AACzC,iDAAsD;AACtD,uCAKmB;AAKnB,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,kBAAkB,GAAG,MAAM,IAAA,iCAAwB,EACvD,MAAM,EACN,yBAAgB,EAChB,wBAAY,EACZ,sBAAY,CACb,CAAC;IACF,IAAI,CAAC,kBAAkB;QAAE,OAAO;IAEhC,iBAAiB;IACjB,MAAM,YAAY,GAAuB,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,YAAY,CAC1C,iBAAiB,CAAC,wBAAwB,CAAC,GAAG,CAC5C,oCAA0B,CAC3B,CACF,EACD,iBAAiB,CAClB,CAAC,QAAQ,EAAE,CAAC;QAEb,MAAM,eAAe,GAAG,iBAAiB,CAAC,cAAc;aACrD,YAAY,CACX,iBAAiB,CAAC,yBAAyB,CAAC,GAAG,CAC7C,oCAA0B,CAC3B,CACF;aACA,GAAG,CAAC,iBAAiB,CAAC;aACtB,QAAQ,EAAE,CAAC;QAEd,IAAI,cAAc,IAAI,EAAE,IAAI,eAAe,IAAI,EAAE;YAAE,SAAS;QAE5D,MAAM,IAAI,GAAmB;YAC3B,YAAY;YACZ,WAAW,EAAE;gBACX,GAAG,EAAE,IAAA,yBAAQ,EAAC,SAAS,CAAC;gBACxB,GAAG,EAAE,SAAS;aACf;YACD,cAAc;YACd,YAAY,EAAE;gBACZ,GAAG,EAAE,IAAA,yBAAQ,EAAC,UAAU,CAAC;gBACzB,GAAG,EAAE,UAAU;aAChB;YACD,eAAe;YACf,UAAU,EAAV,sBAAU;
|
1
|
+
{"version":3,"file":"spotMarketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/drift/spotMarketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,gEAAqC;AACrC,2CAKqB;AACrB,+CAA8D;AAC9D,qCAA4C;AAC5C,uCAAyC;AACzC,iDAAsD;AACtD,uCAKmB;AAKnB,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,kBAAkB,GAAG,MAAM,IAAA,iCAAwB,EACvD,MAAM,EACN,yBAAgB,EAChB,wBAAY,EACZ,sBAAY,CACb,CAAC;IACF,IAAI,CAAC,kBAAkB;QAAE,OAAO;IAEhC,iBAAiB;IACjB,MAAM,YAAY,GAAuB,EAAE,CAAC;IAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,E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="jito-ts/node_modules/@solana/web3.js" />
|
1
3
|
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
-
import {
|
4
|
+
import { PublicKey } from '@solana/web3.js';
|
3
5
|
export declare const platformId = "elemental";
|
4
6
|
export declare const platform: Platform;
|
5
7
|
export declare const poolsCacheKey = "pools";
|
6
|
-
export declare const
|
8
|
+
export declare const programId: PublicKey;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
const
|
3
|
+
exports.programId = exports.poolsCacheKey = exports.platform = exports.platformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
exports.platformId = 'elemental';
|
6
6
|
exports.platform = {
|
7
7
|
id: exports.platformId,
|
@@ -16,9 +16,5 @@ exports.platform = {
|
|
16
16
|
github: 'https://github.com/elementalfund',
|
17
17
|
};
|
18
18
|
exports.poolsCacheKey = `pools`;
|
19
|
-
exports.
|
20
|
-
programId: elementalVaultIDL_1.elementalIDLs.address,
|
21
|
-
idl: elementalVaultIDL_1.elementalIDLs,
|
22
|
-
idlType: 'anchor',
|
23
|
-
};
|
19
|
+
exports.programId = new web3_js_1.PublicKey('ELE5vYY81W7UCpTPs7SyD6Bwm5FwZBntTW8PiGqM5d4A');
|
24
20
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elemental/constants.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elemental/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE/B,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EACH,+EAA+E;IACjF,OAAO,EAAE,yBAAyB;IAClC,OAAO,EAAE,mCAAmC;IAC5C,qEAAqE;IACrE,aAAa,EAAE,8BAA8B;IAC7C,QAAQ,EAAE,2BAA2B;IACrC,WAAW,EACT,oEAAoE;IACtE,MAAM,EAAE,kCAAkC;CAC3C,CAAC;AACW,QAAA,aAAa,GAAG,OAAO,CAAC;AAExB,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,8CAA8C,CAC/C,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.positionFilter = void 0;
|
4
4
|
const positionFilter = (owner) => [
|
5
5
|
{
|
6
6
|
memcmp: {
|
@@ -13,9 +13,4 @@ const positionFilter = (owner) => [
|
|
13
13
|
},
|
14
14
|
];
|
15
15
|
exports.positionFilter = positionFilter;
|
16
|
-
exports.poolFilter = [
|
17
|
-
{
|
18
|
-
dataSize: 254,
|
19
|
-
},
|
20
|
-
];
|
21
16
|
//# sourceMappingURL=filters.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elemental/filters.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IAC3E;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,GAAG;KACd;CACF,CAAC;AAVW,QAAA,cAAc,kBAUzB
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/elemental/filters.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IAC3E;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,GAAG;KACd;CACF,CAAC;AAVW,QAAA,cAAc,kBAUzB"}
|
@@ -2,13 +2,13 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getStatus = exports.getPositionAddress = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
|
-
const
|
5
|
+
const constants_1 = require("./constants");
|
6
6
|
function getPositionAddress(poolAddress, ownerAddress) {
|
7
7
|
return web3_js_1.PublicKey.findProgramAddressSync([
|
8
8
|
Buffer.from('position'),
|
9
9
|
new web3_js_1.PublicKey(ownerAddress).toBuffer(),
|
10
10
|
new web3_js_1.PublicKey(poolAddress).toBuffer(),
|
11
|
-
],
|
11
|
+
], constants_1.programId)[0];
|
12
12
|
}
|
13
13
|
exports.getPositionAddress = getPositionAddress;
|
14
14
|
function getStatus(position, pool) {
|