@sonarwatch/portfolio-plugins 0.11.221 → 0.11.223

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +2 -2
  3. package/src/index.js +4 -0
  4. package/src/index.js.map +1 -1
  5. package/src/plugins/hedgehog/ammJob.js +72 -26
  6. package/src/plugins/hedgehog/ammJob.js.map +1 -1
  7. package/src/plugins/hedgehog/constants.d.ts +2 -0
  8. package/src/plugins/hedgehog/constants.js +3 -1
  9. package/src/plugins/hedgehog/constants.js.map +1 -1
  10. package/src/plugins/hedgehog/structs.d.ts +37 -4
  11. package/src/plugins/hedgehog/structs.js +37 -6
  12. package/src/plugins/hedgehog/structs.js.map +1 -1
  13. package/src/plugins/whalesmarket/constants.d.ts +5 -0
  14. package/src/plugins/whalesmarket/constants.js +15 -0
  15. package/src/plugins/whalesmarket/constants.js.map +1 -0
  16. package/src/plugins/whalesmarket/depositFetcher.d.ts +3 -0
  17. package/src/plugins/whalesmarket/depositFetcher.js +81 -0
  18. package/src/plugins/whalesmarket/depositFetcher.js.map +1 -0
  19. package/src/plugins/whalesmarket/filters.d.ts +10 -0
  20. package/src/plugins/whalesmarket/filters.js +16 -0
  21. package/src/plugins/whalesmarket/filters.js.map +1 -0
  22. package/src/plugins/whalesmarket/index.d.ts +6 -0
  23. package/src/plugins/whalesmarket/index.js +12 -0
  24. package/src/plugins/whalesmarket/index.js.map +1 -0
  25. package/src/plugins/whalesmarket/structs.d.ts +58 -0
  26. package/src/plugins/whalesmarket/structs.js +61 -0
  27. package/src/plugins/whalesmarket/structs.js.map +1 -0
  28. package/src/plugins/x-staking-solana/constants.d.ts +0 -2
  29. package/src/plugins/x-staking-solana/constants.js +3 -11
  30. package/src/plugins/x-staking-solana/constants.js.map +1 -1
  31. package/src/plugins/x-staking-solana/index.js +1 -4
  32. package/src/plugins/x-staking-solana/index.js.map +1 -1
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.11.223](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.222...plugins-0.11.223) (2024-05-29)
6
+
7
+
8
+
9
+ ## [0.11.222](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.221...plugins-0.11.222) (2024-05-28)
10
+
11
+
12
+
5
13
  ## [0.11.221](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.220...plugins-0.11.221) (2024-05-28)
6
14
 
7
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.11.221",
3
+ "version": "0.11.223",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "dependencies": {
@@ -42,7 +42,7 @@
42
42
  "web3-v1": "npm:web3@^1.5.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@sonarwatch/portfolio-core": "0.11.221"
45
+ "@sonarwatch/portfolio-core": "0.11.223"
46
46
  },
47
47
  "main": "./src/index.js",
48
48
  "types": "./src/index.d.ts"
package/src/index.js CHANGED
@@ -115,6 +115,7 @@ const mole_1 = require("./plugins/mole");
115
115
  const bonfida_1 = require("./plugins/bonfida");
116
116
  const cropper_1 = require("./plugins/cropper");
117
117
  const hedgehog_1 = require("./plugins/hedgehog");
118
+ const whalesmarket_1 = require("./plugins/whalesmarket");
118
119
  var constants_1 = require("./plugins/tokens/constants");
119
120
  Object.defineProperty(exports, "walletTokensPlatform", { enumerable: true, get: function () { return constants_1.walletTokensPlatform; } });
120
121
  Object.defineProperty(exports, "walletNftsPlatform", { enumerable: true, get: function () { return constants_1.walletNftsPlatform; } });
@@ -223,6 +224,7 @@ exports.platforms = [
223
224
  ...bonfida_1.platforms,
224
225
  ...cropper_1.platforms,
225
226
  ...hedgehog_1.platforms,
227
+ ...whalesmarket_1.platforms,
226
228
  ];
227
229
  // JOBS //
