lynx-client 0.0.39 → 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 (175) 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/contractsIntegration/LexLensService/ILexLensService.js +7 -1
  4. package/dist/cjs/lib/contractsIntegration/LexLensService/LexLensService.js +6 -0
  5. package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +6 -1
  6. package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +4 -0
  7. package/dist/cjs/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +12 -0
  8. package/dist/cjs/lib/devex/getChainAddresses.js +1 -1
  9. package/dist/cjs/lib/priceFeeds/pyth/{pythFeedConstants.js → hermes/hermesFeedConstants.js} +5 -5
  10. package/dist/cjs/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.js +24 -0
  11. package/dist/{esm/lib/priceFeeds/pyth/pythPriceData.js → cjs/lib/priceFeeds/pyth/hermes/hermesPriceData.js} +11 -9
  12. package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerFeedConstants.js +166 -0
  13. package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.js +25 -0
  14. package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.js +2 -0
  15. package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerPriceData.js +60 -0
  16. package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerSigningFormats.js +27 -0
  17. package/dist/cjs/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.js +1 -1
  18. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.js +1 -1
  19. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.js +1 -1
  20. package/dist/cjs/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +1 -1
  21. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1 -1
  22. package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +1 -1
  23. package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +82 -1
  24. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1 -1
  25. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +81 -1
  26. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +42 -1
  27. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
  28. package/dist/esm/index.d.ts +8 -3
  29. package/dist/esm/index.d.ts.map +1 -1
  30. package/dist/esm/index.js +8 -3
  31. package/dist/esm/lib/addresses/lensAddresses.d.ts +10 -8
  32. package/dist/esm/lib/addresses/lensAddresses.d.ts.map +1 -1
  33. package/dist/esm/lib/addresses/lensAddresses.js +10 -8
  34. package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.d.ts +4 -1
  35. package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.d.ts.map +1 -1
  36. package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.js +7 -1
  37. package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.d.ts +2 -1
  38. package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.d.ts.map +1 -1
  39. package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.js +6 -0
  40. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +4 -1
  41. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -1
  42. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +6 -1
  43. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +2 -1
  44. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -1
  45. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +4 -0
  46. package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +6 -1
  47. package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -1
  48. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +2 -1
  49. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -1
  50. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +12 -0
  51. package/dist/esm/lib/devex/getChainAddresses.js +1 -1
  52. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedConstants.d.ts +5 -0
  53. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedConstants.d.ts.map +1 -0
  54. package/dist/esm/lib/priceFeeds/pyth/{pythFeedConstants.js → hermes/hermesFeedConstants.js} +5 -5
  55. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.d.ts +14 -0
  56. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.d.ts.map +1 -0
  57. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.js +24 -0
  58. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesPriceData.d.ts +11 -0
  59. package/dist/esm/lib/priceFeeds/pyth/hermes/hermesPriceData.d.ts.map +1 -0
  60. package/dist/{cjs/lib/priceFeeds/pyth/pythPriceData.js → esm/lib/priceFeeds/pyth/hermes/hermesPriceData.js} +11 -9
  61. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedConstants.d.ts +54 -0
  62. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedConstants.d.ts.map +1 -0
  63. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedConstants.js +166 -0
  64. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.d.ts +16 -0
  65. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.d.ts.map +1 -0
  66. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.js +25 -0
  67. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.d.ts +64 -0
  68. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.d.ts.map +1 -0
  69. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.js +2 -0
  70. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPriceData.d.ts +26 -0
  71. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPriceData.d.ts.map +1 -0
  72. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPriceData.js +60 -0
  73. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerSigningFormats.d.ts +36 -0
  74. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerSigningFormats.d.ts.map +1 -0
  75. package/dist/esm/lib/priceFeeds/pyth/lazer/lazerSigningFormats.js +27 -0
  76. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +63 -2
  77. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -1
  78. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts +30 -1
  79. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts.map +1 -1
  80. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +29 -1
  81. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
  82. package/dist/esm/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.d.ts +1 -1
  83. package/dist/esm/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.js +1 -1
  84. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts +1 -1
  85. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.js +1 -1
  86. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.d.ts +1 -1
  87. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.js +1 -1
  88. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +1 -1
  89. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +1 -1
  90. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +1 -1
  91. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1 -1
  92. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +1 -1
  93. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +1 -1
  94. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +64 -1
  95. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -1
  96. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +82 -1
  97. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1 -1
  98. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -1
  99. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1 -1
  100. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +62 -1
  101. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts.map +1 -1
  102. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +81 -1
  103. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +32 -1
  104. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -1
  105. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +42 -1
  106. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
  107. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
  108. package/dist/types/index.d.ts +8 -3
  109. package/dist/types/index.d.ts.map +1 -1
  110. package/dist/types/lib/addresses/lensAddresses.d.ts +10 -8
  111. package/dist/types/lib/addresses/lensAddresses.d.ts.map +1 -1
  112. package/dist/types/lib/contractsIntegration/LexLensService/ILexLensService.d.ts +4 -1
  113. package/dist/types/lib/contractsIntegration/LexLensService/ILexLensService.d.ts.map +1 -1
  114. package/dist/types/lib/contractsIntegration/LexLensService/LexLensService.d.ts +2 -1
  115. package/dist/types/lib/contractsIntegration/LexLensService/LexLensService.d.ts.map +1 -1
  116. package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +4 -1
  117. package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -1
  118. package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +2 -1
  119. package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -1
  120. package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +6 -1
  121. package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -1
  122. package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +2 -1
  123. package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -1
  124. package/dist/types/lib/priceFeeds/pyth/hermes/hermesFeedConstants.d.ts +5 -0
  125. package/dist/types/lib/priceFeeds/pyth/hermes/hermesFeedConstants.d.ts.map +1 -0
  126. package/dist/types/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.d.ts +14 -0
  127. package/dist/types/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.d.ts.map +1 -0
  128. package/dist/types/lib/priceFeeds/pyth/hermes/hermesPriceData.d.ts +11 -0
  129. package/dist/types/lib/priceFeeds/pyth/hermes/hermesPriceData.d.ts.map +1 -0
  130. package/dist/types/lib/priceFeeds/pyth/lazer/lazerFeedConstants.d.ts +54 -0
  131. package/dist/types/lib/priceFeeds/pyth/lazer/lazerFeedConstants.d.ts.map +1 -0
  132. package/dist/types/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.d.ts +16 -0
  133. package/dist/types/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.d.ts.map +1 -0
  134. package/dist/types/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.d.ts +64 -0
  135. package/dist/types/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.d.ts.map +1 -0
  136. package/dist/types/lib/priceFeeds/pyth/lazer/lazerPriceData.d.ts +26 -0
  137. package/dist/types/lib/priceFeeds/pyth/lazer/lazerPriceData.d.ts.map +1 -0
  138. package/dist/types/lib/priceFeeds/pyth/lazer/lazerSigningFormats.d.ts +36 -0
  139. package/dist/types/lib/priceFeeds/pyth/lazer/lazerSigningFormats.d.ts.map +1 -0
  140. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +63 -2
  141. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -1
  142. package/dist/types/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts +30 -1
  143. package/dist/types/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts.map +1 -1
  144. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +29 -1
  145. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
  146. package/dist/types/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.d.ts +1 -1
  147. package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts +1 -1
  148. package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.d.ts +1 -1
  149. package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +1 -1
  150. package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +1 -1
  151. package/dist/types/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +1 -1
  152. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +64 -1
  153. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -1
  154. package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1 -1
  155. package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -1
  156. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +62 -1
  157. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts.map +1 -1
  158. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +32 -1
  159. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -1
  160. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
  161. package/package.json +13 -13
  162. package/dist/cjs/lib/priceFeeds/pyth/pythFeedFunctions.js +0 -27
  163. package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts +0 -5
  164. package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +0 -1
  165. package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.d.ts +0 -17
  166. package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.d.ts.map +0 -1
  167. package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.js +0 -27
  168. package/dist/esm/lib/priceFeeds/pyth/pythPriceData.d.ts +0 -10
  169. package/dist/esm/lib/priceFeeds/pyth/pythPriceData.d.ts.map +0 -1
  170. package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts +0 -5
  171. package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +0 -1
  172. package/dist/types/lib/priceFeeds/pyth/pythFeedFunctions.d.ts +0 -17
  173. package/dist/types/lib/priceFeeds/pyth/pythFeedFunctions.d.ts.map +0 -1
  174. package/dist/types/lib/priceFeeds/pyth/pythPriceData.d.ts +0 -10
  175. 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
  },
