lynx-client 0.0.38 → 0.1.0

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 (185) hide show
  1. package/dist/cjs/index.js +8 -3
  2. package/dist/cjs/lib/addresses/lensAddresses.js +10 -8
  3. package/dist/cjs/lib/constants/pairIds.js +6 -0
  4. package/dist/cjs/lib/contractsIntegration/LexLensService/ILexLensService.js +7 -1
  5. package/dist/cjs/lib/contractsIntegration/LexLensService/LexLensService.js +6 -0
  6. package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +6 -1
  7. package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +4 -0
  8. package/dist/cjs/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +12 -0
  9. package/dist/cjs/lib/devex/getChainAddresses.js +1 -1
  10. package/dist/cjs/lib/priceFeeds/flare/flareFeedConstants.js +3 -0
  11. package/dist/cjs/lib/priceFeeds/pyth/{pythFeedConstants.js → hermes/hermesFeedConstants.js} +11 -5
  12. package/dist/cjs/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.js +24 -0
  13. package/dist/{esm/lib/priceFeeds/pyth/pythPriceData.js → cjs/lib/priceFeeds/pyth/hermes/hermesPriceData.js} +11 -9
  14. package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerFeedConstants.js +166 -0
  15. package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.js +25 -0
  16. package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.js +2 -0
  17. package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerPriceData.js +60 -0
  18. package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerSigningFormats.js +27 -0
  19. package/dist/cjs/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.js +1 -1
  20. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.js +1 -1
  21. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.js +1 -1
  22. package/dist/cjs/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +1 -1
  23. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1 -1
  24. package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +1 -1
  25. package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +82 -1
  26. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1 -1
  27. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +81 -1
  28. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +42 -1
  29. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
  30. package/dist/esm/index.d.ts +8 -3
  31. package/dist/esm/index.d.ts.map +1 -1
  32. package/dist/esm/index.js +8 -3
  33. package/dist/esm/lib/addresses/lensAddresses.d.ts +10 -8
  34. package/dist/esm/lib/addresses/lensAddresses.d.ts.map +1 -1
  35. package/dist/esm/lib/addresses/lensAddresses.js +10 -8
  36. package/dist/esm/lib/constants/pairIds.d.ts +4 -1
  37. package/dist/esm/lib/constants/pairIds.d.ts.map +1 -1
  38. package/dist/esm/lib/constants/pairIds.js +6 -0
  39. package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.d.ts +4 -1
  40. package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.d.ts.map +1 -1
  41. package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.js +7 -1
  42. package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.d.ts +2 -1
  43. package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.d.ts.map +1 -1
  44. package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.js +6 -0
  45. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +4 -1
  46. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -1
  47. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +6 -1
  48. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +2 -1
  49. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -1
  50. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +4 -0
  51. package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +6 -1
  52. package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -1
  53. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +2 -1
  54. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -1
  55. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +12 -0
  56. package/dist/esm/lib/devex/getChainAddresses.js +1 -1
  57. package/dist/esm/lib/priceFeeds/flare/flareFeedConstants.d.ts.map +1 -1
  58. package/dist/esm/lib/priceFeeds/flare/flareFeedConstants.js +3 -0
  59. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedConstants.d.ts +5 -0
  60. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedConstants.d.ts.map +1 -0
  61. package/dist/esm/lib/priceFeeds/pyth/{pythFeedConstants.js → hermes/hermesFeedConstants.js} +11 -5
  62. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.d.ts +14 -0
  63. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.d.ts.map +1 -0
  64. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.js +24 -0
  65. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesPriceData.d.ts +11 -0
  66. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesPriceData.d.ts.map +1 -0
  67. package/dist/{cjs/lib/priceFeeds/pyth/pythPriceData.js → esm/lib/priceFeeds/pyth/hermes/hermesPriceData.js} +11 -9
  68. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedConstants.d.ts +54 -0
  69. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedConstants.d.ts.map +1 -0
  70. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedConstants.js +166 -0
  71. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.d.ts +16 -0
  72. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.d.ts.map +1 -0
  73. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.js +25 -0
  74. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.d.ts +64 -0
  75. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.d.ts.map +1 -0
  76. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.js +2 -0
  77. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPriceData.d.ts +26 -0
  78. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPriceData.d.ts.map +1 -0
  79. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPriceData.js +60 -0
  80. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerSigningFormats.d.ts +36 -0
  81. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerSigningFormats.d.ts.map +1 -0
  82. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerSigningFormats.js +27 -0
  83. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +63 -2
  84. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -1
  85. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts +30 -1
  86. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts.map +1 -1
  87. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +29 -1
  88. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
  89. package/dist/esm/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.d.ts +1 -1
  90. package/dist/esm/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.js +1 -1
  91. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts +1 -1
  92. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.js +1 -1
  93. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.d.ts +1 -1
  94. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.js +1 -1
  95. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +1 -1
  96. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +1 -1
  97. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +1 -1
  98. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1 -1
  99. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +1 -1
  100. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +1 -1
  101. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +64 -1
  102. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -1
  103. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +82 -1
  104. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1 -1
  105. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -1
  106. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1 -1
  107. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +62 -1
  108. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts.map +1 -1
  109. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +81 -1
  110. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +32 -1
  111. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -1
  112. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +42 -1
  113. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
  114. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
  115. package/dist/types/index.d.ts +8 -3
  116. package/dist/types/index.d.ts.map +1 -1
  117. package/dist/types/lib/addresses/lensAddresses.d.ts +10 -8
  118. package/dist/types/lib/addresses/lensAddresses.d.ts.map +1 -1
  119. package/dist/types/lib/constants/pairIds.d.ts +4 -1
  120. package/dist/types/lib/constants/pairIds.d.ts.map +1 -1
  121. package/dist/types/lib/contractsIntegration/LexLensService/ILexLensService.d.ts +4 -1
  122. package/dist/types/lib/contractsIntegration/LexLensService/ILexLensService.d.ts.map +1 -1
  123. package/dist/types/lib/contractsIntegration/LexLensService/LexLensService.d.ts +2 -1
  124. package/dist/types/lib/contractsIntegration/LexLensService/LexLensService.d.ts.map +1 -1
  125. package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +4 -1
  126. package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -1
  127. package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +2 -1
  128. package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -1
  129. package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +6 -1
  130. package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -1
  131. package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +2 -1
  132. package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -1
  133. package/dist/types/lib/priceFeeds/flare/flareFeedConstants.d.ts.map +1 -1
  134. package/dist/types/lib/priceFeeds/pyth/hermes/hermesFeedConstants.d.ts +5 -0
  135. package/dist/types/lib/priceFeeds/pyth/hermes/hermesFeedConstants.d.ts.map +1 -0
  136. package/dist/types/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.d.ts +14 -0
  137. package/dist/types/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.d.ts.map +1 -0
  138. package/dist/types/lib/priceFeeds/pyth/hermes/hermesPriceData.d.ts +11 -0
  139. package/dist/types/lib/priceFeeds/pyth/hermes/hermesPriceData.d.ts.map +1 -0
  140. package/dist/types/lib/priceFeeds/pyth/lazer/lazerFeedConstants.d.ts +54 -0
  141. package/dist/types/lib/priceFeeds/pyth/lazer/lazerFeedConstants.d.ts.map +1 -0
  142. package/dist/types/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.d.ts +16 -0
  143. package/dist/types/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.d.ts.map +1 -0
  144. package/dist/types/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.d.ts +64 -0
  145. package/dist/types/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.d.ts.map +1 -0
  146. package/dist/types/lib/priceFeeds/pyth/lazer/lazerPriceData.d.ts +26 -0
  147. package/dist/types/lib/priceFeeds/pyth/lazer/lazerPriceData.d.ts.map +1 -0
  148. package/dist/types/lib/priceFeeds/pyth/lazer/lazerSigningFormats.d.ts +36 -0
  149. package/dist/types/lib/priceFeeds/pyth/lazer/lazerSigningFormats.d.ts.map +1 -0
  150. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +63 -2
  151. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -1
  152. package/dist/types/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts +30 -1
  153. package/dist/types/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts.map +1 -1
  154. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +29 -1
  155. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
  156. package/dist/types/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.d.ts +1 -1
  157. package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts +1 -1
  158. package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.d.ts +1 -1
  159. package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +1 -1
  160. package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +1 -1
  161. package/dist/types/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +1 -1
  162. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +64 -1
  163. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -1
  164. package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1 -1
  165. package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -1
  166. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +62 -1
  167. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts.map +1 -1
  168. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +32 -1
  169. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -1
  170. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
  171. package/package.json +13 -13
  172. package/dist/cjs/lib/priceFeeds/pyth/pythFeedFunctions.js +0 -27
  173. package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts +0 -5
  174. package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +0 -1
  175. package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.d.ts +0 -17
  176. package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.d.ts.map +0 -1
  177. package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.js +0 -27
  178. package/dist/esm/lib/priceFeeds/pyth/pythPriceData.d.ts +0 -10
  179. package/dist/esm/lib/priceFeeds/pyth/pythPriceData.d.ts.map +0 -1
  180. package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts +0 -5
  181. package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +0 -1
  182. package/dist/types/lib/priceFeeds/pyth/pythFeedFunctions.d.ts +0 -17
  183. package/dist/types/lib/priceFeeds/pyth/pythFeedFunctions.d.ts.map +0 -1
  184. package/dist/types/lib/priceFeeds/pyth/pythPriceData.d.ts +0 -10
  185. package/dist/types/lib/priceFeeds/pyth/pythPriceData.d.ts.map +0 -1