228
230
  exports.jobs = [
@@ -314,6 +316,7 @@ exports.jobs = [
314
316
  ...bonfida_1.jobs,
315
317
  ...cropper_1.jobs,
316
318
  ...hedgehog_1.jobs,
319
+ ...whalesmarket_1.jobs,
317
320
  ];
318
321
  // FETCHERS //
319
322
  exports.fetchers = [
@@ -407,6 +410,7 @@ exports.fetchers = [
407
410
  ...bonfida_1.fetchers,
408
411
  ...cropper_1.fetchers,
409
412
  ...hedgehog_1.fetchers,
413
+ ...whalesmarket_1.fetchers,
410
414
  ];
411
415
  exports.fetchersByAddressSystem = (0, getFetchersByAddressSystem_1.getFetchersByAddressSystem)(exports.fetchers);
412
416
  exports.airdropFetchers = [
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAIA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,uDAAgE;AAChE,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+CAI2B;AAC3B,yCAIwB;AACxB,+CAI2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAKyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEAIsC;AACtC,uDAI+B;AAC/B,mDAI6B;AAC7B,qDAG8B;AAC9B,uDAG+B;AAC/B,2CAIyB;AACzB,6CAI0B;AAC1B,6CAG0B;AAC1B,yCAIwB;AACxB,+CAI2B;AAC3B,uDAG+B;AAC/B,yCAGwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,6CAI0B;AAC1B,+CAI2B;AAC3B,qDAG8B;AAC9B,iDAI4B;AAC5B,iDAI4B;AAC5B,mDAG6B;AAC7B,yCAIwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,+CAI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,GAAG,kBAAe;IAClB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,uBAAoB;CACxB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC;AAE/D,QAAA,eAAe,GAAqB;IAC/C,sBAAmB;IACnB,sBAAmB;CACpB,CAAC;AACW,QAAA,8BAA8B,GACzC,IAAA,uDAA0B,EAAC,uBAAe,CAAC,CAAC"}
@@ -16,6 +16,9 @@ const solana_1 = require("../../utils/solana");
16
16
  const structs_1 = require("./structs");
17
17
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
18
18
  const client = (0, clients_1.getClientSolana)();
19
+ const usdcTokenPrice = yield cache.getTokenPrice(constants_1.usdcMint, portfolio_core_1.NetworkId.solana);
20
+ if (!usdcTokenPrice)
21
+ return;
19
22
  const accounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.swapStruct, constants_1.ammPid, [
20
23
  {
21
24
  dataSize: structs_1.swapStruct.byteSize,
@@ -23,8 +26,20 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
23
26
  ]);
24
27
  if (accounts.length === 0)
25
28
  return;
29
+ // Markets
30
+ const marketAddresses = accounts.map((a) => a.market);
31
+ const marketAccounts = (yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.marketStruct, marketAddresses)).filter((a) => a !== null);
32
+ const marketAccountsMap = new Map();
33
+ marketAccounts.forEach((a) => {
34
+ marketAccountsMap.set(a.pubkey.toString(), a);
35
+ });
36
+ // Token Swap
26
37
  const tokenSwapAddresses = accounts.map((a) => a.underlyingSwap);
27
38
  const tokenSwapAccounts = (yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.tokenSwapStruct, tokenSwapAddresses)).filter((a) => a !== null);
39
+ const tokenSwapAccountsMap = new Map();
40
+ tokenSwapAccounts.forEach((a) => {
41
+ tokenSwapAccountsMap.set(a.pubkey.toString(), a);
42
+ });
28
43
  // Token accounts
29
44
  const tokenAccountAddresses = tokenSwapAccounts
30
45
  .map((a) => [a.tokenAccountA, a.tokenAccountB])
@@ -47,41 +62,51 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
47
62
  return;
48
63
  mintAccountsMap.set(a.pubkey.toString(), a);
49
64
  });
50
- const tokenPrices = yield cache.getTokenPricesAsMap(tokenSwapAccounts.map((a) => a.tokenPool.toString()), portfolio_core_1.NetworkId.solana);
51
65
  const sources = [];
