@gmx-io/sdk 1.4.2 → 1.5.0-alpha-2
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/build/cjs/scripts/generate-platform-tokens.js +200 -0
- package/build/cjs/scripts/prebuild/index.js +6 -1
- package/build/cjs/scripts/prebuild/prebuildKinkModelMarketRatesKeys.js +2 -28
- package/build/cjs/scripts/prebuild/prebuildMarketConfigKeys.js +2 -2
- package/build/cjs/scripts/prebuild/prebuildMarketValuesKeys.js +2 -2
- package/build/cjs/scripts/subsquid-codegen.js +26 -0
- package/build/cjs/src/{utils → clients/v1}/callContract.js +4 -6
- package/build/cjs/src/{index.js → clients/v1/index.js} +4 -4
- package/build/cjs/src/{modules → clients/v1/modules}/accounts/accounts.js +1 -1
- package/build/cjs/src/{modules → clients/v1/modules}/accounts/accounts.spec.js +1 -1
- package/build/cjs/src/clients/v1/modules/markets/index.js +227 -0
- package/build/cjs/src/{modules → clients/v1/modules}/markets/markets.spec.js +3 -3
- package/build/cjs/src/{modules → clients/v1/modules}/oracle.js +1 -1
- package/build/cjs/src/{modules → clients/v1/modules}/orders/helpers.js +9 -9
- package/build/cjs/src/{modules → clients/v1/modules}/orders/helpers.spec.js +5 -5
- package/build/cjs/src/{modules → clients/v1/modules}/orders/orders.js +14 -14
- package/build/cjs/src/{modules → clients/v1/modules}/orders/orders.spec.js +1 -1
- package/build/cjs/src/{modules → clients/v1/modules}/orders/transactions/cancelOrdersTxn.js +2 -2
- package/build/cjs/src/{modules → clients/v1/modules}/orders/transactions/createDecreaseOrderTxn.js +7 -7
- package/build/cjs/src/{modules → clients/v1/modules}/orders/transactions/createIncreaseOrderTxn.js +11 -11
- package/build/cjs/src/{modules → clients/v1/modules}/orders/transactions/createSwapOrderTxn.js +10 -10
- package/build/cjs/src/{modules → clients/v1/modules}/orders/transactions/createWrapOrUnwrapTxn.js +2 -2
- package/build/cjs/src/{modules → clients/v1/modules}/orders/transactions/updateOrderTxn.js +3 -3
- package/build/cjs/src/{modules → clients/v1/modules}/orders/utils.js +7 -7
- package/build/cjs/src/{modules → clients/v1/modules}/positions/positions.js +16 -158
- package/build/cjs/src/{modules → clients/v1/modules}/positions/positions.spec.js +1 -1
- package/build/cjs/src/{modules → clients/v1/modules}/tokens/tokens.js +3 -3
- package/build/cjs/src/{modules → clients/v1/modules}/tokens/tokens.spec.js +3 -3
- package/build/cjs/src/{modules → clients/v1/modules}/trades/trades.js +19 -19
- package/build/cjs/src/{modules → clients/v1/modules}/trades/trades.spec.js +1 -1
- package/build/cjs/src/{modules → clients/v1/modules}/utils/utils.js +8 -8
- package/build/cjs/src/{utils → clients/v1}/multicall.js +2 -2
- package/build/cjs/src/{utils → clients/v1}/simulateExecuteOrder.js +5 -5
- package/build/cjs/src/{utils → clients/v1}/testUtil.js +2 -2
- package/build/cjs/src/clients/v2/index.js +29 -0
- package/build/cjs/src/codegen/platformTokens.json +134 -0
- package/build/cjs/src/{prebuilt → codegen/prebuilt}/hashedKinkModelMarketRatesKeys.json +24 -0
- package/build/cjs/src/{prebuilt → codegen/prebuilt}/hashedMarketConfigKeys.json +171 -0
- package/build/cjs/src/{prebuilt → codegen/prebuilt}/hashedMarketValuesKeys.json +45 -0
- package/build/cjs/src/codegen/prebuilt/index.js +16 -0
- package/build/cjs/src/{types → codegen}/subsquid.js +142 -22
- package/build/cjs/src/configs/api.js +15 -0
- package/build/cjs/src/configs/chains.js +29 -1
- package/build/cjs/src/configs/dataStore.js +6 -2
- package/build/cjs/src/configs/markets.js +21 -0
- package/build/cjs/src/configs/multichain.js +29 -19
- package/build/cjs/src/configs/tokens.js +36 -0
- package/build/cjs/src/test/mock.js +5 -122
- package/build/cjs/src/utils/24h/index.js +17 -0
- package/build/cjs/src/utils/LruCache/index.js +17 -0
- package/build/cjs/src/utils/__tests__/fees.spec.js +2 -2
- package/build/cjs/src/utils/__tests__/numbers.spec.js +1 -1
- package/build/cjs/src/utils/__tests__/orderTransactions/batchUtils.spec.js +3 -3
- package/build/cjs/src/utils/__tests__/orderTransactions/decreaseOrders.spec.js +34 -34
- package/build/cjs/src/utils/__tests__/orderTransactions/exchangeRouterMulticall.spec.js +5 -5
- package/build/cjs/src/utils/__tests__/orderTransactions/externalCalls.spec.js +1 -1
- package/build/cjs/src/utils/__tests__/orderTransactions/increaseOrders.spec.js +29 -29
- package/build/cjs/src/utils/__tests__/orderTransactions/swapOrders.spec.js +21 -21
- package/build/cjs/src/utils/__tests__/orderTransactions/updateOrder.spec.js +4 -4
- package/build/cjs/src/utils/__tests__/parseError.spec.js +40 -0
- package/build/cjs/src/utils/__tests__/positions.spec.js +1 -1
- package/build/cjs/src/utils/__tests__/prices.spec.js +18 -18
- package/build/cjs/src/utils/__tests__/tokens.spec.js +191 -4
- package/build/cjs/src/utils/abort/index.js +17 -0
- package/build/cjs/src/utils/bigmath/index.js +17 -0
- package/build/cjs/src/utils/buildUrl/index.js +17 -0
- package/build/cjs/src/utils/chains/index.js +17 -0
- package/build/cjs/src/utils/common/index.js +17 -0
- package/build/cjs/src/utils/{common.js → common/utils.js} +1 -2
- package/build/cjs/src/utils/errors/parseError.js +67 -25
- package/build/cjs/src/utils/fees/executionFee.js +2 -2
- package/build/cjs/src/utils/fees/index.js +9 -9
- package/build/cjs/src/utils/fees/priceImpact.js +6 -1
- package/build/cjs/src/utils/gelatoRelay/index.js +17 -0
- package/build/cjs/src/utils/graphqlFetcher/index.js +8 -0
- package/build/cjs/src/utils/hash/index.js +17 -0
- package/build/cjs/src/utils/{hash.js → hash/utils.js} +1 -1
- package/build/cjs/src/utils/http/http.js +33 -0
- package/build/cjs/src/utils/indexers/index.js +17 -0
- package/build/cjs/src/utils/{indexers.js → indexers/utils.js} +1 -1
- package/build/cjs/src/utils/markets/__tests__/mockMarkets.js +129 -0
- package/build/cjs/src/utils/markets/api.js +14 -0
- package/build/cjs/src/utils/{marketKeysAndConfigs.js → markets/hashKeys.js} +32 -3
- package/build/cjs/src/utils/markets/index.js +21 -0
- package/build/cjs/src/{modules/markets/query-builders.js → utils/markets/multicall.js} +149 -42
- package/build/cjs/src/utils/markets/utils.js +398 -0
- package/build/cjs/src/utils/numbers/index.js +17 -0
- package/build/cjs/src/utils/{numbers.js → numbers/utils.js} +12 -5
- package/build/cjs/src/utils/objects/index.js +17 -0
- package/build/cjs/src/utils/{objects.js → objects/utils.js} +9 -1
- package/build/cjs/src/utils/orderTransactions/index.js +17 -0
- package/build/cjs/src/utils/{orderTransactions.js → orderTransactions/utils.js} +22 -22
- package/build/cjs/src/utils/orders/api.js +13 -0
- package/build/cjs/src/utils/orders/index.js +19 -0
- package/build/cjs/src/utils/{orders.js → orders/utils.js} +22 -22
- package/build/cjs/src/utils/positions/api.js +14 -0
- package/build/cjs/src/utils/positions/index.js +19 -0
- package/build/cjs/src/utils/positions/utils.js +425 -0
- package/build/cjs/src/utils/prices/index.js +17 -0
- package/build/cjs/src/utils/{prices.js → prices/utils.js} +15 -15
- package/build/cjs/src/utils/referrals/index.js +18 -0
- package/build/cjs/src/utils/sidecarOrders/index.js +17 -0
- package/build/cjs/src/utils/swap/__tests__/mockRouting.spec.js +15 -15
- package/build/cjs/src/utils/swap/__tests__/swapRouting.spec.js +6 -6
- package/build/cjs/src/utils/swap/__tests__/swapStats.spec.js +10 -10
- package/build/cjs/src/utils/swap/botanixStaking.js +3 -3
- package/build/cjs/src/utils/swap/buildSwapStrategy.js +2 -2
- package/build/cjs/src/utils/swap/externalSwapPath.js +2 -2
- package/build/cjs/src/utils/swap/externalSwapQuoteByPath.js +2 -2
- package/build/cjs/src/utils/swap/index.js +12 -0
- package/build/cjs/src/utils/swap/swapPath.js +3 -3
- package/build/cjs/src/utils/swap/swapValues.js +4 -4
- package/build/cjs/src/utils/time/index.js +17 -0
- package/build/cjs/src/utils/tokens/index.js +18 -0
- package/build/cjs/src/utils/{tokens.js → tokens/utils.js} +27 -7
- package/build/cjs/src/utils/trade/decrease.js +8 -8
- package/build/cjs/src/utils/trade/increase.js +2 -2
- package/build/cjs/src/utils/trade/index.js +3 -0
- package/build/cjs/src/utils/trade/trade.js +10 -10
- package/build/cjs/src/utils/tradeHistory/index.js +18 -0
- package/build/cjs/src/utils/{tradeHistory.js → tradeHistory/utils.js} +4 -4
- package/build/cjs/src/utils/twap/index.js +15 -0
- package/build/cjs/src/utils/types/index.js +7 -0
- package/build/esm/scripts/generate-platform-tokens.js +195 -0
- package/build/esm/scripts/prebuild/index.js +3 -1
- package/build/esm/scripts/prebuild/prebuildKinkModelMarketRatesKeys.js +2 -28
- package/build/esm/scripts/prebuild/prebuildMarketConfigKeys.js +1 -1
- package/build/esm/scripts/prebuild/prebuildMarketValuesKeys.js +1 -1
- package/build/esm/scripts/subsquid-codegen.js +24 -0
- package/build/esm/src/{utils → clients/v1}/callContract.js +5 -5
- package/build/esm/src/{index.js → clients/v1/index.js} +4 -4
- package/build/esm/src/{modules → clients/v1/modules}/accounts/accounts.js +1 -1
- package/build/esm/src/{modules → clients/v1/modules}/accounts/accounts.spec.js +1 -1
- package/build/esm/src/clients/v1/modules/markets/index.js +220 -0
- package/build/esm/src/{modules → clients/v1/modules}/markets/markets.spec.js +2 -2
- package/build/esm/src/{modules → clients/v1/modules}/oracle.js +1 -1
- package/build/esm/src/{modules → clients/v1/modules}/orders/helpers.js +6 -6
- package/build/esm/src/{modules → clients/v1/modules}/orders/helpers.spec.js +5 -5
- package/build/esm/src/{modules → clients/v1/modules}/orders/orders.js +7 -7
- package/build/esm/src/{modules → clients/v1/modules}/orders/orders.spec.js +1 -1
- package/build/esm/src/{modules → clients/v1/modules}/orders/transactions/cancelOrdersTxn.js +2 -2
- package/build/esm/src/{modules → clients/v1/modules}/orders/transactions/createDecreaseOrderTxn.js +7 -7
- package/build/esm/src/{modules → clients/v1/modules}/orders/transactions/createIncreaseOrderTxn.js +8 -8
- package/build/esm/src/{modules → clients/v1/modules}/orders/transactions/createSwapOrderTxn.js +7 -7
- package/build/esm/src/{modules → clients/v1/modules}/orders/transactions/createWrapOrUnwrapTxn.js +2 -2
- package/build/esm/src/{modules → clients/v1/modules}/orders/transactions/updateOrderTxn.js +3 -3
- package/build/esm/src/{modules → clients/v1/modules}/orders/utils.js +7 -7
- package/build/esm/src/{modules → clients/v1/modules}/positions/positions.js +16 -158
- package/build/esm/src/{modules → clients/v1/modules}/positions/positions.spec.js +1 -1
- package/build/esm/src/{modules → clients/v1/modules}/tokens/tokens.js +3 -3
- package/build/esm/src/{modules → clients/v1/modules}/tokens/tokens.spec.js +1 -1
- package/build/esm/src/{modules → clients/v1/modules}/trades/trades.js +8 -8
- package/build/esm/src/{modules → clients/v1/modules}/trades/trades.spec.js +1 -1
- package/build/esm/src/{modules → clients/v1/modules}/utils/utils.js +8 -8
- package/build/esm/src/{utils → clients/v1}/multicall.js +2 -2
- package/build/esm/src/{utils → clients/v1}/simulateExecuteOrder.js +5 -5
- package/build/esm/src/{utils → clients/v1}/testUtil.js +2 -2
- package/build/esm/src/clients/v2/index.js +25 -0
- package/build/esm/src/codegen/platformTokens.json +134 -0
- package/build/esm/src/{prebuilt → codegen/prebuilt}/hashedKinkModelMarketRatesKeys.json +24 -0
- package/build/esm/src/{prebuilt → codegen/prebuilt}/hashedMarketConfigKeys.json +171 -0
- package/build/esm/src/{prebuilt → codegen/prebuilt}/hashedMarketValuesKeys.json +45 -0
- package/build/esm/src/codegen/prebuilt/index.js +10 -0
- package/build/esm/src/{types → codegen}/subsquid.js +141 -21
- package/build/esm/src/configs/api.js +11 -0
- package/build/esm/src/configs/chains.js +29 -1
- package/build/esm/src/configs/dataStore.js +3 -0
- package/build/esm/src/configs/markets.js +21 -0
- package/build/esm/src/configs/multichain.js +28 -19
- package/build/esm/src/configs/tokens.js +36 -0
- package/build/esm/src/test/mock.js +3 -120
- package/build/esm/src/utils/24h/index.js +1 -0
- package/build/esm/src/utils/LruCache/index.js +1 -0
- package/build/esm/src/utils/__tests__/fees.spec.js +2 -2
- package/build/esm/src/utils/__tests__/numbers.spec.js +1 -1
- package/build/esm/src/utils/__tests__/orderTransactions/batchUtils.spec.js +2 -2
- package/build/esm/src/utils/__tests__/orderTransactions/decreaseOrders.spec.js +2 -2
- package/build/esm/src/utils/__tests__/orderTransactions/exchangeRouterMulticall.spec.js +2 -2
- package/build/esm/src/utils/__tests__/orderTransactions/externalCalls.spec.js +1 -1
- package/build/esm/src/utils/__tests__/orderTransactions/increaseOrders.spec.js +2 -2
- package/build/esm/src/utils/__tests__/orderTransactions/swapOrders.spec.js +2 -2
- package/build/esm/src/utils/__tests__/orderTransactions/updateOrder.spec.js +2 -2
- package/build/esm/src/utils/__tests__/parseError.spec.js +40 -0
- package/build/esm/src/utils/__tests__/positions.spec.js +1 -1
- package/build/esm/src/utils/__tests__/prices.spec.js +2 -2
- package/build/esm/src/utils/__tests__/tokens.spec.js +192 -5
- package/build/esm/src/utils/abort/index.js +1 -0
- package/build/esm/src/utils/bigmath/index.js +1 -0
- package/build/esm/src/utils/buildUrl/index.js +1 -0
- package/build/esm/src/utils/chains/index.js +1 -0
- package/build/esm/src/utils/common/index.js +1 -0
- package/build/esm/src/utils/{common.js → common/utils.js} +0 -1
- package/build/esm/src/utils/errors/parseError.js +64 -24
- package/build/esm/src/utils/fees/executionFee.js +1 -1
- package/build/esm/src/utils/fees/index.js +7 -7
- package/build/esm/src/utils/fees/priceImpact.js +5 -1
- package/build/esm/src/utils/gelatoRelay/index.js +1 -0
- package/build/esm/src/utils/graphqlFetcher/index.js +1 -0
- package/build/esm/src/utils/hash/index.js +1 -0
- package/build/esm/src/utils/{hash.js → hash/utils.js} +1 -1
- package/build/esm/src/utils/http/http.js +26 -0
- package/build/esm/src/utils/indexers/index.js +1 -0
- package/build/esm/src/utils/{indexers.js → indexers/utils.js} +1 -1
- package/build/esm/src/utils/markets/__tests__/mockMarkets.js +124 -0
- package/build/esm/src/utils/markets/api.js +9 -0
- package/build/esm/src/utils/{marketKeysAndConfigs.js → markets/hashKeys.js} +30 -2
- package/build/esm/src/utils/markets/index.js +5 -0
- package/build/esm/src/{modules/markets/query-builders.js → utils/markets/multicall.js} +146 -41
- package/build/esm/src/utils/markets/utils.js +364 -0
- package/build/esm/src/utils/numbers/index.js +1 -0
- package/build/esm/src/utils/{numbers.js → numbers/utils.js} +10 -3
- package/build/esm/src/utils/objects/index.js +1 -0
- package/build/esm/src/utils/{objects.js → objects/utils.js} +7 -0
- package/build/esm/src/utils/orderTransactions/index.js +1 -0
- package/build/esm/src/utils/{orderTransactions.js → orderTransactions/utils.js} +14 -14
- package/build/esm/src/utils/orders/api.js +9 -0
- package/build/esm/src/utils/orders/index.js +3 -0
- package/build/esm/src/utils/{orders.js → orders/utils.js} +8 -8
- package/build/esm/src/utils/positions/api.js +10 -0
- package/build/esm/src/utils/positions/index.js +3 -0
- package/build/esm/src/utils/positions/utils.js +407 -0
- package/build/esm/src/utils/prices/index.js +1 -0
- package/build/esm/src/utils/{prices.js → prices/utils.js} +7 -7
- package/build/esm/src/utils/referrals/index.js +2 -0
- package/build/esm/src/utils/sidecarOrders/index.js +1 -0
- package/build/esm/src/utils/swap/__tests__/mockRouting.spec.js +2 -2
- package/build/esm/src/utils/swap/__tests__/swapRouting.spec.js +2 -2
- package/build/esm/src/utils/swap/__tests__/swapStats.spec.js +1 -1
- package/build/esm/src/utils/swap/botanixStaking.js +1 -1
- package/build/esm/src/utils/swap/buildSwapStrategy.js +1 -1
- package/build/esm/src/utils/swap/externalSwapPath.js +1 -1
- package/build/esm/src/utils/swap/externalSwapQuoteByPath.js +1 -1
- package/build/esm/src/utils/swap/index.js +12 -0
- package/build/esm/src/utils/swap/swapPath.js +1 -1
- package/build/esm/src/utils/swap/swapValues.js +1 -1
- package/build/esm/src/utils/time/index.js +1 -0
- package/build/esm/src/utils/tokens/index.js +2 -0
- package/build/esm/src/utils/{tokens.js → tokens/utils.js} +27 -7
- package/build/esm/src/utils/trade/decrease.js +1 -1
- package/build/esm/src/utils/trade/increase.js +1 -1
- package/build/esm/src/utils/trade/index.js +3 -0
- package/build/esm/src/utils/trade/trade.js +2 -2
- package/build/esm/src/utils/tradeHistory/index.js +2 -0
- package/build/esm/src/utils/{tradeHistory.js → tradeHistory/utils.js} +4 -4
- package/build/esm/src/utils/twap/index.js +1 -0
- package/build/esm/src/utils/types/index.js +3 -0
- package/build/types/scripts/generate-platform-tokens.d.ts +27 -0
- package/build/types/scripts/subsquid-codegen.d.ts +3 -0
- package/build/types/src/clients/v1/callContract.d.ts +7 -0
- package/build/types/src/{index.d.ts → clients/v1/index.d.ts} +3 -3
- package/build/types/src/{modules → clients/v1/modules}/markets/index.d.ts +12 -1
- package/build/types/src/{modules → clients/v1/modules}/oracle.d.ts +2 -2
- package/build/types/src/{modules → clients/v1/modules}/orders/helpers.d.ts +3 -3
- package/build/types/src/{modules → clients/v1/modules}/orders/orders.d.ts +6 -6
- package/build/types/src/{modules → clients/v1/modules}/orders/transactions/cancelOrdersTxn.d.ts +1 -1
- package/build/types/src/{modules → clients/v1/modules}/orders/transactions/createDecreaseOrderTxn.d.ts +3 -3
- package/build/types/src/{modules → clients/v1/modules}/orders/transactions/createIncreaseOrderTxn.d.ts +4 -4
- package/build/types/src/{modules → clients/v1/modules}/orders/transactions/createSwapOrderTxn.d.ts +2 -2
- package/build/types/src/{modules → clients/v1/modules}/orders/transactions/createWrapOrUnwrapTxn.d.ts +1 -1
- package/build/types/src/{modules → clients/v1/modules}/orders/transactions/updateOrderTxn.d.ts +2 -2
- package/build/types/src/{modules → clients/v1/modules}/orders/utils.d.ts +9 -9
- package/build/types/src/{modules → clients/v1/modules}/positions/positions.d.ts +4 -4
- package/build/types/src/{modules → clients/v1/modules}/tokens/tokens.d.ts +1 -1
- package/build/types/src/{modules → clients/v1/modules}/trades/trades.d.ts +4 -4
- package/build/types/src/{modules → clients/v1/modules}/utils/utils.d.ts +4 -4
- package/build/types/src/{utils → clients/v1}/multicall.d.ts +2 -2
- package/build/types/src/{utils → clients/v1}/simulateExecuteOrder.d.ts +3 -3
- package/build/types/src/{utils → clients/v1}/testUtil.d.ts +2 -2
- package/build/types/src/{types/sdk.d.ts → clients/v1/types.d.ts} +3 -3
- package/build/types/src/clients/v2/index.d.ts +20 -0
- package/build/types/src/codegen/prebuilt/index.d.ts +13876 -0
- package/build/types/src/{types → codegen}/subsquid.d.ts +505 -60
- package/build/types/src/configs/api.d.ts +1 -0
- package/build/types/src/configs/chains.d.ts +26 -2
- package/build/types/src/configs/dataStore.d.ts +1 -0
- package/build/types/src/configs/express.d.ts +1 -1
- package/build/types/src/configs/gasLimits.d.ts +1 -1
- package/build/types/src/configs/markets.d.ts +1 -1
- package/build/types/src/configs/multichain.d.ts +6 -3
- package/build/types/src/configs/tokens.d.ts +1 -1
- package/build/types/src/test/mock.d.ts +3 -7
- package/build/types/src/utils/24h/index.d.ts +1 -0
- package/build/types/src/utils/24h/types.d.ts +7 -0
- package/build/types/src/utils/LruCache/index.d.ts +1 -0
- package/build/types/src/utils/abort/index.d.ts +1 -0
- package/build/types/src/utils/bigmath/index.d.ts +1 -0
- package/build/types/src/utils/buildUrl/index.d.ts +1 -0
- package/build/types/src/utils/chains/index.d.ts +1 -0
- package/build/types/src/utils/common/index.d.ts +1 -0
- package/build/types/src/utils/{common.d.ts → common/utils.d.ts} +0 -1
- package/build/types/src/utils/errors/parseError.d.ts +13 -1
- package/build/types/src/utils/fees/executionFee.d.ts +3 -3
- package/build/types/src/utils/fees/getNaiveEstimatedGasBySwapCount.d.ts +1 -1
- package/build/types/src/utils/fees/index.d.ts +10 -13
- package/build/types/src/utils/fees/priceImpact.d.ts +4 -3
- package/build/types/src/{types/fees.d.ts → utils/fees/types.d.ts} +2 -2
- package/build/types/src/utils/gelatoRelay/index.d.ts +1 -0
- package/build/types/src/utils/graphqlFetcher/index.d.ts +1 -0
- package/build/types/src/utils/hash/index.d.ts +1 -0
- package/build/types/src/utils/http/http.d.ts +9 -0
- package/build/types/src/utils/http/types.d.ts +7 -0
- package/build/types/src/utils/indexers/index.d.ts +1 -0
- package/build/types/src/utils/markets/__tests__/mockMarkets.d.ts +9 -0
- package/build/types/src/utils/markets/api.d.ts +9 -0
- package/build/types/src/utils/markets/hashKeys.d.ts +23 -0
- package/build/types/src/utils/markets/index.d.ts +5 -0
- package/build/types/src/utils/markets/multicall.d.ts +25 -0
- package/build/types/src/{types/markets.d.ts → utils/markets/types.d.ts} +64 -1
- package/build/types/src/utils/markets/utils.d.ts +122 -0
- package/build/types/src/utils/numbers/index.d.ts +1 -0
- package/build/types/src/utils/{numbers.d.ts → numbers/utils.d.ts} +5 -1
- package/build/types/src/utils/objects/index.d.ts +1 -0
- package/build/types/src/utils/{objects.d.ts → objects/utils.d.ts} +1 -0
- package/build/types/src/utils/orderTransactions/index.d.ts +1 -0
- package/build/types/src/utils/{orderTransactions.d.ts → orderTransactions/utils.d.ts} +6 -6
- package/build/types/src/utils/orders/api.d.ts +7 -0
- package/build/types/src/utils/orders/index.d.ts +3 -0
- package/build/types/src/{types/orders.d.ts → utils/orders/types.d.ts} +30 -3
- package/build/types/src/utils/{orders.d.ts → orders/utils.d.ts} +3 -3
- package/build/types/src/utils/positions/api.d.ts +8 -0
- package/build/types/src/utils/positions/index.d.ts +3 -0
- package/build/types/src/{types/positions.d.ts → utils/positions/types.d.ts} +7 -18
- package/build/types/src/utils/{positions.d.ts → positions/utils.d.ts} +45 -4
- package/build/types/src/utils/prices/index.d.ts +1 -0
- package/build/types/src/utils/{prices.d.ts → prices/utils.d.ts} +4 -4
- package/build/types/src/utils/referrals/index.d.ts +2 -0
- package/build/types/src/utils/sidecarOrders/index.d.ts +1 -0
- package/build/types/src/{types/sidecarOrders.d.ts → utils/sidecarOrders/types.d.ts} +2 -2
- package/build/types/src/utils/swap/botanixStaking.d.ts +2 -2
- package/build/types/src/utils/swap/buildSwapStrategy.d.ts +5 -5
- package/build/types/src/utils/swap/externalSwapPath.d.ts +1 -1
- package/build/types/src/utils/swap/externalSwapQuoteByPath.d.ts +1 -1
- package/build/types/src/utils/swap/findSwapPathsBetweenTokens.d.ts +1 -1
- package/build/types/src/utils/swap/index.d.ts +12 -0
- package/build/types/src/utils/swap/preparedSwapData.d.ts +1 -1
- package/build/types/src/utils/swap/swapPath.d.ts +6 -6
- package/build/types/src/utils/swap/swapRouting.d.ts +5 -5
- package/build/types/src/utils/swap/swapStats.d.ts +3 -3
- package/build/types/src/utils/swap/swapValues.d.ts +4 -4
- package/build/types/src/{types/swapStrategy.d.ts → utils/swap/types.d.ts} +1 -1
- package/build/types/src/utils/time/index.d.ts +1 -0
- package/build/types/src/utils/tokens/index.d.ts +2 -0
- package/build/types/src/{types/tokens.d.ts → utils/tokens/types.d.ts} +1 -1
- package/build/types/src/utils/{tokens.d.ts → tokens/utils.d.ts} +2 -2
- package/build/types/src/utils/trade/decrease.d.ts +5 -5
- package/build/types/src/utils/trade/increase.d.ts +5 -5
- package/build/types/src/utils/trade/index.d.ts +3 -0
- package/build/types/src/utils/trade/trade.d.ts +1 -1
- package/build/types/src/{types/trade.d.ts → utils/trade/types.d.ts} +4 -4
- package/build/types/src/utils/tradeHistory/index.d.ts +2 -0
- package/build/types/src/{types/tradeHistory.d.ts → utils/tradeHistory/types.d.ts} +5 -5
- package/build/types/src/utils/{tradeHistory.d.ts → tradeHistory/utils.d.ts} +4 -4
- package/build/types/src/utils/twap/index.d.ts +3 -2
- package/build/types/src/utils/{types.d.ts → types/index.d.ts} +0 -1
- package/package.json +280 -31
- package/build/cjs/src/modules/markets/index.js +0 -366
- package/build/cjs/src/prebuilt/index.js +0 -15
- package/build/cjs/src/utils/markets.js +0 -195
- package/build/cjs/src/utils/positions.js +0 -213
- package/build/cjs/src/utils/types.js +0 -13
- package/build/esm/src/modules/markets/index.js +0 -359
- package/build/esm/src/prebuilt/index.js +0 -7
- package/build/esm/src/utils/markets.js +0 -171
- package/build/esm/src/utils/positions.js +0 -197
- package/build/esm/src/utils/types.js +0 -8
- package/build/types/src/modules/markets/query-builders.d.ts +0 -42
- package/build/types/src/modules/markets/types.d.ts +0 -51
- package/build/types/src/prebuilt/index.d.ts +0 -24
- package/build/types/src/types/common.d.ts +0 -1
- package/build/types/src/utils/callContract.d.ts +0 -17
- package/build/types/src/utils/marketKeysAndConfigs.d.ts +0 -73
- package/build/types/src/utils/markets.d.ts +0 -58
- /package/build/cjs/src/{modules → clients/v1/modules}/base.js +0 -0
- /package/build/cjs/src/{modules/markets → clients/v1}/types.js +0 -0
- /package/build/cjs/src/{types/chains.js → utils/24h/types.js} +0 -0
- /package/build/cjs/src/utils/{LruCache.js → LruCache/utils.js} +0 -0
- /package/build/cjs/src/utils/{abort.js → abort/utils.js} +0 -0
- /package/build/cjs/src/utils/{bigmath.js → bigmath/utils.js} +0 -0
- /package/build/cjs/src/utils/{buildUrl.js → buildUrl/utils.js} +0 -0
- /package/build/cjs/src/{types/common.js → utils/chains/types.js} +0 -0
- /package/build/cjs/src/{types/fees.js → utils/fees/types.js} +0 -0
- /package/build/cjs/src/utils/{gelatoRelay.js → gelatoRelay/utils.js} +0 -0
- /package/build/cjs/src/utils/{graphqlFetcher.js → graphqlFetcher/utils.js} +0 -0
- /package/build/cjs/src/{types/markets.js → utils/http/types.js} +0 -0
- /package/build/cjs/src/{types/positions.js → utils/markets/types.js} +0 -0
- /package/build/cjs/src/{types/orders.js → utils/orders/types.js} +0 -0
- /package/build/cjs/src/{types/sdk.js → utils/positions/types.js} +0 -0
- /package/build/cjs/src/{types/referrals.js → utils/referrals/types.js} +0 -0
- /package/build/cjs/src/utils/{referrals.js → referrals/utils.js} +0 -0
- /package/build/cjs/src/{types/sidecarOrders.js → utils/sidecarOrders/types.js} +0 -0
- /package/build/cjs/src/{types/swapStrategy.js → utils/swap/types.js} +0 -0
- /package/build/cjs/src/utils/{time.js → time/utils.js} +0 -0
- /package/build/cjs/src/{types/tokens.js → utils/tokens/types.js} +0 -0
- /package/build/cjs/src/{types/trade.js → utils/trade/types.js} +0 -0
- /package/build/cjs/src/{types/tradeHistory.js → utils/tradeHistory/types.js} +0 -0
- /package/build/cjs/src/{types/twap.js → utils/twap/types.js} +0 -0
- /package/build/esm/src/{modules → clients/v1/modules}/base.js +0 -0
- /package/build/esm/src/{modules/markets → clients/v1}/types.js +0 -0
- /package/build/esm/src/{types/chains.js → utils/24h/types.js} +0 -0
- /package/build/esm/src/utils/{LruCache.js → LruCache/utils.js} +0 -0
- /package/build/esm/src/utils/{abort.js → abort/utils.js} +0 -0
- /package/build/esm/src/utils/{bigmath.js → bigmath/utils.js} +0 -0
- /package/build/esm/src/utils/{buildUrl.js → buildUrl/utils.js} +0 -0
- /package/build/esm/src/{types/common.js → utils/chains/types.js} +0 -0
- /package/build/esm/src/{types/fees.js → utils/fees/types.js} +0 -0
- /package/build/esm/src/utils/{gelatoRelay.js → gelatoRelay/utils.js} +0 -0
- /package/build/esm/src/utils/{graphqlFetcher.js → graphqlFetcher/utils.js} +0 -0
- /package/build/esm/src/{types/markets.js → utils/http/types.js} +0 -0
- /package/build/esm/src/{types/positions.js → utils/markets/types.js} +0 -0
- /package/build/esm/src/{types/orders.js → utils/orders/types.js} +0 -0
- /package/build/esm/src/{types/sdk.js → utils/positions/types.js} +0 -0
- /package/build/esm/src/{types/referrals.js → utils/referrals/types.js} +0 -0
- /package/build/esm/src/utils/{referrals.js → referrals/utils.js} +0 -0
- /package/build/esm/src/{types/sidecarOrders.js → utils/sidecarOrders/types.js} +0 -0
- /package/build/esm/src/{types/swapStrategy.js → utils/swap/types.js} +0 -0
- /package/build/esm/src/utils/{time.js → time/utils.js} +0 -0
- /package/build/esm/src/{types/tokens.js → utils/tokens/types.js} +0 -0
- /package/build/esm/src/{types/trade.js → utils/trade/types.js} +0 -0
- /package/build/esm/src/{types/tradeHistory.js → utils/tradeHistory/types.js} +0 -0
- /package/build/esm/src/{types/twap.js → utils/twap/types.js} +0 -0
- /package/build/types/src/{modules → clients/v1/modules}/accounts/accounts.d.ts +0 -0
- /package/build/types/src/{modules → clients/v1/modules}/accounts/accounts.spec.d.ts +0 -0
- /package/build/types/src/{modules → clients/v1/modules}/base.d.ts +0 -0
- /package/build/types/src/{modules → clients/v1/modules}/markets/markets.spec.d.ts +0 -0
- /package/build/types/src/{modules → clients/v1/modules}/orders/helpers.spec.d.ts +0 -0
- /package/build/types/src/{modules → clients/v1/modules}/orders/orders.spec.d.ts +0 -0
- /package/build/types/src/{modules → clients/v1/modules}/positions/positions.spec.d.ts +0 -0
- /package/build/types/src/{modules → clients/v1/modules}/tokens/tokens.spec.d.ts +0 -0
- /package/build/types/src/{modules → clients/v1/modules}/trades/trades.spec.d.ts +0 -0
- /package/build/types/src/utils/{LruCache.d.ts → LruCache/utils.d.ts} +0 -0
- /package/build/types/src/utils/{abort.d.ts → abort/utils.d.ts} +0 -0
- /package/build/types/src/utils/{bigmath.d.ts → bigmath/utils.d.ts} +0 -0
- /package/build/types/src/utils/{buildUrl.d.ts → buildUrl/utils.d.ts} +0 -0
- /package/build/types/src/{types/chains.d.ts → utils/chains/types.d.ts} +0 -0
- /package/build/types/src/utils/{gelatoRelay.d.ts → gelatoRelay/utils.d.ts} +0 -0
- /package/build/types/src/utils/{graphqlFetcher.d.ts → graphqlFetcher/utils.d.ts} +0 -0
- /package/build/types/src/utils/{hash.d.ts → hash/utils.d.ts} +0 -0
- /package/build/types/src/utils/{indexers.d.ts → indexers/utils.d.ts} +0 -0
- /package/build/types/src/{types/referrals.d.ts → utils/referrals/types.d.ts} +0 -0
- /package/build/types/src/utils/{referrals.d.ts → referrals/utils.d.ts} +0 -0
- /package/build/types/src/utils/{time.d.ts → time/utils.d.ts} +0 -0
- /package/build/types/src/{types/twap.d.ts → utils/twap/types.d.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.queryPaginated = exports.buildFiltersBody = void 0;
|
|
4
|
-
const batch_1 = require("
|
|
4
|
+
const batch_1 = require("../../configs/batch");
|
|
5
5
|
function buildFiltersBody(filters, options) {
|
|
6
6
|
const res = {};
|
|
7
7
|
let hadOr = false;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mockMarketsInfoData = exports.mockMarketsData = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const factors_1 = require("../../../configs/factors");
|
|
6
|
+
const mock_1 = require("../../../test/mock");
|
|
7
|
+
const markets_1 = require("..");
|
|
8
|
+
const numbers_1 = require("../../numbers");
|
|
9
|
+
const tokens_1 = require("../../tokens");
|
|
10
|
+
/**
|
|
11
|
+
* @param marketKeys - array of market keys in the following format: indexToken-longToken-shortToken
|
|
12
|
+
*/
|
|
13
|
+
function mockMarketsData(marketKeys) {
|
|
14
|
+
return marketKeys.reduce((acc, key) => {
|
|
15
|
+
const [indexTokenAddress, longTokenAddress, shortTokenAddress] = key.split("-");
|
|
16
|
+
acc[key] = {
|
|
17
|
+
marketTokenAddress: key,
|
|
18
|
+
indexTokenAddress,
|
|
19
|
+
longTokenAddress,
|
|
20
|
+
shortTokenAddress,
|
|
21
|
+
isSameCollaterals: longTokenAddress === shortTokenAddress,
|
|
22
|
+
isSpotOnly: indexTokenAddress === "SPOT",
|
|
23
|
+
data: "",
|
|
24
|
+
name: "Test Market",
|
|
25
|
+
};
|
|
26
|
+
return acc;
|
|
27
|
+
}, {});
|
|
28
|
+
}
|
|
29
|
+
exports.mockMarketsData = mockMarketsData;
|
|
30
|
+
function mockMarketsInfoData(tokensData, marketKeys, overrides = {}) {
|
|
31
|
+
return marketKeys.reduce((acc, key) => {
|
|
32
|
+
const [indexTokenAddress, longTokenAddress, shortTokenAddress] = key.split("-");
|
|
33
|
+
const indexToken = (0, tokens_1.getTokenData)(tokensData, indexTokenAddress);
|
|
34
|
+
const longToken = (0, tokens_1.getTokenData)(tokensData, longTokenAddress);
|
|
35
|
+
const shortToken = (0, tokens_1.getTokenData)(tokensData, shortTokenAddress);
|
|
36
|
+
const isSpotOnly = indexTokenAddress === "SPOT";
|
|
37
|
+
acc[key] = {
|
|
38
|
+
isDisabled: false,
|
|
39
|
+
marketTokenAddress: key,
|
|
40
|
+
indexTokenAddress,
|
|
41
|
+
longTokenAddress,
|
|
42
|
+
shortTokenAddress,
|
|
43
|
+
isSameCollaterals: longTokenAddress === shortTokenAddress,
|
|
44
|
+
isSpotOnly,
|
|
45
|
+
name: (0, markets_1.getMarketFullName)({ longToken, shortToken, indexToken, isSpotOnly }),
|
|
46
|
+
longToken,
|
|
47
|
+
shortToken,
|
|
48
|
+
indexToken,
|
|
49
|
+
longPoolAmount: (0, mock_1.usdToToken)(1000, longToken),
|
|
50
|
+
shortPoolAmount: (0, mock_1.usdToToken)(1000, shortToken),
|
|
51
|
+
maxLongPoolAmount: (0, mock_1.usdToToken)(10000, longToken),
|
|
52
|
+
maxShortPoolAmount: (0, mock_1.usdToToken)(10000, shortToken),
|
|
53
|
+
maxLongPoolUsdForDeposit: (0, mock_1.usdToToken)(10000, longToken),
|
|
54
|
+
maxShortPoolUsdForDeposit: (0, mock_1.usdToToken)(10000, shortToken),
|
|
55
|
+
poolValueMax: (0, numbers_1.expandDecimals)(2000, factors_1.USD_DECIMALS),
|
|
56
|
+
poolValueMin: (0, numbers_1.expandDecimals)(2000, factors_1.USD_DECIMALS),
|
|
57
|
+
reserveFactorLong: (0, numbers_1.expandDecimals)(5, 29),
|
|
58
|
+
reserveFactorShort: (0, numbers_1.expandDecimals)(5, 29),
|
|
59
|
+
openInterestReserveFactorLong: (0, numbers_1.expandDecimals)(5, 29),
|
|
60
|
+
openInterestReserveFactorShort: (0, numbers_1.expandDecimals)(5, 29),
|
|
61
|
+
maxOpenInterestLong: (0, numbers_1.expandDecimals)(5, 29),
|
|
62
|
+
maxOpenInterestShort: (0, numbers_1.expandDecimals)(5, 29),
|
|
63
|
+
positionImpactPoolAmount: (0, mock_1.usdToToken)(1000, indexToken),
|
|
64
|
+
positionImpactPoolDistributionRate: 0n,
|
|
65
|
+
minPositionImpactPoolAmount: 0n,
|
|
66
|
+
swapImpactPoolAmountLong: (0, mock_1.usdToToken)(1000, longToken),
|
|
67
|
+
swapImpactPoolAmountShort: (0, mock_1.usdToToken)(1000, shortToken),
|
|
68
|
+
positionFeeFactorForBalanceWasImproved: (0, numbers_1.expandDecimals)(5, 26),
|
|
69
|
+
positionFeeFactorForBalanceWasNotImproved: (0, numbers_1.expandDecimals)(5, 26),
|
|
70
|
+
positionImpactFactorPositive: (0, numbers_1.expandDecimals)(2, 23),
|
|
71
|
+
positionImpactFactorNegative: (0, numbers_1.expandDecimals)(1, 23),
|
|
72
|
+
maxPositionImpactFactorPositive: (0, numbers_1.expandDecimals)(2, 23),
|
|
73
|
+
maxPositionImpactFactorNegative: (0, numbers_1.expandDecimals)(1, 23),
|
|
74
|
+
maxPositionImpactFactorForLiquidations: (0, numbers_1.expandDecimals)(1, 23),
|
|
75
|
+
maxLendableImpactFactor: (0, numbers_1.expandDecimals)(1, 23),
|
|
76
|
+
maxLendableImpactFactorForWithdrawals: (0, numbers_1.expandDecimals)(1, 23),
|
|
77
|
+
maxLendableImpactUsd: (0, numbers_1.expandDecimals)(1, 23),
|
|
78
|
+
lentPositionImpactPoolAmount: (0, numbers_1.expandDecimals)(1, 23),
|
|
79
|
+
positionImpactExponentFactorPositive: (0, numbers_1.expandDecimals)(2, 30),
|
|
80
|
+
positionImpactExponentFactorNegative: (0, numbers_1.expandDecimals)(2, 30),
|
|
81
|
+
useOpenInterestInTokensForBalance: true,
|
|
82
|
+
swapFeeFactorForBalanceWasImproved: (0, numbers_1.expandDecimals)(2, 27),
|
|
83
|
+
swapFeeFactorForBalanceWasNotImproved: (0, numbers_1.expandDecimals)(2, 27),
|
|
84
|
+
atomicSwapFeeFactor: (0, numbers_1.expandDecimals)(2, 27),
|
|
85
|
+
swapImpactFactorPositive: (0, numbers_1.expandDecimals)(2, 23),
|
|
86
|
+
swapImpactFactorNegative: (0, numbers_1.expandDecimals)(1, 23),
|
|
87
|
+
swapImpactExponentFactor: (0, numbers_1.expandDecimals)(2, 30),
|
|
88
|
+
withdrawalFeeFactorBalanceWasImproved: (0, numbers_1.expandDecimals)(2, 27),
|
|
89
|
+
withdrawalFeeFactorBalanceWasNotImproved: (0, numbers_1.expandDecimals)(2, 27),
|
|
90
|
+
borrowingFactorPerSecondForLongs: 0n,
|
|
91
|
+
borrowingFactorPerSecondForShorts: 0n,
|
|
92
|
+
borrowingExponentFactorLong: 0n,
|
|
93
|
+
borrowingExponentFactorShort: 0n,
|
|
94
|
+
fundingFactor: 0n,
|
|
95
|
+
fundingExponentFactor: 0n,
|
|
96
|
+
fundingIncreaseFactorPerSecond: 0n,
|
|
97
|
+
fundingDecreaseFactorPerSecond: 0n,
|
|
98
|
+
maxFundingFactorPerSecond: 0n,
|
|
99
|
+
minFundingFactorPerSecond: 0n,
|
|
100
|
+
thresholdForDecreaseFunding: 0n,
|
|
101
|
+
thresholdForStableFunding: 0n,
|
|
102
|
+
totalBorrowingFees: 0n,
|
|
103
|
+
minCollateralFactor: 0n,
|
|
104
|
+
minCollateralFactorForLiquidation: 0n,
|
|
105
|
+
minCollateralFactorForOpenInterestLong: 0n,
|
|
106
|
+
minCollateralFactorForOpenInterestShort: 0n,
|
|
107
|
+
borrowingFactorLong: 0n,
|
|
108
|
+
borrowingFactorShort: 0n,
|
|
109
|
+
fundingFactorPerSecond: 0n,
|
|
110
|
+
longsPayShorts: false,
|
|
111
|
+
longInterestUsd: (0, numbers_1.expandDecimals)(500, factors_1.USD_DECIMALS),
|
|
112
|
+
shortInterestUsd: (0, numbers_1.expandDecimals)(500, factors_1.USD_DECIMALS),
|
|
113
|
+
longInterestInTokens: (0, mock_1.usdToToken)(500, indexToken),
|
|
114
|
+
shortInterestInTokens: (0, mock_1.usdToToken)(500, indexToken),
|
|
115
|
+
maxPnlFactorForTradersLong: (0, numbers_1.expandDecimals)(1, 30),
|
|
116
|
+
maxPnlFactorForTradersShort: (0, numbers_1.expandDecimals)(1, 30),
|
|
117
|
+
data: "",
|
|
118
|
+
virtualPoolAmountForLongToken: 0n,
|
|
119
|
+
virtualPoolAmountForShortToken: 0n,
|
|
120
|
+
virtualInventoryForPositions: 0n,
|
|
121
|
+
virtualMarketId: viem_1.zeroAddress,
|
|
122
|
+
virtualLongTokenId: viem_1.zeroAddress,
|
|
123
|
+
virtualShortTokenId: viem_1.zeroAddress,
|
|
124
|
+
...(overrides[key] || {}),
|
|
125
|
+
};
|
|
126
|
+
return acc;
|
|
127
|
+
}, {});
|
|
128
|
+
}
|
|
129
|
+
exports.mockMarketsInfoData = mockMarketsInfoData;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchApiTokensData = exports.fetchApiMarketsInfo = void 0;
|
|
4
|
+
const numbers_1 = require("../numbers");
|
|
5
|
+
async function fetchApiMarketsInfo(ctx) {
|
|
6
|
+
const mInfos = await ctx.api.fetchJson("/markets/info");
|
|
7
|
+
return mInfos.map((mInfo) => (0, numbers_1.deserializeBigIntsInObject)(mInfo, { handleInts: true }));
|
|
8
|
+
}
|
|
9
|
+
exports.fetchApiMarketsInfo = fetchApiMarketsInfo;
|
|
10
|
+
async function fetchApiTokensData(ctx) {
|
|
11
|
+
const tInfos = await ctx.api.fetchJson("/tokens/info");
|
|
12
|
+
return tInfos.map((tInfo) => (0, numbers_1.deserializeBigIntsInObject)(tInfo, { handleInts: true }));
|
|
13
|
+
}
|
|
14
|
+
exports.fetchApiTokensData = fetchApiTokensData;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hashMarketValuesKeys = exports.hashMarketConfigKeys = void 0;
|
|
4
|
-
const dataStore_1 = require("
|
|
5
|
-
const hash_1 = require("
|
|
3
|
+
exports.hashKinkModelKeys = exports.hashMarketValuesKeys = exports.hashMarketConfigKeys = void 0;
|
|
4
|
+
const dataStore_1 = require("../../configs/dataStore");
|
|
5
|
+
const hash_1 = require("../hash");
|
|
6
6
|
function hashMarketConfigKeys(market) {
|
|
7
7
|
const marketAddress = market.marketTokenAddress;
|
|
8
8
|
return (0, hash_1.hashDataMap)({
|
|
@@ -288,3 +288,32 @@ function hashMarketValuesKeys(market) {
|
|
|
288
288
|
return marketKeys;
|
|
289
289
|
}
|
|
290
290
|
exports.hashMarketValuesKeys = hashMarketValuesKeys;
|
|
291
|
+
function hashKinkModelKeys(marketAddress) {
|
|
292
|
+
return (0, hash_1.hashDataMap)({
|
|
293
|
+
optimalUsageFactorLong: [
|
|
294
|
+
["bytes32", "address", "bool"],
|
|
295
|
+
[dataStore_1.OPTIMAL_USAGE_FACTOR, marketAddress, true],
|
|
296
|
+
],
|
|
297
|
+
optimalUsageFactorShort: [
|
|
298
|
+
["bytes32", "address", "bool"],
|
|
299
|
+
[dataStore_1.OPTIMAL_USAGE_FACTOR, marketAddress, false],
|
|
300
|
+
],
|
|
301
|
+
baseBorrowingFactorLong: [
|
|
302
|
+
["bytes32", "address", "bool"],
|
|
303
|
+
[dataStore_1.BASE_BORROWING_FACTOR, marketAddress, true],
|
|
304
|
+
],
|
|
305
|
+
baseBorrowingFactorShort: [
|
|
306
|
+
["bytes32", "address", "bool"],
|
|
307
|
+
[dataStore_1.BASE_BORROWING_FACTOR, marketAddress, false],
|
|
308
|
+
],
|
|
309
|
+
aboveOptimalUsageBorrowingFactorLong: [
|
|
310
|
+
["bytes32", "address", "bool"],
|
|
311
|
+
[dataStore_1.ABOVE_OPTIMAL_USAGE_BORROWING_FACTOR, marketAddress, true],
|
|
312
|
+
],
|
|
313
|
+
aboveOptimalUsageBorrowingFactorShort: [
|
|
314
|
+
["bytes32", "address", "bool"],
|
|
315
|
+
[dataStore_1.ABOVE_OPTIMAL_USAGE_BORROWING_FACTOR, marketAddress, false],
|
|
316
|
+
],
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
exports.hashKinkModelKeys = hashKinkModelKeys;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./utils"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
19
|
+
__exportStar(require("./api"), exports);
|
|
20
|
+
__exportStar(require("./hashKeys"), exports);
|
|
21
|
+
__exportStar(require("./multicall"), exports);
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildMarketsConfigsRequest = exports.buildMarketsValuesRequest = exports.buildClaimableFundingDataRequest = void 0;
|
|
3
|
+
exports.parseMarketsConfigsResponse = exports.buildMarketsConfigsRequest = exports.parseMarketsValuesResponse = exports.buildMarketsValuesRequest = exports.buildClaimableFundingDataRequest = void 0;
|
|
4
|
+
const prebuilt_1 = require("../../codegen/prebuilt");
|
|
4
5
|
const contracts_1 = require("../../configs/contracts");
|
|
5
6
|
const dataStore_1 = require("../../configs/dataStore");
|
|
6
|
-
const hash_1 = require("
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const objects_1 = require("../../utils/objects");
|
|
10
|
-
const prebuilt_1 = require("../../prebuilt");
|
|
7
|
+
const hash_1 = require("../hash");
|
|
8
|
+
const markets_1 = require("./");
|
|
9
|
+
const objects_1 = require("../objects");
|
|
11
10
|
function buildClaimableFundingDataRequest({ marketsAddresses, marketsData, chainId, account, }) {
|
|
12
11
|
if (!marketsAddresses) {
|
|
13
12
|
return {};
|
|
@@ -45,19 +44,17 @@ function buildClaimableFundingDataRequest({ marketsAddresses, marketsData, chain
|
|
|
45
44
|
}, {});
|
|
46
45
|
}
|
|
47
46
|
exports.buildClaimableFundingDataRequest = buildClaimableFundingDataRequest;
|
|
48
|
-
async function buildMarketsValuesRequest(chainId, { marketsAddresses, marketsData, tokensData,
|
|
47
|
+
async function buildMarketsValuesRequest(chainId, { marketsAddresses, marketsData, tokensData, }) {
|
|
48
|
+
const dataStoreAddress = (0, contracts_1.getContract)(chainId, "DataStore");
|
|
49
|
+
const syntheticsReaderAddress = (0, contracts_1.getContract)(chainId, "SyntheticsReader");
|
|
49
50
|
const request = {};
|
|
50
51
|
for (const marketAddress of marketsAddresses || []) {
|
|
51
52
|
const market = (0, objects_1.getByKey)(marketsData, marketAddress);
|
|
52
53
|
if (!market) {
|
|
53
|
-
// eslint-disable-next-line no-console
|
|
54
|
-
console.warn(`No market data found for ${marketAddress}, skipping market values request`);
|
|
55
54
|
continue;
|
|
56
55
|
}
|
|
57
56
|
const marketPrices = (0, markets_1.getContractMarketPrices)(tokensData, market);
|
|
58
57
|
if (!marketPrices) {
|
|
59
|
-
// eslint-disable-next-line no-console
|
|
60
|
-
console.warn(`No market prices for ${marketAddress}, skipping market values request`);
|
|
61
58
|
continue;
|
|
62
59
|
}
|
|
63
60
|
const marketProps = {
|
|
@@ -100,73 +97,65 @@ async function buildMarketsValuesRequest(chainId, { marketsAddresses, marketsDat
|
|
|
100
97
|
},
|
|
101
98
|
},
|
|
102
99
|
};
|
|
103
|
-
|
|
100
|
+
const prebuiltHashedKeys = prebuilt_1.HASHED_MARKET_VALUES_KEYS[chainId]?.[marketAddress];
|
|
104
101
|
if (!prebuiltHashedKeys) {
|
|
105
|
-
|
|
106
|
-
console.warn(`No pre-built hashed market keys found for the market ${marketAddress}. Run \`yarn prebuild\` to generate them.`);
|
|
107
|
-
if (!marketsData?.[marketAddress]) {
|
|
108
|
-
throw new Error(`No market data found for the market ${marketAddress}`);
|
|
109
|
-
}
|
|
110
|
-
prebuiltHashedKeys = (0, marketKeysAndConfigs_1.hashMarketValuesKeys)(marketsData[marketAddress]);
|
|
102
|
+
throw new Error(`No pre-built hashed market keys found for the market ${marketAddress}.`);
|
|
111
103
|
}
|
|
112
|
-
const keys = {
|
|
113
|
-
...prebuiltHashedKeys,
|
|
114
|
-
};
|
|
115
104
|
request[`${marketAddress}-dataStore`] = {
|
|
116
105
|
contractAddress: dataStoreAddress,
|
|
117
106
|
abiId: "DataStore",
|
|
118
107
|
calls: {
|
|
119
108
|
longPoolAmount: {
|
|
120
109
|
methodName: "getUint",
|
|
121
|
-
params: [
|
|
110
|
+
params: [prebuiltHashedKeys.longPoolAmount],
|
|
122
111
|
},
|
|
123
112
|
shortPoolAmount: {
|
|
124
113
|
methodName: "getUint",
|
|
125
|
-
params: [
|
|
114
|
+
params: [prebuiltHashedKeys.shortPoolAmount],
|
|
126
115
|
},
|
|
127
116
|
positionImpactPoolAmount: {
|
|
128
117
|
methodName: "getUint",
|
|
129
|
-
params: [
|
|
118
|
+
params: [prebuiltHashedKeys.positionImpactPoolAmount],
|
|
130
119
|
},
|
|
131
120
|
swapImpactPoolAmountLong: {
|
|
132
121
|
methodName: "getUint",
|
|
133
|
-
params: [
|
|
122
|
+
params: [prebuiltHashedKeys.swapImpactPoolAmountLong],
|
|
134
123
|
},
|
|
135
124
|
swapImpactPoolAmountShort: {
|
|
136
125
|
methodName: "getUint",
|
|
137
|
-
params: [
|
|
126
|
+
params: [prebuiltHashedKeys.swapImpactPoolAmountShort],
|
|
138
127
|
},
|
|
139
128
|
longInterestUsingLongToken: {
|
|
140
129
|
methodName: "getUint",
|
|
141
|
-
params: [
|
|
130
|
+
params: [prebuiltHashedKeys.longInterestUsingLongToken],
|
|
142
131
|
},
|
|
143
132
|
longInterestUsingShortToken: {
|
|
144
133
|
methodName: "getUint",
|
|
145
|
-
params: [
|
|
134
|
+
params: [prebuiltHashedKeys.longInterestUsingShortToken],
|
|
146
135
|
},
|
|
147
136
|
shortInterestUsingLongToken: {
|
|
148
137
|
methodName: "getUint",
|
|
149
|
-
params: [
|
|
138
|
+
params: [prebuiltHashedKeys.shortInterestUsingLongToken],
|
|
150
139
|
},
|
|
151
140
|
shortInterestUsingShortToken: {
|
|
152
141
|
methodName: "getUint",
|
|
153
|
-
params: [
|
|
142
|
+
params: [prebuiltHashedKeys.shortInterestUsingShortToken],
|
|
154
143
|
},
|
|
155
144
|
longInterestInTokensUsingLongToken: {
|
|
156
145
|
methodName: "getUint",
|
|
157
|
-
params: [
|
|
146
|
+
params: [prebuiltHashedKeys.longInterestInTokensUsingLongToken],
|
|
158
147
|
},
|
|
159
148
|
longInterestInTokensUsingShortToken: {
|
|
160
149
|
methodName: "getUint",
|
|
161
|
-
params: [
|
|
150
|
+
params: [prebuiltHashedKeys.longInterestInTokensUsingShortToken],
|
|
162
151
|
},
|
|
163
152
|
shortInterestInTokensUsingLongToken: {
|
|
164
153
|
methodName: "getUint",
|
|
165
|
-
params: [
|
|
154
|
+
params: [prebuiltHashedKeys.shortInterestInTokensUsingLongToken],
|
|
166
155
|
},
|
|
167
156
|
shortInterestInTokensUsingShortToken: {
|
|
168
157
|
methodName: "getUint",
|
|
169
|
-
params: [
|
|
158
|
+
params: [prebuiltHashedKeys.shortInterestInTokensUsingShortToken],
|
|
170
159
|
},
|
|
171
160
|
},
|
|
172
161
|
};
|
|
@@ -174,17 +163,67 @@ async function buildMarketsValuesRequest(chainId, { marketsAddresses, marketsDat
|
|
|
174
163
|
return request;
|
|
175
164
|
}
|
|
176
165
|
exports.buildMarketsValuesRequest = buildMarketsValuesRequest;
|
|
177
|
-
|
|
166
|
+
function parseMarketsValuesResponse(res, marketsAddresses, marketsData, getMarketDivisor) {
|
|
167
|
+
return marketsAddresses.reduce((acc, marketAddress) => {
|
|
168
|
+
const readerErrors = res.errors[`${marketAddress}-reader`];
|
|
169
|
+
const dataStoreErrors = res.errors[`${marketAddress}-dataStore`];
|
|
170
|
+
const readerValues = res.data[`${marketAddress}-reader`];
|
|
171
|
+
const dataStoreValues = res.data[`${marketAddress}-dataStore`];
|
|
172
|
+
if (!readerValues || !dataStoreValues || readerErrors || dataStoreErrors) {
|
|
173
|
+
return acc;
|
|
174
|
+
}
|
|
175
|
+
const market = (0, objects_1.getByKey)(marketsData, marketAddress);
|
|
176
|
+
if (!market) {
|
|
177
|
+
return acc;
|
|
178
|
+
}
|
|
179
|
+
const marketDivisor = getMarketDivisor(market);
|
|
180
|
+
const { longInterestUsd, shortInterestUsd } = (0, markets_1.getOiUsdFromRawValues)({
|
|
181
|
+
longInterestUsingLongToken: BigInt(dataStoreValues.longInterestUsingLongToken.returnValues[0]),
|
|
182
|
+
longInterestUsingShortToken: BigInt(dataStoreValues.longInterestUsingShortToken.returnValues[0]),
|
|
183
|
+
shortInterestUsingLongToken: BigInt(dataStoreValues.shortInterestUsingLongToken.returnValues[0]),
|
|
184
|
+
shortInterestUsingShortToken: BigInt(dataStoreValues.shortInterestUsingShortToken.returnValues[0]),
|
|
185
|
+
}, marketDivisor);
|
|
186
|
+
const { longInterestInTokens, shortInterestInTokens } = (0, markets_1.getOiInTokensFromRawValues)({
|
|
187
|
+
longInterestInTokensUsingLongToken: BigInt(dataStoreValues.longInterestInTokensUsingLongToken.returnValues[0]),
|
|
188
|
+
longInterestInTokensUsingShortToken: BigInt(dataStoreValues.longInterestInTokensUsingShortToken.returnValues[0]),
|
|
189
|
+
shortInterestInTokensUsingLongToken: BigInt(dataStoreValues.shortInterestInTokensUsingLongToken.returnValues[0]),
|
|
190
|
+
shortInterestInTokensUsingShortToken: BigInt(dataStoreValues.shortInterestInTokensUsingShortToken.returnValues[0]),
|
|
191
|
+
}, marketDivisor);
|
|
192
|
+
const { nextFunding, virtualInventory } = readerValues.marketInfo.returnValues;
|
|
193
|
+
const [, poolValueInfoMin] = readerValues.marketTokenPriceMin.returnValues;
|
|
194
|
+
const [, poolValueInfoMax] = readerValues.marketTokenPriceMax.returnValues;
|
|
195
|
+
acc[marketAddress] = {
|
|
196
|
+
longInterestUsd,
|
|
197
|
+
shortInterestUsd,
|
|
198
|
+
longInterestInTokens,
|
|
199
|
+
shortInterestInTokens,
|
|
200
|
+
longPoolAmount: dataStoreValues.longPoolAmount.returnValues[0] / marketDivisor,
|
|
201
|
+
shortPoolAmount: dataStoreValues.shortPoolAmount.returnValues[0] / marketDivisor,
|
|
202
|
+
poolValueMin: poolValueInfoMin.poolValue,
|
|
203
|
+
poolValueMax: poolValueInfoMax.poolValue,
|
|
204
|
+
totalBorrowingFees: poolValueInfoMax.totalBorrowingFees,
|
|
205
|
+
positionImpactPoolAmount: dataStoreValues.positionImpactPoolAmount.returnValues[0],
|
|
206
|
+
swapImpactPoolAmountLong: dataStoreValues.swapImpactPoolAmountLong.returnValues[0],
|
|
207
|
+
swapImpactPoolAmountShort: dataStoreValues.swapImpactPoolAmountShort.returnValues[0],
|
|
208
|
+
borrowingFactorPerSecondForLongs: readerValues.marketInfo.returnValues.borrowingFactorPerSecondForLongs,
|
|
209
|
+
borrowingFactorPerSecondForShorts: readerValues.marketInfo.returnValues.borrowingFactorPerSecondForShorts,
|
|
210
|
+
fundingFactorPerSecond: nextFunding.fundingFactorPerSecond,
|
|
211
|
+
longsPayShorts: nextFunding.longsPayShorts,
|
|
212
|
+
virtualPoolAmountForLongToken: virtualInventory.virtualPoolAmountForLongToken,
|
|
213
|
+
virtualPoolAmountForShortToken: virtualInventory.virtualPoolAmountForShortToken,
|
|
214
|
+
virtualInventoryForPositions: virtualInventory.virtualInventoryForPositions,
|
|
215
|
+
};
|
|
216
|
+
return acc;
|
|
217
|
+
}, {});
|
|
218
|
+
}
|
|
219
|
+
exports.parseMarketsValuesResponse = parseMarketsValuesResponse;
|
|
220
|
+
async function buildMarketsConfigsRequest(chainId, { marketsAddresses, }) {
|
|
221
|
+
const dataStoreAddress = (0, contracts_1.getContract)(chainId, "DataStore");
|
|
178
222
|
const request = {};
|
|
179
223
|
for (const marketAddress of marketsAddresses || []) {
|
|
180
|
-
|
|
224
|
+
const prebuiltHashedKeys = prebuilt_1.HASHED_MARKET_CONFIG_KEYS[chainId]?.[marketAddress];
|
|
181
225
|
if (!prebuiltHashedKeys) {
|
|
182
|
-
|
|
183
|
-
console.warn(`No pre-built hashed config keys found for the market ${marketAddress}. Run \`yarn prebuild\` to generate them.`);
|
|
184
|
-
if (!marketsData?.[marketAddress]) {
|
|
185
|
-
throw new Error(`No market data found for the market ${marketAddress}`);
|
|
186
|
-
}
|
|
187
|
-
prebuiltHashedKeys = (0, marketKeysAndConfigs_1.hashMarketConfigKeys)(marketsData[marketAddress]);
|
|
226
|
+
throw new Error(`No pre-built hashed config keys found for the market ${marketAddress}.`);
|
|
188
227
|
}
|
|
189
228
|
request[`${marketAddress}-dataStore`] = {
|
|
190
229
|
contractAddress: dataStoreAddress,
|
|
@@ -416,3 +455,71 @@ async function buildMarketsConfigsRequest(chainId, { marketsData, marketsAddress
|
|
|
416
455
|
return request;
|
|
417
456
|
}
|
|
418
457
|
exports.buildMarketsConfigsRequest = buildMarketsConfigsRequest;
|
|
458
|
+
function parseMarketsConfigsResponse(res, marketsAddresses) {
|
|
459
|
+
return marketsAddresses.reduce((acc, marketAddress) => {
|
|
460
|
+
const dataStoreErrors = res.errors[`${marketAddress}-dataStore`];
|
|
461
|
+
const dataStoreValues = res.data[`${marketAddress}-dataStore`];
|
|
462
|
+
if (!dataStoreValues || dataStoreErrors) {
|
|
463
|
+
return acc;
|
|
464
|
+
}
|
|
465
|
+
acc[marketAddress] = {
|
|
466
|
+
isDisabled: dataStoreValues.isDisabled.returnValues[0],
|
|
467
|
+
maxLongPoolUsdForDeposit: dataStoreValues.maxLongPoolUsdForDeposit.returnValues[0],
|
|
468
|
+
maxShortPoolUsdForDeposit: dataStoreValues.maxShortPoolUsdForDeposit.returnValues[0],
|
|
469
|
+
maxLongPoolAmount: dataStoreValues.maxLongPoolAmount.returnValues[0],
|
|
470
|
+
maxShortPoolAmount: dataStoreValues.maxShortPoolAmount.returnValues[0],
|
|
471
|
+
reserveFactorLong: dataStoreValues.reserveFactorLong.returnValues[0],
|
|
472
|
+
reserveFactorShort: dataStoreValues.reserveFactorShort.returnValues[0],
|
|
473
|
+
openInterestReserveFactorLong: dataStoreValues.openInterestReserveFactorLong.returnValues[0],
|
|
474
|
+
openInterestReserveFactorShort: dataStoreValues.openInterestReserveFactorShort.returnValues[0],
|
|
475
|
+
maxOpenInterestLong: dataStoreValues.maxOpenInterestLong.returnValues[0],
|
|
476
|
+
maxOpenInterestShort: dataStoreValues.maxOpenInterestShort.returnValues[0],
|
|
477
|
+
minPositionImpactPoolAmount: dataStoreValues.minPositionImpactPoolAmount.returnValues[0],
|
|
478
|
+
positionImpactPoolDistributionRate: dataStoreValues.positionImpactPoolDistributionRate.returnValues[0],
|
|
479
|
+
borrowingFactorLong: dataStoreValues.borrowingFactorLong.returnValues[0],
|
|
480
|
+
borrowingFactorShort: dataStoreValues.borrowingFactorShort.returnValues[0],
|
|
481
|
+
borrowingExponentFactorLong: dataStoreValues.borrowingExponentFactorLong.returnValues[0],
|
|
482
|
+
borrowingExponentFactorShort: dataStoreValues.borrowingExponentFactorShort.returnValues[0],
|
|
483
|
+
fundingFactor: dataStoreValues.fundingFactor.returnValues[0],
|
|
484
|
+
fundingExponentFactor: dataStoreValues.fundingExponentFactor.returnValues[0],
|
|
485
|
+
fundingIncreaseFactorPerSecond: dataStoreValues.fundingIncreaseFactorPerSecond.returnValues[0],
|
|
486
|
+
fundingDecreaseFactorPerSecond: dataStoreValues.fundingDecreaseFactorPerSecond.returnValues[0],
|
|
487
|
+
thresholdForDecreaseFunding: dataStoreValues.thresholdForDecreaseFunding.returnValues[0],
|
|
488
|
+
thresholdForStableFunding: dataStoreValues.thresholdForStableFunding.returnValues[0],
|
|
489
|
+
minFundingFactorPerSecond: dataStoreValues.minFundingFactorPerSecond.returnValues[0],
|
|
490
|
+
maxFundingFactorPerSecond: dataStoreValues.maxFundingFactorPerSecond.returnValues[0],
|
|
491
|
+
maxPnlFactorForTradersLong: dataStoreValues.maxPnlFactorForTradersLong.returnValues[0],
|
|
492
|
+
maxPnlFactorForTradersShort: dataStoreValues.maxPnlFactorForTradersShort.returnValues[0],
|
|
493
|
+
minCollateralFactor: dataStoreValues.minCollateralFactor.returnValues[0],
|
|
494
|
+
minCollateralFactorForOpenInterestLong: dataStoreValues.minCollateralFactorForOpenInterestLong.returnValues[0],
|
|
495
|
+
minCollateralFactorForOpenInterestShort: dataStoreValues.minCollateralFactorForOpenInterestShort.returnValues[0],
|
|
496
|
+
minCollateralFactorForLiquidation: dataStoreValues.minCollateralFactorForLiquidation.returnValues[0],
|
|
497
|
+
positionFeeFactorForBalanceWasImproved: dataStoreValues.positionFeeFactorForBalanceWasImproved.returnValues[0],
|
|
498
|
+
positionFeeFactorForBalanceWasNotImproved: dataStoreValues.positionFeeFactorForBalanceWasNotImproved.returnValues[0],
|
|
499
|
+
positionImpactFactorPositive: dataStoreValues.positionImpactFactorPositive.returnValues[0],
|
|
500
|
+
positionImpactFactorNegative: dataStoreValues.positionImpactFactorNegative.returnValues[0],
|
|
501
|
+
maxPositionImpactFactorPositive: dataStoreValues.maxPositionImpactFactorPositive.returnValues[0],
|
|
502
|
+
maxPositionImpactFactorNegative: dataStoreValues.maxPositionImpactFactorNegative.returnValues[0],
|
|
503
|
+
maxPositionImpactFactorForLiquidations: dataStoreValues.maxPositionImpactFactorForLiquidations.returnValues[0],
|
|
504
|
+
maxLendableImpactFactor: dataStoreValues.maxLendableImpactFactor.returnValues[0],
|
|
505
|
+
maxLendableImpactFactorForWithdrawals: dataStoreValues.maxLendableImpactFactorForWithdrawals.returnValues[0],
|
|
506
|
+
maxLendableImpactUsd: dataStoreValues.maxLendableImpactUsd.returnValues[0],
|
|
507
|
+
lentPositionImpactPoolAmount: dataStoreValues.lentPositionImpactPoolAmount.returnValues[0],
|
|
508
|
+
positionImpactExponentFactorPositive: dataStoreValues.positionImpactExponentFactorPositive.returnValues[0],
|
|
509
|
+
positionImpactExponentFactorNegative: dataStoreValues.positionImpactExponentFactorNegative.returnValues[0],
|
|
510
|
+
swapFeeFactorForBalanceWasImproved: dataStoreValues.swapFeeFactorForBalanceWasImproved.returnValues[0],
|
|
511
|
+
swapFeeFactorForBalanceWasNotImproved: dataStoreValues.swapFeeFactorForBalanceWasNotImproved.returnValues[0],
|
|
512
|
+
swapImpactFactorPositive: dataStoreValues.swapImpactFactorPositive.returnValues[0],
|
|
513
|
+
swapImpactFactorNegative: dataStoreValues.swapImpactFactorNegative.returnValues[0],
|
|
514
|
+
atomicSwapFeeFactor: dataStoreValues.atomicSwapFeeFactor.returnValues[0],
|
|
515
|
+
withdrawalFeeFactorBalanceWasImproved: dataStoreValues.withdrawalFeeFactorBalanceWasImproved.returnValues[0],
|
|
516
|
+
withdrawalFeeFactorBalanceWasNotImproved: dataStoreValues.withdrawalFeeFactorBalanceWasNotImproved.returnValues[0],
|
|
517
|
+
swapImpactExponentFactor: dataStoreValues.swapImpactExponentFactor.returnValues[0],
|
|
518
|
+
virtualMarketId: dataStoreValues.virtualMarketId.returnValues[0],
|
|
519
|
+
virtualLongTokenId: dataStoreValues.virtualLongTokenId.returnValues[0],
|
|
520
|
+
virtualShortTokenId: dataStoreValues.virtualShortTokenId.returnValues[0],
|
|
521
|
+
};
|
|
522
|
+
return acc;
|
|
523
|
+
}, {});
|
|
524
|
+
}
|
|
525
|
+
exports.parseMarketsConfigsResponse = parseMarketsConfigsResponse;
|