package/dist/cjs/index.js CHANGED
@@ -36,9 +36,14 @@ __exportStar(require("./lib/constants/groupIds"), exports);
36
36
  __exportStar(require("./lib/constants/feeIds"), exports);
37
37
  // Market hours utilities
38
38
  __exportStar(require("./lib/marketHours/marketHoursUtils"), exports);
39
- __exportStar(require("./lib/priceFeeds/pyth/pythFeedConstants"), exports);
40
- __exportStar(require("./lib/priceFeeds/pyth/pythFeedFunctions"), exports);
41
- __exportStar(require("./lib/priceFeeds/pyth/pythPriceData"), exports);
39
+ __exportStar(require("./lib/priceFeeds/pyth/hermes/hermesFeedConstants"), exports);
40
+ __exportStar(require("./lib/priceFeeds/pyth/hermes/hermesFeedFunctions"), exports);
41
+ __exportStar(require("./lib/priceFeeds/pyth/hermes/hermesPriceData"), exports);
42
+ __exportStar(require("./lib/priceFeeds/pyth/lazer/lazerFeedConstants"), exports);
43
+ __exportStar(require("./lib/priceFeeds/pyth/lazer/lazerFeedFunctions"), exports);
44
+ __exportStar(require("./lib/priceFeeds/pyth/lazer/lazerPriceData"), exports);
45
+ __exportStar(require("./lib/priceFeeds/pyth/lazer/lazerSigningFormats"), exports);
46
+ __exportStar(require("./lib/priceFeeds/pyth/lazer/lazerPayloadTypes"), exports);
42
47
  __exportStar(require("./lib/priceFeeds/interfaces"), exports);
43
48
  __exportStar(require("./lib/priceFeeds/flare/flareFeedConstants"), exports);
44
49
  __exportStar(require("./lib/priceFeeds/flare/flareFeedFunctions"), exports);
@@ -1,39 +1,41 @@
1
1
  "use strict";