52
- for (let i = 0; i < tokenSwapAccounts.length; i++) {
53
- const acc = tokenSwapAccounts[i];
54
- const poolMint = mintAccountsMap.get(acc.tokenPool.toString());
66
+ for (let i = 0; i < accounts.length; i++) {
67
+ const acc = accounts[i];
68
+ const tsAcc = tokenSwapAccountsMap.get(acc.underlyingSwap.toString());
69
+ const marketAcc = marketAccountsMap.get(acc.market.toString());
70
+ if (!marketAcc || !tsAcc)
71
+ continue;
72
+ const poolMint = mintAccountsMap.get(tsAcc.tokenPool.toString());
55
73
  if (!poolMint)
56
74
  continue;
57
- const mintA = mintAccountsMap.get(acc.mintA.toString());
58
- const mintB = mintAccountsMap.get(acc.mintB.toString());
75
+ const mintA = mintAccountsMap.get(tsAcc.mintA.toString());
76
+ const mintB = mintAccountsMap.get(tsAcc.mintB.toString());
59
77
  if (!mintA || !mintB)
60
78
  continue;
61
- const tokenAccountA = tokenAccountsMap.get(acc.tokenAccountA.toString());
62
- const tokenAccountB = tokenAccountsMap.get(acc.tokenAccountB.toString());
79
+ const tokenAccountA = tokenAccountsMap.get(tsAcc.tokenAccountA.toString());
80
+ const tokenAccountB = tokenAccountsMap.get(tsAcc.tokenAccountB.toString());
63
81
  if (!tokenAccountA || !tokenAccountB)
64
82
  continue;
65
83
  if (tokenAccountA.amount.isZero())
66
84
  continue;
67
85
  if (tokenAccountB.amount.isZero())
68
86
  continue;
69
- const tokenPrice = tokenPrices.get(acc.tokenPool.toString());
70
- if (!tokenPrice)
71
- continue;
72
- const totalAmount = tokenAccountA.amount.plus(tokenAccountB.amount);
73
- const priceA = totalAmount
74
- .plus(tokenAccountA.amount)
75
- .div(totalAmount)
76
- .minus(1)
77
- .times(tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.price)
87
+ let shareA = tokenAccountB.amount
88
+ .div(tokenAccountA.amount.plus(tokenAccountB.amount))
89
+ .times(usdcTokenPrice.price)
78
90
  .toNumber();
79
- const priceB = totalAmount
80
- .plus(tokenAccountB.amount)
81
- .div(totalAmount)
82
- .minus(1)
83
- .times(tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.price)
91
+ let shareB = tokenAccountA.amount
92
+ .div(tokenAccountA.amount.plus(tokenAccountB.amount))
93
+ .times(usdcTokenPrice.price)
84
94
  .toNumber();
95
+ if (marketAcc.outcome === structs_1.Outcome.Yes) {
96
+ shareA = 1;
97
+ shareB = 0;
98
+ }
99
+ if (marketAcc.outcome === structs_1.Outcome.No) {
100
+ shareA = 0;
101
+ shareB = 1;
102
+ }
103
+ if (marketAcc.outcome === structs_1.Outcome.Invalid) {
104
+ shareA = 0.5;
105
+ shareB = 0.5;
106
+ }
107
+ const liquidityNameA = mintA.pubkey.toString() === marketAcc.yesToken.toString()
108
+ ? 'Bet - YES'
109
+ : 'Bet - NO';
85
110
  const sourceA = {
86
111
  address: mintA.pubkey.toString(),
87
112
  decimals: mintA.decimals,
@@ -90,10 +115,22 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
90
115
  platformId: constants_1.platformId,
91
116
  timestamp: Date.now(),
92
117
  elementName: 'Hedgehog AMM',
93
- liquidityName: 'Bet - YES',
118
+ liquidityName: liquidityNameA,
94
119
  weight: 1,
95
- price: priceA,
120
+ price: shareA * usdcTokenPrice.price,
121
+ underlyings: [
122
+ {
123
+ address: constants_1.usdcMint,
124
+ amountPerLp: shareA,
125
+ decimals: constants_1.usdcDecimals,
126
+ networkId: portfolio_core_1.NetworkId.solana,
127
+ price: usdcTokenPrice.price,
128
+ },
129
+ ],
96
130
  };
131
+ const liquidityNameB = mintB.pubkey.toString() === marketAcc.yesToken.toString()
132
+ ? 'Bet - YES'
133
+ : 'Bet - NO';
97
134
  const sourceB = {
98
135
  address: mintB.pubkey.toString(),
99
136
  decimals: mintB.decimals,
@@ -102,9 +139,18 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
102
139
  platformId: constants_1.platformId,
103
140
  timestamp: Date.now(),
104
141
  elementName: 'Hedgehog AMM',
105
- liquidityName: 'Bet - YES',
142
+ liquidityName: liquidityNameB,
106
143
  weight: 1,
107
- price: priceB,
144
+ price: shareB * usdcTokenPrice.price,
145
+ underlyings: [
146
+ {
147
+ address: constants_1.usdcMint,
148
+ amountPerLp: shareB,
149
+ decimals: constants_1.usdcDecimals,
150
+ networkId: portfolio_core_1.NetworkId.solana,
151
+ price: usdcTokenPrice.price,
152
+ },
153
+ ],
108
154
  };
109
155
  sources.push(sourceA, sourceB);
110
156
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ammJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/ammJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AAGzE,2CAAiD;AACjD,iDAAsD;AACtD,+CAQ4B;AAC5B,uCAAmE;AAEnE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAAC,MAAM,EAAE,oBAAU,EAAE,kBAAM,EAAE;QAC1E;YACE,QAAQ,EAAE,oBAAU,CAAC,QAAQ;SAC9B;KACF,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAClC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IACjE,MAAM,iBAAiB,GAAG,CACxB,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ChC,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,EAAE,EAAE,sBAAU;YACd,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,WAAW,EAAE,cAAc;YAC3B,aAAa,EAAE,cAAc;YAC7B,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,MAAM,GAAG,cAAc,CAAC,KAAK;YACpC,WAAW,EAAE;gBACX;oBACE,OAAO,EAAE,oBAAQ;oBACjB,WAAW,EAAE,MAAM;oBACnB,QAAQ,EAAE,wBAAY;oBACtB,SAAS,EAAE,0BAAS,CAAC,MAAM;oBAC3B,KAAK,EAAE,cAAc,CAAC,KAAK;iBAC5B;aACF;SACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,MAAM;IACvB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -4,3 +4,5 @@ export declare const platformId = "hedgehog";
4
4
  export declare const platform: Platform;
5
5
  export declare const ammPid: PublicKey;
6
6
  export declare const swapPid: PublicKey;
7
+ export declare const usdcMint = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
8
+ export declare const usdcDecimals = 6;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.swapPid = exports.ammPid = exports.platform = exports.platformId = void 0;
3
+ exports.usdcDecimals = exports.usdcMint = exports.swapPid = exports.ammPid = exports.platform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.platformId = 'hedgehog';
6
6
  exports.platform = {
@@ -13,4 +13,6 @@ exports.platform = {
13
13
  };
14
14
  exports.ammPid = new web3_js_1.PublicKey('Hr4whNgXr3yZsJvx3TVSwfsFgXuSEPB1xKmvgrtLhsrM');
15
15
  exports.swapPid = new web3_js_1.PublicKey('2ZznCMfx2XP43zaPw9R9wKnjXWiEeEexyhdBPv3UqDtD');
16
+ exports.usdcMint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
17
+ exports.usdcDecimals = 6;
16
18
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,oCAAoC;IAC7C,qEAAqE;CACtE,CAAC;AACW,QAAA,MAAM,GAAG,IAAI,mBAAS,CACjC,8CAA8C,CAC/C,CAAC;AACW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,oCAAoC;IAC7C,qEAAqE;CACtE,CAAC;AACW,QAAA,MAAM,GAAG,IAAI,mBAAS,CACjC,8CAA8C,CAC/C,CAAC;AACW,QAAA,OAAO,GAAG,IAAI,mBAAS,CAClC,8CAA8C,CAC/C,CAAC;AACW,QAAA,QAAQ,GAAG,8CAA8C,CAAC;AAC1D,QAAA,YAAY,GAAG,CAAC,CAAC"}
@@ -2,15 +2,21 @@
2
2
  import { BeetStruct } from '@metaplex-foundation/beet';
3
3
  import { PublicKey } from '@solana/web3.js';
4
4
  import BigNumber from 'bignumber.js';
5
+ export declare enum Outcome {
6
+ Open = 0,
7
+ Yes = 1,
8
+ No = 2,
9
+ Invalid = 3
10
+ }
5
11
  export type Swap = {
6
12
  buffer: Buffer;
13
+ market: PublicKey;
7
14
  underlyingSwap: PublicKey;
8
15
  creator: PublicKey;
9
16
  fees: Buffer;
10
17
  index: BigNumber;
11
18
  volume: BigNumber;
12
19
  nonce: number;
13
- padding: Buffer;
14
20
  };
15
21
  export declare const swapStruct: BeetStruct<Swap, Partial<Swap>>;
16
22
  export type TokenSwap = {
@@ -19,11 +25,11 @@ export type TokenSwap = {
19
25
  isInitialized: number;
20
26
  bumpSeed: number;
21
27
  tokenProgramId: PublicKey;
22
- mintA: PublicKey;
23
- mintB: PublicKey;
24
- tokenPool: PublicKey;
25
28
  tokenAccountA: PublicKey;
26
29
  tokenAccountB: PublicKey;
30
+ tokenPool: PublicKey;
31
+ mintA: PublicKey;
32
+ mintB: PublicKey;
27
33
  feeAccount: PublicKey;
28
34
  tradeFeeNumerator: BigNumber;
29
35
  tradeFeeDenominator: BigNumber;
@@ -38,3 +44,30 @@ export type TokenSwap = {
38
44
  swapGuardian: PublicKey;
39
45
  };
40
46
  export declare const tokenSwapStruct: BeetStruct<TokenSwap, Partial<TokenSwap>>;
47
+ export type StoredRatio = {
48
+ numer: BigNumber;
49
+ denom: BigNumber;
50
+ };
51
+ export declare const storedRatioStruct: BeetStruct<StoredRatio, Partial<StoredRatio>>;
52
+ export type Market = {
53
+ buffer: Buffer;
54
+ creator: PublicKey;
55
+ yesToken: PublicKey;
56
+ noToken: PublicKey;
57
+ quoteToken: PublicKey;
58
+ marketCollateral: PublicKey;
59
+ feeAccount: PublicKey;
60
+ nonce: number;
61
+ expiryTs: BigNumber;
62
+ creationTs: BigNumber;
63
+ outcomeTs: BigNumber;
64
+ resolutionDelay: number;
65
+ index: BigNumber;
66
+ info: Buffer;
67
+ fees: Buffer;
68
+ outcome: Outcome;
69
+ flags: number;
70
+ redeemOracleForInvalid: PublicKey;
71
+ redeemRatioForInvalid: StoredRatio;
72
+ };
73
+ export declare const marketStruct: BeetStruct<Market, Partial<Market>>;
@@ -1,30 +1,36 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tokenSwapStruct = exports.swapStruct = void 0;
3
+ exports.marketStruct = exports.storedRatioStruct = exports.tokenSwapStruct = exports.swapStruct = exports.Outcome = 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");
7
+ var Outcome;
8
+ (function (Outcome) {
9
+ Outcome[Outcome["Open"] = 0] = "Open";
10
+ Outcome[Outcome["Yes"] = 1] = "Yes";
11
+ Outcome[Outcome["No"] = 2] = "No";
12
+ Outcome[Outcome["Invalid"] = 3] = "Invalid";
13
+ })(Outcome || (exports.Outcome = Outcome = {}));
7
14
  exports.swapStruct = new beet_1.BeetStruct([
8
15
  ['buffer', (0, solana_1.blob)(8)],
16
+ ['market', beet_solana_1.publicKey],
9
17
  ['underlyingSwap', beet_solana_1.publicKey],
10
18
  ['creator', beet_solana_1.publicKey],
11
19
  ['fees', (0, solana_1.blob)(12)],
12
20
  ['index', solana_1.u64],
13
21
  ['volume', solana_1.u128],
14
22
  ['nonce', beet_1.u8],
15
- ['padding', (0, solana_1.blob)(32)],
16
23
  ], (args) => args);
17
24
  exports.tokenSwapStruct = new beet_1.BeetStruct([
18
- ['buffer', (0, solana_1.blob)(5)],
19
25
  ['version', beet_1.u8],
20
26
  ['isInitialized', beet_1.u8],
21
27
  ['bumpSeed', beet_1.u8],
22
28
  ['tokenProgramId', beet_solana_1.publicKey],
23
- ['mintA', beet_solana_1.publicKey],
24
- ['mintB', beet_solana_1.publicKey],
25
- ['tokenPool', beet_solana_1.publicKey],
26
29
  ['tokenAccountA', beet_solana_1.publicKey],
27
30
  ['tokenAccountB', beet_solana_1.publicKey],
31
+ ['tokenPool', beet_solana_1.publicKey],
32
+ ['mintA', beet_solana_1.publicKey],
33
+ ['mintB', beet_solana_1.publicKey],
28
34
  ['feeAccount', beet_solana_1.publicKey],
29
35
  ['tradeFeeNumerator', solana_1.u64],
30
36
  ['tradeFeeDenominator', solana_1.u64],
@@ -38,4 +44,29 @@ exports.tokenSwapStruct = new beet_1.BeetStruct([
38
44
  ['curveParameters', (0, solana_1.blob)(32)],
39
45
  ['swapGuardian', beet_solana_1.publicKey],
40
46
  ], (args) => args);
47
+ exports.storedRatioStruct = new beet_1.BeetStruct([
48
+ ['numer', solana_1.u64],
49
+ ['denom', solana_1.u128],
50
+ ], (args) => args);
51
+ exports.marketStruct = new beet_1.BeetStruct([
52
+ ['buffer', (0, solana_1.blob)(8)],
53
+ ['creator', beet_solana_1.publicKey],
54
+ ['yesToken', beet_solana_1.publicKey],
55
+ ['noToken', beet_solana_1.publicKey],
56
+ ['quoteToken', beet_solana_1.publicKey],
57
+ ['marketCollateral', beet_solana_1.publicKey],
58
+ ['feeAccount', beet_solana_1.publicKey],
59
+ ['nonce', beet_1.u8],
60
+ ['expiryTs', solana_1.u64],
61
+ ['creationTs', solana_1.u64],
62
+ ['outcomeTs', solana_1.u64],
63
+ ['resolutionDelay', beet_1.u32],
64
+ ['index', solana_1.u64],
65
+ ['info', (0, solana_1.blob)(402)],
66
+ ['fees', (0, solana_1.blob)(4)],
67
+ ['outcome', beet_1.u8],
68
+ ['flags', beet_1.u8],
69
+ ['redeemOracleForInvalid', beet_solana_1.publicKey],
70
+ ['redeemRatioForInvalid', exports.storedRatioStruct],
71
+ ], (args) => args);
41
72
  //# sourceMappingURL=structs.js.map
@@ -1 +1 @@
1
- {"version":3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C;IACjC,CAAC,2BAA2B,EAAE,YAAG,CAAC;IAClC,CAAC,6BAA6B,EAAE,YAAG,CAAC;IACpC,CAAC,kBAAkB,EAAE,YAAG,CAAC;IACzB,CAAC,oBAAoB,EAAE,YAAG,CAAC;IAC3B,CAAC,WAAW,EAAE,SAAE,CAAC;IACjB,CAAC,iBAAiB,EAAE,IAAA,aAAI,EAAC,EAAE,CAAC,CAAC;IAC7B,CAAC,cAAc,EAAE,uBAAS,CAAC;CAC5B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC"}
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/hedgehog/structs.ts"],"names":[],"mappings":";;;AAAA,oDAAgE;AAChE,kEAA6D;AAG7D,+CAAqD;AAErD,IAAY,OAKX;AALD,WAAY,OAAO;IACjB,qCAAI,CAAA;IACJ,mCAAG,CAAA;IACH,iCAAE,CAAA;IACF,2CAAO,CAAA;AACT,CAAC,EALW,OAAO,uBAAP,OAAO,QAKlB;AAaY,QAAA,UAAU,GAAG,IAAI,iBAAU,CACtC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,gBAAgB,EAAE,uBAAS,CAAC;IAC7B,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,MAAM,EAAE,IAAA,aAAI,EAAC,EAAE,CAAC,CAAC;IAClB,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,QAAQ,EAAE,aAAI,CAAC;IAChB,CAAC,OAAO,EAAE,SAAE,CAAC;CACd,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAY,CACvB,CAAC;AA2BW,QAAA,eAAe,GAAG,IAAI,iBAAU,CAC3C;IACE,CAAC,SAAS,EAAE,SAAE,CAAC;IACf,CAAC,eAAe,EAAE,SAAE,CAAC;IACrB,CAAC,UAAU,EAA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CAAC,kBAAkB,EAAE,uBAAS,CAAC;IAC/B,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,OAAO,EAAE,SAAE,CAAC;IACb,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,iBAAiB,EAAE,UAAG,CAAC;IACxB,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,MAAM,EAAE,IAAA,aAAI,EAAC,GAAG,CAAC,CAAC;IACnB,CAAC,MAAM,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACjB,CAAC,SAAS,EAAE,SAAE,CAAC;IACf,CAAC,OAAO,EAAE,SAAE,CAAC;IACb,CAAC,wBAAwB,EAAE,uBAAS,CAAC;IACrC,CAAC,uBAAuB,EAAE,yBAAiB,CAAC;CAC7C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAc,CACzB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import { Platform } from '@sonarwatch/portfolio-core';
3
+ export declare const platformId = "whalesmarket";
4
+ export declare const platform: Platform;
5
+ export declare const pid: PublicKey;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pid = exports.platform = exports.platformId = void 0;
4
+ const web3_js_1 = require("@solana/web3.js");
5
+ exports.platformId = 'whalesmarket';
6
+ exports.platform = {
7
+ id: exports.platformId,
8
+ name: 'Whales Market',
9
+ image: 'https://sonar.watch/img/platforms/whalesmarket.png',
10
+ defiLlamaId: 'whales-market', // from https://defillama.com/docs/api
11
+ website: 'https://app.whales.market/',
12
+ twitter: 'https://twitter.com/WhalesMarket',
13
+ };
14
+ exports.pid = new web3_js_1.PublicKey('stPdYNaJNsV3ytS9Xtx4GXXXRcVqVS6x66ZFa26K39S');
15
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,cAAc,CAAC;AAC5B,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,oDAAoD;IAC3D,WAAW,EAAE,eAAe,EAAE,sCAAsC;IACpE,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,GAAG,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Fetcher } from '../../Fetcher';
2
+ declare const fetcher: Fetcher;
3
+ export default fetcher;
@@ -0,0 +1,81 @@
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 structs_1 = require("./structs");
20
+ const filters_1 = require("./filters");
21
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
22
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
23
+ const client = (0, clients_1.getClientSolana)();
24
+ const offers = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.offerStruct, constants_1.pid, (0, filters_1.offerFilter)(owner));
25
+ const mints = new Set();
26
+ offers.forEach((offer) => mints.add(offer.exToken.toString()));
27
+ const tokenPriceById = yield cache.getTokenPricesAsMap(Array.from(mints), portfolio_core_1.NetworkId.solana);
28
+ const buyOfferAssets = [];
29
+ const sellOfferAssets = [];
30
+ for (const offer of offers) {
31
+ if (offer.status === structs_1.OfferStatus.Closed || offer.collateral.isZero())
32
+ continue;
33
+ const mint = offer.exToken.toString();
34
+ const tokenPrice = tokenPriceById.get(mint);
35
+ if (!tokenPrice)
36
+ continue;
37
+ const amount = offer.collateral
38
+ .dividedBy(Math.pow(10, tokenPrice.decimals))
39
+ .toNumber();
40
+ const asset = (0, tokenPriceToAssetToken_1.default)(mint, amount, portfolio_core_1.NetworkId.solana, tokenPrice);
41
+ if (offer.offerType === structs_1.OfferType.Sell) {
42
+ sellOfferAssets.push(asset);
43
+ }
44
+ else {
45
+ buyOfferAssets.push(asset);
46
+ }
47
+ }
48
+ if (sellOfferAssets.length === 0 && buyOfferAssets.length === 0)
49
+ return [];
50
+ const elements = [];
51
+ if (sellOfferAssets.length > 0) {
52
+ elements.push({
53
+ type: portfolio_core_1.PortfolioElementType.multiple,
54
+ label: 'Deposit',
55
+ name: 'Sell offers',
56
+ networkId: portfolio_core_1.NetworkId.solana,
57
+ platformId: constants_1.platformId,
58
+ data: { assets: sellOfferAssets },
59
+ value: (0, portfolio_core_1.getUsdValueSum)(sellOfferAssets.map((asset) => asset.value)),
60
+ });
61
+ }
62
+ if (buyOfferAssets.length > 0) {
63
+ elements.push({
64
+ type: portfolio_core_1.PortfolioElementType.multiple,
65
+ label: 'Deposit',
66
+ name: 'Buy offers',
67
+ networkId: portfolio_core_1.NetworkId.solana,
68
+ platformId: constants_1.platformId,
69
+ data: { assets: buyOfferAssets },
70
+ value: (0, portfolio_core_1.getUsdValueSum)(buyOfferAssets.map((asset) => asset.value)),
71
+ });
72
+ }
73
+ return elements;
74
+ });
75
+ const fetcher = {
76
+ id: `${constants_1.platformId}-deposit`,
77
+ networkId: portfolio_core_1.NetworkId.solana,
78
+ executor,
79
+ };
80
+ exports.default = fetcher;
81
+ //# sourceMappingURL=depositFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"depositFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/depositFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AAGpC,2CAA8C;AAC9C,iDAAsD;AACtD,+CAA8D;AAC9D,uCAAgE;AAChE,uCAAwC;AACxC,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAwB,EAC3C,MAAM,EACN,qBAAW,EACX,eAAG,EACH,IAAA,qBAAW,EAAC,KAAK,CAAC,CACnB,CAAC;IAEF,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IACrC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC/D,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACpD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EACjB,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,MAAM,cAAc,GAAG,EAAE,CAAC;IAC1B,MAAM,eAAe,GAAG,EAAE,CAAC;IAC3B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,MAAM,KAAK,qBAAW,CAAC,MAAM,IAAI,KAAK,CAA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;IACL,CAAC;IAED,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,YAAY;YAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE;YAChC,KAAK,EAAE,IAAA,+BAAc,EAAC,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAClE,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,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,10 @@
1
+ export declare const offerFilter: (owner: string) => ({
2
+ memcmp: {
3
+ offset: number;
4
+ bytes: string;
5
+ };
6
+ dataSize?: undefined;
7
+ } | {
8
+ dataSize: number;
9
+ memcmp?: undefined;
10
+ })[];
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.offerFilter = void 0;
4
+ const offerFilter = (owner) => [
5
+ {
6
+ memcmp: {
7
+ offset: 116,
8
+ bytes: owner,
9
+ },
10
+ },
11
+ {
12
+ dataSize: 181,
13
+ },
14
+ ];
15
+ exports.offerFilter = offerFilter;
16
+ //# sourceMappingURL=filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/filters.ts"],"names":[],"mappings":";;;AAAO,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC;IAC5C;QACE,MAAM,EAAE;YACN,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,KAAK;SACb;KACF;IACD;QACE,QAAQ,EAAE,GAAG;KACd;CACF,CAAC;AAVW,QAAA,WAAW,eAUtB"}
@@ -0,0 +1,6 @@
1
+ import { Platform } from '@sonarwatch/portfolio-core';
2
+ import { Fetcher } from '../../Fetcher';
3
+ import { Job } from '../../Job';
4
+ export declare const platforms: Platform[];
5
+ export declare const jobs: Job[];
6
+ export declare const fetchers: Fetcher[];
@@ -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 depositFetcher_1 = __importDefault(require("./depositFetcher"));
9
+ exports.platforms = [constants_1.platform];
10
+ exports.jobs = [];
11
+ exports.fetchers = [depositFetcher_1.default];
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
@@ -0,0 +1,58 @@
1
+ /// <reference types="node" />
2
+ import { BeetStruct } from '@metaplex-foundation/beet';
3
+ import BigNumber from 'bignumber.js';
4
+ import { PublicKey } from '@metaplex-foundation/js';
5
+ export declare enum OfferStatus {
6
+ Open = 0,
7
+ Closed = 1
8
+ }
9
+ export declare enum OfferType {
10
+ Buy = 0,
11
+ Sell = 1
12
+ }
13
+ export declare enum OrderStatus {
14
+ Open = 0,
15
+ Closed = 1,
16
+ Cancelled = 2
17
+ }
18
+ export type Offer = {
19
+ buffer: Buffer;
20
+ version: number;
21
+ id: BigNumber;
22
+ offerType: OfferType;
23
+ tokenConfig: PublicKey;
24
+ totalAmount: BigNumber;
25
+ price: BigNumber;
26
+ exToken: PublicKey;
27
+ collateral: BigNumber;
28
+ status: OfferStatus;
29
+ filledAmount: BigNumber;
30
+ isFullMatch: boolean;
31
+ authority: PublicKey;
32
+ bump: number;
33
+ config: PublicKey;
34
+ };
35
+ export declare const offerStruct: BeetStruct<Offer, Partial<Offer>>;
36
+ export type Order = {
37
+ version: number;
38
+ id: BigNumber;
39
+ config: PublicKey;
40
+ offer: PublicKey;
41
+ authority: PublicKey;
42
+ bump: number;
43
+ seller: PublicKey;
44
+ buyer: PublicKey;
45
+ status: OrderStatus;
46
+ amount: BigNumber;
47
+ };
48
+ export declare const orderStruct: BeetStruct<Order, Partial<Order>>;
49
+ export type ExToken = {
50
+ version: number;
51
+ bump: number;
52
+ isAccepted: boolean;
53
+ token: PublicKey;
54
+ config: PublicKey;
55
+ vaultToken: PublicKey;
56
+ vaultTokenBump: number;
57
+ };
58
+ export declare const exTokenStruct: BeetStruct<ExToken, Partial<ExToken>>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.exTokenStruct = exports.orderStruct = exports.offerStruct = exports.OrderStatus = exports.OfferType = exports.OfferStatus = 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
+ var OfferStatus;
8
+ (function (OfferStatus) {
9
+ OfferStatus[OfferStatus["Open"] = 0] = "Open";
10
+ OfferStatus[OfferStatus["Closed"] = 1] = "Closed";
11
+ })(OfferStatus || (exports.OfferStatus = OfferStatus = {}));
12
+ var OfferType;
13
+ (function (OfferType) {
14
+ OfferType[OfferType["Buy"] = 0] = "Buy";
15
+ OfferType[OfferType["Sell"] = 1] = "Sell";
16
+ })(OfferType || (exports.OfferType = OfferType = {}));
17
+ var OrderStatus;
18
+ (function (OrderStatus) {
19
+ OrderStatus[OrderStatus["Open"] = 0] = "Open";
20
+ OrderStatus[OrderStatus["Closed"] = 1] = "Closed";
21
+ OrderStatus[OrderStatus["Cancelled"] = 2] = "Cancelled";
22
+ })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
23
+ exports.offerStruct = new beet_1.BeetStruct([
24
+ ['buffer', (0, solana_1.blob)(8)],
25
+ ['version', beet_1.u8],
26
+ ['id', solana_1.u64],
27
+ ['offerType', beet_1.u8],
28
+ ['tokenConfig', beet_solana_1.publicKey],
29
+ ['totalAmount', solana_1.u64],
30
+ ['price', solana_1.u64],
31
+ ['exToken', beet_solana_1.publicKey],
32
+ ['collateral', solana_1.u64],
33
+ ['status', beet_1.u8],
34
+ ['filledAmount', solana_1.u64],
35
+ ['isFullMatch', beet_1.bool],
36
+ ['authority', beet_solana_1.publicKey],
37
+ ['bump', beet_1.u8],
38
+ ['config', beet_solana_1.publicKey],
39
+ ], (args) => args);
40
+ exports.orderStruct = new beet_1.BeetStruct([
41
+ ['version', beet_1.u8],
42
+ ['id', solana_1.u64],
43
+ ['config', beet_solana_1.publicKey],
44
+ ['offer', beet_solana_1.publicKey],
45
+ ['authority', beet_solana_1.publicKey],
46
+ ['bump', beet_1.u8],
47
+ ['seller', beet_solana_1.publicKey],
48
+ ['buyer', beet_solana_1.publicKey],
49
+ ['status', beet_1.u8],
50
+ ['amount', solana_1.u64],
51
+ ], (args) => args);
52
+ exports.exTokenStruct = new beet_1.BeetStruct([
53
+ ['version', beet_1.u8],
54
+ ['bump', beet_1.u8],
55
+ ['isAccepted', beet_1.bool],
56
+ ['token', beet_solana_1.publicKey],
57
+ ['config', beet_solana_1.publicKey],
58
+ ['vaultToken', beet_solana_1.publicKey],
59
+ ['vaultTokenBump', beet_1.u8],
60
+ ], (args) => args);
61
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/whalesmarket/structs.ts"],"names":[],"mappings":";;;AAAA,oDAAiE;AACjE,kEAA6D;AAG7D,+CAA+C;AAE/C,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,6CAAI,CAAA;IACJ,iDAAM,CAAA;AACR,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,uCAAG,CAAA;IACH,yCAAI,CAAA;AACN,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,6CAAI,CAAA;IACJ,iDAAM,CAAA;IACN,uDAAS,CAAA;AACX,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAoBY,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,SAAS,EAAE,SAAE,CAAC;IACf,CAAC,IAAI,EAAE,YAAG,CAAC;IACX,CAAC,WAAW,EAAE,SAAE,CAAC;IACjB,CAAC,aAAa,EAAE,uBAAS,CAAC;IAC1B,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,SAAS,EAAE,uBAAS,CAAC;IACtB,CAAC,YAAY,EAAE,YAAG,CAAC;IACnB,CAAC,QAAQ,EAAE,SAAE,CAAC;IACd,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,aAAa,EAAE,WAAI,CAAC;IACrB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,QAAQ,EAAE,uBAAS,CAAC;CACtB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC;AAeW,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;IACE,CAAC,SAAS,EAAE,SAAE,CAAC;IACf,CAAC,IAAI,EAAE,YAAG,CAAC;IACX,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,QAAQ,EAAE,SAAE,CAAC;IACd,CAAC,QAAQ,EAAE,YAAG,CAAC;CAChB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC;AAYW,QAAA,aAAa,GAAG,IAAI,iBAAU,CACzC;IACE,CAAC,SAAS,EAAE,SAAE,CAAC;IACf,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,YAAY,EAAE,WAAI,CAAC;IACpB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,gBAAgB,EAAE,SAAE,CAAC;CACvB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAe,CAC1B,CAAC"}
@@ -1,6 +1,4 @@
1
1
  import { Platform } from '@sonarwatch/portfolio-core';
2
- export declare const whalesMarketPlatformId = "whalesmarket";
3
- export declare const whalesMarketPlatform: Platform;
4
2
  export declare const stepFinancePlatformId = "stepfinance";
5
3
  export declare const stepFinancePlatform: Platform;
6
4
  export declare const allbridgePlatformId = "allbridge";
@@ -1,17 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.xStakingConfigs = exports.allbridgePlatform = exports.allbridgePlatformId = exports.stepFinancePlatform = exports.stepFinancePlatformId = exports.whalesMarketPlatform = exports.whalesMarketPlatformId = void 0;
3
+ exports.xStakingConfigs = exports.allbridgePlatform = exports.allbridgePlatformId = exports.stepFinancePlatform = exports.stepFinancePlatformId = void 0;
4
4
  const constants_1 = require("../aurory/constants");
5
5
  const constants_2 = require("../hawksight/constants");
6
- exports.whalesMarketPlatformId = 'whalesmarket';
7
- exports.whalesMarketPlatform = {
8
- id: exports.whalesMarketPlatformId,
9
- name: 'Whales Market',
10
- image: 'https://sonar.watch/img/platforms/whalesmarket.png',
11
- // defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
12
- website: 'https://app.whales.market/',
13
- twitter: 'https://twitter.com/WhalesMarket',
14
- };
6
+ const constants_3 = require("../whalesmarket/constants");
15
7
  exports.stepFinancePlatformId = 'stepfinance';
16
8
  exports.stepFinancePlatform = {
17
9
  id: exports.stepFinancePlatformId,
@@ -43,7 +35,7 @@ exports.xStakingConfigs = [
43
35
  vault: 'Cm1KT2iqQ3LoxbmLy4WrQ9wE7WByJx6R512A28LbjGh9',
44
36
  xMint: '3wCoTb3TArUdzmeTBPzPFyPBUP6EJXaW5LAzGsWCpySu',
45
37
  xDecimals: 6,
46
- platformId: exports.whalesMarketPlatformId,
38
+ platformId: constants_3.platformId,
47
39
  },
48
40
  {
49
41
  mint: 'StepAscQoEioFxxWGnh2sLBDFp9d8rvKz2Yp39iDpyT',
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/x-staking-solana/constants.ts"],"names":[],"mappings":";;;AACA,mDAM6B;AAC7B,sDAA2E;AAE9D,QAAA,sBAAsB,GAAG,cAAc,CAAC;AACxC,QAAA,oBAAoB,GAAa;IAC5C,EAAE,EAAE,8BAAsB;IAC1B,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,oDAAoD;IAC3D,qEAAqE;IACrE,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,qBAAqB,GAAG,aAAa,CAAC;AACtC,QAAA,mBAAmB,GAAa;IAC3C,EAAE,EAAE,6BAAqB;IACzB,IAAI,EAA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C;QACX,KAAK,EAAE,8CAA8C;QACrD,KAAK,EAAE,6CAA6C;QACpD,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,sBAAmB;KAChC;CACF,CAAC"}
@@ -6,10 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.fetchers = exports.jobs = exports.platforms = void 0;
7
7
  const constants_1 = require("./constants");
8
8
  const stakingJob_1 = __importDefault(require("./stakingJob"));
9
- exports.platforms = [
10
- constants_1.whalesMarketPlatform,
11
- constants_1.stepFinancePlatform,
12
- ];
9
+ exports.platforms = [constants_1.stepFinancePlatform, constants_1.allbridgePlatform];
13
10
  exports.jobs = [stakingJob_1.default];
14
11
  exports.fetchers = [];
15
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/x-staking-solana/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAwE;AACxE,8DAAuC;AAE1B,QAAA,SAAS,GAAe;IACnC,gCAAoB;IACpB,+BAAmB;CACpB,CAAC;AACW,QAAA,IAAI,GAAU,CAAC,oBAAW,CAAC,CAAC;AAC5B,QAAA,QAAQ,GAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/x-staking-solana/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAqE;AACrE,8DAAuC;AAE1B,QAAA,SAAS,GAAe,CAAC,+BAAmB,EAAE,6BAAiB,CAAC,CAAC;AACjE,QAAA,IAAI,GAAU,CAAC,oBAAW,CAAC,CAAC;AAC5B,QAAA,QAAQ,GAAc,EAAE,CAAC"}