@sonarwatch/portfolio-plugins 0.12.157 → 0.12.159

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { BeetStruct } from '@metaplex-foundation/beet';
2
+ import { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
3
3
  import BigNumber from 'bignumber.js';
4
4
  import { PublicKey } from '@solana/web3.js';
5
5
  export type PositionRewardInfo = {
@@ -24,7 +24,7 @@ export type PersonalPositionState = {
24
24
  };
25
25
  export declare const personalPositionStateStruct: BeetStruct<PersonalPositionState, Partial<PersonalPositionState>>;
26
26
  export type RewardInfo = {
27
- rewardState: Buffer;
27
+ rewardState: number;
28
28
  openTime: BigNumber;
29
29
  endTime: BigNumber;
30
30
  lastUpdateTime: BigNumber;
@@ -78,3 +78,24 @@ export type PoolState = {
78
78
  padding2: BigNumber[];
79
79
  };
80
80
  export declare const poolStateStruct: BeetStruct<PoolState, Partial<PoolState>>;
81
+ export type TickState = {
82
+ tick: number;
83
+ liquidityNet: BigNumber;
84
+ liquidityGross: BigNumber;
85
+ feeGrowthOutsideX64A: BigNumber;
86
+ feeGrowthOutsideX64B: BigNumber;
87
+ rewardGrowthsOutsideX640: BigNumber;
88
+ rewardGrowthsOutsideX641: BigNumber;
89
+ rewardGrowthsOutsideX642: BigNumber;
90
+ padding: number[];
91
+ };
92
+ export declare const tickStatetruct: BeetStruct<TickState, Partial<TickState>>;
93
+ export type TickArrayState = {
94
+ buffer: Buffer;
95
+ poolId: PublicKey;
96
+ startTickIndex: number;
97
+ ticks: TickState[];
98
+ initializedTickCount: number;
99
+ padding: number[];
100
+ };
101
+ export declare const tickArrayStatetruct: FixableBeetStruct<TickArrayState, Partial<TickArrayState>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.poolStateStruct = exports.rewardInfoStruct = exports.personalPositionStateStruct = exports.positionRewardInfoStruct = void 0;
3
+ exports.tickArrayStatetruct = exports.tickStatetruct = exports.poolStateStruct = exports.rewardInfoStruct = exports.personalPositionStateStruct = exports.positionRewardInfoStruct = void 0;
4
4
  const beet_1 = require("@metaplex-foundation/beet");
5
5
  const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
6
  const solana_1 = require("../../../utils/solana");
@@ -24,7 +24,7 @@ exports.personalPositionStateStruct = new beet_1.BeetStruct([
24
24
  ['padding', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 8)],
25
25
  ], (args) => args);
26
26
  exports.rewardInfoStruct = new beet_1.BeetStruct([
27
- ['rewardState', (0, solana_1.blob)(8)],
27
+ ['rewardState', beet_1.u8],
28
28
  ['openTime', solana_1.u64],
29
29
  ['endTime', solana_1.u64],
30
30
  ['lastUpdateTime', solana_1.u64],
@@ -76,4 +76,23 @@ exports.poolStateStruct = new beet_1.BeetStruct([
76
76
  ['padding1', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 26)],
77
77
  ['padding2', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 32)],
78
78
  ], (args) => args);
79
+ exports.tickStatetruct = new beet_1.BeetStruct([
80
+ ['tick', beet_1.i32],
81
+ ['liquidityNet', solana_1.i128],
82
+ ['liquidityGross', solana_1.u128],
83
+ ['feeGrowthOutsideX64A', solana_1.u128],
84
+ ['feeGrowthOutsideX64B', solana_1.u128],
85
+ ['rewardGrowthsOutsideX640', solana_1.u128],
86
+ ['rewardGrowthsOutsideX641', solana_1.u128],
87
+ ['rewardGrowthsOutsideX642', solana_1.u128],
88
+ ['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u32, 13)],
89
+ ], (args) => args);
90
+ exports.tickArrayStatetruct = new beet_1.FixableBeetStruct([
91
+ ['buffer', (0, solana_1.blob)(8)],
92
+ ['poolId', beet_solana_1.publicKey],
93
+ ['startTickIndex', beet_1.i32],
94
+ ['ticks', (0, beet_1.uniformFixedSizeArray)(exports.tickStatetruct, 60)],
95
+ ['initializedTickCount', beet_1.u8],
96
+ ['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 115)],
97
+ ], (args) => args);
79
98
  //# sourceMappingURL=clmms.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clmms.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/raydium/structs/clmms.ts"],"names":[],"mappings":";;;AAAA,oDAMmC;AACnC,kEAA6D;AAG7D,kDAAwD;AAO3C,QAAA,wBAAwB,GAAG,IAAI,iBAAU,CACpD;IACE,CAAC,qBAAqB,EAAE,aAAI,CAAC;IAC7B,CAAC,kBAAkB,EAAE,YAAG,CAAC;CAC1B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAA0B,CACrC,CAAC;AAkBW,QAAA,2BAA2B,GACtC,IAAI,iBAAU,CACZ;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,gBAAgB,EAAE,UAAG,CAAC;IACvB,CAAC,gBAAgB,EAAE,UAAG,CAAC;IACvB,CAAC,WAAW,EAAE,aAAI,CAAC;IACnB,CAAC,yBAAyB,EAAE,aAAI,CAAC;IACjC,CAAC,yBAAyB,EAAE,aAAI,CAAC;IACjC,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,aAAa,EAAE,IAAA,4BAAqB,EAAC,gCAAwB,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,YAAG,EAAE,CAAC,CAAC,CAAC;CAC3C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAA6B,CACxC,CAAC;AAgBS,QAAA,gBAAgB,GAAG,IAAI,iBAAU,CAC5C;IACE,CAAC,aAAa,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;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IACrB,CAAC,gBAAgB,EAAE,UAAG,CAAC;IACvB,CAAC,OAAO,EAAE,IAAA,4BAAqB,EAAC,sBAAc,EAAE,EAAE,CAAC,CAAC;IACpD,CAAC,sBAAsB,EAAE,SAAE,CAAC;IAC5B,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,GAAG,CAAC,CAAC;CAC5C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAsB,CACjC,CAAC"}
@@ -2,6 +2,8 @@ import { GetProgramAccountsFilter, PublicKey } from '@solana/web3.js';
2
2
  import { BeetStruct } from '@metaplex-foundation/beet';
3
3
  import { TokenPrice, Yield } from '@sonarwatch/portfolio-core';
4
4
  import BigNumber from 'bignumber.js';
5
+ import BN from 'bn.js';
6
+ import Decimal from 'decimal.js';
5
7
  import { AmmInfoV4, AmmInfoV5 } from './structs/amms';
6
8
  import { FarmAccount, FarmAccountV6, UserFarmAccountV3, UserFarmAccountV31, UserFarmAccountV4, UserFarmAccountV5 } from './structs/farms';
7
9
  import { ParsedAccount } from '../../utils/solana';
@@ -53,3 +55,126 @@ export type FarmInfoV6 = {
53
55
  rewardTokens: (TokenPrice | undefined)[];
54
56
  yields?: Yield[];
55
57
  };
58
+ export interface ClmmPoolRewardInfo {
59
+ rewardState: number;
60
+ openTime: BN;
61
+ endTime: BN;
62
+ lastUpdateTime: BN;
63
+ emissionsPerSecondX64: BN;
64
+ rewardTotalEmissioned: BN;
65
+ rewardClaimed: BN;
66
+ tokenMint: PublicKey;
67
+ tokenVault: PublicKey;
68
+ creator: PublicKey;
69
+ rewardGrowthGlobalX64: BN;
70
+ perSecond: Decimal;
71
+ remainingRewards: undefined | BN;
72
+ tokenProgramId: PublicKey;
73
+ }
74
+ export interface ClmmPoolInfo {
75
+ id: PublicKey;
76
+ mintA: {
77
+ programId: PublicKey;
78
+ mint: PublicKey;
79
+ vault: PublicKey;
80
+ decimals: number;
81
+ };
82
+ mintB: {
83
+ programId: PublicKey;
84
+ mint: PublicKey;
85
+ vault: PublicKey;
86
+ decimals: number;
87
+ };
88
+ ammConfig: ClmmConfigInfo;
89
+ observationId: PublicKey;
90
+ creator: PublicKey;
91
+ programId: PublicKey;
92
+ version: 6;
93
+ tickSpacing: number;
94
+ liquidity: BN;
95
+ sqrtPriceX64: BN;
96
+ currentPrice: Decimal;
97
+ tickCurrent: number;
98
+ feeGrowthGlobalX64A: BN;
99
+ feeGrowthGlobalX64B: BN;
100
+ protocolFeesTokenA: BN;
101
+ protocolFeesTokenB: BN;
102
+ swapInAmountTokenA: BN;
103
+ swapOutAmountTokenB: BN;
104
+ swapInAmountTokenB: BN;
105
+ swapOutAmountTokenA: BN;
106
+ tickArrayBitmap: BN[];
107
+ rewardInfos: ClmmPoolRewardInfo[];
108
+ day: {
109
+ volume: number;
110
+ volumeFee: number;
111
+ feeA: number;
112
+ feeB: number;
113
+ feeApr: number;
114
+ rewardApr: {
115
+ A: number;
116
+ B: number;
117
+ C: number;
118
+ };
119
+ apr: number;
120
+ priceMin: number;
121
+ priceMax: number;
122
+ };
123
+ week: {
124
+ volume: number;
125
+ volumeFee: number;
126
+ feeA: number;
127
+ feeB: number;
128
+ feeApr: number;
129
+ rewardApr: {
130
+ A: number;
131
+ B: number;
132
+ C: number;
133
+ };
134
+ apr: number;
135
+ priceMin: number;
136
+ priceMax: number;
137
+ };
138
+ month: {
139
+ volume: number;
140
+ volumeFee: number;
141
+ feeA: number;
142
+ feeB: number;
143
+ feeApr: number;
144
+ rewardApr: {
145
+ A: number;
146
+ B: number;
147
+ C: number;
148
+ };
149
+ apr: number;
150
+ priceMin: number;
151
+ priceMax: number;
152
+ };
153
+ tvl: number;
154
+ lookupTableAccount: PublicKey;
155
+ startTime: number;
156
+ exBitmapInfo: TickArrayBitmapExtensionType;
157
+ }
158
+ export interface ClmmConfigInfo {
159
+ id: PublicKey;
160
+ index: number;
161
+ protocolFeeRate: number;
162
+ tradeFeeRate: number;
163
+ tickSpacing: number;
164
+ fundFeeRate: number;
165
+ fundOwner: string;
166
+ description: string;
167
+ }
168
+ export interface TickArrayBitmapExtensionType {
169
+ poolId: PublicKey;
170
+ positiveTickArrayBitmap: BN[][];
171
+ negativeTickArrayBitmap: BN[][];
172
+ }
173
+ export type Tick = {
174
+ tick: number;
175
+ liquidityNet: BN;
176
+ liquidityGross: BN;
177
+ feeGrowthOutsideX64A: BN;
178
+ feeGrowthOutsideX64B: BN;
179
+ rewardGrowthsOutsideX64: BN[];
180
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/types.ts"],"names":[],"mappings":";;;AAeA,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,+EAAa,CAAA;IACb,2EAAW,CAAA;IACX,qEAAQ,CAAA;IACR,2FAAmB,CAAA;IACnB,+EAAa,CAAA;IACb,uEAAS,CAAA;IACT,6DAAI,CAAA;IACJ,mFAAe,CAAA;AACjB,CAAC,EATW,mBAAmB,mCAAnB,mBAAmB,QAS9B"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/types.ts"],"names":[],"mappings":";;;AAiBA,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,+EAAa,CAAA;IACb,2EAAW,CAAA;IACX,qEAAQ,CAAA;IACR,2FAAmB,CAAA;IACnB,+EAAa,CAAA;IACb,uEAAS,CAAA;IACT,6DAAI,CAAA;IACJ,mFAAe,CAAA;AACjB,CAAC,EATW,mBAAmB,mCAAnB,mBAAmB,QAS9B"}
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
54
54
  }
55
55
  function getV3PairsAddresses(url, length = 300) {
56
56
  return __awaiter(this, void 0, void 0, function* () {
57
- const query = (0, graphql_request_1.gql) `
58
- {
59
- pools(
60
- orderBy: totalValueLockedUSD
61
- first: ${length}
62
- orderDirection: desc
63
- where: { volumeUSD_not: "0", liquidity_not: "0" }
64
- ) {
65
- id
66
- token0Price
67
- token1Price
68
- liquidity
69
- token0 {
70
- id
71
- totalSupply
72
- decimals
73
- }
74
- token1 {
75
- id
76
- totalSupply
77
- decimals
78
- }
79
- }
80
- }
57
+ const query = (0, graphql_request_1.gql) `
58
+ {
59
+ pools(
60
+ orderBy: totalValueLockedUSD
61
+ first: ${length}
62
+ orderDirection: desc
63
+ where: { volumeUSD_not: "0", liquidity_not: "0" }
64
+ ) {
65
+ id
66
+ token0Price
67
+ token1Price
68
+ liquidity
69
+ token0 {
70
+ id
71
+ totalSupply
72
+ decimals
73
+ }
74
+ token1 {
75
+ id
76
+ totalSupply
77
+ decimals
78
+ }
79
+ }
80
+ }
81
81
  `;
82
82
  const res = yield (0, graphql_request_1.default)(url, query);
83
83
  const pools = res.pools;
@@ -40,28 +40,28 @@ function getPairKey(version) {
40
40
  exports.getPairKey = getPairKey;
41
41
  function getPairsV2FromTheGraph(url, length = 300) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
- const query = (0, graphql_request_1.gql) `
44
- {
45
- pairs(
46
- orderBy: reserveUSD
47
- first: ${length}
48
- orderDirection: desc
49
- where: { trackedReserveETH_not: "0" }
50
- ) {
51
- id
52
- reserve0
53
- reserve1
54
- totalSupply
55
- token0 {
56
- id
57
- decimals
58
- }
59
- token1 {
60
- id
61
- decimals
62
- }
63
- }
64
- }
43
+ const query = (0, graphql_request_1.gql) `
44
+ {
45
+ pairs(
46
+ orderBy: reserveUSD
47
+ first: ${length}
48
+ orderDirection: desc
49
+ where: { trackedReserveETH_not: "0" }
50
+ ) {
51
+ id
52
+ reserve0
53
+ reserve1
54
+ totalSupply
55
+ token0 {
56
+ id
57
+ decimals
58
+ }
59
+ token1 {
60
+ id
61
+ decimals
62
+ }
63
+ }
64
+ }
65
65
  `;
66
66
  const res = yield (0, graphql_request_1.default)(url, query);
67
67
  const pairs = res.pairs;
@@ -42,20 +42,20 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
42
42
  const clients_1 = require("../../utils/clients");
43
43
  const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
44
44
  const helpers_1 = require("./helpers");
45
- const query = (0, graphql_request_1.gql) `
46
- query GetAirdropFinalFrontend($authority: String!) {
47
- getAirdropFinalFrontend(authority: $authority) {
48
- authority
49
- community_allocation
50
- eligibility
51
- main_allocation
52
- og_allocation
53
- s1_allocation
54
- s2_allocation
55
- total_allocation
56
- __typename
57
- }
58
- }
45
+ const query = (0, graphql_request_1.gql) `
46
+ query GetAirdropFinalFrontend($authority: String!) {
47
+ getAirdropFinalFrontend(authority: $authority) {
48
+ authority
49
+ community_allocation
50
+ eligibility
51
+ main_allocation
52
+ og_allocation
53
+ s1_allocation
54
+ s2_allocation
55
+ total_allocation
56
+ __typename
57
+ }
58
+ }
59
59
  `;
60
60
  const networkId = portfolio_core_1.NetworkId.solana;
61
61
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
@@ -1,3 +1,3 @@
1
1
  import BN from 'bn.js';
2
2
  import BigNumber from 'bignumber.js';
3
- export declare const toBN: (n: number | BN | BigNumber) => BN;
3
+ export declare const toBN: (n: number | string | BN | BigNumber) => BN;
@@ -10,13 +10,16 @@ const toBN = (n) => {
10
10
  if (typeof n === 'number') {
11
11
  return new bn_js_1.default(n);
12
12
  }
13
+ if (typeof n === 'string') {
14
+ return new bn_js_1.default(new bignumber_js_1.default(n).toFixed(0));
15
+ }
13
16
  if (n instanceof bn_js_1.default) {
14
17
  return n;
15
18
  }
16
19
  if (n instanceof bignumber_js_1.default) {
17
20
  return new bn_js_1.default(n.toFixed(0)); // Convert BigNumber to a string without decimals
18
21
  }
19
- throw new Error('Unsupported type for conversion to BN');
22
+ throw new Error(`Unsupported type for conversion to BN (${typeof n}) ${n}`);
20
23
  };
21
24
  exports.toBN = toBN;
22
25
  //# sourceMappingURL=toBN.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toBN.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/toBN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CAAC,0CAA0C,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC9E,CAAC,CAAC;AAdW,QAAA,IAAI,QAcf"}
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
4
- exports.infoQueryMsg = JSON.parse(`{
5
- "info": {}
4
+ exports.infoQueryMsg = JSON.parse(`{
5
+ "info": {}
6
6
  }`);
7
- exports.tokenInfoQueryMsg = JSON.parse(`{
8
- "token_info": {}
7
+ exports.tokenInfoQueryMsg = JSON.parse(`{
8
+ "token_info": {}
9
9
  }`);
10
- exports.minterQueryMsg = JSON.parse(`{
11
- "minter": {}
10
+ exports.minterQueryMsg = JSON.parse(`{
11
+ "minter": {}
12
12
  }`);
13
- exports.poolQueryMsg = JSON.parse(`{
14
- "pool": {}
13
+ exports.poolQueryMsg = JSON.parse(`{
14
+ "pool": {}
15
15
  }`);
16
16
  //# sourceMappingURL=constants.js.map
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  function getQueryBalanceByOwner(owner) {
4
- return JSON.parse(`{
5
- "balance": {
6
- "address": "${owner}"
7
- }
4
+ return JSON.parse(`{
5
+ "balance": {
6
+ "address": "${owner}"
7
+ }
8
8
  }`);
9
9
  }
10
10
  exports.default = getQueryBalanceByOwner;