2
+ // Auto-generated by makeClientPackage.js
3
+ // Do not edit manually
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.LensAddresses = void 0;
4
6
  exports.LensAddresses = {
5
7
  boba: {
6
8
  intentsVerifierLens: "0x7DfA2F609573AB8eD8cA231498FF4E8f1e7d31Fa",
7
- lexLens: "0xacd54792eB1844eEB2285C29dE267aA65a7A4fB0",
8
- tradingFloorLensLens: "0x3fBE188f4C52683B910A2a0CBD914613f08CBC19",
9
+ lexLens: "0x6BAC6B06E9A34132dE2d0c6D8666b2620d12CD8F",
10
+ tradingFloorLens: "0x73B640d8a3E4C0B51B87802160DE8b58cbB44CC9",
9
11
  triggersAndPortalLens: "0xd8E6E20A03b6f3Dc02880ac6595678dc28ae2E8A",
10
12
  rateModelLens: "0xee6354F34892C5388FC69ea1CEc0f3050aF84fB9",
11
13
  },
12
14
  sonic: {
13
15
  intentsVerifierLens: "0x0C1Fcd85856b5564a87ae378336b7CC0c139C5f7",
14
- lexLens: "0x175b535ED0383e96Cc5f436464AF88768242E8d8",
15
- tradingFloorLensLens: "0x60E7D645e8Bd03A5865D787206Ab97c78dB234C1",
16
+ lexLens: "0xF9057675BCa17Dd70Fe525B97A674056748677C5",
17
+ tradingFloorLens: "0xaE89ab472d50Fd2cee9a8a05855c90bCe0443a1e",
16
18
  triggersAndPortalLens: "0xF791EB99654411487d9AC8334c6090716001E451",
17
19
  rateModelLens: "0x771176a09E84365552504437e3A026ea049CBa41",
18
20
  },
19
21
  fantom: {
20
22
  intentsVerifierLens: "",
21
23
  lexLens: "",
22
- tradingFloorLensLens: "",
24
+ tradingFloorLens: "",
23
25
  triggersAndPortalLens: "",
24
26
  rateModelLens: "",
25
27
  },
26
28
  flare: {
27
29
  intentsVerifierLens: "0x8fBb98F9BbBBB455A86371D4B2E8ECc7b1b9C6F6",
28
- lexLens: "0x731C1CECb65ab3056BDbBBF3037FBf85A8C888c8",
29
- tradingFloorLensLens: "0xa23D17478ef3f35AE0D540Cdfe6f48ae37Ae9423",
30
+ lexLens: "0xaFDB9874DFd46B0e19216BCA747057b156232e9A",
31
+ tradingFloorLens: "0xbd5F436558D4f81eBe663Eadf57850bf4888b39A",
30
32
  triggersAndPortalLens: "0x1D618cb0543827d0Db1063AEaa61cFCF54b33834",
31
33
  rateModelLens: "0x7D1893Da64A559C5F23C0f565F62C8480ff6A295",
32
34
  },
33
35
  sei: {
34
36
  intentsVerifierLens: "0xD50745448C28B614bCFf772577C02e4Cd4c9a656",
35
37
  lexLens: "0xC334ED231DBaB0584C4F1d091f523884E355De98",
36
- tradingFloorLensLens: "0x804B84Be72a20adb56e98692394794ADA2ab5Da7",
38
+ tradingFloorLens: "0x804B84Be72a20adb56e98692394794ADA2ab5Da7",
37
39
  triggersAndPortalLens: "0x408B6791f300FDEFbE0b56B182004366d9573c2F",
38
40
  rateModelLens: "0x3D317d988697F248fE4D33390E6365e55E14D4cc",
39
41
  },
@@ -14,6 +14,7 @@ exports.PAIR_CONFIGS_IDS = {
14
14
  XRP_USD: 6,
15
15
  // CRYPTO -- Specific cases
16
16
  FLR_USD: 1001,
17
+ SEI_USD: 1002,
17
18
  // CRYPTO -- new version of previous pair
18
19
  S_USD: 2004,
19
20
  // FOREX
@@ -35,6 +36,7 @@ exports.PAIR_CONFIGS_IDS = {
35
36
  // COMMODITIES
36
37
  GOLD_USD: 7001,
37
38
  SILVER_USD: 7002,
39
+ USOIL_USD: 7003,
38
40
  // CAT MODE -- CRYPTO
39
41
  BTC_USD_CAT: 10001,
40
42
  ETH_USD_CAT: 10002,
@@ -57,6 +59,7 @@ exports.PAIR_CONFIGS_IDS = {
57
59
  // CAT MODE -- COMMODITIES
58
60
  GOLD_USD_CAT: 17001,
59
61
  SILVER_USD_CAT: 17002,
62
+ USOIL_USD_CAT: 17003,
60
63
  };
61
64
  exports.PAIR_CONFIGS_IDENTIFIERS = {
62
65
  // CRYPTO
@@ -68,6 +71,7 @@ exports.PAIR_CONFIGS_IDENTIFIERS = {
68
71
  XRP_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.XRP_USD, "XRP", "USD"),
69
72
  // CRYPTO -- Specific cases
70
73
  FLR_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.FLR_USD, "FLR", "USD"),
74
+ SEI_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.SEI_USD, "SEI", "USD"),
71
75
  // CRYPTO -- new version of previous pair
72
76
  S_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.S_USD, "S", "USD"),
73
77
  // FOREX
@@ -89,6 +93,7 @@ exports.PAIR_CONFIGS_IDENTIFIERS = {
89
93
  // COMMODITIES
90
94
  GOLD_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.commoditiesGroup, exports.PAIR_CONFIGS_IDS.GOLD_USD, "GOLD", "USD"),
91
95
  SILVER_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.commoditiesGroup, exports.PAIR_CONFIGS_IDS.SILVER_USD, "SILVER", "USD"),
96
+ USOIL_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.commoditiesGroup, exports.PAIR_CONFIGS_IDS.USOIL_USD, "USOIL", "USD"),
92
97
  // CRYPTO CAT MODE
93
98
  BTC_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catCryptoGroup, exports.PAIR_CONFIGS_IDS.BTC_USD_CAT, "BTC", "USD"),
94
99
  ETH_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catCryptoGroup, exports.PAIR_CONFIGS_IDS.ETH_USD_CAT, "ETH", "USD"),
@@ -112,6 +117,7 @@ exports.PAIR_CONFIGS_IDENTIFIERS = {
112
117
  // COMMODITIES CAT MODE
113
118
  GOLD_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catCommoditiesGroup, exports.PAIR_CONFIGS_IDS.GOLD_USD_CAT, "GOLD", "USD"),
114
119
  SILVER_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catCommoditiesGroup, exports.PAIR_CONFIGS_IDS.SILVER_USD_CAT, "SILVER", "USD"),
120
+ USOIL_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catCommoditiesGroup, exports.PAIR_CONFIGS_IDS.USOIL_USD_CAT, "USOIL", "USD"),
115
121
  };
