@sonarwatch/portfolio-plugins 0.11.114 → 0.11.116

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. package/CHANGELOG.md +1175 -1167
  2. package/README.md +3 -3
  3. package/package.json +2 -2
  4. package/src/index.d.ts +1 -1
  5. package/src/index.js +16 -4
  6. package/src/index.js.map +1 -1
  7. package/src/plugins/abex/constants.d.ts +7 -0
  8. package/src/plugins/abex/constants.js +17 -0
  9. package/src/plugins/abex/constants.js.map +1 -0
  10. package/src/plugins/abex/index.d.ts +6 -0
  11. package/src/plugins/abex/index.js +13 -0
  12. package/src/plugins/abex/index.js.map +1 -0
  13. package/src/plugins/abex/marketsJob.d.ts +3 -0
  14. package/src/plugins/abex/marketsJob.js +90 -0
  15. package/src/plugins/abex/marketsJob.js.map +1 -0
  16. package/src/plugins/abex/positionsFetcher.js +65 -0
  17. package/src/plugins/abex/positionsFetcher.js.map +1 -0
  18. package/src/plugins/abex/types.d.ts +69 -0
  19. package/src/plugins/abex/types.js +3 -0
  20. package/src/plugins/abex/types.js.map +1 -0
  21. package/src/plugins/balancer/helpers/pools.js +21 -21
  22. package/src/plugins/foo/index.js +2 -2
  23. package/src/plugins/foo/index.js.map +1 -1
  24. package/src/plugins/foo/positionsFetcher.d.ts +3 -0
  25. package/src/plugins/foo/{positionFetcher.js → positionsFetcher.js} +2 -2
  26. package/src/plugins/foo/positionsFetcher.js.map +1 -0
  27. package/src/plugins/kai/constants.d.ts +9 -0
  28. package/src/plugins/kai/constants.js +37 -0
  29. package/src/plugins/kai/constants.js.map +1 -0
  30. package/src/plugins/kai/index.d.ts +6 -0
  31. package/src/plugins/kai/index.js +12 -0
  32. package/src/plugins/kai/index.js.map +1 -0
  33. package/src/plugins/kai/types.d.ts +57 -0
  34. package/src/plugins/kai/types.js +3 -0
  35. package/src/plugins/kai/types.js.map +1 -0
  36. package/src/plugins/kai/vaultsJob.d.ts +3 -0
  37. package/src/plugins/kai/vaultsJob.js +60 -0
  38. package/src/plugins/kai/vaultsJob.js.map +1 -0
  39. package/src/plugins/raydium/lpTokensJob.js +4 -1
  40. package/src/plugins/raydium/lpTokensJob.js.map +1 -1
  41. package/src/plugins/suilend/obligationsFetcher.js +10 -8
  42. package/src/plugins/suilend/obligationsFetcher.js.map +1 -1
  43. package/src/plugins/sushiswap/helpers.js +24 -24
  44. package/src/plugins/symmetry/basketsJob.d.ts +3 -0
  45. package/src/plugins/symmetry/basketsJob.js +69 -0
  46. package/src/plugins/symmetry/basketsJob.js.map +1 -0
  47. package/src/plugins/symmetry/constants.d.ts +7 -0
  48. package/src/plugins/symmetry/constants.js +17 -0
  49. package/src/plugins/symmetry/constants.js.map +1 -0
  50. package/src/plugins/symmetry/filters.d.ts +2 -0
  51. package/src/plugins/symmetry/filters.js +15 -0
  52. package/src/plugins/symmetry/filters.js.map +1 -0
  53. package/src/plugins/symmetry/index.d.ts +6 -0
  54. package/src/plugins/symmetry/index.js +12 -0
  55. package/src/plugins/symmetry/index.js.map +1 -0
  56. package/src/plugins/symmetry/structs.d.ts +78 -0
  57. package/src/plugins/symmetry/structs.js +78 -0
  58. package/src/plugins/symmetry/structs.js.map +1 -0
  59. package/src/plugins/uniswap-v2/helpers.js +22 -22
  60. package/src/utils/misc/getLpTokenSourceRaw.d.ts +1 -1
  61. package/src/utils/sei/constants.js +8 -8
  62. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  63. package/src/plugins/foo/positionFetcher.js.map +0 -1
  64. /package/src/plugins/{foo/positionFetcher.d.ts → abex/positionsFetcher.d.ts} +0 -0
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tokenListStruct = exports.tokenSettingsStruct = exports.fundStruct = void 0;
4
+ const beet_solana_1 = require("@metaplex-foundation/beet-solana");
5
+ const beet_1 = require("@metaplex-foundation/beet");
6
+ const solana_1 = require("../../utils/solana");
7
+ exports.fundStruct = new beet_1.BeetStruct([
8
+ ['buffer', (0, solana_1.blob)(8)],
9
+ ['version', solana_1.u64],
10
+ ['manager', beet_solana_1.publicKey],
11
+ ['fundToken', beet_solana_1.publicKey],
12
+ ['managerFee', solana_1.u64],
13
+ ['supplyOutstanding', solana_1.u64],
14
+ ['activelyManaged', solana_1.u64],
15
+ ['activeBuyStates', solana_1.u64],
16
+ ['sellState', solana_1.u64],
17
+ ['rebalanceSellState', solana_1.u64],
18
+ ['hostPubkey', beet_solana_1.publicKey],
19
+ ['hostFee', solana_1.u64],
20
+ ['numOfTokens', solana_1.u64],
21
+ ['currentCompToken', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 20)],
22
+ ['currentCompAmount', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 20)],
23
+ ['lastRebalanceTime', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 20)],
24
+ ['targetWeight', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 20)],
25
+ ['weightSum', solana_1.u64],
26
+ ['currentWeight', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 20)],
27
+ ['fundWorth', solana_1.u64],
28
+ ['lastUpdateTime', solana_1.u64],
29
+ ['refilterInterval', solana_1.u64],
30
+ ['reweightInterval', solana_1.u64],
31
+ ['rebalanceInterval', solana_1.u64],
32
+ ['rebalanceThreshold', solana_1.u64],
33
+ ['rebalanceSlippage', solana_1.u64],
34
+ ['lpOffsetThreshold', solana_1.u64],
35
+ ['lastRefilterTime', solana_1.u64],
36
+ ['lastReweightTime', solana_1.u64],
37
+ ['rulesReady', solana_1.u64],
38
+ ['assetPool', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 200)],
39
+ ['numOfRules', solana_1.u64],
40
+ ['rules', (0, beet_1.uniformFixedSizeArray)((0, solana_1.blob)(320), 20)],
41
+ ['numRuleTokens', solana_1.u64],
42
+ ['ruleTokens', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 20)],
43
+ ['ruleTokenWeights', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 20)],
44
+ ['messageDigestFive', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 16)],
45
+ ['disableRebalance', solana_1.u64],
46
+ ['disableLp', solana_1.u64],
47
+ ['allowMultiAssetContribution', beet_1.u8],
48
+ ['symbolLength', beet_1.u8],
49
+ ['symbol', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 10)],
50
+ ['nameLength', beet_1.u8],
51
+ ['name', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 60)],
52
+ ['uriLength', beet_1.u8],
53
+ ['uri', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 300)],
54
+ ['extraBytes', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 394)],
55
+ ], (args) => args);
56
+ exports.tokenSettingsStruct = new beet_1.BeetStruct([
57
+ ['tokenMint', beet_solana_1.publicKey],
58
+ ['decimals', beet_1.u8],
59
+ ['coingeckoId', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 30)],
60
+ ['pdaTokenAccount', beet_solana_1.publicKey],
61
+ ['oracleType', beet_1.u8],
62
+ ['oracleAccount', beet_solana_1.publicKey],
63
+ ['oracleIndex', beet_1.u8],
64
+ ['oracleConfidencePct', beet_1.u8],
65
+ ['fixedConfidenceBps', beet_1.u8],
66
+ ['tokenSwapFeeAfterTwBps', beet_1.u8],
67
+ ['tokenSwapFeeBeforeTwBps', beet_1.u8],
68
+ ['isLive', beet_1.u8],
69
+ ['lpOn', beet_1.u8],
70
+ ['useCurveData', beet_1.u8],
71
+ ['additionalData', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 63)],
72
+ ], (args) => args);
73
+ exports.tokenListStruct = new beet_1.FixableBeetStruct([
74
+ ['buffer', (0, solana_1.blob)(8)],
75
+ ['numTokens', solana_1.u64],
76
+ ['list', (0, beet_1.uniformFixedSizeArray)(exports.tokenSettingsStruct, 20)],
77
+ ], (args) => args);
78
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/pl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AAG,CAAC,CAAC;CAC/C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAY,CACvB,CAAC;AAoBW,QAAA,mBAAmB,GAAG,IAAI,iBAAU,CAC/C;IACE,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,UAAU,EAAE,SAAE,CAAC;IAChB,CAAC,aAAa,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;IAC9C,CAAC,iBAAiB,EAAE,uBAAS,CAAC;IAC9B,CAAC,YAAY,EAAE,SAAE,CAAC;IAClB,CAAC,eAAe,EAAE,uBAAS,CAAC;IAC5B,CAAC,aAAa,EAAE,SAAE,CAAC;IACnB,CAAC,qBAAqB,EAAE,SAAE,CAAC;IAC3B,CAAC,oBAAoB,EAAE,SAAE,CAAC;IAC1B,CAAC,wBAAwB,EAAE,SAAE,CAAC;IAC9B,CAAC,yBAAyB,EAAE,SAAE,CAAC;IAC/B,CAAC,QAAQ,EAAE,SAAE,CAAC;IACd,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,cAAc,EAAE,SAAE,CAAC;IACpB,CAAC,gBAAgB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;CAClD,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAqB,CAChC,CAAC;AAQW,QAAA,eAAe,GAAG,IAAI,wBAAiB,CAClD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,MAAM,EAAE,IAAA,4BAAqB,EAAC,2BAAmB,EAAE,EAAE,CAAC,CAAC;CACzD,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC"}
@@ -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;
@@ -1,6 +1,6 @@
1
1
  import { NetworkIdType, TokenPriceSource } from '@sonarwatch/portfolio-core';
