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
|
@@ -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: [],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Provider, Signer } from "ethers";
|
|
2
2
|
import { LexLens } from "../../typechain/contracts/Peripheral/Lens/LexLens";
|
|
3
3
|
import { SinglePairTradesValuesInputStruct } from "../../typechain/contracts/Peripheral/Lens/LexLens";
|
|
4
|
-
import { ILexLensService, TLexFeeConfigsLensStruct, TLexGroupConfigsLensStruct, TLexGroupStateLensStruct, TLexPairConfigsLensStruct, TLexPairStateLensStruct, TLexPoolLensParamsStruct, TLexPoolLensConfigsStruct, TPoolAccountantConfigurationsLensStruct, TLexPoolLensStateStruct, TPoolAccountantStateLensStruct, TLensCompleteLexConfigsStruct, TLensCompleteLexStateStruct, TLexPoolSupplierLensStateStruct, TSinglePositionOutputStruct } from "./ILexLensService";
|
|
4
|
+
import { ILexLensService, TLexFeeConfigsLensStruct, TLexGroupConfigsLensStruct, TLexGroupStateLensStruct, TLexPairConfigsLensStruct, TLexPairStateLensStruct, TLexPoolLensParamsStruct, TLexPoolLensConfigsStruct, TPoolAccountantConfigurationsLensStruct, TLexPoolLensStateStruct, TPoolAccountantStateLensStruct, TLensCompleteLexConfigsStruct, TLensCompleteLexStateStruct, TLexPoolSupplierLensStateStruct, TSinglePositionOutputStruct, TTradingFloorPerAssetConfigsLensStruct } from "./ILexLensService";
|
|
5
5
|
import { CallOptions } from "../common";
|
|
6
6
|
export declare class LexLensService implements ILexLensService {
|
|
7
7
|
private readonly contract;
|
|
@@ -29,6 +29,7 @@ export declare class LexLensService implements ILexLensService {
|
|
|
29
29
|
getPoolAccountantStateByPool(lexPool: string, callOptions?: CallOptions): Promise<TPoolAccountantStateLensStruct>;
|
|
30
30
|
getPoolAccountantStateByPoolAll(lexPools: string[], callOptions?: CallOptions): Promise<TPoolAccountantStateLensStruct[]>;
|
|
31
31
|
getSupplierCurrentStateAll(lexPools: string[], supplier: string, callOptions?: CallOptions): Promise<TLexPoolSupplierLensStateStruct[]>;
|
|
32
|
+
readTradingFloorPerAssetConfigurations(lexPool: string, callOptions?: CallOptions): Promise<TTradingFloorPerAssetConfigsLensStruct>;
|
|
32
33
|
tradesValuesMultiplePairs(accountant: string, pairsTrades: SinglePairTradesValuesInputStruct[], callOptions?: CallOptions): Promise<TSinglePositionOutputStruct[][]>;
|
|
33
34
|
tradesValuesSinglePair(accountant: string, pairParams: SinglePairTradesValuesInputStruct, callOptions?: CallOptions): Promise<TSinglePositionOutputStruct[]>;
|
|
34
35
|
private convertCompleteConfigsResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LexLensService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/LexLensService/LexLensService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAE5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,mDAAmD,CAAC;AAEtG,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,uCAAuC,EACvC,uBAAuB,EACvB,8BAA8B,EAC9B,6BAA6B,EAC7B,2BAA2B,EAC3B,+BAA+B,EAC/B,2BAA2B,
|
|
1
|
+
{"version":3,"file":"LexLensService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/LexLensService/LexLensService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAE5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,mDAAmD,CAAC;AAEtG,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,uCAAuC,EACvC,uBAAuB,EACvB,8BAA8B,EAC9B,6BAA6B,EAC7B,2BAA2B,EAC3B,+BAA+B,EAC/B,2BAA2B,EAC3B,sCAAsC,EAmBvC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,cAAe,YAAW,eAAe;IACpD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;gBAEvB,gBAAgB,EAAE,MAAM,GAAG,QAAQ,EAAE,eAAe,EAAE,MAAM;IAIlE,4BAA4B,CAChC,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAahC,8BAA8B,CAClC,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAUlC,qBAAqB,CACzB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAShC,2CAA2C,CAC/C,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,OAAO,CAAC;IAIb,6BAA6B,CACjC,OAAO,EAAE,MAAM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4BAA4B;IAyCpC,WAAW,IAAI,OAAO;CAGvB"}
|
|
@@ -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 {
|
package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BytesLike } from "ethers";
|
|
2
|
-
import { TradingFloorLensStructs } from "../../typechain/contracts/Peripheral/Lens/TradingFloorLens";
|
|
2
|
+
import { TradingFloorLensStructs, TradingFloorLensPerAssetParamsStruct } from "../../typechain/contracts/Peripheral/Lens/TradingFloorLens";
|
|
3
3
|
import { TSafeBigNumberStruct } from "../../utils/ethersTypes";
|
|
4
4
|
import { CallOptions } from "../common";
|
|
5
5
|
export type TCompletePositionDataFromLensStruct = Omit<TSafeBigNumberStruct<TradingFloorLensStructs.CompletePositionDataFromLensStruct>, "pairId" | "positionIndex" | "phase" | "inPhaseSince" | "tpLastUpdated" | "slLastUpdated" | "pendingUpdateOrderType" | "pendingUpdateOrderTimestamp" | "skewIncentiveOpenTimestamp"> & {
|
|
@@ -44,11 +44,13 @@ export type TTradingFloorLensTradeParamsStruct = {
|
|
|
44
44
|
maxSlF: number;
|
|
45
45
|
maxSanityProfitF: number;
|
|
46
46
|
};
|
|
47
|
+
export type TTradingFloorLensPerAssetParamsStruct = TSafeBigNumberStruct<TradingFloorLensPerAssetParamsStruct>;
|
|
47
48
|
export declare const EMPTY_COMPLETE_POSITION_DATA: TCompletePositionDataFromLensStruct;
|
|
48
49
|
export declare const EMPTY_POSITIONS_RESULT: TGetAllPositionsDataForAllTradersResultStruct;
|
|
49
50
|
export declare const EMPTY_POSITION_LIQUIDATION_INFO: TPositionLiquidationInfoStruct;
|
|
50
51
|
export declare const EMPTY_LIQUIDATION_RESULT: TGetAllPositionsLiquidationInfoResultStruct;
|
|
51
52
|
export declare const EMPTY_TRADE_PARAMS: TTradingFloorLensTradeParamsStruct;
|
|
53
|
+
export declare const EMPTY_PER_ASSET_PARAMS: TTradingFloorLensPerAssetParamsStruct;
|
|
52
54
|
export interface ITradingFloorLensService {
|
|
53
55
|
generatePositionHashId(settlementAsset: string, trader: string, pairId: number, index: number, callOptions?: CallOptions): Promise<string>;
|
|
54
56
|
getAllPositionsDataForAllTraders(params: TGetAllPositionsDataForAllTradersParamsStruct, callOptions?: CallOptions): Promise<TGetAllPositionsDataForAllTradersResultStruct>;
|
|
@@ -56,5 +58,6 @@ export interface ITradingFloorLensService {
|
|
|
56
58
|
getCompletePositionData(tradingFloor: string, positionId: BytesLike, callOptions?: CallOptions): Promise<TCompletePositionDataFromLensStruct>;
|
|
57
59
|
getPositionsDataForTrader(tradingFloor: string, trader: string, callOptions?: CallOptions): Promise<TCompletePositionDataFromLensStruct[]>;
|
|
58
60
|
getTradingFloorTradeParams(tradingFloor: string, callOptions?: CallOptions): Promise<TTradingFloorLensTradeParamsStruct>;
|
|
61
|
+
getTradingFloorPerAssetParams(tradingFloor: string, settlementAsset: string, callOptions?: CallOptions): Promise<TTradingFloorLensPerAssetParamsStruct>;
|
|
59
62
|
}
|
|
60
63
|
//# sourceMappingURL=ITradingFloorLensService.d.ts.map
|
package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ITradingFloorLensService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,
|
|
1
|
+
{"version":3,"file":"ITradingFloorLensService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EACL,uBAAuB,EACvB,oCAAoC,EACrC,MAAM,4DAA4D,CAAC;AACpE,OAAO,EAAE,oBAA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E,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB,gCAAgC,CAC9B,MAAM,EAAE,6CAA6C,EACrD,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,6CAA6C,CAAC,CAAC;IAE1D,8BAA8B,CAC5B,MAAM,EAAE,2CAA2C,EACnD,MAAM,CAAC,EAAE,MAAM,EAAE,EACjB,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,2CAA2C,CAAC,CAAC;IAExD,uBAAuB,CACrB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,SAAS,EACrB,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,mCAAmC,CAAC,CAAC;IAEhD,yBAAyB,CACvB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,mCAAmC,EAAE,CAAC,CAAC;IAElD,0BAA0B,CACxB,YAAY,EAAE,MAAM,EACpB,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,kCAAkC,CAAC,CAAC;IAE/C,6BAA6B,CAC3B,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,EACvB,WAAW,CAAC,EAAE,WAAW,GACxB,OAAO,CAAC,qCAAqC,CAAC,CAAC;CACnD"}
|
package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js
CHANGED
|
@@ -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
|
+
};
|
package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BytesLike, Provider, Signer } from "ethers";
|
|
2
2
|
import { TradingFloorLens } from "../../typechain/contracts/Peripheral/Lens/TradingFloorLens";
|
|
3
|
-
import { ITradingFloorLensService, TCompletePositionDataFromLensStruct, TGetAllPositionsDataForAllTradersResultStruct, TGetAllPositionsDataForAllTradersParamsStruct, TGetAllPositionsLiquidationInfoResultStruct, TGetAllPositionsLiquidationInfoParamsStruct, TTradingFloorLensTradeParamsStruct } from "./ITradingFloorLensService";
|
|
3
|
+
import { ITradingFloorLensService, TCompletePositionDataFromLensStruct, TGetAllPositionsDataForAllTradersResultStruct, TGetAllPositionsDataForAllTradersParamsStruct, TGetAllPositionsLiquidationInfoResultStruct, TGetAllPositionsLiquidationInfoParamsStruct, TTradingFloorLensTradeParamsStruct, TTradingFloorLensPerAssetParamsStruct } from "./ITradingFloorLensService";
|
|
4
4
|
import { CallOptions } from "../common";
|
|
5
5
|
export declare class TradingFloorLensService implements ITradingFloorLensService {
|
|
6
6
|
private readonly contract;
|
|
@@ -11,6 +11,7 @@ export declare class TradingFloorLensService implements ITradingFloorLensService
|
|
|
11
11
|
getCompletePositionData(tradingFloor: string, positionId: BytesLike, callOptions?: CallOptions): Promise<TCompletePositionDataFromLensStruct>;
|
|
12
12
|
getPositionsDataForTrader(tradingFloor: string, trader: string, callOptions?: CallOptions): Promise<TCompletePositionDataFromLensStruct[]>;
|
|
13
13
|
getTradingFloorTradeParams(tradingFloor: string, callOptions?: CallOptions): Promise<TTradingFloorLensTradeParamsStruct>;
|
|
14
|
+
getTradingFloorPerAssetParams(tradingFloor: string, settlementAsset: string, callOptions?: CallOptions): Promise<TTradingFloorLensPerAssetParamsStruct>;
|
|
14
15
|
getContract(): TradingFloorLens;
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=TradingFloorLensService.d.ts.map
|
package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TradingFloorLensService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAC;AAG9F,OAAO,EACL,wBAAwB,EACxB,mCAAmC,EACnC,6CAA6C,EAC7C,6CAA6C,EAC7C,2CAA2C,EAC3C,2CAA2C,EAE3C,kCAAkC,
|
|
1
|
+
{"version":3,"file":"TradingFloorLensService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAC;AAG9F,OAAO,EACL,wBAAwB,EACxB,mCAA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,WAAW,IAAI,gBAAgB;CAGhC"}
|
package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js
CHANGED
|
@@ -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
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BytesLike } from "ethers";
|
|
1
|
+
import { BytesLike, ContractTransactionResponse } from "ethers";
|
|
2
2
|
import { TradingFloorStructsV1 } from "../../typechain/contracts/Lynx/TradingFloor/TradingFloorV1";
|
|
3
3
|
import { TSafeBigNumberStruct } from "../../utils/ethersTypes";
|
|
4
4
|
import { ILynxVersionedContract, IPendableAdmin, IPendableImplementation, IProtocolConstants, CallOptions } from "../common";
|
|
@@ -61,6 +61,10 @@ export interface ITradingFloorFunctionsGroup_SettlementAndPool {
|
|
|
61
61
|
lexPoolForAsset(asset: string, callOptions?: CallOptions): Promise<string>;
|
|
62
62
|
poolAccountantForAsset(asset: string, callOptions?: CallOptions): Promise<string>;
|
|
63
63
|
}
|
|
64
|
+
export interface ITradingFloorFunctionsGroup_PerAssetConfig {
|
|
65
|
+
maxProfitBypassThresholdByAsset(asset: string, callOptions?: CallOptions): Promise<bigint>;
|
|
66
|
+
setMaxProfitBypassThreshold(asset: string, threshold: bigint, callOptions?: CallOptions): Promise<ContractTransactionResponse>;
|
|
67
|
+
}
|
|
64
68
|
export interface ITradingFloorFunctionsGroup_Deprecated {
|
|
65
69
|
deprecated_pairTraders(asset: string, pairId: bigint, index: bigint, callOptions?: CallOptions): Promise<string>;
|
|
66
70
|
deprecated_pairTradersArray(asset: string, pairIndex: bigint, callOptions?: CallOptions): Promise<string[]>;
|
|
@@ -100,6 +104,7 @@ export interface ITradingFloorFunctionsGroup_Constants extends IProtocolConstant
|
|
|
100
104
|
export interface ITradingFloorService {
|
|
101
105
|
positionQueries: ITradingFloorFunctionsGroup_PositionQueries;
|
|
102
106
|
settlementAndPool: ITradingFloorFunctionsGroup_SettlementAndPool;
|
|
107
|
+
perAssetConfig: ITradingFloorFunctionsGroup_PerAssetConfig;
|
|
103
108
|
deprecated: ITradingFloorFunctionsGroup_Deprecated;
|
|
104
109
|
traderTracking: ITradingFloorFunctionsGroup_TraderTracking;
|
|
105
110
|
tradingParameters: ITradingFloorFunctionsGroup_TradingParameters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ITradingFloorService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradingFloorService/ITradingFloorService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"ITradingFloorService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradingFloorService/ITradingFloorService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAA;AAClG,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAE9D,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5H,KAAK,+BAA+B,GAClC,qBAAqB,CAAC,gCAAgC,CAAA;AACxD,KAAK,2BAA2B,GAC9B,qBAAqB,CAAC,2BAA2B,CAAA;AAEnD,MAAM,MAAM,gCAAgC,GAC1C,oBAAoB,CAAC,+BAA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M,WAAW,qCAAsC,SAAQ,kBAAkB;IAE/E,2BAA2B,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAGvE,0BAA0B,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CACvE;AAED,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,2CAA2C,CAAA;IAC5D,iBAAiB,EAAE,6CAA6C,CAAA;IAChE,cAAc,EAAE,0CAA0C,CAAA;IAC1D,UAAU,EAAE,sCAAsC,CAAA;IAClD,cAAc,EAAE,0CAA0C,CAAA;IAC1D,iBAAiB,EAAE,6CAA6C,CAAA;IAChE,IAAI,EAAE,gCAAgC,CAAA;IACtC,kBAAkB,EAAE,8CAA8C,CAAA;IAClE,aAAa,EAAE,cAAc,CAAA;IAC7B,sBAAsB,EAAE,uBAAuB,CAAA;IAC/C,qBAAqB,EAAE,sBAAsB,CAAA;IAC7C,SAAS,EAAE,qCAAqC,CAAA;CACjD"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Signer, Provider } from "ethers";
|
|
2
2
|
import { TradingFloorV1 } from "../../typechain/contracts/Lynx/TradingFloor/TradingFloorV1";
|
|
3
|
-
import { ITradingFloorService, ITradingFloorFunctionsGroup_PositionQueries, ITradingFloorFunctionsGroup_SettlementAndPool, ITradingFloorFunctionsGroup_Deprecated, ITradingFloorFunctionsGroup_TraderTracking, ITradingFloorFunctionsGroup_TradingParameters, ITradingFloorFunctionsGroup_Fees, ITradingFloorFunctionsGroup_ContractReferences, ITradingFloorFunctionsGroup_Constants } from "./ITradingFloorService";
|
|
3
|
+
import { ITradingFloorService, ITradingFloorFunctionsGroup_PositionQueries, ITradingFloorFunctionsGroup_SettlementAndPool, ITradingFloorFunctionsGroup_PerAssetConfig, ITradingFloorFunctionsGroup_Deprecated, ITradingFloorFunctionsGroup_TraderTracking, ITradingFloorFunctionsGroup_TradingParameters, ITradingFloorFunctionsGroup_Fees, ITradingFloorFunctionsGroup_ContractReferences, ITradingFloorFunctionsGroup_Constants } from "./ITradingFloorService";
|
|
4
4
|
import { ILynxVersionedContract, IPendableAdmin, IPendableImplementation } from "../common";
|
|
5
5
|
export declare class TradingFloorService implements ITradingFloorService {
|
|
6
6
|
private signerOrProvider;
|
|
7
7
|
private tradingFloorContract;
|
|
8
8
|
positionQueries: ITradingFloorFunctionsGroup_PositionQueries;
|
|
9
9
|
settlementAndPool: ITradingFloorFunctionsGroup_SettlementAndPool;
|
|
10
|
+
perAssetConfig: ITradingFloorFunctionsGroup_PerAssetConfig;
|
|
10
11
|
deprecated: ITradingFloorFunctionsGroup_Deprecated;
|
|
11
12
|
traderTracking: ITradingFloorFunctionsGroup_TraderTracking;
|
|
12
13
|
tradingParameters: ITradingFloorFunctionsGroup_TradingParameters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TradingFloorService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradingFloorService/TradingFloorService.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,QAAQ,EAET,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAE,cAAc,EAAE,MAAM,4DAA4D,CAAA;AAE3F,OAAO,EACL,oBAAoB,EACpB,2CAA2C,EAC3C,6CAA6C,EAC7C,sCAAsC,EACtC,0CAA0C,EAC1C,6CAA6C,EAC7C,gCAAgC,EAChC,8CAA8C,EAC9C,qCAAqC,EAGtC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,uBAAuB,EAAe,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"TradingFloorService.d.ts","sourceRoot":"","sources":["../../../../../lib/contractsIntegration/TradingFloorService/TradingFloorService.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,QAAQ,EAET,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAE,cAAc,EAAE,MAAM,4DAA4D,CAAA;AAE3F,OAAO,EACL,oBAAoB,EACpB,2CAA2C,EAC3C,6CAA6C,EAC7C,0CAA0C,EAC1C,sCAAsC,EACtC,0CAA0C,EAC1C,6CAA6C,EAC7C,gCAAgC,EAChC,8CAA8C,EAC9C,qCAAqC,EAGtC,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,uBAAuB,EAAe,MAAM,WAAW,CAAA;AAqXxG,qBAAa,mBAAoB,YAAW,oBAAoB;IAkB5D,OAAO,CAAC,gBAAgB;IAjB1B,OAAO,CAAC,oBAAoB,CAAgB;IAErC,eAAe,EAAE,2CAA2C,CAAA;IAC5D,iBAAiB,EAAE,6CAA6C,CAAA;IAChE,cAAc,EAAE,0CAA0C,CAAA;IAC1D,UAAU,EAAE,sCAAsC,CAAA;IAClD,cAAc,EAAE,0CAA0C,CAAA;IAC1D,iBAAiB,EAAE,6CAA6C,CAAA;IAChE,IAAI,EAAE,gCAAgC,CAAA;IACtC,kBAAkB,EAAE,8CAA8C,CAAA;IAClE,aAAa,EAAE,cAAc,CAAA;IAC7B,sBAAsB,EAAE,uBAAuB,CAAA;IAC/C,qBAAqB,EAAE,sBAAsB,CAAA;IAC7C,SAAS,EAAE,qCAAqC,CAAA;gBAGrD,OAAO,EAAE,MAAM,EACP,gBAAgB,EAAE,MAAM,GAAG,QAAQ;IAqB7C,WAAW,IAAI,cAAc;CAG9B"}
|
|
@@ -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.
|
|
57
|
+
tradingFloorLensAddress: lensAddresses.tradingFloorLens,
|
|
58
58
|
intentsVerifierLensAddress: lensAddresses.intentsVerifierLens,
|
|
59
59
|
triggersAndPortalLensAddress: lensAddresses.triggersAndPortalLens,
|
|
60
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flareFeedConstants.d.ts","sourceRoot":"","sources":["../../../../../lib/priceFeeds/flare/flareFeedConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGrE,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"flareFeedConstants.d.ts","sourceRoot":"","sources":["../../../../../lib/priceFeeds/flare/flareFeedConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGrE,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAuE/D,CAAC;AAGF,eAAO,MAAM,2BAA2B,0BAKlC,CAAC"}
|
|
@@ -14,6 +14,7 @@ exports.FLARE_PAIRS_PRICE_FEED_IDS = {
|
|
|
14
14
|
[pairIds_1.PAIR_CONFIGS_IDS.XRP_USD]: "0x015852502f55534400000000000000000000000000",
|
|
15
15
|
[pairIds_1.PAIR_CONFIGS_IDS.S_USD]: "0x01532f555344000000000000000000000000000000",
|
|
16
16
|
[pairIds_1.PAIR_CONFIGS_IDS.FLR_USD]: "0x01464c522f55534400000000000000000000000000",
|
|
17
|
+
[pairIds_1.PAIR_CONFIGS_IDS.SEI_USD]: "",
|
|
17
18
|
[pairIds_1.PAIR_CONFIGS_IDS.EUR_USD]: "",
|
|
18
19
|
[pairIds_1.PAIR_CONFIGS_IDS.GBP_USD]: "",
|
|
19
20
|
[pairIds_1.PAIR_CONFIGS_IDS.AUD_USD]: "",
|
|
@@ -40,6 +41,7 @@ exports.FLARE_PAIRS_PRICE_FEED_IDS = {
|
|
|
40
41
|
// Commodities (Flare feed IDs to be configured)
|
|
41
42
|
[pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD]: "",
|
|
42
43
|
[pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD]: "",
|
|
44
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD]: "",
|
|
43
45
|
// CAT Mode Stocks
|
|
44
46
|
[pairIds_1.PAIR_CONFIGS_IDS.TSLA_USD_CAT]: "",
|
|
45
47
|
[pairIds_1.PAIR_CONFIGS_IDS.AAPL_USD_CAT]: "",
|
|
@@ -51,6 +53,7 @@ exports.FLARE_PAIRS_PRICE_FEED_IDS = {
|
|
|
51
53
|
// CAT Mode Commodities
|
|
52
54
|
[pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD_CAT]: "",
|
|
53
55
|
[pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD_CAT]: "",
|
|
56
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD_CAT]: "",
|
|
54
57
|
};
|
|
55
58
|
// Reverse mapping
|
|
56
59
|
exports.FLARE_PRICE_FEED_ID_TO_PAIR = Object.entries(exports.FLARE_PAIRS_PRICE_FEED_IDS).reduce((acc, [pairId, feedId]) => {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TPairIds } from "../../../constants/pairIds";
|
|
2
|
+
export declare const PYTH_HERMES_PRICE_KEYS: Record<TPairIds, string>;
|
|
3
|
+
export declare const PYTH_HERMES_FEED_IDS: Record<TPairIds, string>;
|
|
4
|
+
export declare const PYTH_HERMES_FEED_ID_TO_PAIR: Record<string, TPairIds>;
|
|
5
|
+
//# sourceMappingURL=hermesFeedConstants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermesFeedConstants.d.ts","sourceRoot":"","sources":["../../../../../../lib/priceFeeds/pyth/hermes/hermesFeedConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAExE,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CA6D3D,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAiFzD,CAAC;AAGF,eAAO,MAAM,2BAA2B,0BAKlC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const pairIds_1 = require("
|
|
5
|
-
exports.
|
|
3
|
+
exports.PYTH_HERMES_FEED_ID_TO_PAIR = exports.PYTH_HERMES_FEED_IDS = exports.PYTH_HERMES_PRICE_KEYS = void 0;
|
|
4
|
+
const pairIds_1 = require("../../../constants/pairIds");
|
|
5
|
+
exports.PYTH_HERMES_PRICE_KEYS = {
|
|
6
6
|
[pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "Crypto.BTC/USD",
|
|
7
7
|
[pairIds_1.PAIR_CONFIGS_IDS.ETH_USD]: "Crypto.ETH/USD",
|
|
8
8
|
[pairIds_1.PAIR_CONFIGS_IDS.BNB_USD]: "Crypto.BNB/USD",
|
|
@@ -10,6 +10,7 @@ exports.PYTH_PRICE_KEYS = {
|
|
|
10
10
|
[pairIds_1.PAIR_CONFIGS_IDS.SOL_USD]: "Crypto.SOL/USD",
|
|
11
11
|
[pairIds_1.PAIR_CONFIGS_IDS.XRP_USD]: "Crypto.XRP/USD",
|
|
12
12
|
[pairIds_1.PAIR_CONFIGS_IDS.FLR_USD]: "Crypto.FLR/USD",
|
|
13
|
+
[pairIds_1.PAIR_CONFIGS_IDS.SEI_USD]: "Crypto.SEI/USD",
|
|
13
14
|
[pairIds_1.PAIR_CONFIGS_IDS.S_USD]: "Crypto.S/USD",
|
|
14
15
|
// Forex
|
|
15
16
|
[pairIds_1.PAIR_CONFIGS_IDS.EUR_USD]: "Fx.EUR/USD",
|
|
@@ -40,6 +41,7 @@ exports.PYTH_PRICE_KEYS = {
|
|
|
40
41
|
// Commodities
|
|
41
42
|
[pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD]: "Metal.XAU/USD",
|
|
42
43
|
[pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD]: "Metal.XAG/USD",
|
|
44
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD]: "Commodities.USOILSPOT",
|
|
43
45
|
// CAT Mode Stocks
|
|
44
46
|
[pairIds_1.PAIR_CONFIGS_IDS.TSLA_USD_CAT]: "Equity.US.TSLA/USD",
|
|
45
47
|
[pairIds_1.PAIR_CONFIGS_IDS.AAPL_USD_CAT]: "Equity.US.AAPL/USD",
|
|
@@ -51,9 +53,10 @@ exports.PYTH_PRICE_KEYS = {
|
|
|
51
53
|
// CAT Mode Commodities
|
|
52
54
|
[pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD_CAT]: "Metal.XAU/USD",
|
|
53
55
|
[pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD_CAT]: "Metal.XAG/USD",
|
|
56
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD_CAT]: "Commodities.USOILSPOT",
|
|
54
57
|
};
|
|
55
58
|
// You can find the ids of prices at https://pyth.network/developers/price-feed-ids
|
|
56
|
-
exports.
|
|
59
|
+
exports.PYTH_HERMES_FEED_IDS = {
|
|
57
60
|
[pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
|
|
58
61
|
[pairIds_1.PAIR_CONFIGS_IDS.ETH_USD]: "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
|
|
59
62
|
[pairIds_1.PAIR_CONFIGS_IDS.BNB_USD]: "0x2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1101c4f",
|
|
@@ -64,6 +67,7 @@ exports.PYTH_PAIRS_PRICE_FEED_IDS = {
|
|
|
64
67
|
[pairIds_1.PAIR_CONFIGS_IDS.XRP_USD]: "0xec5d399846a9209f3fe5881d70aae9268c94339ff9817e8d18ff19fa05eea1c8",
|
|
65
68
|
[pairIds_1.PAIR_CONFIGS_IDS.S_USD]: "0xf490b178d0c85683b7a0f2388b40af2e6f7c90cbe0f96b31f315f08d0e5a2d6d",
|
|
66
69
|
[pairIds_1.PAIR_CONFIGS_IDS.FLR_USD]: "0x035aa8d0a2d74e19438f2c1440edff9f3b95f915ca65f681a25ed0bad3dc228d",
|
|
70
|
+
[pairIds_1.PAIR_CONFIGS_IDS.SEI_USD]: "0x53614f1cb0c031d4af66c04cb9c756234adad0e1cee85303795091499a4084eb",
|
|
67
71
|
[pairIds_1.PAIR_CONFIGS_IDS.EUR_USD]: "0xa995d00bb36a63cef7fd2c287dc105fc8f3d93779f062f09551b0af3e81ec30b",
|
|
68
72
|
[pairIds_1.PAIR_CONFIGS_IDS.GBP_USD]: "0x84c2dde9633d93d1bcad84e7dc41c9d56578b7ec52fabedc1f335d673df0a7c1",
|
|
69
73
|
[pairIds_1.PAIR_CONFIGS_IDS.AUD_USD]: "0x67a6f93030420c1c9e3fe37c1ab6b77966af82f995944a9fefce357a22854a80",
|
|
@@ -90,6 +94,7 @@ exports.PYTH_PAIRS_PRICE_FEED_IDS = {
|
|
|
90
94
|
// Commodities
|
|
91
95
|
[pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD]: "0x765d2ba906dbc32ca17cc11f5310a89e9ee1f6420508c63861f2f8ba4ee34bb2",
|
|
92
96
|
[pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD]: "0xf2fb02c32b055c805e7238d628e5e9dadef274376114eb1f012337cabe93871e",
|
|
97
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD]: "0x925ca92ff005ae943c158e3563f59698ce7e75c5a8c8dd43303a0a154887b3e6",
|
|
93
98
|
// CAT Mode Stocks
|
|
94
99
|
[pairIds_1.PAIR_CONFIGS_IDS.TSLA_USD_CAT]: "",
|
|
95
100
|
[pairIds_1.PAIR_CONFIGS_IDS.AAPL_USD_CAT]: "",
|
|
@@ -101,9 +106,10 @@ exports.PYTH_PAIRS_PRICE_FEED_IDS = {
|
|
|
101
106
|
// CAT Mode Commodities
|
|
102
107
|
[pairIds_1.PAIR_CONFIGS_IDS.GOLD_USD_CAT]: "",
|
|
103
108
|
[pairIds_1.PAIR_CONFIGS_IDS.SILVER_USD_CAT]: "",
|
|
109
|
+
[pairIds_1.PAIR_CONFIGS_IDS.USOIL_USD_CAT]: "",
|
|
104
110
|
};
|
|
105
111
|
// Reverse mapping
|
|
106
|
-
exports.
|
|
112
|
+
exports.PYTH_HERMES_FEED_ID_TO_PAIR = Object.entries(exports.PYTH_HERMES_FEED_IDS).reduce((acc, [pairId, feedId]) => {
|
|
107
113
|
if (feedId)
|
|
108
114
|
acc[feedId] = parseInt(pairId);
|
|
109
115
|
return acc;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TPairIds } from "../../../constants/pairIds";
|
|
2
|
+
/**
|
|
3
|
+
* Get the Pyth Hermes symbol (e.g. "Crypto.BTC/USD") for a pair
|
|
4
|
+
*/
|
|
5
|
+
export declare function getHermesPriceKeyForPair(pairId: TPairIds): string;
|
|
6
|
+
/**
|
|
7
|
+
* Get the Pyth Hermes feed id (32-byte hex hash) for a pair
|
|
8
|
+
*/
|
|
9
|
+
export declare function getHermesFeedIdForPair(pairId: TPairIds): string;
|
|
10
|
+
/**
|
|
11
|
+
* Get the pair id for a Pyth Hermes feed id (reverse lookup)
|
|
12
|
+
*/
|
|
13
|
+
export declare function getPairIdForHermesFeedId(feedId: string): TPairIds;
|
|
14
|
+
//# sourceMappingURL=hermesFeedFunctions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermesFeedFunctions.d.ts","sourceRoot":"","sources":["../../../../../../lib/priceFeeds/pyth/hermes/hermesFeedFunctions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAEjE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAE/D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAEjE"}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CombinedPriceData } from "../../interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Fetches historical price data from Pyth Hermes for a specific timestamp or later
|
|
4
|
+
* Only searches forward in time (timestamp >= startTimestamp), never backwards
|
|
5
|
+
* @param priceFeedId - The Pyth Hermes price feed ID (32-byte hex hash)
|
|
6
|
+
* @param startTimestamp - The minimum timestamp to search from
|
|
7
|
+
* @param maxTimeGap - Maximum seconds to search forward from startTimestamp
|
|
8
|
+
* @param pairId - Optional pair identifier included in error messages for context
|
|
9
|
+
*/
|
|
10
|
+
export declare function getHermesPriceForTimestamp(priceFeedId: string, startTimestamp: number, maxTimeGap: number, pairId?: number): Promise<CombinedPriceData>;
|
|
11
|
+
//# sourceMappingURL=hermesPriceData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermesPriceData.d.ts","sourceRoot":"","sources":["../../../../../../lib/priceFeeds/pyth/hermes/hermesPriceData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAgCrD;;;;;;;GAOG;AACH,wBAAsB,0BAA0B,CAC9C,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,CAAC,CAkB5B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const scales_1 = require("
|
|
5
|
-
const lynxScalesUtils_1 = require("
|
|
6
|
-
const bignumbers_1 = require("
|
|
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
|
|
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
|
-
|
|
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,54 @@
|
|
|
1
|
+
import { TPairIds } from "../../../constants/pairIds";
|
|
2
|
+
/**
|
|
3
|
+
* Pyth Lazer feed identifiers are u32 integers (not 32-byte hex hashes like Hermes).
|
|
4
|
+
* Branding this as a distinct nominal type prevents accidentally passing a Hermes
|
|
5
|
+
* hash where a Lazer numeric id is expected, and vice versa.
|
|
6
|
+
*/
|
|
7
|
+
export type PythLazerFeedId = number & {
|
|
8
|
+
readonly __brand: "PythLazerFeedId";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Pyth Lazer symbol per pair. Mirrors PYTH_HERMES_PRICE_KEYS but uses Lazer's
|
|
12
|
+
* symbol convention (e.g. "FX." uppercase prefix instead of Hermes' "Fx.").
|
|
13
|
+
*/
|
|
14
|
+
export declare const PYTH_LAZER_PRICE_KEYS: Record<TPairIds, string>;
|
|
15
|
+
/**
|
|
16
|
+
* Pyth Lazer u32 feed identifiers per pair. Source of truth is
|
|
17
|
+
* https://pyth.dourolabs.app/v1/symbols (pyth_lazer_id field).
|
|
18
|
+
*
|
|
19
|
+
* CAT pairs intentionally share the same feed id as their non-CAT counterpart
|
|
20
|
+
* (the underlying market data is identical). This is a behavior change vs the
|
|
21
|
+
* Hermes map, which uses empty-string sentinels for CAT pairs — Lazer callers
|
|
22
|
+
* always get a usable id back.
|
|
23
|
+
*
|
|
24
|
+
* Feed availability on Lazer at the time these were captured (verify with
|
|
25
|
+
* scripts/verifyLazerMapping.ts before relying on any of this).
|
|
26
|
+
*
|
|
27
|
+
* IMPORTANT — MIGRATION CONTEXT: Hermes is scheduled for deprecation
|
|
28
|
+
* (~2026-07). Lazer is the long-term path. The two entries below are
|
|
29
|
+
* migration blockers that need to be resolved (Pyth state change OR feed
|
|
30
|
+
* replacement) before Hermes shutoff, otherwise we lose pricing entirely:
|
|
31
|
+
*
|
|
32
|
+
* - Crypto.FLR/USD (id 191) — Lazer state `coming_soon`. Querying returns
|
|
33
|
+
* HTTP 400 "Price feed id 191 is not ready". Today FLR pricing works via
|
|
34
|
+
* Hermes and Flare; post-Hermes-shutoff only Flare remains if Pyth has
|
|
35
|
+
* not yet promoted 191 to `stable`. Re-run scripts/verifyLazerMapping.ts
|
|
36
|
+
* to check current state.
|
|
37
|
+
*
|
|
38
|
+
* - Commodities.USOILSPOT (id 657) — Lazer state `inactive`. Querying
|
|
39
|
+
* returns HTTP 400 "Price feed id 657 is not ready". Today USOIL pricing
|
|
40
|
+
* works via Hermes only (the Flare oracle does NOT publish USOIL). This
|
|
41
|
+
* is the more urgent migration blocker: if Pyth does not reactivate 657
|
|
42
|
+
* before Hermes shutoff, we need an alternative provider for USOIL or
|
|
43
|
+
* we lose the pair.
|
|
44
|
+
*
|
|
45
|
+
* All other ids are `stable`.
|
|
46
|
+
*/
|
|
47
|
+
export declare const PYTH_LAZER_FEED_IDS: Record<TPairIds, PythLazerFeedId>;
|
|
48
|
+
/**
|
|
49
|
+
* Reverse lookup: Lazer feed id → pair id. CAT pairs share an id with their
|
|
50
|
+
* non-CAT base, so only the base pair is present — the reverse map returns the
|
|
51
|
+
* "canonical" non-CAT pair for any given Lazer feed id.
|
|
52
|
+
*/
|
|
53
|
+
export declare const PYTH_LAZER_FEED_ID_TO_PAIR: Record<number, TPairIds>;
|
|
54
|
+
//# sourceMappingURL=lazerFeedConstants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazerFeedConstants.d.ts","sourceRoot":"","sources":["../../../../../../lib/priceFeeds/pyth/lazer/lazerFeedConstants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAiCxE;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAI/E;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAsD1D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,QAAQ,EAAE,eAAe,CAsDjE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAiB5D,CAAC"}
|