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.
- package/dist/cjs/index.js +8 -3
- package/dist/cjs/lib/addresses/lensAddresses.js +10 -8
- package/dist/cjs/lib/constants/pairIds.js +6 -0
- package/dist/cjs/lib/contractsIntegration/LexLensService/ILexLensService.js +7 -1
- package/dist/cjs/lib/contractsIntegration/LexLensService/LexLensService.js +6 -0
- package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +6 -1
- package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +4 -0
- package/dist/cjs/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +12 -0
- package/dist/cjs/lib/devex/getChainAddresses.js +1 -1
- package/dist/cjs/lib/priceFeeds/flare/flareFeedConstants.js +3 -0
- package/dist/cjs/lib/priceFeeds/pyth/{pythFeedConstants.js → hermes/hermesFeedConstants.js} +11 -5
- package/dist/cjs/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.js +24 -0
- package/dist/{esm/lib/priceFeeds/pyth/pythPriceData.js → cjs/lib/priceFeeds/pyth/hermes/hermesPriceData.js} +11 -9
- package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerFeedConstants.js +166 -0
- package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.js +25 -0
- package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.js +2 -0
- package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerPriceData.js +60 -0
- package/dist/cjs/lib/priceFeeds/pyth/lazer/lazerSigningFormats.js +27 -0
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +82 -1
- package/dist/cjs/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1 -1
- package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +81 -1
- package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +42 -1
- package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
- package/dist/esm/index.d.ts +8 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +8 -3
- package/dist/esm/lib/addresses/lensAddresses.d.ts +10 -8
- package/dist/esm/lib/addresses/lensAddresses.d.ts.map +1 -1
- package/dist/esm/lib/addresses/lensAddresses.js +10 -8
- package/dist/esm/lib/constants/pairIds.d.ts +4 -1
- package/dist/esm/lib/constants/pairIds.d.ts.map +1 -1
- package/dist/esm/lib/constants/pairIds.js +6 -0
- package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.d.ts +4 -1
- package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.js +7 -1
- package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.d.ts +2 -1
- package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.js +6 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +4 -1
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +6 -1
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +2 -1
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +4 -0
- package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +6 -1
- package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +2 -1
- package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -1
- package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +12 -0
- package/dist/esm/lib/devex/getChainAddresses.js +1 -1
- package/dist/esm/lib/priceFeeds/flare/flareFeedConstants.d.ts.map +1 -1
- package/dist/esm/lib/priceFeeds/flare/flareFeedConstants.js +3 -0
- package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedConstants.d.ts +5 -0
- package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedConstants.d.ts.map +1 -0
- package/dist/esm/lib/priceFeeds/pyth/{pythFeedConstants.js → hermes/hermesFeedConstants.js} +11 -5
- package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.d.ts +14 -0
- package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.d.ts.map +1 -0
- package/dist/esm/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.js +24 -0
- package/dist/esm/lib/priceFeeds/pyth/hermes/hermesPriceData.d.ts +11 -0
- package/dist/esm/lib/priceFeeds/pyth/hermes/hermesPriceData.d.ts.map +1 -0
- package/dist/{cjs/lib/priceFeeds/pyth/pythPriceData.js → esm/lib/priceFeeds/pyth/hermes/hermesPriceData.js} +11 -9
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedConstants.d.ts +54 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedConstants.d.ts.map +1 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedConstants.js +166 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.d.ts +16 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.d.ts.map +1 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.js +25 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.d.ts +64 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.d.ts.map +1 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.js +2 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPriceData.d.ts +26 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPriceData.d.ts.map +1 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerPriceData.js +60 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerSigningFormats.d.ts +36 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerSigningFormats.d.ts.map +1 -0
- package/dist/esm/lib/priceFeeds/pyth/lazer/lazerSigningFormats.js +27 -0
- package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +63 -2
- package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -1
- package/dist/esm/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts +30 -1
- package/dist/esm/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts.map +1 -1
- package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +29 -1
- package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +64 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +82 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +62 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +81 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +32 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +42 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
- package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
- package/dist/types/index.d.ts +8 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/addresses/lensAddresses.d.ts +10 -8
- package/dist/types/lib/addresses/lensAddresses.d.ts.map +1 -1
- package/dist/types/lib/constants/pairIds.d.ts +4 -1
- package/dist/types/lib/constants/pairIds.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/LexLensService/ILexLensService.d.ts +4 -1
- package/dist/types/lib/contractsIntegration/LexLensService/ILexLensService.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/LexLensService/LexLensService.d.ts +2 -1
- package/dist/types/lib/contractsIntegration/LexLensService/LexLensService.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +4 -1
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +2 -1
- package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +6 -1
- package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -1
- package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +2 -1
- package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -1
- package/dist/types/lib/priceFeeds/flare/flareFeedConstants.d.ts.map +1 -1
- package/dist/types/lib/priceFeeds/pyth/hermes/hermesFeedConstants.d.ts +5 -0
- package/dist/types/lib/priceFeeds/pyth/hermes/hermesFeedConstants.d.ts.map +1 -0
- package/dist/types/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.d.ts +14 -0
- package/dist/types/lib/priceFeeds/pyth/hermes/hermesFeedFunctions.d.ts.map +1 -0
- package/dist/types/lib/priceFeeds/pyth/hermes/hermesPriceData.d.ts +11 -0
- package/dist/types/lib/priceFeeds/pyth/hermes/hermesPriceData.d.ts.map +1 -0
- package/dist/types/lib/priceFeeds/pyth/lazer/lazerFeedConstants.d.ts +54 -0
- package/dist/types/lib/priceFeeds/pyth/lazer/lazerFeedConstants.d.ts.map +1 -0
- package/dist/types/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.d.ts +16 -0
- package/dist/types/lib/priceFeeds/pyth/lazer/lazerFeedFunctions.d.ts.map +1 -0
- package/dist/types/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.d.ts +64 -0
- package/dist/types/lib/priceFeeds/pyth/lazer/lazerPayloadTypes.d.ts.map +1 -0
- package/dist/types/lib/priceFeeds/pyth/lazer/lazerPriceData.d.ts +26 -0
- package/dist/types/lib/priceFeeds/pyth/lazer/lazerPriceData.d.ts.map +1 -0
- package/dist/types/lib/priceFeeds/pyth/lazer/lazerSigningFormats.d.ts +36 -0
- package/dist/types/lib/priceFeeds/pyth/lazer/lazerSigningFormats.d.ts.map +1 -0
- package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +63 -2
- package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -1
- package/dist/types/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts +30 -1
- package/dist/types/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts.map +1 -1
- package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +29 -1
- package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/IntentsVerifier/TradeIntentsVerifierV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/PoolAccountant/PoolAccountantV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +64 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1 -1
- package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +62 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +32 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -1
- package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
- package/package.json +13 -13
- package/dist/cjs/lib/priceFeeds/pyth/pythFeedFunctions.js +0 -27
- package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts +0 -5
- package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +0 -1
- package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.d.ts +0 -17
- package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.d.ts.map +0 -1
- package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.js +0 -27
- package/dist/esm/lib/priceFeeds/pyth/pythPriceData.d.ts +0 -10
- package/dist/esm/lib/priceFeeds/pyth/pythPriceData.d.ts.map +0 -1
- package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts +0 -5
- package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +0 -1
- package/dist/types/lib/priceFeeds/pyth/pythFeedFunctions.d.ts +0 -17
- package/dist/types/lib/priceFeeds/pyth/pythFeedFunctions.d.ts.map +0 -1
- package/dist/types/lib/priceFeeds/pyth/pythPriceData.d.ts +0 -10
- package/dist/types/lib/priceFeeds/pyth/pythPriceData.d.ts.map +0 -1
|
@@ -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,16 @@
|
|
|
1
|
+
import { PythLazerFeedId } from "./lazerFeedConstants";
|
|
2
|
+
import { TPairIds } from "../../../constants/pairIds";
|
|
3
|
+
/**
|
|
4
|
+
* Get the Pyth Lazer symbol (e.g. "Crypto.BTC/USD") for a pair
|
|
5
|
+
*/
|
|
6
|
+
export declare function getLazerPriceKeyForPair(pairId: TPairIds): string;
|
|
7
|
+
/**
|
|
8
|
+
* Get the Pyth Lazer u32 feed id for a pair
|
|
9
|
+
*/
|
|
10
|
+
export declare function getLazerFeedIdForPair(pairId: TPairIds): PythLazerFeedId;
|
|
11
|
+
/**
|
|
12
|
+
* Get the canonical (non-CAT) pair id for a Pyth Lazer feed id, or undefined
|
|
13
|
+
* if no pair is registered for that feed id.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getPairIdForLazerFeedId(feedId: PythLazerFeedId): TPairIds | undefined;
|
|
16
|
+
//# sourceMappingURL=lazerFeedFunctions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazerFeedFunctions.d.ts","sourceRoot":"","sources":["../../../../../../lib/priceFeeds/pyth/lazer/lazerFeedFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAEhE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,eAAe,CAEvE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,eAAe,GACtB,QAAQ,GAAG,SAAS,CAEtB"}
|
|
@@ -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,64 @@
|
|
|
1
|
+
import { PythLazerFeedId } from "./lazerFeedConstants";
|
|
2
|
+
import { LazerVerifiablePayload } from "./lazerSigningFormats";
|
|
3
|
+
/**
|
|
4
|
+
* Subscription channel — selects update cadence. `real_time` pushes every
|
|
5
|
+
* publisher update; fixed-rate channels coalesce updates onto a fixed cadence.
|
|
6
|
+
*/
|
|
7
|
+
export type LazerChannel = "real_time" | "fixed_rate@50ms" | "fixed_rate@200ms" | "fixed_rate@1000ms";
|
|
8
|
+
/**
|
|
9
|
+
* Trading session of an underlying market at the time of the update.
|
|
10
|
+
* Some markets (FX, equities, commodities) have non-regular sessions; crypto
|
|
11
|
+
* is always `regular`.
|
|
12
|
+
*/
|
|
13
|
+
export type LazerMarketSession = "regular" | "pre" | "post" | "closed" | (string & {});
|
|
14
|
+
/**
|
|
15
|
+
* A single price feed update inside a `streamUpdated` message.
|
|
16
|
+
* Optional fields appear only when requested via the subscription `properties`.
|
|
17
|
+
*
|
|
18
|
+
* Numeric fields delivered as strings by the wire format (large `i64` values
|
|
19
|
+
* exceed JS safe-integer range) are kept as strings here; consumers should
|
|
20
|
+
* `BigInt(...)` them before arithmetic.
|
|
21
|
+
*/
|
|
22
|
+
export interface LazerPriceFeedUpdate {
|
|
23
|
+
priceFeedId: PythLazerFeedId;
|
|
24
|
+
/** i64 mantissa as string. Actual price = `BigInt(price) * 10n ** BigInt(exponent)`. */
|
|
25
|
+
price: string;
|
|
26
|
+
/** i16 power-of-ten exponent (typically negative, e.g. -8). */
|
|
27
|
+
exponent: number;
|
|
28
|
+
/** i64 confidence interval, same scale as price. */
|
|
29
|
+
confidence: number;
|
|
30
|
+
/** Number of publishers contributing to this update. */
|
|
31
|
+
publisherCount: number;
|
|
32
|
+
marketSession: LazerMarketSession;
|
|
33
|
+
/** Microsecond Unix timestamp of when the price was generated. */
|
|
34
|
+
feedUpdateTimestamp: number;
|
|
35
|
+
bestBidPrice?: string;
|
|
36
|
+
bestAskPrice?: string;
|
|
37
|
+
emaPrice?: string;
|
|
38
|
+
emaConfidence?: number;
|
|
39
|
+
fundingRate?: string;
|
|
40
|
+
fundingTimestamp?: number;
|
|
41
|
+
fundingRateInterval?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Wire shape of a Pyth Lazer `streamUpdated` WebSocket message.
|
|
45
|
+
*
|
|
46
|
+
* The `evm` / `solana` / `leEcdsa` / `leUnsigned` keys hold the binary signed
|
|
47
|
+
* payload(s) for whichever signing formats were requested in the subscription.
|
|
48
|
+
* Use {@link lazerPayloadToBytes} to convert a payload into the bytes that
|
|
49
|
+
* `PythLazer.verifyUpdate(bytes)` expects on EVM chains.
|
|
50
|
+
*/
|
|
51
|
+
export interface LazerStreamUpdated {
|
|
52
|
+
type: "streamUpdated";
|
|
53
|
+
subscriptionId: number;
|
|
54
|
+
parsed: {
|
|
55
|
+
/** Microsecond Unix timestamp as a string (does not fit in JS Number for far-future values). */
|
|
56
|
+
timestampUs: string;
|
|
57
|
+
priceFeeds: LazerPriceFeedUpdate[];
|
|
58
|
+
};
|
|
59
|
+
evm?: LazerVerifiablePayload;
|
|
60
|
+
solana?: LazerVerifiablePayload;
|
|
61
|
+
leEcdsa?: LazerVerifiablePayload;
|
|
62
|
+
leUnsigned?: LazerVerifiablePayload;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=lazerPayloadTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazerPayloadTypes.d.ts","sourceRoot":"","sources":["../../../../../../lib/priceFeeds/pyth/lazer/lazerPayloadTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,CAAC;AAExB;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,KAAK,GACL,MAAM,GACN,QAAQ,GACR,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,eAAe,CAAC;IAC7B,wFAAwF;IACxF,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,kBAAkB,CAAC;IAClC,kEAAkE;IAClE,mBAAmB,EAAE,MAAM,CAAC;IAG5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,eAAe,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE;QACN,gGAAgG;QAChG,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,oBAAoB,EAAE,CAAC;KACpC,CAAC;IACF,GAAG,CAAC,EAAE,sBAAsB,CAAC;IAC7B,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACrC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CombinedPriceData } from "../../interfaces";
|
|
2
|
+
import { PythLazerFeedId } from "./lazerFeedConstants";
|
|
3
|
+
import { LazerChannel } from "./lazerPayloadTypes";
|
|
4
|
+
export interface GetLazerPriceOptions {
|
|
5
|
+
/** Update channel to query. Defaults to `real_time`. */
|
|
6
|
+
channel?: LazerChannel;
|
|
7
|
+
/** Pair identifier included in error messages for context. */
|
|
8
|
+
pairId?: number;
|
|
9
|
+
/** Override the Lazer history base URL (e.g. for testing). */
|
|
10
|
+
baseUrl?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Fetch unsigned historical price data from Pyth Lazer's History REST API
|
|
14
|
+
* for a single feed id at a specific timestamp.
|
|
15
|
+
*
|
|
16
|
+
* Returns the price snapshot the History API resolves at that timestamp.
|
|
17
|
+
* Throws if the API returns no row for the feed.
|
|
18
|
+
*
|
|
19
|
+
* @param feedId - Pyth Lazer u32 feed identifier
|
|
20
|
+
* @param timestampSec - Unix timestamp in seconds
|
|
21
|
+
* @param options.channel - `real_time` | `fixed_rate@50ms` | `fixed_rate@200ms` | `fixed_rate@1000ms` (default `real_time`)
|
|
22
|
+
* @param options.pairId - Pair id for error message context
|
|
23
|
+
* @param options.baseUrl - Override the API base URL
|
|
24
|
+
*/
|
|
25
|
+
export declare function getLazerPriceForTimestamp(feedId: PythLazerFeedId, timestampSec: number, options?: GetLazerPriceOptions): Promise<CombinedPriceData>;
|
|
26
|
+
//# sourceMappingURL=lazerPriceData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazerPriceData.d.ts","sourceRoot":"","sources":["../../../../../../lib/priceFeeds/pyth/lazer/lazerPriceData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAmDnD,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,iBAAiB,CAAC,CA2B5B"}
|
|
@@ -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}×tamp=${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,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pyth Lazer binary payload encoding format, selected per subscription.
|
|
3
|
+
* The chosen format determines the on-chain verifier that can validate it.
|
|
4
|
+
*
|
|
5
|
+
* - `evm` — secp256k1 ECDSA, 65-byte signature. For EVM chains
|
|
6
|
+
* (Ethereum, Arbitrum, Optimism, Polygon, BSC, Avalanche).
|
|
7
|
+
* - `solana` — Ed25519 EdDSA, 64-byte signature. For Solana / Fogo /
|
|
8
|
+
* Ed25519-native chains.
|
|
9
|
+
* - `leEcdsa` — secp256k1 ECDSA in little-endian byte order. For custom
|
|
10
|
+
* integrations.
|
|
11
|
+
* - `leUnsigned` — No signature. Off-chain / dev only.
|
|
12
|
+
*/
|
|
13
|
+
export type LazerSigningFormat = "evm" | "solana" | "leEcdsa" | "leUnsigned";
|
|
14
|
+
/**
|
|
15
|
+
* Verifiable on-chain payload as returned by Pyth Lazer in the WebSocket
|
|
16
|
+
* `streamUpdated` message under the `evm` (or `solana`, etc.) key.
|
|
17
|
+
*
|
|
18
|
+
* The encoding is chosen by the subscriber via `jsonBinaryEncoding` on the
|
|
19
|
+
* subscribe request, and the server echoes the choice back in `encoding`:
|
|
20
|
+
* - `'base64'` (Pyth's default) — `data` is a base64 string. Smaller
|
|
21
|
+
* WebSocket frames; needs decoding before on-chain submission.
|
|
22
|
+
* - `'hex'` — `data` is a hex string (may or may not be `0x`-prefixed;
|
|
23
|
+
* `lazerPayloadToBytes` handles either). Larger frames, but feeds
|
|
24
|
+
* straight into ethers/viem `bytes` args without a decode step.
|
|
25
|
+
*/
|
|
26
|
+
export interface LazerVerifiablePayload {
|
|
27
|
+
encoding: "base64" | "hex";
|
|
28
|
+
data: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Convert a Lazer verifiable payload into a 0x-prefixed hex string suitable for
|
|
32
|
+
* submitting as the `bytes priceUpdate` argument to `PythLazer.verifyUpdate`
|
|
33
|
+
* (or any EVM contract method expecting raw payload bytes).
|
|
34
|
+
*/
|
|
35
|
+
export declare function lazerPayloadToBytes(payload: LazerVerifiablePayload): string;
|
|
36
|
+
//# sourceMappingURL=lazerSigningFormats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazerSigningFormats.d.ts","sourceRoot":"","sources":["../../../../../../lib/priceFeeds/pyth/lazer/lazerSigningFormats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,CAAC;AAE7E;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,CAW3E"}
|
|
@@ -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
|
+
}
|
|
@@ -105,8 +105,8 @@ export declare namespace PoolAccountantStructs {
|
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
export interface TradingFloorV1Interface extends Interface {
|
|
108
|
-
getFunction(nameOrSignature: "ACCURACY_IMPROVEMENT_SCALE" | "CONTRACT_NAME" | "CONTRACT_VERSION" | "FRACTION_SCALE" | "LEVERAGE_SCALE" | "MAX_FEE_FRACTION_FOR_CANCEL" | "PRECISION" | "_become" | "activePositionIdsByTrader" | "admin" | "cancelMarketCloseForPosition" | "cancelPendingPosition" | "closeExistingPosition_Limit" | "closeExistingPosition_Market" | "collectFee" | "deprecated_pairTraders" | "deprecated_pairTradersArray" | "deprecated_pairTradersInfo" | "feesMap" | "generatePositionHashId" | "getActivePositionIdsForTrader" | "getActivePositionsAmountForTrader" | "getContractName" | "getContractVersion" | "getNextPositionIndexForTrader" | "getPositionPortalInfo" | "getPositionRegistrationParams" | "getPositionTriggerInfo" | "implementation" | "initialCollateralByPositionId" | "isSettlementAssetSupported" | "lexPoolForAsset" | "maxSanityProfitF" | "maxSlF" | "maxTradesPerTrader" | "openNewPosition_limit" | "openNewPosition_market" | "pairTradersLastUsedPositionIndex" | "pausedPairs" | "pendingAdmin" | "pendingImplementation" | "poolAccountantForAsset" | "positionIdToActivePositionIndex" | "positionIdentifiersById" | "positionLimitsInfoById" | "positionsById" | "registry" | "setOpenedPositionToMarketClose" | "setPairPaused" | "setTradeParam" | "storePendingPosition" | "supportNewSettlementAsset" | "traders" | "tradersAmount" | "tradersIndex" | "triggerPricesById" | "updateOpenedPosition" | "updatePendingPosition_openLimit"): FunctionFragment;
|
|
109
|
-
getEvent(nameOrSignatureOrTopic: "FeeCollected" | "FeeRegistered" | "IncorrectTraderIndex" | "NumberUpdated" | "OpenedPositionUpdated" | "PairPausedChange" | "PendingPositionCancelled" | "PendingPositionStored" | "PendingPositionStoredV1010" | "PendingPositionUpdated" | "PositionClosedLimit" | "PositionClosedMarket" | "PositionIdentifiersStored" | "PositionMarketCloseCancelled" | "PositionOpenCancelledByCap" | "PositionOpenCancelledByMarketPriceRange" | "PositionOpened" | "PositionSetForMarketClose" | "SettlementAssetAdded"): EventFragment;
|
|
108
|
+
getFunction(nameOrSignature: "ACCURACY_IMPROVEMENT_SCALE" | "CONTRACT_NAME" | "CONTRACT_VERSION" | "FRACTION_SCALE" | "LEVERAGE_SCALE" | "MAX_FEE_FRACTION_FOR_CANCEL" | "PRECISION" | "_become" | "activePositionIdsByTrader" | "admin" | "cancelMarketCloseForPosition" | "cancelPendingPosition" | "closeExistingPosition_Limit" | "closeExistingPosition_Market" | "collectFee" | "deprecated_pairTraders" | "deprecated_pairTradersArray" | "deprecated_pairTradersInfo" | "feesMap" | "generatePositionHashId" | "getActivePositionIdsForTrader" | "getActivePositionsAmountForTrader" | "getContractName" | "getContractVersion" | "getNextPositionIndexForTrader" | "getPositionPortalInfo" | "getPositionRegistrationParams" | "getPositionTriggerInfo" | "implementation" | "initialCollateralByPositionId" | "isSettlementAssetSupported" | "lexPoolForAsset" | "maxProfitBypassThresholdByAsset" | "maxSanityProfitF" | "maxSlF" | "maxTradesPerTrader" | "openNewPosition_limit" | "openNewPosition_market" | "pairTradersLastUsedPositionIndex" | "pausedPairs" | "pendingAdmin" | "pendingImplementation" | "poolAccountantForAsset" | "positionIdToActivePositionIndex" | "positionIdentifiersById" | "positionLimitsInfoById" | "positionsById" | "registry" | "setMaxProfitBypassThreshold" | "setOpenedPositionToMarketClose" | "setPairPaused" | "setTradeParam" | "storePendingPosition" | "supportNewSettlementAsset" | "traders" | "tradersAmount" | "tradersIndex" | "triggerPricesById" | "updateOpenedPosition" | "updatePendingPosition_openLimit"): FunctionFragment;
|
|
109
|
+
getEvent(nameOrSignatureOrTopic: "FeeCollected" | "FeeRegistered" | "IncorrectTraderIndex" | "MaxProfitBypassThresholdUpdated" | "NumberUpdated" | "OpenedPositionUpdated" | "PairPausedChange" | "PendingPositionCancelled" | "PendingPositionStored" | "PendingPositionStoredV1010" | "PendingPositionUpdated" | "PositionClosedLimit" | "PositionClosedMarket" | "PositionIdentifiersStored" | "PositionMarketCloseCancelled" | "PositionOpenCancelledByCap" | "PositionOpenCancelledByMarketPriceRange" | "PositionOpened" | "PositionSetForMarketClose" | "SettlementAssetAdded" | "SkewIncentiveRebate"): EventFragment;
|
|
110
110
|
encodeFunctionData(functionFragment: "ACCURACY_IMPROVEMENT_SCALE", values?: undefined): string;
|
|
111
111
|
encodeFunctionData(functionFragment: "CONTRACT_NAME", values?: undefined): string;
|
|
112
112
|
encodeFunctionData(functionFragment: "CONTRACT_VERSION", values?: undefined): string;
|
|
@@ -139,6 +139,7 @@ export interface TradingFloorV1Interface extends Interface {
|
|
|
139
139
|
encodeFunctionData(functionFragment: "initialCollateralByPositionId", values: [BytesLike]): string;
|
|
140
140
|
encodeFunctionData(functionFragment: "isSettlementAssetSupported", values: [AddressLike]): string;
|
|
141
141
|
encodeFunctionData(functionFragment: "lexPoolForAsset", values: [AddressLike]): string;
|
|
142
|
+
encodeFunctionData(functionFragment: "maxProfitBypassThresholdByAsset", values: [AddressLike]): string;
|
|
142
143
|
encodeFunctionData(functionFragment: "maxSanityProfitF", values?: undefined): string;
|
|
143
144
|
encodeFunctionData(functionFragment: "maxSlF", values?: undefined): string;
|
|
144
145
|
encodeFunctionData(functionFragment: "maxTradesPerTrader", values?: undefined): string;
|
|
@@ -154,6 +155,7 @@ export interface TradingFloorV1Interface extends Interface {
|
|
|
154
155
|
encodeFunctionData(functionFragment: "positionLimitsInfoById", values: [BytesLike]): string;
|
|
155
156
|
encodeFunctionData(functionFragment: "positionsById", values: [BytesLike]): string;
|
|
156
157
|
encodeFunctionData(functionFragment: "registry", values?: undefined): string;
|
|
158
|
+
encodeFunctionData(functionFragment: "setMaxProfitBypassThreshold", values: [AddressLike, BigNumberish]): string;
|
|
157
159
|
encodeFunctionData(functionFragment: "setOpenedPositionToMarketClose", values: [BytesLike, BigNumberish, BigNumberish]): string;
|
|
158
160
|
encodeFunctionData(functionFragment: "setPairPaused", values: [BigNumberish, boolean]): string;
|
|
159
161
|
encodeFunctionData(functionFragment: "setTradeParam", values: [BigNumberish, BigNumberish]): string;
|
|
@@ -202,6 +204,7 @@ export interface TradingFloorV1Interface extends Interface {
|
|
|
202
204
|
decodeFunctionResult(functionFragment: "initialCollateralByPositionId", data: BytesLike): Result;
|
|
203
205
|
decodeFunctionResult(functionFragment: "isSettlementAssetSupported", data: BytesLike): Result;
|
|
204
206
|
decodeFunctionResult(functionFragment: "lexPoolForAsset", data: BytesLike): Result;
|
|
207
|
+
decodeFunctionResult(functionFragment: "maxProfitBypassThresholdByAsset", data: BytesLike): Result;
|
|
205
208
|
decodeFunctionResult(functionFragment: "maxSanityProfitF", data: BytesLike): Result;
|
|
206
209
|
decodeFunctionResult(functionFragment: "maxSlF", data: BytesLike): Result;
|
|
207
210
|
decodeFunctionResult(functionFragment: "maxTradesPerTrader", data: BytesLike): Result;
|
|
@@ -217,6 +220,7 @@ export interface TradingFloorV1Interface extends Interface {
|
|
|
217
220
|
decodeFunctionResult(functionFragment: "positionLimitsInfoById", data: BytesLike): Result;
|
|
218
221
|
decodeFunctionResult(functionFragment: "positionsById", data: BytesLike): Result;
|
|
219
222
|
decodeFunctionResult(functionFragment: "registry", data: BytesLike): Result;
|
|
223
|
+
decodeFunctionResult(functionFragment: "setMaxProfitBypassThreshold", data: BytesLike): Result;
|
|
220
224
|
decodeFunctionResult(functionFragment: "setOpenedPositionToMarketClose", data: BytesLike): Result;
|
|
221
225
|
decodeFunctionResult(functionFragment: "setPairPaused", data: BytesLike): Result;
|
|
222
226
|
decodeFunctionResult(functionFragment: "setTradeParam", data: BytesLike): Result;
|
|
@@ -298,6 +302,18 @@ export declare namespace IncorrectTraderIndexEvent {
|
|
|
298
302
|
type Log = TypedEventLog<Event>;
|
|
299
303
|
type LogDescription = TypedLogDescription<Event>;
|
|
300
304
|
}
|
|
305
|
+
export declare namespace MaxProfitBypassThresholdUpdatedEvent {
|
|
306
|
+
type InputTuple = [asset: AddressLike, threshold: BigNumberish];
|
|
307
|
+
type OutputTuple = [asset: string, threshold: bigint];
|
|
308
|
+
interface OutputObject {
|
|
309
|
+
asset: string;
|
|
310
|
+
threshold: bigint;
|
|
311
|
+
}
|
|
312
|
+
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
|
|
313
|
+
type Filter = TypedDeferredTopicFilter<Event>;
|
|
314
|
+
type Log = TypedEventLog<Event>;
|
|
315
|
+
type LogDescription = TypedLogDescription<Event>;
|
|
316
|
+
}
|
|
301
317
|
export declare namespace NumberUpdatedEvent {
|
|
302
318
|
type InputTuple = [name: string, value: BigNumberish];
|
|
303
319
|
type OutputTuple = [name: string, value: bigint];
|
|
@@ -644,6 +660,27 @@ export declare namespace SettlementAssetAddedEvent {
|
|
|
644
660
|
type Log = TypedEventLog<Event>;
|
|
645
661
|
type LogDescription = TypedLogDescription<Event>;
|
|
646
662
|
}
|
|
663
|
+
export declare namespace SkewIncentiveRebateEvent {
|
|
664
|
+
type InputTuple = [
|
|
665
|
+
positionId: BytesLike,
|
|
666
|
+
trader: AddressLike,
|
|
667
|
+
rebateAmount: BigNumberish
|
|
668
|
+
];
|
|
669
|
+
type OutputTuple = [
|
|
670
|
+
positionId: string,
|
|
671
|
+
trader: string,
|
|
672
|
+
rebateAmount: bigint
|
|
673
|
+
];
|
|
674
|
+
interface OutputObject {
|
|
675
|
+
positionId: string;
|
|
676
|
+
trader: string;
|
|
677
|
+
rebateAmount: bigint;
|
|
678
|
+
}
|
|
679
|
+
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
|
|
680
|
+
type Filter = TypedDeferredTopicFilter<Event>;
|
|
681
|
+
type Log = TypedEventLog<Event>;
|
|
682
|
+
type LogDescription = TypedLogDescription<Event>;
|
|
683
|
+
}
|
|
647
684
|
export interface TradingFloorV1 extends BaseContract {
|
|
648
685
|
connect(runner?: ContractRunner | null): TradingFloorV1;
|
|
649
686
|
waitForDeployment(): Promise<this>;
|
|
@@ -822,6 +859,11 @@ export interface TradingFloorV1 extends BaseContract {
|
|
|
822
859
|
boolean
|
|
823
860
|
], "view">;
|
|
824
861
|
lexPoolForAsset: TypedContractMethod<[arg0: AddressLike], [string], "view">;
|
|
862
|
+
maxProfitBypassThresholdByAsset: TypedContractMethod<[
|
|
863
|
+
arg0: AddressLike
|
|
864
|
+
], [
|
|
865
|
+
bigint
|
|
866
|
+
], "view">;
|
|
825
867
|
maxSanityProfitF: TypedContractMethod<[], [bigint], "view">;
|
|
826
868
|
maxSlF: TypedContractMethod<[], [bigint], "view">;
|
|
827
869
|
maxTradesPerTrader: TypedContractMethod<[], [bigint], "view">;
|
|
@@ -911,6 +953,12 @@ export interface TradingFloorV1 extends BaseContract {
|
|
|
911
953
|
}
|
|
912
954
|
], "view">;
|
|
913
955
|
registry: TypedContractMethod<[], [string], "view">;
|
|
956
|
+
setMaxProfitBypassThreshold: TypedContractMethod<[
|
|
957
|
+
asset: AddressLike,
|
|
958
|
+
threshold: BigNumberish
|
|
959
|
+
], [
|
|
960
|
+
void
|
|
961
|
+
], "nonpayable">;
|
|
914
962
|
setOpenedPositionToMarketClose: TypedContractMethod<[
|
|
915
963
|
_positionId: BytesLike,
|
|
916
964
|
_minPrice: BigNumberish,
|
|
@@ -1126,6 +1174,7 @@ export interface TradingFloorV1 extends BaseContract {
|
|
|
1126
1174
|
getFunction(nameOrSignature: "initialCollateralByPositionId"): TypedContractMethod<[arg0: BytesLike], [bigint], "view">;
|
|
1127
1175
|
getFunction(nameOrSignature: "isSettlementAssetSupported"): TypedContractMethod<[settlementAsset: AddressLike], [boolean], "view">;
|
|
1128
1176
|
getFunction(nameOrSignature: "lexPoolForAsset"): TypedContractMethod<[arg0: AddressLike], [string], "view">;
|
|
1177
|
+
getFunction(nameOrSignature: "maxProfitBypassThresholdByAsset"): TypedContractMethod<[arg0: AddressLike], [bigint], "view">;
|
|
1129
1178
|
getFunction(nameOrSignature: "maxSanityProfitF"): TypedContractMethod<[], [bigint], "view">;
|
|
1130
1179
|
getFunction(nameOrSignature: "maxSlF"): TypedContractMethod<[], [bigint], "view">;
|
|
1131
1180
|
getFunction(nameOrSignature: "maxTradesPerTrader"): TypedContractMethod<[], [bigint], "view">;
|
|
@@ -1207,6 +1256,12 @@ export interface TradingFloorV1 extends BaseContract {
|
|
|
1207
1256
|
}
|
|
1208
1257
|
], "view">;
|
|
1209
1258
|
getFunction(nameOrSignature: "registry"): TypedContractMethod<[], [string], "view">;
|
|
1259
|
+
getFunction(nameOrSignature: "setMaxProfitBypassThreshold"): TypedContractMethod<[
|
|
1260
|
+
asset: AddressLike,
|
|
1261
|
+
threshold: BigNumberish
|
|
1262
|
+
], [
|
|
1263
|
+
void
|
|
1264
|
+
], "nonpayable">;
|
|
1210
1265
|
getFunction(nameOrSignature: "setOpenedPositionToMarketClose"): TypedContractMethod<[
|
|
1211
1266
|
_positionId: BytesLike,
|
|
1212
1267
|
_minPrice: BigNumberish,
|
|
@@ -1279,6 +1334,7 @@ export interface TradingFloorV1 extends BaseContract {
|
|
|
1279
1334
|
getEvent(key: "FeeCollected"): TypedContractEvent<FeeCollectedEvent.InputTuple, FeeCollectedEvent.OutputTuple, FeeCollectedEvent.OutputObject>;
|
|
1280
1335
|
getEvent(key: "FeeRegistered"): TypedContractEvent<FeeRegisteredEvent.InputTuple, FeeRegisteredEvent.OutputTuple, FeeRegisteredEvent.OutputObject>;
|
|
1281
1336
|
getEvent(key: "IncorrectTraderIndex"): TypedContractEvent<IncorrectTraderIndexEvent.InputTuple, IncorrectTraderIndexEvent.OutputTuple, IncorrectTraderIndexEvent.OutputObject>;
|
|
1337
|
+
getEvent(key: "MaxProfitBypassThresholdUpdated"): TypedContractEvent<MaxProfitBypassThresholdUpdatedEvent.InputTuple, MaxProfitBypassThresholdUpdatedEvent.OutputTuple, MaxProfitBypassThresholdUpdatedEvent.OutputObject>;
|
|
1282
1338
|
getEvent(key: "NumberUpdated"): TypedContractEvent<NumberUpdatedEvent.InputTuple, NumberUpdatedEvent.OutputTuple, NumberUpdatedEvent.OutputObject>;
|
|
1283
1339
|
getEvent(key: "OpenedPositionUpdated"): TypedContractEvent<OpenedPositionUpdatedEvent.InputTuple, OpenedPositionUpdatedEvent.OutputTuple, OpenedPositionUpdatedEvent.OutputObject>;
|
|
1284
1340
|
getEvent(key: "PairPausedChange"): TypedContractEvent<PairPausedChangeEvent.InputTuple, PairPausedChangeEvent.OutputTuple, PairPausedChangeEvent.OutputObject>;
|
|
@@ -1295,6 +1351,7 @@ export interface TradingFloorV1 extends BaseContract {
|
|
|
1295
1351
|
getEvent(key: "PositionOpened"): TypedContractEvent<PositionOpenedEvent.InputTuple, PositionOpenedEvent.OutputTuple, PositionOpenedEvent.OutputObject>;
|
|
1296
1352
|
getEvent(key: "PositionSetForMarketClose"): TypedContractEvent<PositionSetForMarketCloseEvent.InputTuple, PositionSetForMarketCloseEvent.OutputTuple, PositionSetForMarketCloseEvent.OutputObject>;
|
|
1297
1353
|
getEvent(key: "SettlementAssetAdded"): TypedContractEvent<SettlementAssetAddedEvent.InputTuple, SettlementAssetAddedEvent.OutputTuple, SettlementAssetAddedEvent.OutputObject>;
|
|
1354
|
+
getEvent(key: "SkewIncentiveRebate"): TypedContractEvent<SkewIncentiveRebateEvent.InputTuple, SkewIncentiveRebateEvent.OutputTuple, SkewIncentiveRebateEvent.OutputObject>;
|
|
1298
1355
|
filters: {
|
|
1299
1356
|
"FeeCollected(address,uint8,address,uint256)": TypedContractEvent<FeeCollectedEvent.InputTuple, FeeCollectedEvent.OutputTuple, FeeCollectedEvent.OutputObject>;
|
|
1300
1357
|
FeeCollected: TypedContractEvent<FeeCollectedEvent.InputTuple, FeeCollectedEvent.OutputTuple, FeeCollectedEvent.OutputObject>;
|
|
@@ -1302,6 +1359,8 @@ export interface TradingFloorV1 extends BaseContract {
|
|
|
1302
1359
|
FeeRegistered: TypedContractEvent<FeeRegisteredEvent.InputTuple, FeeRegisteredEvent.OutputTuple, FeeRegisteredEvent.OutputObject>;
|
|
1303
1360
|
"IncorrectTraderIndex(address,uint256,address)": TypedContractEvent<IncorrectTraderIndexEvent.InputTuple, IncorrectTraderIndexEvent.OutputTuple, IncorrectTraderIndexEvent.OutputObject>;
|
|
1304
1361
|
IncorrectTraderIndex: TypedContractEvent<IncorrectTraderIndexEvent.InputTuple, IncorrectTraderIndexEvent.OutputTuple, IncorrectTraderIndexEvent.OutputObject>;
|
|
1362
|
+
"MaxProfitBypassThresholdUpdated(address,uint256)": TypedContractEvent<MaxProfitBypassThresholdUpdatedEvent.InputTuple, MaxProfitBypassThresholdUpdatedEvent.OutputTuple, MaxProfitBypassThresholdUpdatedEvent.OutputObject>;
|
|
1363
|
+
MaxProfitBypassThresholdUpdated: TypedContractEvent<MaxProfitBypassThresholdUpdatedEvent.InputTuple, MaxProfitBypassThresholdUpdatedEvent.OutputTuple, MaxProfitBypassThresholdUpdatedEvent.OutputObject>;
|
|
1305
1364
|
"NumberUpdated(string,uint256)": TypedContractEvent<NumberUpdatedEvent.InputTuple, NumberUpdatedEvent.OutputTuple, NumberUpdatedEvent.OutputObject>;
|
|
1306
1365
|
NumberUpdated: TypedContractEvent<NumberUpdatedEvent.InputTuple, NumberUpdatedEvent.OutputTuple, NumberUpdatedEvent.OutputObject>;
|
|
1307
1366
|
"OpenedPositionUpdated(bytes32,uint16,bool,uint8,uint64)": TypedContractEvent<OpenedPositionUpdatedEvent.InputTuple, OpenedPositionUpdatedEvent.OutputTuple, OpenedPositionUpdatedEvent.OutputObject>;
|
|
@@ -1334,6 +1393,8 @@ export interface TradingFloorV1 extends BaseContract {
|
|
|
1334
1393
|
PositionSetForMarketClose: TypedContractEvent<PositionSetForMarketCloseEvent.InputTuple, PositionSetForMarketCloseEvent.OutputTuple, PositionSetForMarketCloseEvent.OutputObject>;
|
|
1335
1394
|
"SettlementAssetAdded(address,address,address)": TypedContractEvent<SettlementAssetAddedEvent.InputTuple, SettlementAssetAddedEvent.OutputTuple, SettlementAssetAddedEvent.OutputObject>;
|
|
1336
1395
|
SettlementAssetAdded: TypedContractEvent<SettlementAssetAddedEvent.InputTuple, SettlementAssetAddedEvent.OutputTuple, SettlementAssetAddedEvent.OutputObject>;
|
|
1396
|
+
"SkewIncentiveRebate(bytes32,address,uint256)": TypedContractEvent<SkewIncentiveRebateEvent.InputTuple, SkewIncentiveRebateEvent.OutputTuple, SkewIncentiveRebateEvent.OutputObject>;
|
|
1397
|
+
SkewIncentiveRebate: TypedContractEvent<SkewIncentiveRebateEvent.InputTuple, SkewIncentiveRebateEvent.OutputTuple, SkewIncentiveRebateEvent.OutputObject>;
|
|
1337
1398
|
};
|
|
1338
1399
|
}
|
|
1339
1400
|
//# sourceMappingURL=TradingFloorV1.d.ts.map
|