2
2
  import BigNumber from 'bignumber.js';
3
- type PoolUnderlyingRaw = {
3
+ export type PoolUnderlyingRaw = {
4
4
  address: string;
5
5
  reserveAmountRaw: BigNumber;
6
6
  price: number;
@@ -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;
@@ -1 +0,0 @@
1
- {"version":3,"file":"positionFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/positionFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAMoC;AAEpC,2CAAyC;AAGzC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,aAAa,CAC7C,sCAAqB,EACrB,0BAAS,CAAC,QAAQ,CACnB,CAAC;IACF,MAAM,MAAM,GAAG,CAAC,CAAC;IACjB,MAAM,KAAK,GAAG,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,KAAK,KAAI,IAAI,CAAC;IAC3C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAE5C,MAAM,OAAO,GAA6B;QACxC,SAAS,EAAE,0BAAS,CAAC,QAAQ;QAC7B,KAAK,EAAE,SAAS;QAChB,UAAU,EAAV,sBAAU;QACV,IAAI,EAAE,qCAAoB,CAAC,QAAQ;QACnC,KAAK;QACL,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,mCAAkB,CAAC,KAAK;oBAC9B,SAAS,EAAE,0BAAS,CAAC,QAAQ;oBAC7B,KAAK;oBACL,UAAU,EAAE,EAAE;oBACd,IAAI,EAAE;wBACJ,OAAO,EAAE,sCAAqB;wBAC9B,MAAM;wBACN,KAAK;qBACN;iBACF;aACF;SACF;KACF,CAAC;IAEF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,QAAQ;IAC7B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}