@@ -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
  };
@@ -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",
@@ -56,7 +56,7 @@ exports.PYTH_PRICE_KEYS = {
56
56
  [pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD_CAT]: "Commodities.USOILSPOT",
57
57
  };
58
58
  // You can find the ids of prices at https://pyth.network/developers/price-feed-ids
59
- exports.PYTH_PAIRS_PRICE_FEED_IDS = {
59
+ exports.PYTH_HERMES_FEED_IDS = {
60
60
  [pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
61
61
  [pairIds_1.PAIR_CONFIGS_IDS.ETH_USD]: "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
62
62
  [pairIds_1.PAIR_CONFIGS_IDS.BNB_USD]: "0x2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1101c4f",
@@ -109,7 +109,7 @@ exports.PYTH_PAIRS_PRICE_FEED_IDS = {
109
109
  [pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD_CAT]: "",
110
110
  };
111
111
  // Reverse mapping
112
- 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]) => {
113
113
  if (feedId)
114
114
  acc[feedId] = parseInt(pairId);
115
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 });
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLazerPriceForTimestamp = getLazerPriceForTimestamp;
4
+ const scales_1 = require("../../../constants/scales");
5
+ const lynxScalesUtils_1 = require("../../../lynxSystem/lynxScalesUtils");
6
+ const bignumbers_1 = require("../../../utils/bignumbers");
7
+ const LAZER_HISTORY_BASE_URL = "https://pyth.dourolabs.app";
8
+ function parseHistoryRow(row) {
9
+ const expo = row.exponent;
10
+ const price = Number(row.price);
11
+ const conf = Number(row.confidence);
12
+ const priceInScale = (0, bignumbers_1.floatToUnitsBn)(price, scales_1.PRICES_SCALE + expo);
13
+ const confInScale = (0, bignumbers_1.floatToUnitsBn)(conf, scales_1.PRICES_SCALE + expo);
14
+ return {
15
+ // History endpoint returns unsigned price data; encodedPrice stays empty.
16
+ // Verifiable bytes for on-chain submission must come from the WebSocket
17
+ // stream's `evm` field (see LazerStreamUpdated).
18
+ encodedPrice: "",
19
+ priceInUnits: (0, lynxScalesUtils_1.priceBnToFloat)(priceInScale),
20
+ priceConfidenceInUnits: (0, lynxScalesUtils_1.priceBnToFloat)(confInScale),
21
+ // publish_time is microseconds on Lazer; CombinedPriceData.priceTimestamp
22
+ // is seconds, matching the Hermes convention.
23
+ priceTimestamp: Math.floor(row.publish_time / 1000000),
24
+ priceInScale,
25
+ confInScale,
26
+ };
27
+ }
28
+ /**
29
+ * Fetch unsigned historical price data from Pyth Lazer's History REST API
30
+ * for a single feed id at a specific timestamp.
31
+ *
32
+ * Returns the price snapshot the History API resolves at that timestamp.
33
+ * Throws if the API returns no row for the feed.
34
+ *
35
+ * @param feedId - Pyth Lazer u32 feed identifier
36
+ * @param timestampSec - Unix timestamp in seconds
37
+ * @param options.channel - `real_time` | `fixed_rate@50ms` | `fixed_rate@200ms` | `fixed_rate@1000ms` (default `real_time`)
38
+ * @param options.pairId - Pair id for error message context
39
+ * @param options.baseUrl - Override the API base URL
40
+ */
41
+ async function getLazerPriceForTimestamp(feedId, timestampSec, options = {}) {
42
+ const channel = options.channel ?? "real_time";
43
+ const baseUrl = options.baseUrl ?? LAZER_HISTORY_BASE_URL;
44
+ const timestampMicros = timestampSec * 1000000;
45
+ const url = `${baseUrl}/v1/${channel}/price?ids=${feedId}&timestamp=${timestampMicros}`;
46
+ const response = await fetch(url);
47
+ if (!response.ok) {
48
+ const pairContext = options.pairId !== undefined ? ` (pair ${options.pairId})` : "";
49
+ throw new Error(`Pyth Lazer history request failed for feed ${feedId}${pairContext} at timestamp ${timestampSec}s on channel '${channel}': HTTP ${response.status}`);
50
+ }
51
+ const rows = (await response.json());
52
+ const row = Array.isArray(rows)
53
+ ? rows.find((r) => r.price_feed_id === feedId)
54
+ : undefined;
55
+ if (!row) {
56
+ const pairContext = options.pairId !== undefined ? ` (pair ${options.pairId})` : "";
57
+ throw new Error(`No price found for Pyth Lazer feed ${feedId}${pairContext} at timestamp ${timestampSec}s on channel '${channel}'`);
58
+ }
59
+ return parseHistoryRow(row);
60
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lazerPayloadToBytes = lazerPayloadToBytes;
4
+ /**
5
+ * Convert a Lazer verifiable payload into a 0x-prefixed hex string suitable for
6
+ * submitting as the `bytes priceUpdate` argument to `PythLazer.verifyUpdate`
7
+ * (or any EVM contract method expecting raw payload bytes).
8
+ */
9
+ function lazerPayloadToBytes(payload) {
10
+ if (payload.encoding === "hex") {
11
+ return payload.data.startsWith("0x") ? payload.data : `0x${payload.data}`;
12
+ }
13
+ // base64 → hex
14
+ const base64 = payload.data;
15
+ const binary = typeof Buffer !== "undefined"
16
+ ? Buffer.from(base64, "base64").toString("hex")
17
+ : base64ToHexBrowser(base64);
18
+ return `0x${binary}`;
19
+ }
20
+ function base64ToHexBrowser(base64) {
21
+ const binaryString = atob(base64);
22
+ let hex = "";
23
+ for (let i = 0; i < binaryString.length; i++) {
24
+ hex += binaryString.charCodeAt(i).toString(16).padStart(2, "0");
25
+ }
26
+ return hex;
27
+ }