@sonarwatch/portfolio-plugins 0.14.19 → 0.14.21
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +13 -5
- package/package.json +1 -1
- package/src/index.js +12 -0
- package/src/index.js.map +1 -1
- package/src/plugins/drift-market-maker-vault/constants.d.ts +5 -1
- package/src/plugins/drift-market-maker-vault/constants.js +25 -4
- package/src/plugins/drift-market-maker-vault/constants.js.map +1 -1
- package/src/plugins/drift-market-maker-vault/depositsFetcher.js +1 -1
- package/src/plugins/drift-market-maker-vault/depositsFetcher.js.map +1 -1
- package/src/plugins/drift-market-maker-vault/index.js +6 -1
- package/src/plugins/drift-market-maker-vault/index.js.map +1 -1
- package/src/plugins/drift-market-maker-vault/vaultsJob.js +1 -1
- package/src/plugins/drift-market-maker-vault/vaultsJob.js.map +1 -1
- package/src/plugins/grass/constants.d.ts +6 -0
- package/src/plugins/grass/constants.js +15 -0
- package/src/plugins/grass/constants.js.map +1 -0
- package/src/plugins/grass/helpers.d.ts +2 -0
- package/src/plugins/grass/helpers.js +10 -0
- package/src/plugins/grass/helpers.js.map +1 -0
- package/src/plugins/grass/index.d.ts +6 -0
- package/src/plugins/grass/index.js +12 -0
- package/src/plugins/grass/index.js.map +1 -0
- package/src/plugins/grass/stakingFetcher.js +52 -0
- package/src/plugins/grass/stakingFetcher.js.map +1 -0
- package/src/plugins/grass/structs.d.ts +28 -0
- package/src/plugins/grass/structs.js +28 -0
- package/src/plugins/grass/structs.js.map +1 -0
- package/src/plugins/hxro/constants.d.ts +6 -0
- package/src/plugins/hxro/constants.js +16 -0
- package/src/plugins/hxro/constants.js.map +1 -0
- package/src/plugins/hxro/index.d.ts +6 -0
- package/src/plugins/hxro/index.js +12 -0
- package/src/plugins/hxro/index.js.map +1 -0
- package/src/plugins/hxro/stakingFetcher.d.ts +3 -0
- package/src/plugins/hxro/stakingFetcher.js +57 -0
- package/src/plugins/hxro/stakingFetcher.js.map +1 -0
- package/src/plugins/hxro/structs.d.ts +37 -0
- package/src/plugins/hxro/structs.js +36 -0
- package/src/plugins/hxro/structs.js.map +1 -0
- package/src/plugins/hxro/types.d.ts +5 -0
- package/src/plugins/hxro/types.js +3 -0
- package/src/plugins/hxro/types.js.map +1 -0
- package/src/plugins/jupiter/helpers.js +22 -8
- package/src/plugins/jupiter/helpers.js.map +1 -1
- package/src/plugins/jupiter/pricingJob.js +0 -4
- package/src/plugins/jupiter/pricingJob.js.map +1 -1
- package/src/plugins/orca/getWhirlpoolPositions.js +9 -6
- package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
- package/src/plugins/spdr/constants.d.ts +7 -0
- package/src/plugins/spdr/constants.js +17 -0
- package/src/plugins/spdr/constants.js.map +1 -0
- package/src/plugins/spdr/index.d.ts +6 -0
- package/src/plugins/spdr/index.js +12 -0
- package/src/plugins/spdr/index.js.map +1 -0
- package/src/plugins/spdr/stakingFetcher.d.ts +3 -0
- package/src/plugins/spdr/stakingFetcher.js +78 -0
- package/src/plugins/spdr/stakingFetcher.js.map +1 -0
- package/src/plugins/spdr/structs.d.ts +26 -0
- package/src/plugins/spdr/structs.js +26 -0
- package/src/plugins/spdr/structs.js.map +1 -0
- package/src/plugins/spdr/types.d.ts +21 -0
- package/src/plugins/spdr/types.js +3 -0
- package/src/plugins/spdr/types.js.map +1 -0
- package/src/plugins/tensor/index.js +0 -2
- package/src/plugins/tensor/index.js.map +1 -1
- package/src/plugins/tensor/locksFetcher.js +0 -62
- package/src/plugins/tensor/locksFetcher.js.map +0 -1
- /package/src/plugins/{tensor/locksFetcher.d.ts → grass/stakingFetcher.d.ts} +0 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export type StakeRewardsState = {
|
6
|
+
effectiveAmountStaked: BigNumber;
|
7
|
+
amountStaked: BigNumber;
|
8
|
+
claimedShares: BigNumber;
|
9
|
+
};
|
10
|
+
export declare const stakeRewardsStateStruct: BeetStruct<StakeRewardsState, Partial<StakeRewardsState>>;
|
11
|
+
export type StakingRewards = {
|
12
|
+
buffer: Buffer;
|
13
|
+
staker: PublicKey;
|
14
|
+
stakepool: PublicKey;
|
15
|
+
poolShares: PublicKey;
|
16
|
+
stakerShares: PublicKey;
|
17
|
+
vaultNeedsMultisig: boolean;
|
18
|
+
depositTimestamp: BigNumber;
|
19
|
+
stakeDuration: BigNumber;
|
20
|
+
lastClaimTimestamp: BigNumber;
|
21
|
+
padding: Buffer;
|
22
|
+
stakeState: StakeRewardsState;
|
23
|
+
};
|
24
|
+
export declare const stakeRewardsStruct: BeetStruct<StakingRewards, Partial<StakingRewards>>;
|
25
|
+
export type ClaimableRewards = {
|
26
|
+
buffer: Buffer;
|
27
|
+
staker: PublicKey;
|
28
|
+
stakepool: PublicKey;
|
29
|
+
poolShares: PublicKey;
|
30
|
+
stakerShares: PublicKey;
|
31
|
+
vaultNeedsMultisig: boolean;
|
32
|
+
depositTimestamp: BigNumber;
|
33
|
+
stakeDuration: BigNumber;
|
34
|
+
lastClaimTimestamp: BigNumber;
|
35
|
+
claimableShares: BigNumber;
|
36
|
+
};
|
37
|
+
export declare const claimableRewardsStruct: BeetStruct<ClaimableRewards, Partial<ClaimableRewards>>;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.claimableRewardsStruct = exports.stakeRewardsStruct = exports.stakeRewardsStateStruct = 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.stakeRewardsStateStruct = new beet_1.BeetStruct([
|
8
|
+
['effectiveAmountStaked', solana_1.u128],
|
9
|
+
['amountStaked', solana_1.u64],
|
10
|
+
['claimedShares', solana_1.u128],
|
11
|
+
], (args) => args);
|
12
|
+
exports.stakeRewardsStruct = new beet_1.BeetStruct([
|
13
|
+
['buffer', (0, solana_1.blob)(8)],
|
14
|
+
['staker', beet_solana_1.publicKey],
|
15
|
+
['stakepool', beet_solana_1.publicKey],
|
16
|
+
['poolShares', beet_solana_1.publicKey],
|
17
|
+
['stakerShares', beet_solana_1.publicKey],
|
18
|
+
['vaultNeedsMultisig', beet_1.bool],
|
19
|
+
['depositTimestamp', solana_1.i64],
|
20
|
+
['stakeDuration', solana_1.u64],
|
21
|
+
['lastClaimTimestamp', solana_1.i64],
|
22
|
+
['padding', (0, solana_1.blob)(1)],
|
23
|
+
['stakeState', exports.stakeRewardsStateStruct],
|
24
|
+
], (args) => args);
|
25
|
+
exports.claimableRewardsStruct = new beet_1.BeetStruct([
|
26
|
+
['buffer', (0, solana_1.blob)(8)],
|
27
|
+
['staker', beet_solana_1.publicKey],
|
28
|
+
['stakepool', beet_solana_1.publicKey],
|
29
|
+
['poolShares', beet_solana_1.publicKey],
|
30
|
+
['stakerShares', beet_solana_1.publicKey],
|
31
|
+
['depositTimestamp', solana_1.i64],
|
32
|
+
['stakeDuration', solana_1.u64],
|
33
|
+
['lastClaimTimestamp', solana_1.u64],
|
34
|
+
['claimableShares', solana_1.u64],
|
35
|
+
], (args) => args);
|
36
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hxro/structs.ts"],"names":[],"mappings":";;;AAAA,oDAA6D;AAC7D,kEAA6D;AAG7D,+CAA0D;AAQ7C,QAAA,uBAAuB,GAAG,IAAI,iBAAU,CACnD;IACE,CAAC,uBAAuB,EAAE,aAAI,CAAC;IAC/B,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,eAAe,EAAE,aAAI,CAAC;CACxB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAyB,CACpC,CAAC;AAgBW,QAAA,kBAAkB,GAAG,IAAI,iBAAU,CAC9C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,cAAc,EAAE,uBAAS,CAAC;IAC3B,CAAC,oBAAoB,EAAE,WAAI,CAAC;IAC5B,CAAC,kBAAkB,EAAE,YAAG,CAAC;IACzB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,oBAAoB,EAAE,YAAG,CAAC;IAC3B,CAAC,SAAS,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACpB,CAAC,YAAY,EAAE,+BAAuB,CAAC;CACxC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAsB,CACjC,CAAC;AAeW,QAAA,sBAAsB,GAAG,IAAI,iBAAU,CAClD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,cAAc,EAAE,uBAAS,CAAC;IAC3B,CAAC,kBAAkB,EAAE,YAAG,CAAC;IACzB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,oBAAoB,EAAE,YAAG,CAAC;IAC3B,CAAC,iBAAiB,EAAE,YAAG,CAAC;CACzB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAwB,CACnC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hxro/types.ts"],"names":[],"mappings":""}
|
@@ -25,17 +25,31 @@ function getVotePda(owner) {
|
|
25
25
|
], constants_1.voteProgramId)[0];
|
26
26
|
}
|
27
27
|
exports.getVotePda = getVotePda;
|
28
|
+
const maxIdsPerRequest = 100;
|
28
29
|
function getJupiterPrices(mints, vsMint) {
|
29
30
|
return __awaiter(this, void 0, void 0, function* () {
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
let res;
|
32
|
+
const pricesData = [];
|
33
|
+
let subMints;
|
34
|
+
let start = 0;
|
35
|
+
let end = maxIdsPerRequest - 1;
|
36
|
+
do {
|
37
|
+
subMints = mints.slice(start, end);
|
38
|
+
res = yield axios_1.default.get('https://api.jup.ag/price/v2', {
|
39
|
+
params: {
|
40
|
+
ids: subMints.map((m) => m.toString()).join(','),
|
41
|
+
vsToken: vsMint.toString(),
|
42
|
+
},
|
43
|
+
});
|
44
|
+
start += maxIdsPerRequest;
|
45
|
+
end += maxIdsPerRequest;
|
46
|
+
pricesData.push(res.data.data);
|
47
|
+
} while (mints.at(start));
|
36
48
|
const prices = new Map();
|
37
|
-
for (const
|
38
|
-
|
49
|
+
for (const priceData of pricesData) {
|
50
|
+
for (const [, value] of Object.entries(priceData)) {
|
51
|
+
prices.set(value.id, value.price);
|
52
|
+
}
|
39
53
|
}
|
40
54
|
return prices;
|
41
55
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,kDAA6C;AAC7C,+DAGoC;AAEpC,qDAAoE;AAEpE,SAAgB,UAAU,CAAC,KAAa;IACtC,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;QACrB,wBAAY,CAAC,OAAO,EAAE;QACtB,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE;KAC/B,EACD,yBAAa,CACd,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AATD,gCASC;AAED,SAAsB,gBAAgB,CAAC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C,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1C,CAAC;AAnBD,0CAmBC"}
|
@@ -19,10 +19,6 @@ const clients_1 = require("../../utils/clients");
|
|
19
19
|
const constants_3 = require("../sanctum/constants");
|
20
20
|
const mints = [
|
21
21
|
'xLfNTYy76B8Tiix3hA51Jyvc1kMSFV4sPdR7szTZsRu', // xLifinity
|
22
|
-
'BANXbTpN8U2cU41FjPxe2Ti37PiT5cCxLUKDQZuJeMMR', // Banx
|
23
|
-
'4LLbsb5ReP3yEtYzmXewyGjcir5uXtKFURtaEUVC2AHs', // Parcl
|
24
|
-
'SHARKSYJjqaNyxVfrpnBN9pjgkhwDhatnMyicWPnr1s', // Shark
|
25
|
-
'KMNo3nJsBXfcpJTVhZcXLW7RmTwTt4GVFE7suUBo9sS', // Kamino
|
26
22
|
'DdFPRnccQqLD4zCHrBqdY95D6hvw6PLWp9DEXj1fLCL9', // Wrapped USDC (Allbridge from Ethereum)
|
27
23
|
'eqKJTf1Do4MDPyKisMYqVaUFpkEFAs3riGF3ceDH2Ca', // Wrapped USDC (Allbridge from Polygon)
|
28
24
|
'8Yv9Jz4z7BUHP68dz8E8m3tMe6NKgpMUKn8KVqrPA6Fr', // Wrapped USDC (Allbridge from Avalanche)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pricingJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/jupiter/pricingJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAIoC;AACpC,6CAA4C;AAG5C,oDAAkD;AAClD,uCAA6C;AAC7C,mDAA2D;AAC3D,0FAAuF;AACvF,iDAAsD;AACtD,oDAAgF;AAEhF,MAAM,KAAK,GAAG;IACZ,6CAA6C,EAAE,YAAY;IAC3D,8CAA8C,EAAE,
|
1
|
+
{"version":3,"file":"pricingJob.js","sourceRoot":"","sources":["../../../../../../packages/pl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
|
140
140
|
!assetTokenB ||
|
141
|
-
assetTokenA.value === null
|
142
|
-
assetTokenB.value === null)
|
141
|
+
(assetTokenA.value === null && assetTokenB.value === null))
|
143
142
|
continue;
|
144
143
|
const assets = !tokenAmountA.isZero() && !tokenAmountB.isZero()
|
145
144
|
? [assetTokenA, assetTokenB]
|
146
145
|
: [];
|
147
|
-
const
|
146
|
+
const assetsValue = (0, portfolio_core_1.getUsdValueSum)([
|
147
|
+
assetTokenA.value,
|
148
|
+
assetTokenB.value,
|
149
|
+
]);
|
148
150
|
const rewardAssetsValue = (0, portfolio_core_1.getUsdValueSum)(rewardAssets.map((a) => a.value));
|
151
|
+
const totalValue = (0, portfolio_core_1.getUsdValueSum)([assetsValue, rewardAssetsValue]);
|
149
152
|
if (assets.length === 0 && rewardAssets.length === 0)
|
150
153
|
continue;
|
151
154
|
elements.push({
|
@@ -154,15 +157,15 @@ function getOrcaNftFetcher(platformId, programId) {
|
|
154
157
|
platformId,
|
155
158
|
label: 'LiquidityPool',
|
156
159
|
name: 'Concentrated',
|
157
|
-
value:
|
160
|
+
value: totalValue,
|
158
161
|
data: {
|
159
162
|
liquidities: [
|
160
163
|
{
|
161
164
|
assets,
|
162
|
-
assetsValue
|
165
|
+
assetsValue,
|
163
166
|
rewardAssets,
|
164
167
|
rewardAssetsValue,
|
165
|
-
value:
|
168
|
+
value: totalValue,
|
166
169
|
yields: [],
|
167
170
|
},
|
168
171
|
],
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getWhirlpoolPositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/getWhirlpoolPositions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAC5C,2CAIqB;AACrB,iDAAsD;AACtD,+CAG4B;AAE5B,mDAAgE;AAChE,qGAA6E;AAC7E,wFAAyF;AAEzF,iDAIwB;AAEX,QAAA,qBAAqB,GAAG,iBAAiB,CACpD,sBAAc,EACd,4BAA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AM,EAChB,iBAAiB,CAClB,CACF,CAAC;oBACJ,CAAC;gBACH,CAAC;gBAED,IAAI,cAAc,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;oBAChD,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,CACvC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAC7C,CAAC;oBACF,IAAI,iBAAiB,EAAE,CAAC;wBACtB,YAAY,CAAC,IAAI,CACf,IAAA,gCAAsB,EACpB,iBAAiB,CAAC,OAAO,EACzB,cAAc,CAAC,WAAW;6BACvB,SAAS,CAAC,SAAA,EAAE,EAAI,iBAAiB,CAAC,QAAQ,CAAA,CAAC;6BAC3C,QAAQ,EAAE,EACb,0BAAS,CAAC,MAAM,EAChB,iBAAiB,CAClB,CACF,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IACE,CAAC,WAAW;gBACZ,CAAC,WAAW;gBACZ,WAAW,CAAC,KAAK,KAAK,IAAI
|
1
|
+
{"version":3,"file":"getWhirlpoolPositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/orca/getWhirlpoolPositions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,6CAA4C;AAC5C,2CAIqB;AACrB,iDAAsD;AACtD,+CAG4B;AAE5B,mDAAgE;AAChE,qGAA6E;AAC7E,wFAAyF;AAEzF,iDAIwB;AAEX,QAAA,qBAAqB,GAAG,iBAAiB,CACpD,sBAAc,EACd,4BAAgB,CACjB,CAAC;AAEF,SAAgB,iBAAiB,CAC/B,UAAkB,EAClB,SAAoB;IAEpB,OAAO,CACL,KAAY,EACZ,IAAiC,EACJ,EAAE;QAC/B,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;QACjC,MAAM,uBAAuB,GAAgB,EAAE,CAAC;QAEhD,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,E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;gBACpB,KAAK,EAAE,UAAU;gBACjB,IAAI,EAAE;oBACJ,WAAW,EAAE;wBACX;4BACE,MAAM;4BACN,WAAW;4BACX,YAAY;4BACZ,iBAAiB;4BACjB,KAAK,EAAE,UAAU;4BACjB,MAAM,EAAE,EAAE;yBACX;qBACF;iBACF;gBACD,IAAI;aACL,CAAC,CAAC;QACL,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAA,CAAC;AACJ,CAAC;AA/PD,8CA+PC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
import { PublicKey } from '@solana/web3.js';
|
3
|
+
export declare const platformId = "spdr";
|
4
|
+
export declare const platform: Platform;
|
5
|
+
export declare const pid: PublicKey;
|
6
|
+
export declare const spdrMint = "AT79ReYU9XtHUTF5vM6Q4oa9K8w7918Fp5SU7G1MDMQY";
|
7
|
+
export declare const pool: PublicKey;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.pool = exports.spdrMint = exports.pid = exports.platform = exports.platformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
exports.platformId = 'spdr';
|
6
|
+
exports.platform = {
|
7
|
+
id: exports.platformId,
|
8
|
+
name: 'Spiderswap',
|
9
|
+
image: 'https://sonar.watch/img/platforms/spdr.webp',
|
10
|
+
website: 'https://www.spiderswap.io/staking',
|
11
|
+
twitter: 'https://twitter.com/spdrswap',
|
12
|
+
// defiLlamaId: 'spdr-finance', // from https://defillama.com/docs/api
|
13
|
+
};
|
14
|
+
exports.pid = new web3_js_1.PublicKey('GTavkffQHnDKDH36YNFpk7uxwHNseTRo24tV4HGC8MNY');
|
15
|
+
exports.spdrMint = 'AT79ReYU9XtHUTF5vM6Q4oa9K8w7918Fp5SU7G1MDMQY';
|
16
|
+
exports.pool = new web3_js_1.PublicKey('2hJQSpUvDy2Byhs2Mc3HAy7atKHHELfYfycbZBErpn1X');
|
17
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/spdr/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE/B,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,6CAA6C;IACpD,OAAO,EAAE,mCAAmC;IAC5C,OAAO,EAAE,8BAA8B;IACvC,sEAAsE;CACvE,CAAC;AAEW,QAAA,GAAG,GAAG,IAAI,mBAAS,CAC9B,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,8CAA8C,CAAC;AAC1D,QAAA,IAAI,GAAG,IAAI,mBAAS,CAC/B,8CAA8C,CAC/C,CAAC"}
|
@@ -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/spdr/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAAsD;AAEzC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,wBAAsB,CAAC,CAAC"}
|
@@ -0,0 +1,78 @@
|
|
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 constants_1 = require("./constants");
|
14
|
+
const clients_1 = require("../../utils/clients");
|
15
|
+
const solana_1 = require("../../utils/solana");
|
16
|
+
const structs_1 = require("./structs");
|
17
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
18
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
const connection = (0, clients_1.getClientSolana)();
|
20
|
+
const [stakeAccounts, stakeLockAccounts] = yield Promise.all([
|
21
|
+
(0, solana_1.getParsedProgramAccounts)(connection, structs_1.stakeStruct, constants_1.pid, [
|
22
|
+
{
|
23
|
+
dataSize: 233,
|
24
|
+
},
|
25
|
+
{
|
26
|
+
memcmp: {
|
27
|
+
bytes: owner,
|
28
|
+
offset: 8,
|
29
|
+
},
|
30
|
+
},
|
31
|
+
]),
|
32
|
+
(0, solana_1.getParsedProgramAccounts)(connection, structs_1.stakeLockedStruct, constants_1.pid, [
|
33
|
+
{
|
34
|
+
dataSize: 429,
|
35
|
+
},
|
36
|
+
{
|
37
|
+
memcmp: {
|
38
|
+
bytes: owner,
|
39
|
+
offset: 8,
|
40
|
+
},
|
41
|
+
},
|
42
|
+
]),
|
43
|
+
]);
|
44
|
+
if ([...stakeAccounts, ...stakeLockAccounts].length === 0)
|
45
|
+
return [];
|
46
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
47
|
+
const element = elementRegistry.addElementMultiple({
|
48
|
+
label: 'Staked',
|
49
|
+
});
|
50
|
+
stakeAccounts.forEach((acc) => {
|
51
|
+
element.addAsset({
|
52
|
+
address: constants_1.spdrMint,
|
53
|
+
amount: acc.depositAmount.minus(acc.multiplierAmount),
|
54
|
+
});
|
55
|
+
});
|
56
|
+
stakeLockAccounts.forEach((acc) => {
|
57
|
+
acc.stakeLock.forEach((stakeLock) => {
|
58
|
+
element.addAsset({
|
59
|
+
address: constants_1.spdrMint,
|
60
|
+
amount: stakeLock.depositAmount,
|
61
|
+
attributes: {
|
62
|
+
lockedUntil: stakeLock.startTime
|
63
|
+
.plus(stakeLock.servingPeriod)
|
64
|
+
.times(1000)
|
65
|
+
.toNumber(),
|
66
|
+
},
|
67
|
+
});
|
68
|
+
});
|
69
|
+
});
|
70
|
+
return elementRegistry.getElements(cache);
|
71
|
+
});
|
72
|
+
const fetcher = {
|
73
|
+
id: `${constants_1.platformId}-staking`,
|
74
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
75
|
+
executor,
|
76
|
+
};
|
77
|
+
exports.default = fetcher;
|
78
|
+
//# sourceMappingURL=stakingFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/spdr/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAEvD,2CAAwD;AAExD,iDAAsD;AACtD,+CAA8D;AAC9D,uCAA2D;AAC3D,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE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AAQ;gBACjB,MAAM,EAAE,SAAS,CAAC,aAAa;gBAC/B,UAAU,EAAE;oBACV,WAAW,EAAE,SAAS,CAAC,SAAS;yBAC7B,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;yBAC7B,KAAK,CAAC,IAAI,CAAC;yBACX,QAAQ,EAAE;iBACd;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,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,26 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export type Stake = {
|
6
|
+
buffer: Buffer;
|
7
|
+
authority: PublicKey;
|
8
|
+
depositAmount: BigNumber;
|
9
|
+
reward: BigNumber;
|
10
|
+
rewardDebt: BigNumber;
|
11
|
+
bump: Buffer;
|
12
|
+
multiplierAmount: BigNumber;
|
13
|
+
};
|
14
|
+
export declare const stakeStruct: BeetStruct<Stake, Partial<Stake>>;
|
15
|
+
export type StakeLock = {
|
16
|
+
depositAmount: BigNumber;
|
17
|
+
servingPeriod: BigNumber;
|
18
|
+
startTime: BigNumber;
|
19
|
+
};
|
20
|
+
export declare const stakeLockStruct: BeetStruct<StakeLock, Partial<StakeLock>>;
|
21
|
+
export type StakeLocked = {
|
22
|
+
buffer: Buffer;
|
23
|
+
authority: PublicKey;
|
24
|
+
stakeLock: StakeLock[];
|
25
|
+
};
|
26
|
+
export declare const stakeLockedStruct: FixableBeetStruct<StakeLocked, Partial<StakeLocked>>;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.stakeLockedStruct = exports.stakeLockStruct = exports.stakeStruct = 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.stakeStruct = new beet_1.BeetStruct([
|
8
|
+
['buffer', (0, solana_1.blob)(8)],
|
9
|
+
['authority', beet_solana_1.publicKey],
|
10
|
+
['depositAmount', solana_1.u128],
|
11
|
+
['reward', solana_1.u128],
|
12
|
+
['rewardDebt', solana_1.u128],
|
13
|
+
['bump', (0, solana_1.blob)(1)],
|
14
|
+
['multiplierAmount', solana_1.u128],
|
15
|
+
], (args) => args);
|
16
|
+
exports.stakeLockStruct = new beet_1.BeetStruct([
|
17
|
+
['depositAmount', solana_1.u128],
|
18
|
+
['servingPeriod', solana_1.i64],
|
19
|
+
['startTime', solana_1.i64],
|
20
|
+
], (args) => args);
|
21
|
+
exports.stakeLockedStruct = new beet_1.FixableBeetStruct([
|
22
|
+
['buffer', (0, solana_1.blob)(8)],
|
23
|
+
['authority', beet_solana_1.publicKey],
|
24
|
+
['stakeLock', (0, beet_1.array)(exports.stakeLockStruct)],
|
25
|
+
], (args) => args);
|
26
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/spdr/structs.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AACnC,kEAA6D;AAG7D,+CAAqD;AAYxC,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,eAAe,EAAE,aAAI,CAAC;IACvB,CAAC,QAAQ,EAAE,aAAI,CAAC;IAChB,CAAC,YAAY,EAAE,aAAI,CAAC;IACpB,CAAC,MAAM,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACjB,CAAC,kBAAkB,EAAE,aAAI,CAAC;CAC3B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC;AAQW,QAAA,eAAe,GAAG,IAAI,iBAAU,CAC3C;IACE,CAAC,eAAe,EAAE,aAAI,CAAC;IACvB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,WAAW,EAAE,YAAG,CAAC;CACnB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC;AAQW,QAAA,iBAAiB,GAAG,IAAI,wBAAiB,CACpD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,WAAW,EAAE,IAAA,YAAK,EAAC,uBAAe,CAAC,CAAC;CACtC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAmB,CAC9B,CAAC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { ID } from '../../utils/sui/structs/id';
|
3
|
+
export type Receipt = {
|
4
|
+
id: ID;
|
5
|
+
amountDeposited: string;
|
6
|
+
};
|
7
|
+
export type Pool = {
|
8
|
+
publickey: string;
|
9
|
+
buffer: Buffer;
|
10
|
+
authority: string;
|
11
|
+
poolMint: string;
|
12
|
+
poolTokenAccount: string;
|
13
|
+
rewardMint: string;
|
14
|
+
rewardTokenAccount: string;
|
15
|
+
rewardPerSecond: string;
|
16
|
+
startTime: string;
|
17
|
+
lastRewardTime: string;
|
18
|
+
accPerShare: string;
|
19
|
+
supply: string;
|
20
|
+
bump: number;
|
21
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/spdr/types.ts"],"names":[],"mappings":""}
|
@@ -6,13 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.fetchers = exports.platforms = void 0;
|
7
7
|
const constants_1 = require("./constants");
|
8
8
|
const bidsFetcher_1 = __importDefault(require("./bidsFetcher"));
|
9
|
-
const locksFetcher_1 = __importDefault(require("./locksFetcher"));
|
10
9
|
const airdropPowerUsersFetcher_1 = __importDefault(require("./airdropPowerUsersFetcher"));
|
11
10
|
const sharedEscrowFetcher_1 = __importDefault(require("./sharedEscrowFetcher"));
|
12
11
|
exports.platforms = [constants_1.platform];
|
13
12
|
exports.fetchers = [
|
14
13
|
bidsFetcher_1.default,
|
15
|
-
locksFetcher_1.default,
|
16
14
|
airdropPowerUsersFetcher_1.default,
|
17
15
|
sharedEscrowFetcher_1.default,
|
18
16
|
];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/index.ts"],"names":[],"mappings":";;;;;;AAIA,2CAAuC;AACvC,gEAAwC;AACxC,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/index.ts"],"names":[],"mappings":";;;;;;AAIA,2CAAuC;AACvC,gEAAwC;AACxC,0FAAiE;AACjE,gFAAwD;AAE3C,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,QAAQ,GAAc;IACjC,qBAAW;IACX,kCAAuB;IACvB,6BAAmB;CACpB,CAAC"}
|
@@ -1,62 +0,0 @@
|
|
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 solana_1 = require("../../utils/solana");
|
19
|
-
const struct_1 = require("./struct");
|
20
|
-
const filters_1 = require("./filters");
|
21
|
-
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
|
-
const getTokensPricesMap_1 = __importDefault(require("../../utils/misc/getTokensPricesMap"));
|
23
|
-
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
|
-
const client = (0, clients_1.getClientSolana)();
|
25
|
-
const locksAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, struct_1.orderStateLockStruct, constants_1.locksPid, (0, filters_1.locksFilter)(owner));
|
26
|
-
const tokenPricesById = yield (0, getTokensPricesMap_1.default)([portfolio_core_1.solanaNativeAddress, solana_1.usdcSolanaMint], portfolio_core_1.NetworkId.solana, cache);
|
27
|
-
let solAmount = 0;
|
28
|
-
let usdcAmount = 0;
|
29
|
-
const assets = [];
|
30
|
-
for (const account of locksAccounts) {
|
31
|
-
if (account.currency.toString() !== solana_1.usdcSolanaMint) {
|
32
|
-
solAmount += account.price.dividedBy(Math.pow(10, 9)).toNumber();
|
33
|
-
}
|
34
|
-
else {
|
35
|
-
usdcAmount += account.price.dividedBy(Math.pow(10, 6)).toNumber();
|
36
|
-
}
|
37
|
-
}
|
38
|
-
if (usdcAmount)
|
39
|
-
assets.push((0, tokenPriceToAssetToken_1.default)(solana_1.usdcSolanaMint, usdcAmount, portfolio_core_1.NetworkId.solana, tokenPricesById.get(solana_1.usdcSolanaMint)));
|
40
|
-
if (solAmount)
|
41
|
-
assets.push((0, tokenPriceToAssetToken_1.default)(portfolio_core_1.solanaNativeAddress, solAmount, portfolio_core_1.NetworkId.solana, tokenPricesById.get(portfolio_core_1.solanaNativeAddress)));
|
42
|
-
if (assets.length === 0)
|
43
|
-
return [];
|
44
|
-
return [
|
45
|
-
{
|
46
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
47
|
-
platformId: constants_1.platformId,
|
48
|
-
type: portfolio_core_1.PortfolioElementType.multiple,
|
49
|
-
label: 'Deposit',
|
50
|
-
name: 'Locks',
|
51
|
-
data: { assets },
|
52
|
-
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
|
53
|
-
},
|
54
|
-
];
|
55
|
-
});
|
56
|
-
const fetcher = {
|
57
|
-
id: `${constants_1.platformId}-locks`,
|
58
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
59
|
-
executor,
|
60
|
-
};
|
61
|
-
exports.default = fetcher;
|
62
|
-
//# sourceMappingURL=locksFetcher.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"locksFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/locksFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AAGpC,2CAAmD;AACnD,iDAAsD;AACtD,+CAA8E;AAC9E,qCAAgD;AAChD,uCAAwC;AACxC,qGAA6E;AAC7E,6FAAoE;AAEpE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,aAAa,GAAG,MAAM,IAAA,iCAAwB,EAClD,MAAM,EACN,6BAAoB,EACpB,oBAAQ,EACR,IAAA,qBAAW,EAAC,KA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