116
122
  const PAIR_ID_TO_NAME = Object.fromEntries(Object.entries(exports.PAIR_CONFIGS_IDENTIFIERS).map(([pairName, value]) => [
117
123
  value.id,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EMPTY_SINGLE_POSITION_OUTPUT = exports.EMPTY_COMPLETE_LEX_CONFIGS = exports.EMPTY_COMPLETE_LEX_STATE = exports.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS = exports.EMPTY_POOL_ACCOUNTANT_STATE_LENS = exports.EMPTY_LEX_POOL_SUPPLIER_LENS_STATE = exports.EMPTY_LEX_GROUP_STATE_LENS = exports.EMPTY_LEX_PAIR_STATE_LENS = exports.EMPTY_GROUP_CONFIGS_LENS = exports.EMPTY_FEE_CONFIGS_LENS = exports.EMPTY_PAIR_CONFIGS_LENS = exports.EMPTY_LEX_POOL_LENS_CONFIGS = exports.EMPTY_LEX_POOL_LENS_STATE = exports.EMPTY_LEX_POOL_LENS_PARAMS = exports.EMPTY_COLLATERAL_LIMITS_FOR_ASSET = exports.EMPTY_PENDING_EPOCH_REDEEM = exports.EMPTY_PENDING_EPOCH_DEPOSIT = void 0;
3
+ exports.EMPTY_SINGLE_POSITION_OUTPUT = exports.EMPTY_COMPLETE_LEX_CONFIGS = exports.EMPTY_COMPLETE_LEX_STATE = exports.EMPTY_TRADING_FLOOR_PER_ASSET_CONFIGS_LENS = exports.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS = exports.EMPTY_POOL_ACCOUNTANT_STATE_LENS = exports.EMPTY_LEX_POOL_SUPPLIER_LENS_STATE = exports.EMPTY_LEX_GROUP_STATE_LENS = exports.EMPTY_LEX_PAIR_STATE_LENS = exports.EMPTY_GROUP_CONFIGS_LENS = exports.EMPTY_FEE_CONFIGS_LENS = exports.EMPTY_PAIR_CONFIGS_LENS = exports.EMPTY_LEX_POOL_LENS_CONFIGS = exports.EMPTY_LEX_POOL_LENS_STATE = exports.EMPTY_LEX_POOL_LENS_PARAMS = exports.EMPTY_COLLATERAL_LIMITS_FOR_ASSET = exports.EMPTY_PENDING_EPOCH_REDEEM = exports.EMPTY_PENDING_EPOCH_DEPOSIT = void 0;
4
4
  // Empty constants
5
5
  exports.EMPTY_PENDING_EPOCH_DEPOSIT = {
6
6
  account: "",
@@ -128,6 +128,11 @@ exports.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS = {
128
128
  maxVirtualUtilization: 0n,
129
129
  supportedPairIds: [],
130
130
  };
131
+ exports.EMPTY_TRADING_FLOOR_PER_ASSET_CONFIGS_LENS = {
132
+ tradingFloor: "",
133
+ settlementAsset: "",
134
+ maxProfitBypassThreshold: 0n,
135
+ };
131
136
  exports.EMPTY_COMPLETE_LEX_STATE = {
132
137
  lexPoolState: exports.EMPTY_LEX_POOL_LENS_STATE,
133
138
  poolAccountantState: exports.EMPTY_POOL_ACCOUNTANT_STATE_LENS,
@@ -138,6 +143,7 @@ exports.EMPTY_COMPLETE_LEX_CONFIGS = {
138
143
  lexPoolParams: exports.EMPTY_LEX_POOL_LENS_PARAMS,
139
144
  lexPoolConfigurations: exports.EMPTY_LEX_POOL_LENS_CONFIGS,
140
145
  poolAccountantConfigurations: exports.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS,
146
+ tradingFloorPerAssetConfigurations: exports.EMPTY_TRADING_FLOOR_PER_ASSET_CONFIGS_LENS,
141
147
  groupsConfigs: [],
142
148
  pairsConfigs: [],
143
149
  feesConfigs: [],
@@ -68,6 +68,7 @@ class LexLensService {
68
68
  lexPoolParams: ILexLensService_1.EMPTY_LEX_POOL_LENS_PARAMS,
69
69
  lexPoolConfigurations: ILexLensService_1.EMPTY_LEX_POOL_LENS_CONFIGS,
70
70
  poolAccountantConfigurations: ILexLensService_1.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS,
71
+ tradingFloorPerAssetConfigurations: ILexLensService_1.EMPTY_TRADING_FLOOR_PER_ASSET_CONFIGS_LENS,
71
72
  });
72
73
  // Apply number conversions
73
74
  return {
@@ -216,6 +217,10 @@ class LexLensService {
216
217
  pendingEpochRedeems: ILexLensService_1.EMPTY_PENDING_EPOCH_REDEEM,
217
218
  });
218
219
  }
220
+ async readTradingFloorPerAssetConfigurations(lexPool, callOptions) {
221
+ const result = await this.contract.readTradingFloorPerAssetConfigurations(lexPool, { ...callOptions });
222
+ return (0, ethersTypes_1.ethersStructResponseToObject)(result, ILexLensService_1.EMPTY_TRADING_FLOOR_PER_ASSET_CONFIGS_LENS);
223
+ }
219
224
  async tradesValuesMultiplePairs(accountant, pairsTrades, callOptions) {
220
225
  // @ts-ignore
221
226
  const results = await this.contract.tradesValuesMultiplePairs.staticCall(accountant, pairsTrades, { ...callOptions });
@@ -236,6 +241,7 @@ class LexLensService {
236
241
  lexPoolParams: ILexLensService_1.EMPTY_LEX_POOL_LENS_PARAMS,
237
242
  lexPoolConfigurations: ILexLensService_1.EMPTY_LEX_POOL_LENS_CONFIGS,
238
243
  poolAccountantConfigurations: ILexLensService_1.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS,
244
+ tradingFloorPerAssetConfigurations: ILexLensService_1.EMPTY_TRADING_FLOOR_PER_ASSET_CONFIGS_LENS,
239
245
  });
240
246
  // Apply number conversions
241
247
  return {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EMPTY_TRADE_PARAMS = exports.EMPTY_LIQUIDATION_RESULT = exports.EMPTY_POSITION_LIQUIDATION_INFO = exports.EMPTY_POSITIONS_RESULT = exports.EMPTY_COMPLETE_POSITION_DATA = void 0;
3
+ exports.EMPTY_PER_ASSET_PARAMS = exports.EMPTY_TRADE_PARAMS = exports.EMPTY_LIQUIDATION_RESULT = exports.EMPTY_POSITION_LIQUIDATION_INFO = exports.EMPTY_POSITIONS_RESULT = exports.EMPTY_COMPLETE_POSITION_DATA = void 0;
4
4
  // Empty struct constants for ethersStructResponseToObject
5
5
  exports.EMPTY_COMPLETE_POSITION_DATA = {
6
6
  id: "",
@@ -61,3 +61,8 @@ exports.EMPTY_TRADE_PARAMS = {
61
61
  maxSlF: 0,
62
62
  maxSanityProfitF: 0,
63
63
  };
64
+ exports.EMPTY_PER_ASSET_PARAMS = {
65
+ tradingFloor: "",
66
+ settlementAsset: "",
67
+ maxProfitBypassThreshold: 0n,
68
+ };
@@ -110,6 +110,10 @@ class TradingFloorLensService {
110
110
  maxSanityProfitF: Number(result.maxSanityProfitF),
111
111
  };
112
112
  }
113
+ async getTradingFloorPerAssetParams(tradingFloor, settlementAsset, callOptions) {
114
+ const result = await this.contract.getTradingFloorPerAssetParams(tradingFloor, settlementAsset, { ...callOptions });
115
+ return (0, ethersTypes_1.ethersStructResponseToObject)(result, ITradingFloorLensService_1.EMPTY_PER_ASSET_PARAMS);
116
+ }
113
117
  getContract() {
114
118
  return this.contract;
115
119
  }
@@ -94,6 +94,17 @@ class SettlementAndPool {
94
94
  return this.tradingFloorContract.poolAccountantForAsset(asset, { ...callOptions });
95
95
  }
96
96
  }
97
+ class PerAssetConfig {
98
+ constructor(tradingFloorContract) {
99
+ this.tradingFloorContract = tradingFloorContract;
100
+ }
101
+ async maxProfitBypassThresholdByAsset(asset, callOptions) {
102
+ return this.tradingFloorContract.maxProfitBypassThresholdByAsset(asset, { ...callOptions });
103
+ }
104
+ async setMaxProfitBypassThreshold(asset, threshold, callOptions) {
105
+ return this.tradingFloorContract.setMaxProfitBypassThreshold(asset, threshold, { ...callOptions });
106
+ }
107
+ }
97
108
  class Deprecated {
98
109
  constructor(tradingFloorContract) {
99
110
  this.tradingFloorContract = tradingFloorContract;
@@ -242,6 +253,7 @@ class TradingFloorService {
242
253
  this.tradingFloorContract = TradingFloorV1__factory_1.TradingFloorV1__factory.connect(address, signerOrProvider);
243
254
  this.positionQueries = new PositionQueries(this.tradingFloorContract);
244
255
  this.settlementAndPool = new SettlementAndPool(this.tradingFloorContract);
256
+ this.perAssetConfig = new PerAssetConfig(this.tradingFloorContract);
245
257
  this.deprecated = new Deprecated(this.tradingFloorContract);
246
258
  this.traderTracking = new TraderTracking(this.tradingFloorContract);
247
259
  this.tradingParameters = new TradingParameters(this.tradingFloorContract);
@@ -54,7 +54,7 @@ async function getChainAddresses(options) {
54
54
  orderBookAddress: orderBook,
55
55
  triggersAddress: triggers,
56
56
  lexLensAddress: lensAddresses.lexLens,
57
- tradingFloorLensAddress: lensAddresses.tradingFloorLensLens,
57
+ tradingFloorLensAddress: lensAddresses.tradingFloorLens,
58
58
  intentsVerifierLensAddress: lensAddresses.intentsVerifierLens,
59
59
  triggersAndPortalLensAddress: lensAddresses.triggersAndPortalLens,
60
60
  };
@@ -14,6 +14,7 @@ exports.FLARE_PAIRS_PRICE_FEED_IDS = {
14
14
  [pairIds_1.PAIR_CONFIGS_IDS.XRP_USD]: "0x015852502f55534400000000000000000000000000",
15
15
  [pairIds_1.PAIR_CONFIGS_IDS.S_USD]: "0x01532f555344000000000000000000000000000000",
16
16
  [pairIds_1.PAIR_CONFIGS_IDS.FLR_USD]: "0x01464c522f55534400000000000000000000000000",
17
+ [pairIds_1.PAIR_CONFIGS_IDS.SEI_USD]: "",
17
18
  [pairIds_1.PAIR_CONFIGS_IDS.EUR_USD]: "",
18
19
  [pairIds_1.PAIR_CONFIGS_IDS.GBP_USD]: "",
19
20
  [pairIds_1.PAIR_CONFIGS_IDS.AUD_USD]: "",
@@ -40,6 +41,7 @@ exports.FLARE_PAIRS_PRICE_FEED_IDS = {
40
41
  // Commodities (Flare feed IDs to be configured)
41
42
  [pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD]: "",
42
43
  [pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD]: "",
44
+ [pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD]: "",
43
45
  // CAT Mode Stocks
44
46
  [pairIds_1.PAIR_CONFIGS_IDS.TSLA_USD_CAT]: "",
45
47
  [pairIds_1.PAIR_CONFIGS_IDS.AAPL_USD_CAT]: "",
@@ -51,6 +53,7 @@ exports.FLARE_PAIRS_PRICE_FEED_IDS = {
51
53
  // CAT Mode Commodities
52
54
  [pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD_CAT]: "",
53
55
  [pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD_CAT]: "",
56
+ [pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD_CAT]: "",
54
57
  };
55
58
  // Reverse mapping
56
59
  exports.FLARE_PRICE_FEED_ID_TO_PAIR = Object.entries(exports.FLARE_PAIRS_PRICE_FEED_IDS).reduce((acc, [pairId, feedId]) => {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PYTH_PRICE_FEED_ID_TO_PAIR = exports.PYTH_PAIRS_PRICE_FEED_IDS = exports.PYTH_PRICE_KEYS = void 0;
4
- const pairIds_1 = require("../../constants/pairIds");
5
- exports.PYTH_PRICE_KEYS = {
3
+ exports.PYTH_HERMES_FEED_ID_TO_PAIR = exports.PYTH_HERMES_FEED_IDS = exports.PYTH_HERMES_PRICE_KEYS = void 0;
4
+ const pairIds_1 = require("../../../constants/pairIds");
5
+ exports.PYTH_HERMES_PRICE_KEYS = {
6
6
  [pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "Crypto.BTC/USD",
7
7
  [pairIds_1.PAIR_CONFIGS_IDS.ETH_USD]: "Crypto.ETH/USD",
8
8
  [pairIds_1.PAIR_CONFIGS_IDS.BNB_USD]: "Crypto.BNB/USD",
@@ -10,6 +10,7 @@ exports.PYTH_PRICE_KEYS = {
10
10
  [pairIds_1.PAIR_CONFIGS_IDS.SOL_USD]: "Crypto.SOL/USD",
11
11
  [pairIds_1.PAIR_CONFIGS_IDS.XRP_USD]: "Crypto.XRP/USD",
12
12
  [pairIds_1.PAIR_CONFIGS_IDS.FLR_USD]: "Crypto.FLR/USD",
13
+ [pairIds_1.PAIR_CONFIGS_IDS.SEI_USD]: "Crypto.SEI/USD",
13
14
  [pairIds_1.PAIR_CONFIGS_IDS.S_USD]: "Crypto.S/USD",
14
15
  // Forex
15
16
  [pairIds_1.PAIR_CONFIGS_IDS.EUR_USD]: "Fx.EUR/USD",
@@ -40,6 +41,7 @@ exports.PYTH_PRICE_KEYS = {
40
41
  // Commodities
41
42
  [pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD]: "Metal.XAU/USD",
42
43
  [pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD]: "Metal.XAG/USD",
44
+ [pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD]: "Commodities.USOILSPOT",
43
45
  // CAT Mode Stocks
44
46
  [pairIds_1.PAIR_CONFIGS_IDS.TSLA_USD_CAT]: "Equity.US.TSLA/USD",
45
47
  [pairIds_1.PAIR_CONFIGS_IDS.AAPL_USD_CAT]: "Equity.US.AAPL/USD",
@@ -51,9 +53,10 @@ exports.PYTH_PRICE_KEYS = {
51
53
  // CAT Mode Commodities
52
54
  [pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD_CAT]: "Metal.XAU/USD",
53
55
  [pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD_CAT]: "Metal.XAG/USD",
56
+ [pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD_CAT]: "Commodities.USOILSPOT",
54
57
  };
55
58
  // You can find the ids of prices at https://pyth.network/developers/price-feed-ids
56
- exports.PYTH_PAIRS_PRICE_FEED_IDS = {
59
+ exports.PYTH_HERMES_FEED_IDS = {
57
60
  [pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
58
61
  [pairIds_1.PAIR_CONFIGS_IDS.ETH_USD]: "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
59
62
  [pairIds_1.PAIR_CONFIGS_IDS.BNB_USD]: "0x2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1101c4f",
@@ -64,6 +67,7 @@ exports.PYTH_PAIRS_PRICE_FEED_IDS = {
64
67
  [pairIds_1.PAIR_CONFIGS_IDS.XRP_USD]: "0xec5d399846a9209f3fe5881d70aae9268c94339ff9817e8d18ff19fa05eea1c8",
65
68
  [pairIds_1.PAIR_CONFIGS_IDS.S_USD]: "0xf490b178d0c85683b7a0f2388b40af2e6f7c90cbe0f96b31f315f08d0e5a2d6d",
66
69
  [pairIds_1.PAIR_CONFIGS_IDS.FLR_USD]: "0x035aa8d0a2d74e19438f2c1440edff9f3b95f915ca65f681a25ed0bad3dc228d",
70
+ [pairIds_1.PAIR_CONFIGS_IDS.SEI_USD]: "0x53614f1cb0c031d4af66c04cb9c756234adad0e1cee85303795091499a4084eb",
67
71
  [pairIds_1.PAIR_CONFIGS_IDS.EUR_USD]: "0xa995d00bb36a63cef7fd2c287dc105fc8f3d93779f062f09551b0af3e81ec30b",
68
72
  [pairIds_1.PAIR_CONFIGS_IDS.GBP_USD]: "0x84c2dde9633d93d1bcad84e7dc41c9d56578b7ec52fabedc1f335d673df0a7c1",
69
73
  [pairIds_1.PAIR_CONFIGS_IDS.AUD_USD]: "0x67a6f93030420c1c9e3fe37c1ab6b77966af82f995944a9fefce357a22854a80",
@@ -90,6 +94,7 @@ exports.PYTH_PAIRS_PRICE_FEED_IDS = {
90
94
  // Commodities
91
95
  [pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD]: "0x765d2ba906dbc32ca17cc11f5310a89e9ee1f6420508c63861f2f8ba4ee34bb2",
92
96
  [pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD]: "0xf2fb02c32b055c805e7238d628e5e9dadef274376114eb1f012337cabe93871e",
97
+ [pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD]: "0x925ca92ff005ae943c158e3563f59698ce7e75c5a8c8dd43303a0a154887b3e6",
93
98
  // CAT Mode Stocks
94
99
  [pairIds_1.PAIR_CONFIGS_IDS.TSLA_USD_CAT]: "",
95
100
  [pairIds_1.PAIR_CONFIGS_IDS.AAPL_USD_CAT]: "",
@@ -101,9 +106,10 @@ exports.PYTH_PAIRS_PRICE_FEED_IDS = {
101
106
  // CAT Mode Commodities
102
107
  [pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD_CAT]: "",
103
108
  [pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD_CAT]: "",
109
+ [pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD_CAT]: "",
104
110
  };
105
111
  // Reverse mapping
106
- exports.PYTH_PRICE_FEED_ID_TO_PAIR = Object.entries(exports.PYTH_PAIRS_PRICE_FEED_IDS).reduce((acc, [pairId, feedId]) => {
112
+ exports.PYTH_HERMES_FEED_ID_TO_PAIR = Object.entries(exports.PYTH_HERMES_FEED_IDS).reduce((acc, [pairId, feedId]) => {
107
113
  if (feedId)
108
114
  acc[feedId] = parseInt(pairId);
109
115
  return acc;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getHermesPriceKeyForPair = getHermesPriceKeyForPair;
4
+ exports.getHermesFeedIdForPair = getHermesFeedIdForPair;
5
+ exports.getPairIdForHermesFeedId = getPairIdForHermesFeedId;
6
+ const hermesFeedConstants_1 = require("./hermesFeedConstants");
7
+ /**
8
+ * Get the Pyth Hermes symbol (e.g. "Crypto.BTC/USD") for a pair
9
+ */
10
+ function getHermesPriceKeyForPair(pairId) {
11
+ return hermesFeedConstants_1.PYTH_HERMES_PRICE_KEYS[pairId];
12
+ }
13
+ /**
14
+ * Get the Pyth Hermes feed id (32-byte hex hash) for a pair
15
+ */
16
+ function getHermesFeedIdForPair(pairId) {
17
+ return hermesFeedConstants_1.PYTH_HERMES_FEED_IDS[pairId];
18
+ }
19
+ /**
20
+ * Get the pair id for a Pyth Hermes feed id (reverse lookup)
21
+ */
22
+ function getPairIdForHermesFeedId(feedId) {
23
+ return hermesFeedConstants_1.PYTH_HERMES_FEED_ID_TO_PAIR[feedId];
24
+ }
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPricesForTimestamp = getPricesForTimestamp;
4
- const scales_1 = require("../../constants/scales");
5
- const lynxScalesUtils_1 = require("../../lynxSystem/lynxScalesUtils");
6
- const bignumbers_1 = require("../../utils/bignumbers");
3
+ exports.getHermesPriceForTimestamp = getHermesPriceForTimestamp;
4
+ const scales_1 = require("../../../constants/scales");
5
+ const lynxScalesUtils_1 = require("../../../lynxSystem/lynxScalesUtils");
6
+ const bignumbers_1 = require("../../../utils/bignumbers");
7
7
  /**
8
- * Helper function to parse Pyth API response data into CombinedPriceData
8
+ * Helper function to parse Pyth Hermes API response data into CombinedPriceData
9
9
  */
10
10
  function parseResponse(data) {
11
11
  const encodedPrice = data.binary?.data ? `0x${data.binary.data}` : "";
@@ -30,13 +30,14 @@ function parseResponse(data) {
30
30
  };
31
31
  }
32
32
  /**
33
- * Fetches historical price data from Pyth for a specific timestamp or later
33
+ * Fetches historical price data from Pyth Hermes for a specific timestamp or later
34
34
  * Only searches forward in time (timestamp >= startTimestamp), never backwards
35
- * @param priceFeedId - The Pyth price feed ID
35
+ * @param priceFeedId - The Pyth Hermes price feed ID (32-byte hex hash)
36
36
  * @param startTimestamp - The minimum timestamp to search from
37
37
  * @param maxTimeGap - Maximum seconds to search forward from startTimestamp
38
+ * @param pairId - Optional pair identifier included in error messages for context
38
39
  */
39
- async function getPricesForTimestamp(priceFeedId, startTimestamp, maxTimeGap) {
40
+ async function getHermesPriceForTimestamp(priceFeedId, startTimestamp, maxTimeGap, pairId) {
40
41
  const hermesUrl = "https://hermes.pyth.network";
41
42
  const buildUrl = (timestamp) => `${hermesUrl}/v2/updates/price/${timestamp}?ids[]=${priceFeedId}&encoding=hex`;
42
43
  // Try timestamps from startTimestamp onwards, incrementing by 1 second
@@ -47,5 +48,6 @@ async function getPricesForTimestamp(priceFeedId, startTimestamp, maxTimeGap) {
47
48
  return parseResponse(await response.json());
48
49
  }
49
50
  }
50
- throw new Error(`No price found for asset ${priceFeedId} at or within ${maxTimeGap}s after timestamp ${startTimestamp}`);
51
+ const pairContext = pairId !== undefined ? ` (pair ${pairId})` : "";
52
+ throw new Error(`No price found for Pyth Hermes feed ${priceFeedId}${pairContext} at or within ${maxTimeGap}s after timestamp ${startTimestamp}`);
51
53
  }
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PYTH_LAZER_FEED_ID_TO_PAIR = exports.PYTH_LAZER_FEED_IDS = exports.PYTH_LAZER_PRICE_KEYS = void 0;
4
+ const pairIds_1 = require("../../../constants/pairIds");
5
+ const lazerId = (n) => n;
6
+ /**
7
+ * Pyth Lazer symbol per pair. Mirrors PYTH_HERMES_PRICE_KEYS but uses Lazer's
8
+ * symbol convention (e.g. "FX." uppercase prefix instead of Hermes' "Fx.").
9
+ */
10
+ exports.PYTH_LAZER_PRICE_KEYS = {
11
+ // Crypto
12
+ [pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "Crypto.BTC/USD",
13
+ [pairIds_1.PAIR_CONFIGS_IDS.ETH_USD]: "Crypto.ETH/USD",
14
+ [pairIds_1.PAIR_CONFIGS_IDS.BNB_USD]: "Crypto.BNB/USD",
15
+ // Crypto.FTM/USD is deprecated; reuses Crypto.S/USD (same convention as Hermes map)
16
+ [pairIds_1.PAIR_CONFIGS_IDS.FTM_USD]: "Crypto.S/USD",
17
+ [pairIds_1.PAIR_CONFIGS_IDS.SOL_USD]: "Crypto.SOL/USD",
18
+ [pairIds_1.PAIR_CONFIGS_IDS.XRP_USD]: "Crypto.XRP/USD",
19
+ [pairIds_1.PAIR_CONFIGS_IDS.FLR_USD]: "Crypto.FLR/USD",
20
+ [pairIds_1.PAIR_CONFIGS_IDS.SEI_USD]: "Crypto.SEI/USD",
21
+ [pairIds_1.PAIR_CONFIGS_IDS.S_USD]: "Crypto.S/USD",
22
+ // Forex (Lazer uses uppercase "FX." prefix)
23
+ [pairIds_1.PAIR_CONFIGS_IDS.EUR_USD]: "FX.EUR/USD",
24
+ [pairIds_1.PAIR_CONFIGS_IDS.GBP_USD]: "FX.GBP/USD",
25
+ [pairIds_1.PAIR_CONFIGS_IDS.AUD_USD]: "FX.AUD/USD",
26
+ [pairIds_1.PAIR_CONFIGS_IDS.NZD_USD]: "FX.NZD/USD",
27
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_JPY]: "FX.USD/JPY",
28
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_CHF]: "FX.USD/CHF",
29
+ // Stocks
30
+ [pairIds_1.PAIR_CONFIGS_IDS.TSLA_USD]: "Equity.US.TSLA/USD",
31
+ [pairIds_1.PAIR_CONFIGS_IDS.AAPL_USD]: "Equity.US.AAPL/USD",
32
+ [pairIds_1.PAIR_CONFIGS_IDS.NVDA_USD]: "Equity.US.NVDA/USD",
33
+ [pairIds_1.PAIR_CONFIGS_IDS.AMZN_USD]: "Equity.US.AMZN/USD",
34
+ [pairIds_1.PAIR_CONFIGS_IDS.GOOGL_USD]: "Equity.US.GOOGL/USD",
35
+ [pairIds_1.PAIR_CONFIGS_IDS.MSFT_USD]: "Equity.US.MSFT/USD",
36
+ [pairIds_1.PAIR_CONFIGS_IDS.META_USD]: "Equity.US.META/USD",
37
+ // Commodities
38
+ [pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD]: "Metal.XAU/USD",
39
+ [pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD]: "Metal.XAG/USD",
40
+ [pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD]: "Commodities.USOILSPOT",
41
+ // CAT mode — share the symbol of the corresponding non-CAT pair
42
+ [pairIds_1.PAIR_CONFIGS_IDS.BTC_USD_CAT]: "Crypto.BTC/USD",
43
+ [pairIds_1.PAIR_CONFIGS_IDS.ETH_USD_CAT]: "Crypto.ETH/USD",
44
+ [pairIds_1.PAIR_CONFIGS_IDS.EUR_USD_CAT]: "FX.EUR/USD",
45
+ [pairIds_1.PAIR_CONFIGS_IDS.GBP_USD_CAT]: "FX.GBP/USD",
46
+ [pairIds_1.PAIR_CONFIGS_IDS.AUD_USD_CAT]: "FX.AUD/USD",
47
+ [pairIds_1.PAIR_CONFIGS_IDS.NZD_USD_CAT]: "FX.NZD/USD",
48
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_JPY_CAT]: "FX.USD/JPY",
49
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_CHF_CAT]: "FX.USD/CHF",
50
+ [pairIds_1.PAIR_CONFIGS_IDS.TSLA_USD_CAT]: "Equity.US.TSLA/USD",
51
+ [pairIds_1.PAIR_CONFIGS_IDS.AAPL_USD_CAT]: "Equity.US.AAPL/USD",
52
+ [pairIds_1.PAIR_CONFIGS_IDS.NVDA_USD_CAT]: "Equity.US.NVDA/USD",
53
+ [pairIds_1.PAIR_CONFIGS_IDS.AMZN_USD_CAT]: "Equity.US.AMZN/USD",
54
+ [pairIds_1.PAIR_CONFIGS_IDS.GOOGL_USD_CAT]: "Equity.US.GOOGL/USD",
55
+ [pairIds_1.PAIR_CONFIGS_IDS.MSFT_USD_CAT]: "Equity.US.MSFT/USD",
56
+ [pairIds_1.PAIR_CONFIGS_IDS.META_USD_CAT]: "Equity.US.META/USD",
57
+ [pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD_CAT]: "Metal.XAU/USD",
58
+ [pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD_CAT]: "Metal.XAG/USD",
59
+ [pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD_CAT]: "Commodities.USOILSPOT",
60
+ };
61
+ /**
62
+ * Pyth Lazer u32 feed identifiers per pair. Source of truth is
63
+ * https://pyth.dourolabs.app/v1/symbols (pyth_lazer_id field).
64
+ *
65
+ * CAT pairs intentionally share the same feed id as their non-CAT counterpart
66
+ * (the underlying market data is identical). This is a behavior change vs the
67
+ * Hermes map, which uses empty-string sentinels for CAT pairs — Lazer callers
68
+ * always get a usable id back.
69
+ *
70
+ * Feed availability on Lazer at the time these were captured (verify with
71
+ * scripts/verifyLazerMapping.ts before relying on any of this).
72
+ *
73
+ * IMPORTANT — MIGRATION CONTEXT: Hermes is scheduled for deprecation
74
+ * (~2026-07). Lazer is the long-term path. The two entries below are
75
+ * migration blockers that need to be resolved (Pyth state change OR feed
76
+ * replacement) before Hermes shutoff, otherwise we lose pricing entirely:
77
+ *
78
+ * - Crypto.FLR/USD (id 191) — Lazer state `coming_soon`. Querying returns
79
+ * HTTP 400 "Price feed id 191 is not ready". Today FLR pricing works via
80
+ * Hermes and Flare; post-Hermes-shutoff only Flare remains if Pyth has
81
+ * not yet promoted 191 to `stable`. Re-run scripts/verifyLazerMapping.ts
82
+ * to check current state.
83
+ *
84
+ * - Commodities.USOILSPOT (id 657) — Lazer state `inactive`. Querying
85
+ * returns HTTP 400 "Price feed id 657 is not ready". Today USOIL pricing
86
+ * works via Hermes only (the Flare oracle does NOT publish USOIL). This
87
+ * is the more urgent migration blocker: if Pyth does not reactivate 657
88
+ * before Hermes shutoff, we need an alternative provider for USOIL or
89
+ * we lose the pair.
90
+ *
91
+ * All other ids are `stable`.
92
+ */
93
+ exports.PYTH_LAZER_FEED_IDS = {
94
+ // Crypto
95
+ [pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: lazerId(1),
96
+ [pairIds_1.PAIR_CONFIGS_IDS.ETH_USD]: lazerId(2),
97
+ [pairIds_1.PAIR_CONFIGS_IDS.BNB_USD]: lazerId(15),
98
+ // FTM is deprecated; route to S/USD's Lazer id, matching the Hermes map convention.
99
+ [pairIds_1.PAIR_CONFIGS_IDS.FTM_USD]: lazerId(190),
100
+ [pairIds_1.PAIR_CONFIGS_IDS.SOL_USD]: lazerId(6),
101
+ [pairIds_1.PAIR_CONFIGS_IDS.XRP_USD]: lazerId(14),
102
+ [pairIds_1.PAIR_CONFIGS_IDS.FLR_USD]: lazerId(191), // state=coming_soon at time of writing
103
+ [pairIds_1.PAIR_CONFIGS_IDS.SEI_USD]: lazerId(51),
104
+ [pairIds_1.PAIR_CONFIGS_IDS.S_USD]: lazerId(190),
105
+ // Forex
106
+ [pairIds_1.PAIR_CONFIGS_IDS.EUR_USD]: lazerId(327),
107
+ [pairIds_1.PAIR_CONFIGS_IDS.GBP_USD]: lazerId(333),
108
+ [pairIds_1.PAIR_CONFIGS_IDS.AUD_USD]: lazerId(315),
109
+ [pairIds_1.PAIR_CONFIGS_IDS.NZD_USD]: lazerId(337),
110
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_JPY]: lazerId(340),
111
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_CHF]: lazerId(339),
112
+ // Stocks
113
+ [pairIds_1.PAIR_CONFIGS_IDS.TSLA_USD]: lazerId(1435),
114
+ [pairIds_1.PAIR_CONFIGS_IDS.AAPL_USD]: lazerId(922),
115
+ [pairIds_1.PAIR_CONFIGS_IDS.NVDA_USD]: lazerId(1314),
116
+ [pairIds_1.PAIR_CONFIGS_IDS.AMZN_USD]: lazerId(954),
117
+ [pairIds_1.PAIR_CONFIGS_IDS.GOOGL_USD]: lazerId(1163),
118
+ [pairIds_1.PAIR_CONFIGS_IDS.MSFT_USD]: lazerId(1292),
119
+ [pairIds_1.PAIR_CONFIGS_IDS.META_USD]: lazerId(1272),
120
+ // Commodities
121
+ [pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD]: lazerId(346),
122
+ [pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD]: lazerId(345),
123
+ [pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD]: lazerId(657), // state=inactive at time of writing
124
+ // CAT mode — share the feed id of the corresponding non-CAT pair
125
+ [pairIds_1.PAIR_CONFIGS_IDS.BTC_USD_CAT]: lazerId(1),
126
+ [pairIds_1.PAIR_CONFIGS_IDS.ETH_USD_CAT]: lazerId(2),
127
+ [pairIds_1.PAIR_CONFIGS_IDS.EUR_USD_CAT]: lazerId(327),
128
+ [pairIds_1.PAIR_CONFIGS_IDS.GBP_USD_CAT]: lazerId(333),
129
+ [pairIds_1.PAIR_CONFIGS_IDS.AUD_USD_CAT]: lazerId(315),
130
+ [pairIds_1.PAIR_CONFIGS_IDS.NZD_USD_CAT]: lazerId(337),
131
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_JPY_CAT]: lazerId(340),
132
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_CHF_CAT]: lazerId(339),
133
+ [pairIds_1.PAIR_CONFIGS_IDS.TSLA_USD_CAT]: lazerId(1435),
134
+ [pairIds_1.PAIR_CONFIGS_IDS.AAPL_USD_CAT]: lazerId(922),
135
+ [pairIds_1.PAIR_CONFIGS_IDS.NVDA_USD_CAT]: lazerId(1314),
136
+ [pairIds_1.PAIR_CONFIGS_IDS.AMZN_USD_CAT]: lazerId(954),
137
+ [pairIds_1.PAIR_CONFIGS_IDS.GOOGL_USD_CAT]: lazerId(1163),
138
+ [pairIds_1.PAIR_CONFIGS_IDS.MSFT_USD_CAT]: lazerId(1292),
139
+ [pairIds_1.PAIR_CONFIGS_IDS.META_USD_CAT]: lazerId(1272),
140
+ [pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD_CAT]: lazerId(346),
141
+ [pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD_CAT]: lazerId(345),
142
+ [pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD_CAT]: lazerId(657),
143
+ };
144
+ /**
145
+ * Reverse lookup: Lazer feed id → pair id. CAT pairs share an id with their
146
+ * non-CAT base, so only the base pair is present — the reverse map returns the
147
+ * "canonical" non-CAT pair for any given Lazer feed id.
148
+ */
149
+ exports.PYTH_LAZER_FEED_ID_TO_PAIR = (() => {
150
+ const acc = {};
151
+ // Iterate non-CAT pairs first so CAT entries don't overwrite them
152
+ const catSuffix = "_CAT";
153
+ const orderedPairNames = Object.keys(pairIds_1.PAIR_CONFIGS_IDS).sort((a, b) => {
154
+ const aCat = a.endsWith(catSuffix);
155
+ const bCat = b.endsWith(catSuffix);
156
+ return Number(aCat) - Number(bCat);
157
+ });
158
+ for (const name of orderedPairNames) {
159
+ const pairId = pairIds_1.PAIR_CONFIGS_IDS[name];
160
+ const feedId = exports.PYTH_LAZER_FEED_IDS[pairId];
161
+ if (feedId !== undefined && !(feedId in acc)) {
162
+ acc[feedId] = pairId;
163
+ }
164
+ }
165
+ return acc;
166
+ })();
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLazerPriceKeyForPair = getLazerPriceKeyForPair;
4
+ exports.getLazerFeedIdForPair = getLazerFeedIdForPair;
5
+ exports.getPairIdForLazerFeedId = getPairIdForLazerFeedId;
6
+ const lazerFeedConstants_1 = require("./lazerFeedConstants");
7
+ /**
8
+ * Get the Pyth Lazer symbol (e.g. "Crypto.BTC/USD") for a pair
9
+ */
10
+ function getLazerPriceKeyForPair(pairId) {
11
+ return lazerFeedConstants_1.PYTH_LAZER_PRICE_KEYS[pairId];
12
+ }
13
+ /**
14
+ * Get the Pyth Lazer u32 feed id for a pair
15
+ */
16
+ function getLazerFeedIdForPair(pairId) {
17
+ return lazerFeedConstants_1.PYTH_LAZER_FEED_IDS[pairId];
18
+ }
19
+ /**
20
+ * Get the canonical (non-CAT) pair id for a Pyth Lazer feed id, or undefined
21
+ * if no pair is registered for that feed id.
22
+ */
23
+ function getPairIdForLazerFeedId(feedId) {
24
+ return lazerFeedConstants_1.PYTH_LAZER_FEED_ID_TO_PAIR[feedId];
25
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });