@sonarwatch/portfolio-plugins 0.14.145 → 0.14.152

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/CHANGELOG.md +2232 -2204
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/plugins/allbridge/constants.d.ts +0 -6
  5. package/src/plugins/allbridge/constants.js +1 -9
  6. package/src/plugins/allbridge/constants.js.map +1 -1
  7. package/src/plugins/allbridge/helpers.d.ts +1 -1
  8. package/src/plugins/allbridge/helpers.js +1 -3
  9. package/src/plugins/allbridge/helpers.js.map +1 -1
  10. package/src/plugins/allbridge/positionsFetcher.js +2 -1
  11. package/src/plugins/allbridge/positionsFetcher.js.map +1 -1
  12. package/src/plugins/allbridge/structs.d.ts +13 -0
  13. package/src/plugins/allbridge/structs.js +14 -0
  14. package/src/plugins/allbridge/structs.js.map +1 -0
  15. package/src/plugins/allbridge/types.d.ts +0 -6
  16. package/src/plugins/balancer/helpers/pools.js +21 -21
  17. package/src/plugins/bonfida/constants.js +1 -1
  18. package/src/plugins/bonfida/constants.js.map +1 -1
  19. package/src/plugins/divvy/constants.d.ts +0 -2
  20. package/src/plugins/divvy/constants.js +1 -7
  21. package/src/plugins/divvy/constants.js.map +1 -1
  22. package/src/plugins/divvy/houseJob.js +6 -3
  23. package/src/plugins/divvy/houseJob.js.map +1 -1
  24. package/src/plugins/divvy/housePoolFetcher.js +9 -11
  25. package/src/plugins/divvy/housePoolFetcher.js.map +1 -1
  26. package/src/plugins/divvy/stakingFetcher.js +7 -12
  27. package/src/plugins/divvy/stakingFetcher.js.map +1 -1
  28. package/src/plugins/divvy/structs.d.ts +57 -0
  29. package/src/plugins/divvy/structs.js +57 -0
  30. package/src/plugins/divvy/structs.js.map +1 -0
  31. package/src/plugins/elemental/constants.d.ts +4 -2
  32. package/src/plugins/elemental/constants.js +3 -7
  33. package/src/plugins/elemental/constants.js.map +1 -1
  34. package/src/plugins/elemental/filters.d.ts +0 -1
  35. package/src/plugins/elemental/filters.js +1 -6
  36. package/src/plugins/elemental/filters.js.map +1 -1
  37. package/src/plugins/elemental/helpers.js +2 -2
  38. package/src/plugins/elemental/helpers.js.map +1 -1
  39. package/src/plugins/elemental/poolsJob.js +4 -4
  40. package/src/plugins/elemental/poolsJob.js.map +1 -1
  41. package/src/plugins/ensofi/constants.d.ts +4 -2
  42. package/src/plugins/ensofi/constants.js +3 -7
  43. package/src/plugins/ensofi/constants.js.map +1 -1
  44. package/src/plugins/ensofi/idl.d.ts +149 -6
  45. package/src/plugins/ensofi/idl.js +1074 -61
  46. package/src/plugins/ensofi/idl.js.map +1 -1
  47. package/src/plugins/ensofi/solanaLoansFetcher.js +23 -37
  48. package/src/plugins/ensofi/solanaLoansFetcher.js.map +1 -1
  49. package/src/plugins/ensofi/structs.d.ts +58 -0
  50. package/src/plugins/ensofi/structs.js +60 -0
  51. package/src/plugins/ensofi/structs.js.map +1 -0
  52. package/src/plugins/jupiter/governance/constants.js +3 -3
  53. package/src/plugins/jupiter/governance/constants.js.map +1 -1
  54. package/src/plugins/jupiter/launchpad/constants.d.ts +1 -0
  55. package/src/plugins/jupiter/launchpad/constants.js +8 -7
  56. package/src/plugins/jupiter/launchpad/constants.js.map +1 -1
  57. package/src/plugins/jupiter/pricingJob.js +2 -1
  58. package/src/plugins/jupiter/pricingJob.js.map +1 -1
  59. package/src/plugins/orca/getWhirlpoolPositions.js +7 -7
  60. package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
  61. package/src/plugins/orca/types.d.ts +2 -0
  62. package/src/plugins/picasso/constants.d.ts +0 -2
  63. package/src/plugins/picasso/constants.js +1 -7
  64. package/src/plugins/picasso/constants.js.map +1 -1
  65. package/src/plugins/picasso/helpers.js +7 -4
  66. package/src/plugins/picasso/helpers.js.map +1 -1
  67. package/src/plugins/picasso/structs.d.ts +39 -0
  68. package/src/plugins/picasso/structs.js +37 -0
  69. package/src/plugins/picasso/structs.js.map +1 -0
  70. package/src/plugins/picasso/unstakingNftsJob.js +2 -1
  71. package/src/plugins/picasso/unstakingNftsJob.js.map +1 -1
  72. package/src/plugins/picasso/unstakingPositionsFetcher.js +4 -4
  73. package/src/plugins/picasso/unstakingPositionsFetcher.js.map +1 -1
  74. package/src/plugins/ratex/getPool.d.ts +1 -2
  75. package/src/plugins/ratex/getPool.js +4 -3
  76. package/src/plugins/ratex/getPool.js.map +1 -1
  77. package/src/plugins/ratex/helpers.d.ts +7 -4
  78. package/src/plugins/ratex/helpers.js +11 -31
  79. package/src/plugins/ratex/helpers.js.map +1 -1
  80. package/src/plugins/ratex/marketsJob.js +4 -9
  81. package/src/plugins/ratex/marketsJob.js.map +1 -1
  82. package/src/plugins/ratex/positionsFetcher.js +2 -2
  83. package/src/plugins/ratex/positionsFetcher.js.map +1 -1
  84. package/src/plugins/ratex/structs.d.ts +211 -0
  85. package/src/plugins/ratex/structs.js +203 -0
  86. package/src/plugins/ratex/structs.js.map +1 -0
  87. package/src/plugins/ratex/types.d.ts +5 -76
  88. package/src/plugins/raydium/ammV2ApiJob.js +24 -0
  89. package/src/plugins/raydium/ammV2ApiJob.js.map +1 -1
  90. package/src/plugins/raydium/constants.d.ts +1 -0
  91. package/src/plugins/raydium/constants.js +2 -1
  92. package/src/plugins/raydium/constants.js.map +1 -1
  93. package/src/plugins/raydium/getRaydiumCLMMPositions.js +9 -5
  94. package/src/plugins/raydium/getRaydiumCLMMPositions.js.map +1 -1
  95. package/src/plugins/raydium/types.d.ts +14 -4
  96. package/src/plugins/sanctum/s1AirdropFetcher.js +2 -2
  97. package/src/plugins/sanctum/s1AirdropFetcher.js.map +1 -1
  98. package/src/plugins/sharky/collectionsJob.js +8 -9
  99. package/src/plugins/sharky/collectionsJob.js.map +1 -1
  100. package/src/plugins/sharky/constants.d.ts +0 -2
  101. package/src/plugins/sharky/constants.js +1 -7
  102. package/src/plugins/sharky/constants.js.map +1 -1
  103. package/src/plugins/sharky/loansFetcher.js +25 -19
  104. package/src/plugins/sharky/loansFetcher.js.map +1 -1
  105. package/src/plugins/sharky/structs.d.ts +96 -0
  106. package/src/plugins/sharky/structs.js +103 -0
  107. package/src/plugins/sharky/structs.js.map +1 -0
  108. package/src/plugins/sharky/types.d.ts +0 -15
  109. package/src/plugins/sharky/types.js +0 -8
  110. package/src/plugins/sharky/types.js.map +1 -1
  111. package/src/plugins/stabble/constants.d.ts +0 -3
  112. package/src/plugins/stabble/constants.js +1 -13
  113. package/src/plugins/stabble/constants.js.map +1 -1
  114. package/src/plugins/stabble/poolsJob.js +14 -9
  115. package/src/plugins/stabble/poolsJob.js.map +1 -1
  116. package/src/plugins/stabble/structs.d.ts +43 -0
  117. package/src/plugins/stabble/structs.js +42 -0
  118. package/src/plugins/stabble/structs.js.map +1 -0
  119. package/src/plugins/sushiswap/helpers.js +24 -24
  120. package/src/plugins/uniswap-v2/helpers.js +22 -22
  121. package/src/plugins/zeta/constants.d.ts +0 -2
  122. package/src/plugins/zeta/constants.js +1 -7
  123. package/src/plugins/zeta/constants.js.map +1 -1
  124. package/src/plugins/zeta/stakingFetcher.js +6 -3
  125. package/src/plugins/zeta/stakingFetcher.js.map +1 -1
  126. package/src/plugins/zeta/structs.d.ts +24 -1
  127. package/src/plugins/zeta/structs.js +30 -1
  128. package/src/plugins/zeta/structs.js.map +1 -1
  129. package/src/plugins/zeta/types.d.ts +0 -26
  130. package/src/plugins/zeta/types.js +0 -7
  131. package/src/plugins/zeta/types.js.map +1 -1
  132. package/src/utils/sei/constants.js +8 -8
  133. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  134. package/src/utils/solana/beets/ParsedGpa.d.ts +1 -0
  135. package/src/utils/solana/beets/ParsedGpa.js +9 -0
  136. package/src/utils/solana/beets/ParsedGpa.js.map +1 -1
  137. package/src/plugins/divvy/types.d.ts +0 -28
  138. package/src/plugins/divvy/types.js +0 -3
  139. package/src/plugins/divvy/types.js.map +0 -1
  140. package/src/plugins/picasso/types.d.ts +0 -17
  141. package/src/plugins/picasso/types.js +0 -3
  142. package/src/plugins/picasso/types.js.map +0 -1
  143. package/src/plugins/ratex/idl.json +0 -8806
  144. package/src/plugins/sharky/filters.d.ts +0 -8
  145. package/src/plugins/sharky/filters.js +0 -43
  146. package/src/plugins/sharky/filters.js.map +0 -1
  147. package/src/plugins/stabble/filters.d.ts +0 -5
  148. package/src/plugins/stabble/filters.js +0 -20
  149. package/src/plugins/stabble/filters.js.map +0 -1
  150. package/src/plugins/stabble/types.d.ts +0 -40
  151. package/src/plugins/stabble/types.js +0 -3
  152. package/src/plugins/stabble/types.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/ratex/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,kDAAuB;AAEvB,+CAG4B;AAE5B,iDAAsD;AACtD,0DAA6B;AAC7B,uCAAoC;AAG7B,MAAM,qBAAqB,GAAG,CACnC,QAAmB,EACnB,KAAa,EACoB,EAAE;IACnC,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7C,MAAM,CAAC,YAAY,CAAC,GAAG,mBAAS,CAAC,sBAAsB,CACrD,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,EAC5D,IAAI,mBAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CACjC,CAAC;QACF,OAAO,YAAY,CAAC;IACtB,CAAC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,MAAM,IAAA,0CAAiC,EACxD,UAAU,EACV;QACE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QAChC,GAAG,EAAH,kBAAG;QACH,OAAO,EAAE,QAAQ;KACP,EACZ,aAAa,CACd,CA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AI,CAAC,IAAI,CAAC;YACjB,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;YAC/B,IAAI,eAAE,CAAC,YAAY,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;SAClD,EACD,SAAS,CACV,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,OAAO,IAAA,sCAA6B,EAAC,UAAU,EAAE,kBAAQ,EAAE,MAAM,CAAC,CAAC;AACrE,CAAC,CAAC;AAvBW,QAAA,UAAU,cAuBrB"}
@@ -17,8 +17,8 @@ const bn_js_1 = __importDefault(require("bn.js"));
17
17
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
18
18
  const constants_1 = require("./constants");
19
19
  const clients_1 = require("../../utils/clients");
20
- const idl_json_1 = __importDefault(require("./idl.json"));
21
20
  const solana_1 = require("../../utils/solana");
21
+ const structs_1 = require("./structs");
22
22
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
23
23
  const connection = (0, clients_1.getClientSolana)();
24
24
  const addressLookupTable = (yield connection.getAddressLookupTable(constants_1.programIdLookupTable)).value;
@@ -27,12 +27,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
27
27
  const programs = [];
28
28
  for (const programId of addressLookupTable.state.addresses) {
29
29
  const [statePda] = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('ratex_state')], programId);
30
- const idlItem = {
31
- programId: programId.toString(),
32
- idl: idl_json_1.default,
33
- idlType: 'anchor',
34
- };
35
- const states = yield (0, solana_1.getAutoParsedMultipleAccountsInfo)(connection, idlItem, [statePda]);
30
+ const states = yield (0, solana_1.getParsedMultipleAccountsInfo)(connection, structs_1.stateStruct, [statePda]);
36
31
  if (!states[0])
37
32
  continue;
38
33
  const marketIndexStart = states[0]['marketIndexStart'];
@@ -40,12 +35,12 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
40
35
  Buffer.from('margin_market'),
41
36
  new bn_js_1.default(marketIndexStart).toArrayLike(Buffer, 'le', 4),
42
37
  ], programId);
43
- const marginMarkets = yield (0, solana_1.getAutoParsedMultipleAccountsInfo)(connection, idlItem, [marginMarketPda]);
38
+ const marginMarkets = yield (0, solana_1.getParsedMultipleAccountsInfo)(connection, structs_1.marginMarketStruct, [marginMarketPda]);
44
39
  if (!marginMarkets[0])
45
40
  continue;
46
41
  programs.push({
47
42
  programId: programId.toString(),
48
- mint: marginMarkets[0].mint,
43
+ mint: marginMarkets[0].mint.toString(),
49
44
  });
50
45
  }
51
46
  yield cache.setItem(constants_1.programsCacheKey, programs, {
@@ -1 +1 @@
1
- {"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/ratex/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,6CAA4C;AAE5C,kDAAuB;AACvB,+DAAuD;AAGvD,2CAIqB;AACrB,iDAAsD;AACtD,0DAA6B;AAC7B,+CAAuE;AAGvE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,kBAAkB,GAAG,CACzB,MAAM,UAAU,CAAC,qBAAqB,CAAC,gCAAoB,CAAC,CAC7D,CAAC,KAAK,CAAC;IAER,IAAI,CAAC,kBAAkB;QAAE,OAAO;IAEhC,MAAM,QAAQ,GAAG,EAAE,CAAC;IAEpB,KAAK,MAAM,SAAS,IAAI,kBAAkB,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QAC3D,MAAM,CAAC,QAAQ,CAAC,GAAG,mBAAS,CAAC,sBAAsB,CACjD,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAC5B,SAAS,CACV,CAAC;QAEF,MAAM,OAAO,GAAG;YACd,SAAS,EAAE,SAAS,CAAC,Q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CAAC,aAAa,CAAC,CAAC,CAAC;YAAE,SAAS;QAEhC,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS,EAAE,SAAS,CAAC,QAAQ,EAAE;YAC/B,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE;SACvC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,KAAK,CAAC,OAAO,CAAC,4BAAgB,EAAE,QAAQ,EAAE;QAC9C,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,MAAM,EAAE,CAAC,QAAQ,CAAC;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -42,7 +42,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
42
42
  if (!user)
43
43
  return;
44
44
  user.marginPositions.forEach((marginPosition) => {
45
- if (marginPosition.balance !== 0) {
45
+ if (!marginPosition.balance.isZero()) {
46
46
  const element = elementRegistry.addElementMultiple({
47
47
  label: 'Margin',
48
48
  link: 'https://app.rate-x.io/trade',
@@ -61,7 +61,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
61
61
  lpDatas.forEach((lpData) => {
62
62
  if (!lpData)
63
63
  return;
64
- const ammpool = pools.get(lpData.ammPosition.ammpool);
64
+ const ammpool = pools.get(lpData.ammPosition.ammpool.toString());
65
65
  if (!ammpool)
66
66
  return;
67
67
  const { tokenAmountA, tokenAmountB } = (0, tokenAmountFromLiquidity_1.getTokenAmountsFromLiquidity)(new bignumber_js_1.default(lpData.ammPosition.liquidity), ammpool.pool.tickCurrentIndex, lpData.ammPosition.tickLowerIndex, lpData.ammPosition.tickUpperIndex, true);
@@ -1 +1 @@
1
- {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../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YAAY,CACb,CAAC;gBACF,MAAM,gBAAgB,GAAG,IAAI,sBAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CACpE,YAAY,CACb,CAAC;gBACF,MAAM,CAAC,GAAG,IAAA,yCAAmB,EAC3B,IAAI,sBAAS,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EACrC,CAAC,EACD,CAAC,CACF,CAAC;gBAEF,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;oBACjD,KAAK,EAAE,eAAe;oBACtB,IAAI,EAAE,iCAAiC;oBACvC,GAAG,EAAE,MAAM,CAAC,MAAM;oBAClB,UAAU,EAAE;wBACV;4BACE,IAAI,EAAE,MAAM;4BACZ,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;yBACnC;qBACF;iBACF,CAAC,CAAC;gBACH,OAAO,CAAC,QAAQ,CAAC;oBACf,OAAO,EAAE,OAAO,CAAC,IAAI;oBACrB,MAAM,EAAE,eAAe;yBACpB,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;yBACnB,IAAI,CAAC,gBAAgB,CAAC;yBACtB,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;oBAC1B,cAAc,EAAE,IAAI;iBACrB,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/ratex/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,gEA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,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CACpE,YAAY,CACb,CAAC;gBACF,MAAM,CAAC,GAAG,IAAA,yCAAmB,EAC3B,IAAI,sBAAS,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EACrC,CAAC,EACD,CAAC,CACF,CAAC;gBAEF,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;oBACjD,KAAK,EAAE,eAAe;oBACtB,IAAI,EAAE,iCAAiC;oBACvC,GAAG,EAAE,MAAM,CAAC,MAAM;oBAClB,UAAU,EAAE;wBACV;4BACE,IAAI,EAAE,MAAM;4BACZ,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;yBACnC;qBACF;iBACF,CAAC,CAAC;gBACH,OAAO,CAAC,QAAQ,CAAC;oBACf,OAAO,EAAE,OAAO,CAAC,IAAI;oBACrB,MAAM,EAAE,eAAe;yBACpB,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;yBACnB,IAAI,CAAC,gBAAgB,CAAC;yBACtB,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;oBAC1B,cAAc,EAAE,IAAI;iBACrB,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,211 @@
1
+ /// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
2
+ /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
+ import { PublicKey } from '@solana/web3.js';
4
+ import BigNumber from 'bignumber.js';
5
+ import { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
6
+ export type State = {
7
+ accountDiscriminator: number[];
8
+ admin: PublicKey;
9
+ signer: PublicKey;
10
+ numberOfAuthorities: BigNumber;
11
+ numberOfSubAccounts: BigNumber;
12
+ collateralRatioInitial: BigNumber;
13
+ collateralRatioMaintenance: BigNumber;
14
+ collateralRatioInitialPreExpiry: BigNumber;
15
+ numberOfYieldMarkets: number;
16
+ numberOfMarginMarkets: number;
17
+ signerNonce: number;
18
+ twapDuration: number;
19
+ marginIndexStart: number;
20
+ marketIndexStart: number;
21
+ keepers: PublicKey[];
22
+ keeperFeePerTx: BigNumber[];
23
+ keeperFee: BigNumber[];
24
+ };
25
+ export declare const stateStruct: FixableBeetStruct<State, Partial<State>>;
26
+ export type MarginMarket = {
27
+ accountDiscriminator: number[];
28
+ pubkey: PublicKey;
29
+ mint: PublicKey;
30
+ };
31
+ export declare const marginMarketStruct: FixableBeetStruct<MarginMarket, Partial<MarginMarket>>;
32
+ export type AmmpoolRewardInfo = {
33
+ mint: PublicKey;
34
+ vault: PublicKey;
35
+ authority: PublicKey;
36
+ emissionsPerSecondX64: BigNumber;
37
+ growthGlobalX64: BigNumber;
38
+ };
39
+ export declare const ammPoolRewardInfoStruct: BeetStruct<AmmpoolRewardInfo, Partial<AmmpoolRewardInfo>>;
40
+ export type Ammpool = {
41
+ ammpoolsConfig: PublicKey;
42
+ liquidity: BigNumber;
43
+ sqrtPrice: BigNumber;
44
+ protocolFeeOwedA: BigNumber;
45
+ protocolFeeOwedB: BigNumber;
46
+ tokenMintBase: PublicKey;
47
+ tokenVaultBase: PublicKey;
48
+ feeGrowthGlobalA: BigNumber;
49
+ tokenMintQuote: PublicKey;
50
+ tokenVaultQuote: PublicKey;
51
+ feeGrowthGlobalB: BigNumber;
52
+ rewardLastUpdatedTimestamp: BigNumber;
53
+ rewardInfos: AmmpoolRewardInfo[];
54
+ oracle: PublicKey;
55
+ tickCurrentIndex: number;
56
+ observationIndex: number;
57
+ observationUpdateDuration: number;
58
+ tickSpacing: number;
59
+ tickSpacingSeed: number[];
60
+ feeRate: number;
61
+ protocolFeeRate: number;
62
+ };
63
+ export declare const ammpoolStruct: BeetStruct<Ammpool, Partial<Ammpool>>;
64
+ export declare enum MarginType {
65
+ NonYieldBearing = 0,
66
+ YieldBearing = 1
67
+ }
68
+ export type YieldMarket = {
69
+ accountDiscriminator: number[];
70
+ pubkey: PublicKey;
71
+ oracle: PublicKey;
72
+ name: number[];
73
+ quoteAssetVault: PublicKey;
74
+ baseAssetVault: PublicKey;
75
+ pool: Ammpool;
76
+ startTs: BigNumber;
77
+ expireTs: BigNumber;
78
+ orderStepSize: BigNumber;
79
+ minOrderSize: BigNumber;
80
+ minLpAmount: BigNumber;
81
+ minLiquidationSize: BigNumber;
82
+ marketIndex: number;
83
+ marginIndex: number;
84
+ lpMarginIndex: number;
85
+ marginType: MarginType;
86
+ lpMarginType: MarginType;
87
+ marginDecimals: number;
88
+ lpMarginDecimals: number;
89
+ };
90
+ export declare const yieldMarketStruct: FixableBeetStruct<YieldMarket, Partial<YieldMarket>>;
91
+ export type Oracle = {
92
+ accountDiscriminator: number[];
93
+ admin: PublicKey;
94
+ name: number[];
95
+ lastRate: BigNumber;
96
+ rate: BigNumber;
97
+ marketRate: BigNumber;
98
+ ts: BigNumber;
99
+ decimals: number;
100
+ padding: number[];
101
+ epochStartTimestamp: BigNumber;
102
+ lastEpochStartTimestamp: BigNumber;
103
+ padding1: number[];
104
+ };
105
+ export declare const oracleStruct: FixableBeetStruct<Oracle, Partial<Oracle>>;
106
+ export type YieldPosition = {
107
+ baseAssetAmount: BigNumber;
108
+ quoteAssetAmount: BigNumber;
109
+ lastRate: BigNumber;
110
+ marketIndex: number;
111
+ padding1: number[];
112
+ padding2: number[];
113
+ };
114
+ export declare const yieldPositionStruct: BeetStruct<YieldPosition, Partial<YieldPosition>>;
115
+ export declare enum OrderStatus {
116
+ Init = 0,
117
+ Open = 1,
118
+ Filled = 2,
119
+ Canceled = 3
120
+ }
121
+ export declare enum OrderType {
122
+ Market = 0,
123
+ Limit = 1
124
+ }
125
+ export type Order = {
126
+ slot: BigNumber;
127
+ priceLimit: BigNumber;
128
+ baseAssetAmount: BigNumber;
129
+ baseAssetAmountFilled: BigNumber;
130
+ quoteAssetAmountFilled: BigNumber;
131
+ expireTs: BigNumber;
132
+ orderIndex: number;
133
+ orderId: number;
134
+ isolatedMarginAmount: BigNumber;
135
+ marketIndex: number;
136
+ status: OrderStatus;
137
+ orderType: OrderType;
138
+ isClose: boolean;
139
+ padding1: number[];
140
+ padding2: number[];
141
+ };
142
+ export declare const orderStruct: BeetStruct<Order, Partial<Order>>;
143
+ export type MarginPosition = {
144
+ balance: BigNumber;
145
+ marketIndex: number;
146
+ decimals: number;
147
+ padding2: number[];
148
+ };
149
+ export declare const marginPositionStruct: BeetStruct<MarginPosition, Partial<MarginPosition>>;
150
+ export type User = {
151
+ accountDiscriminator: number[];
152
+ authority: PublicKey;
153
+ marginPositions: MarginPosition[];
154
+ orders: Order[];
155
+ yieldPositions: YieldPosition[];
156
+ lastActiveSlot: BigNumber;
157
+ lastOrderId: number;
158
+ subAccountId: number;
159
+ idle: boolean;
160
+ padding2: boolean;
161
+ isIsolated: boolean;
162
+ isExpiryOn: boolean;
163
+ padding1: number[];
164
+ };
165
+ export declare const userStruct: FixableBeetStruct<User, Partial<User>>;
166
+ export type UserStats = {
167
+ accountDiscriminator: number[];
168
+ authority: PublicKey;
169
+ referrer: PublicKey;
170
+ numberOfSubAccounts: number;
171
+ numberOfSubAccountsCreated: number;
172
+ padding: number[];
173
+ };
174
+ export declare const userStatsStruct: BeetStruct<UserStats, Partial<UserStats>>;
175
+ export type PositionRewardInfo = {
176
+ growthInsideCheckpoint: BigNumber;
177
+ amountOwed: BigNumber;
178
+ };
179
+ export declare const positionrewardinfoStruct: BeetStruct<PositionRewardInfo, Partial<PositionRewardInfo>>;
180
+ export type AmmPosition = {
181
+ ammpool: PublicKey;
182
+ liquidity: BigNumber;
183
+ tickLowerIndex: number;
184
+ tickUpperIndex: number;
185
+ lowerRate: BigNumber;
186
+ upperRate: BigNumber;
187
+ feeGrowthCheckpointA: BigNumber;
188
+ feeOwedA: BigNumber;
189
+ feeGrowthCheckpointB: BigNumber;
190
+ feeOwedB: BigNumber;
191
+ rewardInfos: PositionRewardInfo[];
192
+ };
193
+ export declare const positionStruct: BeetStruct<AmmPosition, Partial<AmmPosition>>;
194
+ export declare enum LpStatus {
195
+ Active = 0,
196
+ Updating = 1
197
+ }
198
+ export type LP = {
199
+ accountDiscriminator: number[];
200
+ authority: PublicKey;
201
+ ammPosition: AmmPosition;
202
+ reserveQuoteAmount: BigNumber;
203
+ reserveBaseAmount: BigNumber;
204
+ lastActiveSlot: BigNumber;
205
+ subAccountId: BigNumber;
206
+ idle: boolean;
207
+ state: LpStatus;
208
+ padding1: number[];
209
+ padding2: number[];
210
+ };
211
+ export declare const lpStruct: BeetStruct<LP, Partial<LP>>;
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lpStruct = exports.LpStatus = exports.positionStruct = exports.positionrewardinfoStruct = exports.userStatsStruct = exports.userStruct = exports.marginPositionStruct = exports.orderStruct = exports.OrderType = exports.OrderStatus = exports.yieldPositionStruct = exports.oracleStruct = exports.yieldMarketStruct = exports.MarginType = exports.ammpoolStruct = exports.ammPoolRewardInfoStruct = exports.marginMarketStruct = exports.stateStruct = 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.stateStruct = new beet_1.FixableBeetStruct([
8
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
9
+ ['admin', beet_solana_1.publicKey],
10
+ ['signer', beet_solana_1.publicKey],
11
+ ['numberOfAuthorities', solana_1.u64],
12
+ ['numberOfSubAccounts', solana_1.u64],
13
+ ['collateralRatioInitial', solana_1.i64],
14
+ ['collateralRatioMaintenance', solana_1.i64],
15
+ ['collateralRatioInitialPreExpiry', solana_1.i64],
16
+ ['numberOfYieldMarkets', beet_1.u32],
17
+ ['numberOfMarginMarkets', beet_1.u32],
18
+ ['signerNonce', beet_1.u8],
19
+ ['twapDuration', beet_1.u32],
20
+ ['marginIndexStart', beet_1.u32],
21
+ ['marketIndexStart', beet_1.u32],
22
+ ['keepers', (0, beet_1.uniformFixedSizeArray)(beet_solana_1.publicKey, 20)],
23
+ ['keeperFeePerTx', solana_1.u64],
24
+ ['keeperFee', solana_1.u64],
25
+ ], (args) => args);
26
+ exports.marginMarketStruct = new beet_1.FixableBeetStruct([
27
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
28
+ ['pubkey', beet_solana_1.publicKey],
29
+ ['mint', beet_solana_1.publicKey],
30
+ ], (args) => args);
31
+ exports.ammPoolRewardInfoStruct = new beet_1.BeetStruct([
32
+ ['mint', beet_solana_1.publicKey],
33
+ ['vault', beet_solana_1.publicKey],
34
+ ['authority', beet_solana_1.publicKey],
35
+ ['emissionsPerSecondX64', solana_1.u128],
36
+ ['growthGlobalX64', solana_1.u128],
37
+ ], (args) => args);
38
+ exports.ammpoolStruct = new beet_1.BeetStruct([
39
+ ['ammpoolsConfig', beet_solana_1.publicKey],
40
+ ['liquidity', solana_1.u128],
41
+ ['sqrtPrice', solana_1.u128],
42
+ ['protocolFeeOwedA', solana_1.u64],
43
+ ['protocolFeeOwedB', solana_1.u64],
44
+ ['tokenMintBase', beet_solana_1.publicKey],
45
+ ['tokenVaultBase', beet_solana_1.publicKey],
46
+ ['feeGrowthGlobalA', solana_1.u128],
47
+ ['tokenMintQuote', beet_solana_1.publicKey],
48
+ ['tokenVaultQuote', beet_solana_1.publicKey],
49
+ ['feeGrowthGlobalB', solana_1.u128],
50
+ ['rewardLastUpdatedTimestamp', solana_1.u64],
51
+ ['rewardInfos', (0, beet_1.uniformFixedSizeArray)(exports.ammPoolRewardInfoStruct, 3)],
52
+ ['oracle', beet_solana_1.publicKey],
53
+ ['tickCurrentIndex', beet_1.i32],
54
+ ['observationIndex', beet_1.u16],
55
+ ['observationUpdateDuration', beet_1.u16],
56
+ ['tickSpacing', beet_1.u16],
57
+ ['tickSpacingSeed', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 2)],
58
+ ['feeRate', beet_1.u16],
59
+ ['protocolFeeRate', beet_1.u16],
60
+ ], (args) => args);
61
+ var MarginType;
62
+ (function (MarginType) {
63
+ MarginType[MarginType["NonYieldBearing"] = 0] = "NonYieldBearing";
64
+ MarginType[MarginType["YieldBearing"] = 1] = "YieldBearing";
65
+ })(MarginType || (exports.MarginType = MarginType = {}));
66
+ exports.yieldMarketStruct = new beet_1.FixableBeetStruct([
67
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
68
+ ['pubkey', beet_solana_1.publicKey],
69
+ ['oracle', beet_solana_1.publicKey],
70
+ ['name', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
71
+ ['quoteAssetVault', beet_solana_1.publicKey],
72
+ ['baseAssetVault', beet_solana_1.publicKey],
73
+ ['pool', exports.ammpoolStruct],
74
+ ['startTs', solana_1.i64],
75
+ ['expireTs', solana_1.i64],
76
+ ['orderStepSize', solana_1.u64],
77
+ ['minOrderSize', solana_1.u64],
78
+ ['minLpAmount', solana_1.u64],
79
+ ['minLiquidationSize', solana_1.u64],
80
+ ['marketIndex', beet_1.u32],
81
+ ['marginIndex', beet_1.u32],
82
+ ['lpMarginIndex', beet_1.u32],
83
+ ['marginType', beet_1.u8],
84
+ ['lpMarginType', beet_1.u8],
85
+ ['marginDecimals', beet_1.u8],
86
+ ['lpMarginDecimals', beet_1.u8],
87
+ ], (args) => args);
88
+ exports.oracleStruct = new beet_1.FixableBeetStruct([
89
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
90
+ ['admin', beet_solana_1.publicKey],
91
+ ['name', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
92
+ ['lastRate', solana_1.u64],
93
+ ['rate', solana_1.u64],
94
+ ['marketRate', solana_1.u64],
95
+ ['ts', solana_1.i64],
96
+ ['decimals', beet_1.u32],
97
+ ['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 4)],
98
+ ['epochStartTimestamp', solana_1.i64],
99
+ ['lastEpochStartTimestamp', solana_1.i64],
100
+ ['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
101
+ ], (args) => args);
102
+ exports.yieldPositionStruct = new beet_1.BeetStruct([
103
+ ['baseAssetAmount', solana_1.i64],
104
+ ['quoteAssetAmount', solana_1.i64],
105
+ ['lastRate', solana_1.u64],
106
+ ['marketIndex', beet_1.u32],
107
+ ['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 4)],
108
+ ['padding2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
109
+ ], (args) => args);
110
+ var OrderStatus;
111
+ (function (OrderStatus) {
112
+ OrderStatus[OrderStatus["Init"] = 0] = "Init";
113
+ OrderStatus[OrderStatus["Open"] = 1] = "Open";
114
+ OrderStatus[OrderStatus["Filled"] = 2] = "Filled";
115
+ OrderStatus[OrderStatus["Canceled"] = 3] = "Canceled";
116
+ })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
117
+ var OrderType;
118
+ (function (OrderType) {
119
+ OrderType[OrderType["Market"] = 0] = "Market";
120
+ OrderType[OrderType["Limit"] = 1] = "Limit";
121
+ })(OrderType || (exports.OrderType = OrderType = {}));
122
+ exports.orderStruct = new beet_1.BeetStruct([
123
+ ['slot', solana_1.u64],
124
+ ['priceLimit', solana_1.u128],
125
+ ['baseAssetAmount', solana_1.i64],
126
+ ['baseAssetAmountFilled', solana_1.i64],
127
+ ['quoteAssetAmountFilled', solana_1.i64],
128
+ ['expireTs', solana_1.i64],
129
+ ['orderIndex', beet_1.u32],
130
+ ['orderId', beet_1.u32],
131
+ ['isolatedMarginAmount', solana_1.u64],
132
+ ['marketIndex', beet_1.u32],
133
+ ['status', beet_1.u8],
134
+ ['orderType', beet_1.u8],
135
+ ['isClose', beet_1.bool],
136
+ ['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 1)],
137
+ ['padding2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
138
+ ], (args) => args);
139
+ exports.marginPositionStruct = new beet_1.BeetStruct([
140
+ ['balance', solana_1.i64],
141
+ ['marketIndex', beet_1.u32],
142
+ ['decimals', beet_1.u32],
143
+ ['padding2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
144
+ ], (args) => args);
145
+ exports.userStruct = new beet_1.FixableBeetStruct([
146
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
147
+ ['authority', beet_solana_1.publicKey],
148
+ ['marginPositions', (0, beet_1.uniformFixedSizeArray)(exports.marginPositionStruct, 2)],
149
+ ['orders', (0, beet_1.uniformFixedSizeArray)(exports.orderStruct, 32)],
150
+ ['yieldPositions', (0, beet_1.uniformFixedSizeArray)(exports.yieldPositionStruct, 8)],
151
+ ['lastActiveSlot', solana_1.u64],
152
+ ['lastOrderId', beet_1.u32],
153
+ ['subAccountId', beet_1.u16],
154
+ ['idle', beet_1.bool],
155
+ ['padding2', beet_1.bool],
156
+ ['isIsolated', beet_1.bool],
157
+ ['isExpiryOn', beet_1.bool],
158
+ ['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 6)],
159
+ ], (args) => args);
160
+ exports.userStatsStruct = new beet_1.BeetStruct([
161
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
162
+ ['authority', beet_solana_1.publicKey],
163
+ ['referrer', beet_solana_1.publicKey],
164
+ ['numberOfSubAccounts', beet_1.u16],
165
+ ['numberOfSubAccountsCreated', beet_1.u16],
166
+ ['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 52)],
167
+ ], (args) => args);
168
+ exports.positionrewardinfoStruct = new beet_1.BeetStruct([
169
+ ['growthInsideCheckpoint', solana_1.u128],
170
+ ['amountOwed', solana_1.u64],
171
+ ], (args) => args);
172
+ exports.positionStruct = new beet_1.BeetStruct([
173
+ ['ammpool', beet_solana_1.publicKey],
174
+ ['liquidity', solana_1.u128],
175
+ ['tickLowerIndex', beet_1.i32],
176
+ ['tickUpperIndex', beet_1.i32],
177
+ ['lowerRate', solana_1.u64],
178
+ ['upperRate', solana_1.u64],
179
+ ['feeGrowthCheckpointA', solana_1.u128],
180
+ ['feeOwedA', solana_1.u64],
181
+ ['feeGrowthCheckpointB', solana_1.u128],
182
+ ['feeOwedB', solana_1.u64],
183
+ ['rewardInfos', (0, beet_1.uniformFixedSizeArray)(exports.positionrewardinfoStruct, 3)],
184
+ ], (args) => args);
185
+ var LpStatus;
186
+ (function (LpStatus) {
187
+ LpStatus[LpStatus["Active"] = 0] = "Active";
188
+ LpStatus[LpStatus["Updating"] = 1] = "Updating";
189
+ })(LpStatus || (exports.LpStatus = LpStatus = {}));
190
+ exports.lpStruct = new beet_1.BeetStruct([
191
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
192
+ ['authority', beet_solana_1.publicKey],
193
+ ['ammPosition', exports.positionStruct],
194
+ ['reserveQuoteAmount', solana_1.i64],
195
+ ['reserveBaseAmount', solana_1.i64],
196
+ ['lastActiveSlot', solana_1.u64],
197
+ ['subAccountId', beet_1.u16],
198
+ ['idle', beet_1.bool],
199
+ ['state', beet_1.u8],
200
+ ['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 7)],
201
+ ['padding2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 72)],
202
+ ], (args) => args);
203
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/ratex/structs.ts"],"names":[],"mappings":";;;AAEA,oDASmC;AACnC,kEAA6D;AA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- };
1
+ import BigNumber from 'bignumber.js';
2
+ import { YieldMarket } from './structs';
8
3
  export type Program = {
9
4
  programId: string;
10
5
  mint: string;
11
6
  };
12
- export type UserStats = {
13
- numberOfSubAccountsCreated: number;
14
- };
15
- export type User = {
16
- marginPositions: MarginPosition[];
17
- };
18
- export type MarginPosition = {
19
- balance: number;
20
- marketIndex: number;
21
- decimals: number;
22
- };
23
- export type LP = {
24
- ammPosition: AmmPosition;
25
- reserveQuoteAmount: number;
26
- reserveBaseAmount: number;
27
- };
28
- export type AmmPosition = {
29
- ammpool: string;
30
- liquidity: number;
31
- tickLowerIndex: number;
32
- tickUpperIndex: number;
33
- lowerRate: number;
34
- upperRate: number;
35
- feeGrowthCheckpointA: number;
36
- feeOwedA: number;
37
- feeGrowthCheckpointB: number;
38
- feeOwedB: number;
39
- };
40
- export type YieldMarket = {
41
- pubkey: string;
42
- oracle: string;
43
- pool: Ammpool;
44
- lpMarginIndex: number;
45
- lpMarginDecimals: number;
46
- };
47
- export type AmmpoolRewardInfo = {
48
- mint: string;
49
- vault: string;
50
- authority: string;
51
- emissionsPerSecondX64: number;
52
- growthGlobalX64: number;
53
- };
54
- export type Ammpool = {
55
- ammpoolsConfig: string;
56
- liquidity: number;
57
- sqrtPrice: number;
58
- protocolFeeOwedA: number;
59
- protocolFeeOwedB: number;
60
- tokenMintBase: string;
61
- tokenVaultBase: string;
62
- feeGrowthGlobalA: number;
63
- tokenMintQuote: string;
64
- tokenVaultQuote: string;
65
- feeGrowthGlobalB: number;
66
- rewardLastUpdatedTimestamp: number;
67
- rewardInfos: AmmpoolRewardInfo[];
68
- oracle: string;
69
- tickCurrentIndex: number;
70
- observationIndex: number;
71
- observationUpdateDuration: number;
72
- tickSpacing: number;
73
- tickSpacingSeed: number[];
74
- feeRate: number;
75
- protocolFeeRate: number;
76
- };
77
- export type Oracle = {
78
- rate: number;
79
- };
80
- export type YieldMarketWithOracle = YieldMarket & Oracle;
81
7
  export type PtToken = {
82
8
  pt_mint: string;
83
9
  pt_price: number;
@@ -85,3 +11,6 @@ export type PtToken = {
85
11
  pt_yield: number;
86
12
  security_id: string;
87
13
  };
14
+ export type YieldMarketWithOracle = YieldMarket & {
15
+ rate: BigNumber;
16
+ };