@gearbox-protocol/sdk 15.1.0-next.1 → 15.1.0-next.11
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/abi/iExpirable.js +15 -0
- package/dist/cjs/common-utils/utils/apy/get-single-quota-borrow-rate.js +2 -0
- package/dist/cjs/common-utils/utils/creditAccount/calc-health-factor.js +24 -22
- package/dist/cjs/common-utils/utils/creditAccount/calc-quota-borrow-rate.js +2 -0
- package/dist/cjs/common-utils/utils/creditAccount/get-time-to-liquidation.js +8 -5
- package/dist/cjs/common-utils/utils/creditAccount/liquidation-price.js +21 -11
- package/dist/cjs/dev/AccountOpener.js +0 -1
- package/dist/cjs/dev/compareOpportunities.js +137 -0
- package/dist/cjs/dev/comparePositions.js +183 -0
- package/dist/cjs/dev/fieldDiff.js +241 -0
- package/dist/cjs/model/charts.js +147 -0
- package/dist/cjs/model/charts.schema.js +240 -0
- package/dist/cjs/model/index.js +35 -22
- package/dist/cjs/model/liquidations.schema.js +1 -1
- package/dist/cjs/model/notices.schema.js +25 -0
- package/dist/cjs/model/opportunities.schema.js +1 -1
- package/dist/cjs/model/positions.schema.js +48 -2
- package/dist/cjs/new-sdk/AbstractNamespace.js +34 -4
- package/dist/cjs/new-sdk/GearboxSDK.js +72 -3
- package/dist/cjs/new-sdk/execute/ExecuteApi.js +95 -0
- package/dist/cjs/new-sdk/execute/index.js +3 -0
- package/dist/cjs/new-sdk/index.js +7 -0
- package/dist/cjs/new-sdk/opportunities/OpportunitiesNamespace.js +29 -6
- package/dist/cjs/new-sdk/positions/PositionsNamespace.js +3 -6
- package/dist/cjs/new-sdk/simulate/SimulateApi.js +361 -0
- package/dist/cjs/new-sdk/simulate/index.js +4 -0
- package/dist/cjs/new-sdk/utils/index.js +0 -1
- package/dist/cjs/offchain/AbstractOffchainNamespace.js +10 -7
- package/dist/cjs/offchain/GearboxAPI.js +7 -0
- package/dist/cjs/offchain/index.js +3 -0
- package/dist/cjs/offchain/notices/OffchainNotices.js +27 -0
- package/dist/cjs/offchain/notices/index.js +3 -0
- package/dist/cjs/offchain/opportunities/OffchainOpportunities.js +4 -8
- package/dist/cjs/offchain/positions/OffchainPositions.js +12 -12
- package/dist/cjs/preview/preview/CreditAccountState.js +14 -1
- package/dist/cjs/preview/preview/buildDelayedPreview.js +16 -6
- package/dist/cjs/preview/preview/previewAdjustCreditAccount.js +9 -2
- package/dist/cjs/preview/preview/previewOpenCreditAccount.js +11 -3
- package/dist/cjs/preview/preview/previewOperation.js +1 -1
- package/dist/cjs/sdk/MultichainSDK.js +3 -4
- package/dist/cjs/sdk/OnchainSDK.js +42 -13
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +2 -8
- package/dist/cjs/sdk/accounts/credit-account-compressor/CreditAccountCompressor.js +2 -90
- package/dist/cjs/sdk/accounts/index.js +5 -2
- package/dist/cjs/sdk/accounts/intents/guards.js +114 -0
- package/dist/cjs/sdk/accounts/intents/index.js +216 -358
- package/dist/cjs/sdk/accounts/intents/math.js +56 -0
- package/dist/cjs/sdk/accounts/intents/open-strategy.js +133 -0
- package/dist/cjs/sdk/accounts/intents/operations.js +165 -0
- package/dist/cjs/sdk/accounts/intents/plan.js +373 -0
- package/dist/cjs/sdk/accounts/intents/realize.js +301 -0
- package/dist/cjs/sdk/accounts/intents/testing/delayed.js +50 -0
- package/dist/cjs/sdk/accounts/intents/testing/market.js +166 -0
- package/dist/cjs/sdk/accounts/intents/testing/sdk-mock.js +194 -35
- package/dist/cjs/sdk/accounts/intents/tests/add-collateral.fixtures.js +123 -0
- package/dist/cjs/sdk/accounts/intents/tests/adjust-leverage.fixtures.js +254 -0
- package/dist/cjs/sdk/accounts/intents/tests/deposit.fixtures.js +324 -0
- package/dist/cjs/sdk/accounts/intents/tests/finish-decrease-leverage.fixtures.js +242 -0
- package/dist/cjs/sdk/accounts/intents/tests/finish-withdraw.fixtures.js +383 -0
- package/dist/cjs/sdk/accounts/intents/tests/open-strategy.fixtures.js +133 -0
- package/dist/cjs/sdk/accounts/intents/tests/withdraw-asset.fixtures.js +131 -0
- package/dist/cjs/sdk/accounts/intents/tests/withdraw.fixtures.js +426 -0
- package/dist/cjs/sdk/accounts/intents/types.js +16 -0
- package/dist/cjs/sdk/accounts/intents/utils/adjust-state-to-snapshot.js +18 -0
- package/dist/cjs/sdk/accounts/intents/utils/credit-account-slice.js +45 -0
- package/dist/cjs/sdk/accounts/intents/utils/index.js +17 -8
- package/dist/cjs/sdk/accounts/intents/utils/ledger.js +94 -0
- package/dist/cjs/sdk/accounts/intents/utils/pick-token.js +72 -0
- package/dist/cjs/sdk/accounts/intents/utils/quotas-for-update.js +27 -0
- package/dist/cjs/sdk/accounts/intents/utils/router-path.js +86 -0
- package/dist/cjs/sdk/accounts/intents/view.js +38 -0
- package/dist/cjs/sdk/accounts/liquidations/LiquidationsService.js +0 -3
- package/dist/cjs/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.js +29 -18
- package/dist/cjs/sdk/base/BaseContract.js +1 -1
- package/dist/cjs/sdk/base/TokensMeta.js +78 -27
- package/dist/cjs/sdk/index.js +30 -7
- package/dist/cjs/sdk/market/MarketRegister.js +16 -7
- package/dist/cjs/sdk/market/ZapperRegister.js +56 -25
- package/dist/cjs/sdk/market/credit/CreditManagerV310Contract.js +1 -12
- package/dist/cjs/sdk/market/credit/CreditSuite.js +28 -9
- package/dist/cjs/sdk/market/credit/index.js +3 -0
- package/dist/cjs/sdk/market/credit/isStrategyCollateral.js +50 -0
- package/dist/cjs/sdk/market/index.js +17 -0
- package/dist/cjs/sdk/market/math.js +65 -45
- package/dist/cjs/sdk/market/oracle/PriceOracleBaseContract.js +10 -3
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +15 -1
- package/dist/cjs/sdk/market/rwa/RWARegistry.js +22 -0
- package/dist/cjs/sdk/opportunities/index.js +0 -13
- package/dist/cjs/sdk/options.js +1 -5
- package/dist/cjs/sdk/pools/PoolService.js +133 -4
- package/dist/cjs/sdk/pools/index.js +2 -0
- package/dist/cjs/sdk/positions/PositionsService.js +218 -1
- package/dist/cjs/sdk/positions/calcBorrowRate.js +43 -0
- package/dist/cjs/sdk/positions/calcHealthFactor.js +52 -0
- package/dist/cjs/sdk/positions/calcLiquidationPrice.js +23 -0
- package/dist/cjs/sdk/positions/calcLiquidationPriceForTarget.js +30 -0
- package/dist/cjs/sdk/positions/calcTimeToLiquidationMs.js +19 -0
- package/dist/cjs/sdk/positions/index.js +12 -1
- package/dist/cjs/sdk/positions/types.js +31 -0
- package/dist/cjs/sdk/utils/abi-decode.js +2 -2
- package/dist/cjs/sdk/utils/viem/executeMulticallBatches.js +32 -0
- package/dist/cjs/sdk/utils/viem/index.js +2 -0
- package/dist/esm/abi/iExpirable.js +14 -0
- package/dist/esm/common-utils/utils/apy/get-single-quota-borrow-rate.js +2 -0
- package/dist/esm/common-utils/utils/creditAccount/calc-health-factor.js +24 -22
- package/dist/esm/common-utils/utils/creditAccount/calc-quota-borrow-rate.js +2 -0
- package/dist/esm/common-utils/utils/creditAccount/get-time-to-liquidation.js +8 -5
- package/dist/esm/common-utils/utils/creditAccount/liquidation-price.js +21 -11
- package/dist/esm/dev/AccountOpener.js +0 -1
- package/dist/esm/dev/compareOpportunities.js +135 -0
- package/dist/esm/dev/comparePositions.js +181 -0
- package/dist/esm/dev/fieldDiff.js +224 -0
- package/dist/esm/model/charts.js +140 -0
- package/dist/esm/model/charts.schema.js +226 -0
- package/dist/esm/model/index.js +9 -7
- package/dist/esm/model/liquidations.schema.js +1 -1
- package/dist/esm/model/notices.schema.js +23 -0
- package/dist/esm/model/opportunities.schema.js +1 -1
- package/dist/esm/model/positions.schema.js +46 -4
- package/dist/esm/new-sdk/AbstractNamespace.js +34 -4
- package/dist/esm/new-sdk/GearboxSDK.js +72 -4
- package/dist/esm/new-sdk/execute/ExecuteApi.js +94 -0
- package/dist/esm/new-sdk/execute/index.js +2 -0
- package/dist/esm/new-sdk/index.js +6 -2
- package/dist/esm/new-sdk/opportunities/OpportunitiesNamespace.js +29 -6
- package/dist/esm/new-sdk/positions/PositionsNamespace.js +3 -6
- package/dist/esm/new-sdk/simulate/SimulateApi.js +360 -0
- package/dist/esm/new-sdk/simulate/index.js +3 -0
- package/dist/esm/new-sdk/utils/index.js +0 -1
- package/dist/esm/offchain/AbstractOffchainNamespace.js +10 -7
- package/dist/esm/offchain/GearboxAPI.js +7 -0
- package/dist/esm/offchain/index.js +3 -1
- package/dist/esm/offchain/notices/OffchainNotices.js +26 -0
- package/dist/esm/offchain/notices/index.js +2 -0
- package/dist/esm/offchain/opportunities/OffchainOpportunities.js +4 -8
- package/dist/esm/offchain/positions/OffchainPositions.js +12 -12
- package/dist/esm/preview/preview/CreditAccountState.js +14 -1
- package/dist/esm/preview/preview/buildDelayedPreview.js +16 -6
- package/dist/esm/preview/preview/previewAdjustCreditAccount.js +9 -2
- package/dist/esm/preview/preview/previewOpenCreditAccount.js +11 -3
- package/dist/esm/preview/preview/previewOperation.js +1 -1
- package/dist/esm/sdk/MultichainSDK.js +3 -4
- package/dist/esm/sdk/OnchainSDK.js +42 -13
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +2 -8
- package/dist/esm/sdk/accounts/credit-account-compressor/CreditAccountCompressor.js +2 -90
- package/dist/esm/sdk/accounts/index.js +3 -2
- package/dist/esm/sdk/accounts/intents/guards.js +108 -0
- package/dist/esm/sdk/accounts/intents/index.js +214 -358
- package/dist/esm/sdk/accounts/intents/math.js +51 -0
- package/dist/esm/sdk/accounts/intents/open-strategy.js +132 -0
- package/dist/esm/sdk/accounts/intents/operations.js +153 -0
- package/dist/esm/sdk/accounts/intents/plan.js +361 -0
- package/dist/esm/sdk/accounts/intents/realize.js +300 -0
- package/dist/esm/sdk/accounts/intents/testing/delayed.js +38 -0
- package/dist/esm/sdk/accounts/intents/testing/market.js +148 -0
- package/dist/esm/sdk/accounts/intents/testing/sdk-mock.js +194 -35
- package/dist/esm/sdk/accounts/intents/tests/add-collateral.fixtures.js +110 -0
- package/dist/esm/sdk/accounts/intents/tests/adjust-leverage.fixtures.js +234 -0
- package/dist/esm/sdk/accounts/intents/tests/deposit.fixtures.js +302 -0
- package/dist/esm/sdk/accounts/intents/tests/finish-decrease-leverage.fixtures.js +220 -0
- package/dist/esm/sdk/accounts/intents/tests/finish-withdraw.fixtures.js +355 -0
- package/dist/esm/sdk/accounts/intents/tests/open-strategy.fixtures.js +119 -0
- package/dist/esm/sdk/accounts/intents/tests/withdraw-asset.fixtures.js +117 -0
- package/dist/esm/sdk/accounts/intents/tests/withdraw.fixtures.js +402 -0
- package/dist/esm/sdk/accounts/intents/types.js +16 -1
- package/dist/esm/sdk/accounts/intents/utils/adjust-state-to-snapshot.js +17 -0
- package/dist/esm/sdk/accounts/intents/utils/credit-account-slice.js +43 -0
- package/dist/esm/sdk/accounts/intents/utils/index.js +9 -7
- package/dist/esm/sdk/accounts/intents/utils/ledger.js +93 -0
- package/dist/esm/sdk/accounts/intents/utils/pick-token.js +68 -0
- package/dist/esm/sdk/accounts/intents/utils/quotas-for-update.js +27 -1
- package/dist/esm/sdk/accounts/intents/utils/router-path.js +85 -0
- package/dist/esm/sdk/accounts/intents/view.js +37 -0
- package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +0 -3
- package/dist/esm/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.js +29 -18
- package/dist/esm/sdk/base/BaseContract.js +1 -1
- package/dist/esm/sdk/base/TokensMeta.js +78 -27
- package/dist/esm/sdk/index.js +13 -4
- package/dist/esm/sdk/market/MarketRegister.js +16 -7
- package/dist/esm/sdk/market/ZapperRegister.js +56 -25
- package/dist/esm/sdk/market/credit/CreditManagerV310Contract.js +2 -13
- package/dist/esm/sdk/market/credit/CreditSuite.js +29 -10
- package/dist/esm/sdk/market/credit/index.js +2 -1
- package/dist/esm/sdk/market/credit/isStrategyCollateral.js +48 -0
- package/dist/esm/sdk/market/index.js +3 -1
- package/dist/esm/sdk/market/math.js +60 -41
- package/dist/esm/sdk/market/oracle/PriceOracleBaseContract.js +10 -3
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +16 -2
- package/dist/esm/sdk/market/rwa/RWARegistry.js +22 -0
- package/dist/esm/sdk/opportunities/index.js +1 -2
- package/dist/esm/sdk/options.js +1 -5
- package/dist/esm/sdk/pools/PoolService.js +133 -6
- package/dist/esm/sdk/pools/index.js +2 -2
- package/dist/esm/sdk/positions/PositionsService.js +218 -1
- package/dist/esm/sdk/positions/calcBorrowRate.js +42 -0
- package/dist/esm/sdk/positions/calcHealthFactor.js +51 -0
- package/dist/esm/sdk/positions/calcLiquidationPrice.js +22 -0
- package/dist/esm/sdk/positions/calcLiquidationPriceForTarget.js +29 -0
- package/dist/esm/sdk/positions/calcTimeToLiquidationMs.js +18 -0
- package/dist/esm/sdk/positions/index.js +7 -2
- package/dist/esm/sdk/positions/types.js +31 -1
- package/dist/esm/sdk/utils/abi-decode.js +2 -2
- package/dist/esm/sdk/utils/viem/executeMulticallBatches.js +31 -0
- package/dist/esm/sdk/utils/viem/index.js +2 -1
- package/dist/types/abi/iExpirable.d.ts +14 -0
- package/dist/types/common-utils/utils/apy/get-single-quota-borrow-rate.d.ts +2 -0
- package/dist/types/common-utils/utils/creditAccount/calc-health-factor.d.ts +3 -0
- package/dist/types/common-utils/utils/creditAccount/calc-quota-borrow-rate.d.ts +2 -0
- package/dist/types/common-utils/utils/creditAccount/get-time-to-liquidation.d.ts +6 -1
- package/dist/types/common-utils/utils/creditAccount/liquidation-price.d.ts +3 -0
- package/dist/types/dev/compareOpportunities.d.ts +105 -0
- package/dist/types/dev/comparePositions.d.ts +149 -0
- package/dist/types/dev/fieldDiff.d.ts +167 -0
- package/dist/types/model/charts.d.ts +349 -0
- package/dist/types/model/charts.schema.d.ts +364 -0
- package/dist/types/model/index.d.ts +8 -6
- package/dist/types/model/notices.d.ts +29 -0
- package/dist/types/model/notices.schema.d.ts +23 -0
- package/dist/types/model/opportunities.d.ts +9 -9
- package/dist/types/model/positions.d.ts +133 -7
- package/dist/types/model/positions.schema.d.ts +128 -1
- package/dist/types/new-sdk/AbstractNamespace.d.ts +15 -2
- package/dist/types/new-sdk/GearboxSDK.d.ts +14 -2
- package/dist/types/new-sdk/execute/ExecuteApi.d.ts +108 -0
- package/dist/types/new-sdk/execute/index.d.ts +2 -0
- package/dist/types/new-sdk/index.d.ts +8 -4
- package/dist/types/new-sdk/opportunities/OpportunitiesNamespace.d.ts +19 -7
- package/dist/types/new-sdk/opportunities/types.d.ts +30 -9
- package/dist/types/new-sdk/positions/PositionsNamespace.d.ts +4 -5
- package/dist/types/new-sdk/positions/types.d.ts +9 -9
- package/dist/types/new-sdk/simulate/SimulateApi.d.ts +90 -0
- package/dist/types/new-sdk/simulate/index.d.ts +3 -0
- package/dist/types/new-sdk/simulate/types.d.ts +508 -0
- package/dist/types/new-sdk/types.d.ts +35 -1
- package/dist/types/new-sdk/utils/index.d.ts +1 -2
- package/dist/types/offchain/AbstractOffchainNamespace.d.ts +5 -21
- package/dist/types/offchain/GearboxAPI.d.ts +6 -0
- package/dist/types/offchain/index.d.ts +4 -2
- package/dist/types/offchain/notices/OffchainNotices.d.ts +19 -0
- package/dist/types/offchain/notices/index.d.ts +2 -0
- package/dist/types/offchain/opportunities/OffchainOpportunities.d.ts +8 -4
- package/dist/types/offchain/positions/OffchainPositions.d.ts +8 -6
- package/dist/types/preview/preview/CreditAccountState.d.ts +6 -0
- package/dist/types/preview/preview/buildDelayedPreview.d.ts +5 -1
- package/dist/types/preview/preview/types.d.ts +4 -2
- package/dist/types/sdk/MultichainSDK.d.ts +0 -5
- package/dist/types/sdk/OnchainSDK.d.ts +1 -5
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -7
- package/dist/types/sdk/accounts/credit-account-compressor/CreditAccountCompressor.d.ts +3 -12
- package/dist/types/sdk/accounts/credit-account-compressor/index.d.ts +2 -2
- package/dist/types/sdk/accounts/credit-account-compressor/types.d.ts +1 -19
- package/dist/types/sdk/accounts/index.d.ts +7 -5
- package/dist/types/sdk/accounts/intents/guards.d.ts +72 -0
- package/dist/types/sdk/accounts/intents/index.d.ts +130 -15
- package/dist/types/sdk/accounts/intents/math.d.ts +46 -0
- package/dist/types/sdk/accounts/intents/open-strategy.d.ts +64 -0
- package/dist/types/sdk/accounts/intents/operations.d.ts +215 -0
- package/dist/types/sdk/accounts/intents/plan.d.ts +189 -0
- package/dist/types/sdk/accounts/intents/realize.d.ts +35 -0
- package/dist/types/sdk/accounts/intents/testing/delayed.d.ts +50 -0
- package/dist/types/sdk/accounts/intents/testing/expect.d.ts +17 -21
- package/dist/types/sdk/accounts/intents/testing/market.d.ts +91 -0
- package/dist/types/sdk/accounts/intents/testing/sdk-mock.d.ts +64 -16
- package/dist/types/sdk/accounts/intents/tests/add-collateral.fixtures.d.ts +45 -0
- package/dist/types/sdk/accounts/intents/tests/adjust-leverage.fixtures.d.ts +56 -0
- package/dist/types/sdk/accounts/intents/tests/deposit.fixtures.d.ts +64 -0
- package/dist/types/sdk/accounts/intents/tests/finish-decrease-leverage.fixtures.d.ts +107 -0
- package/dist/types/sdk/accounts/intents/tests/finish-withdraw.fixtures.d.ts +136 -0
- package/dist/types/sdk/accounts/intents/tests/open-strategy.fixtures.d.ts +56 -0
- package/dist/types/sdk/accounts/intents/tests/withdraw-asset.fixtures.d.ts +60 -0
- package/dist/types/sdk/accounts/intents/tests/withdraw.fixtures.d.ts +79 -0
- package/dist/types/sdk/accounts/intents/types.d.ts +369 -43
- package/dist/types/sdk/accounts/intents/utils/adjust-state-to-snapshot.d.ts +13 -0
- package/dist/types/sdk/accounts/intents/utils/assemble-operation-calls.d.ts +1 -1
- package/dist/types/sdk/accounts/intents/utils/credit-account-slice.d.ts +29 -0
- package/dist/types/sdk/accounts/intents/utils/index.d.ts +7 -5
- package/dist/types/sdk/accounts/intents/utils/ledger.d.ts +41 -0
- package/dist/types/sdk/accounts/intents/utils/pick-token.d.ts +55 -0
- package/dist/types/sdk/accounts/intents/utils/quotas-for-update.d.ts +15 -4
- package/dist/types/sdk/accounts/intents/utils/router-path.d.ts +70 -0
- package/dist/types/sdk/accounts/intents/view.d.ts +15 -0
- package/dist/types/sdk/accounts/types.d.ts +17 -14
- package/dist/types/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.d.ts +6 -0
- package/dist/types/sdk/accounts/withdrawal-compressor/types.d.ts +18 -0
- package/dist/types/sdk/base/TokensMeta.d.ts +44 -1
- package/dist/types/sdk/base/index.d.ts +2 -2
- package/dist/types/sdk/base/token-types.d.ts +12 -1
- package/dist/types/sdk/index.d.ts +28 -19
- package/dist/types/sdk/market/MarketRegister.d.ts +7 -3
- package/dist/types/sdk/market/ZapperRegister.d.ts +20 -2
- package/dist/types/sdk/market/credit/CreditManagerV310Contract.d.ts +0 -4
- package/dist/types/sdk/market/credit/CreditSuite.d.ts +6 -3
- package/dist/types/sdk/market/credit/index.d.ts +2 -1
- package/dist/types/sdk/market/credit/isStrategyCollateral.d.ts +74 -0
- package/dist/types/sdk/market/credit/types.d.ts +2 -9
- package/dist/types/sdk/market/index.d.ts +4 -2
- package/dist/types/sdk/market/math.d.ts +46 -34
- package/dist/types/sdk/market/oracle/PriceOracleBaseContract.d.ts +6 -2
- package/dist/types/sdk/market/oracle/types.d.ts +10 -2
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +5 -0
- package/dist/types/sdk/market/pool/types.d.ts +5 -0
- package/dist/types/sdk/market/rwa/RWARegistry.d.ts +13 -0
- package/dist/types/sdk/market/types.d.ts +5 -1
- package/dist/types/sdk/opportunities/index.d.ts +1 -2
- package/dist/types/sdk/options.d.ts +0 -1
- package/dist/types/sdk/pools/PoolService.d.ts +32 -2
- package/dist/types/sdk/pools/index.d.ts +3 -3
- package/dist/types/sdk/pools/types.d.ts +109 -4
- package/dist/types/sdk/positions/PositionsService.d.ts +33 -2
- package/dist/types/sdk/positions/calcBorrowRate.d.ts +40 -0
- package/dist/types/sdk/positions/calcHealthFactor.d.ts +55 -0
- package/dist/types/sdk/positions/calcLiquidationPrice.d.ts +12 -0
- package/dist/types/sdk/positions/calcLiquidationPriceForTarget.d.ts +43 -0
- package/dist/types/sdk/positions/calcTimeToLiquidationMs.d.ts +16 -0
- package/dist/types/sdk/positions/index.d.ts +7 -2
- package/dist/types/sdk/positions/types.d.ts +58 -1
- package/dist/types/sdk/types/state.d.ts +6 -0
- package/dist/types/sdk/utils/viem/executeMulticallBatches.d.ts +39 -0
- package/dist/types/sdk/utils/viem/index.d.ts +3 -2
- package/package.json +2 -1
- package/dist/cjs/model/history.js +0 -53
- package/dist/cjs/model/history.schema.js +0 -128
- package/dist/cjs/sdk/accounts/intents/intents/index.js +0 -14
- package/dist/cjs/sdk/accounts/intents/intents/resume/add-collateral/add-collateral.fixtures.js +0 -121
- package/dist/cjs/sdk/accounts/intents/intents/resume/add-collateral/add-collateral.js +0 -15
- package/dist/cjs/sdk/accounts/intents/intents/resume/close/close.fixtures.js +0 -108
- package/dist/cjs/sdk/accounts/intents/intents/resume/close/close.js +0 -51
- package/dist/cjs/sdk/accounts/intents/intents/resume/decrease-leverage/decrease-leverage.fixtures.js +0 -130
- package/dist/cjs/sdk/accounts/intents/intents/resume/decrease-leverage/decrease-leverage.js +0 -83
- package/dist/cjs/sdk/accounts/intents/intents/resume/deposit/deposit.fixtures.js +0 -117
- package/dist/cjs/sdk/accounts/intents/intents/resume/deposit/deposit.js +0 -15
- package/dist/cjs/sdk/accounts/intents/intents/resume/increase-leverage/increase-leverage.fixtures.js +0 -95
- package/dist/cjs/sdk/accounts/intents/intents/resume/increase-leverage/increase-leverage.js +0 -15
- package/dist/cjs/sdk/accounts/intents/intents/resume/index.js +0 -13
- package/dist/cjs/sdk/accounts/intents/intents/resume/withdraw/withdraw.fixtures.js +0 -138
- package/dist/cjs/sdk/accounts/intents/intents/resume/withdraw/withdraw.js +0 -161
- package/dist/cjs/sdk/accounts/intents/operations/add-collateral/index.js +0 -17
- package/dist/cjs/sdk/accounts/intents/operations/claim-delayed/index.js +0 -54
- package/dist/cjs/sdk/accounts/intents/operations/close-credit-account/index.js +0 -26
- package/dist/cjs/sdk/accounts/intents/operations/decrease-debt/index.js +0 -12
- package/dist/cjs/sdk/accounts/intents/operations/increase-debt/index.js +0 -12
- package/dist/cjs/sdk/accounts/intents/operations/index.js +0 -27
- package/dist/cjs/sdk/accounts/intents/operations/quota-update/index.js +0 -22
- package/dist/cjs/sdk/accounts/intents/operations/repay-credit-account/index.js +0 -22
- package/dist/cjs/sdk/accounts/intents/operations/start-delayed-withdrawal/index.js +0 -18
- package/dist/cjs/sdk/accounts/intents/operations/swap/index.js +0 -18
- package/dist/cjs/sdk/accounts/intents/operations/unwrap-rwa-collateral/index.js +0 -27
- package/dist/cjs/sdk/accounts/intents/operations/withdraw-collateral/index.js +0 -43
- package/dist/cjs/sdk/accounts/intents/operations/wrap-rwa-collateral/index.js +0 -27
- package/dist/cjs/sdk/accounts/intents/quoters/close.js +0 -58
- package/dist/cjs/sdk/accounts/intents/quoters/index.js +0 -7
- package/dist/cjs/sdk/accounts/intents/quoters/swap.js +0 -79
- package/dist/cjs/sdk/accounts/intents/testing/expect.js +0 -167
- package/dist/cjs/sdk/accounts/intents/testing/resume.js +0 -172
- package/dist/cjs/sdk/accounts/intents/utils/simulate-adjust-state.js +0 -39
- package/dist/cjs/sdk/accounts/intents/utils/simulate-assets.js +0 -69
- package/dist/cjs/sdk/accounts/intents/utils/with-quota-update.js +0 -13
- package/dist/esm/model/history.js +0 -49
- package/dist/esm/model/history.schema.js +0 -116
- package/dist/esm/sdk/accounts/intents/intents/index.js +0 -8
- package/dist/esm/sdk/accounts/intents/intents/resume/add-collateral/add-collateral.fixtures.js +0 -107
- package/dist/esm/sdk/accounts/intents/intents/resume/add-collateral/add-collateral.js +0 -14
- package/dist/esm/sdk/accounts/intents/intents/resume/close/close.fixtures.js +0 -94
- package/dist/esm/sdk/accounts/intents/intents/resume/close/close.js +0 -50
- package/dist/esm/sdk/accounts/intents/intents/resume/decrease-leverage/decrease-leverage.fixtures.js +0 -114
- package/dist/esm/sdk/accounts/intents/intents/resume/decrease-leverage/decrease-leverage.js +0 -82
- package/dist/esm/sdk/accounts/intents/intents/resume/deposit/deposit.fixtures.js +0 -110
- package/dist/esm/sdk/accounts/intents/intents/resume/deposit/deposit.js +0 -14
- package/dist/esm/sdk/accounts/intents/intents/resume/increase-leverage/increase-leverage.fixtures.js +0 -88
- package/dist/esm/sdk/accounts/intents/intents/resume/increase-leverage/increase-leverage.js +0 -14
- package/dist/esm/sdk/accounts/intents/intents/resume/index.js +0 -7
- package/dist/esm/sdk/accounts/intents/intents/resume/withdraw/withdraw.fixtures.js +0 -121
- package/dist/esm/sdk/accounts/intents/intents/resume/withdraw/withdraw.js +0 -160
- package/dist/esm/sdk/accounts/intents/operations/add-collateral/index.js +0 -16
- package/dist/esm/sdk/accounts/intents/operations/claim-delayed/index.js +0 -52
- package/dist/esm/sdk/accounts/intents/operations/close-credit-account/index.js +0 -25
- package/dist/esm/sdk/accounts/intents/operations/decrease-debt/index.js +0 -11
- package/dist/esm/sdk/accounts/intents/operations/increase-debt/index.js +0 -11
- package/dist/esm/sdk/accounts/intents/operations/index.js +0 -14
- package/dist/esm/sdk/accounts/intents/operations/quota-update/index.js +0 -21
- package/dist/esm/sdk/accounts/intents/operations/repay-credit-account/index.js +0 -21
- package/dist/esm/sdk/accounts/intents/operations/start-delayed-withdrawal/index.js +0 -17
- package/dist/esm/sdk/accounts/intents/operations/swap/index.js +0 -17
- package/dist/esm/sdk/accounts/intents/operations/unwrap-rwa-collateral/index.js +0 -26
- package/dist/esm/sdk/accounts/intents/operations/withdraw-collateral/index.js +0 -42
- package/dist/esm/sdk/accounts/intents/operations/wrap-rwa-collateral/index.js +0 -26
- package/dist/esm/sdk/accounts/intents/quoters/close.js +0 -56
- package/dist/esm/sdk/accounts/intents/quoters/index.js +0 -3
- package/dist/esm/sdk/accounts/intents/quoters/swap.js +0 -77
- package/dist/esm/sdk/accounts/intents/testing/expect.js +0 -162
- package/dist/esm/sdk/accounts/intents/testing/resume.js +0 -157
- package/dist/esm/sdk/accounts/intents/utils/simulate-adjust-state.js +0 -38
- package/dist/esm/sdk/accounts/intents/utils/simulate-assets.js +0 -68
- package/dist/esm/sdk/accounts/intents/utils/with-quota-update.js +0 -12
- package/dist/types/model/history.d.ts +0 -153
- package/dist/types/model/history.schema.d.ts +0 -95
- package/dist/types/new-sdk/utils/history.d.ts +0 -18
- package/dist/types/sdk/accounts/intents/intents/index.d.ts +0 -8
- package/dist/types/sdk/accounts/intents/intents/resume/add-collateral/add-collateral.d.ts +0 -13
- package/dist/types/sdk/accounts/intents/intents/resume/add-collateral/add-collateral.fixtures.d.ts +0 -38
- package/dist/types/sdk/accounts/intents/intents/resume/close/close.d.ts +0 -26
- package/dist/types/sdk/accounts/intents/intents/resume/close/close.fixtures.d.ts +0 -63
- package/dist/types/sdk/accounts/intents/intents/resume/decrease-leverage/decrease-leverage.d.ts +0 -26
- package/dist/types/sdk/accounts/intents/intents/resume/decrease-leverage/decrease-leverage.fixtures.d.ts +0 -86
- package/dist/types/sdk/accounts/intents/intents/resume/deposit/deposit.d.ts +0 -13
- package/dist/types/sdk/accounts/intents/intents/resume/deposit/deposit.fixtures.d.ts +0 -48
- package/dist/types/sdk/accounts/intents/intents/resume/increase-leverage/increase-leverage.d.ts +0 -13
- package/dist/types/sdk/accounts/intents/intents/resume/increase-leverage/increase-leverage.fixtures.d.ts +0 -46
- package/dist/types/sdk/accounts/intents/intents/resume/index.d.ts +0 -7
- package/dist/types/sdk/accounts/intents/intents/resume/withdraw/withdraw.d.ts +0 -33
- package/dist/types/sdk/accounts/intents/intents/resume/withdraw/withdraw.fixtures.d.ts +0 -68
- package/dist/types/sdk/accounts/intents/operations/add-collateral/index.d.ts +0 -23
- package/dist/types/sdk/accounts/intents/operations/claim-delayed/index.d.ts +0 -55
- package/dist/types/sdk/accounts/intents/operations/close-credit-account/index.d.ts +0 -22
- package/dist/types/sdk/accounts/intents/operations/decrease-debt/index.d.ts +0 -18
- package/dist/types/sdk/accounts/intents/operations/increase-debt/index.d.ts +0 -18
- package/dist/types/sdk/accounts/intents/operations/index.d.ts +0 -14
- package/dist/types/sdk/accounts/intents/operations/quota-update/index.d.ts +0 -24
- package/dist/types/sdk/accounts/intents/operations/repay-credit-account/index.d.ts +0 -31
- package/dist/types/sdk/accounts/intents/operations/start-delayed-withdrawal/index.d.ts +0 -23
- package/dist/types/sdk/accounts/intents/operations/swap/index.d.ts +0 -28
- package/dist/types/sdk/accounts/intents/operations/types.d.ts +0 -21
- package/dist/types/sdk/accounts/intents/operations/unwrap-rwa-collateral/index.d.ts +0 -30
- package/dist/types/sdk/accounts/intents/operations/withdraw-collateral/index.d.ts +0 -36
- package/dist/types/sdk/accounts/intents/operations/wrap-rwa-collateral/index.d.ts +0 -30
- package/dist/types/sdk/accounts/intents/quoters/close.d.ts +0 -43
- package/dist/types/sdk/accounts/intents/quoters/index.d.ts +0 -3
- package/dist/types/sdk/accounts/intents/quoters/swap.d.ts +0 -43
- package/dist/types/sdk/accounts/intents/testing/resume.d.ts +0 -84
- package/dist/types/sdk/accounts/intents/utils/simulate-adjust-state.d.ts +0 -19
- package/dist/types/sdk/accounts/intents/utils/simulate-assets.d.ts +0 -21
- package/dist/types/sdk/accounts/intents/utils/with-quota-update.d.ts +0 -16
- /package/dist/cjs/{new-sdk/utils/history.js → model/notices.js} +0 -0
- /package/dist/cjs/{sdk/accounts/intents/operations → new-sdk/simulate}/types.js +0 -0
- /package/dist/esm/{new-sdk/utils/history.js → model/notices.js} +0 -0
- /package/dist/esm/{sdk/accounts/intents/operations → new-sdk/simulate}/types.js +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/dev/fieldDiff.ts
|
|
3
|
+
/**
|
|
4
|
+
* Relative drift allowed on {@link Amount.valueUsd} before a USD float is a
|
|
5
|
+
* real disagreement: 0.1%.
|
|
6
|
+
**/
|
|
7
|
+
const USD_RELATIVE_EPSILON = .001;
|
|
8
|
+
/**
|
|
9
|
+
* Relative drift allowed on lag-bounded bigint amounts: 0.05%.
|
|
10
|
+
**/
|
|
11
|
+
const AMOUNT_RELATIVE_EPSILON = 5e-4;
|
|
12
|
+
/**
|
|
13
|
+
* Absolute drift allowed on bps rates before rounding and a one-block lag are
|
|
14
|
+
* no longer enough to explain it.
|
|
15
|
+
**/
|
|
16
|
+
const BPS_ABSOLUTE_EPSILON = 1;
|
|
17
|
+
/**
|
|
18
|
+
* Every field two versions of one value disagree on. Nothing is filtered or
|
|
19
|
+
* tagged: the caller marks expected diffs afterwards.
|
|
20
|
+
**/
|
|
21
|
+
function diffValue(path, onchain, offchain, out, options) {
|
|
22
|
+
if (isAbsent(onchain) && isAbsent(offchain)) return;
|
|
23
|
+
if (isAbsent(onchain) || isAbsent(offchain)) {
|
|
24
|
+
out.push({
|
|
25
|
+
path,
|
|
26
|
+
onchain,
|
|
27
|
+
offchain,
|
|
28
|
+
kind: "presence"
|
|
29
|
+
});
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (Array.isArray(onchain) && Array.isArray(offchain)) {
|
|
33
|
+
diffArray(path, onchain, offchain, out, options);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (isRecord(onchain) && isRecord(offchain)) {
|
|
37
|
+
for (const key of union(Object.keys(onchain), Object.keys(offchain))) diffValue(join(path, key), onchain[key], offchain[key], out, options);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (!sameScalar(onchain, offchain)) out.push({
|
|
41
|
+
path,
|
|
42
|
+
onchain,
|
|
43
|
+
offchain,
|
|
44
|
+
kind: scalarKind(path, onchain)
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Deep-diff two values and return the disagreements, in path order of
|
|
49
|
+
* discovery.
|
|
50
|
+
**/
|
|
51
|
+
function diffObjects(onchain, offchain, options) {
|
|
52
|
+
const diffs = [];
|
|
53
|
+
diffValue("", onchain, offchain, diffs, options);
|
|
54
|
+
return diffs;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Mark a diff expected, so a later `clean` count can ignore it.
|
|
58
|
+
**/
|
|
59
|
+
function withExpected(diff, reason) {
|
|
60
|
+
return {
|
|
61
|
+
...diff,
|
|
62
|
+
expected: true,
|
|
63
|
+
reason
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* How often each field differed, with array keys collapsed so that the same
|
|
68
|
+
* field of a hundred collateral tokens counts as one path. Sorted so the
|
|
69
|
+
* unexpected disagreements come first.
|
|
70
|
+
**/
|
|
71
|
+
function countPaths(diffs) {
|
|
72
|
+
const counts = /* @__PURE__ */ new Map();
|
|
73
|
+
for (const diff of diffs) {
|
|
74
|
+
const path = collapseArrayKeys(diff.path);
|
|
75
|
+
const entry = counts.get(path) ?? {
|
|
76
|
+
path,
|
|
77
|
+
kinds: [],
|
|
78
|
+
count: 0,
|
|
79
|
+
expected: 0,
|
|
80
|
+
unexpected: 0
|
|
81
|
+
};
|
|
82
|
+
entry.count += 1;
|
|
83
|
+
if (diff.expected) entry.expected += 1;
|
|
84
|
+
else entry.unexpected += 1;
|
|
85
|
+
if (!entry.kinds.includes(diff.kind)) entry.kinds.push(diff.kind);
|
|
86
|
+
counts.set(path, entry);
|
|
87
|
+
}
|
|
88
|
+
return [...counts.values()].sort((a, b) => b.unexpected - a.unexpected || b.count - a.count || a.path.localeCompare(b.path));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Collapse `collateralTokens[0xa0b8...].symbol` to `collateralTokens[].symbol`.
|
|
92
|
+
**/
|
|
93
|
+
function collapseArrayKeys(path) {
|
|
94
|
+
return path.replace(/\[[^\]]*\]/g, "[]");
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Membership and match totals of one comparison, from already-built lists.
|
|
98
|
+
**/
|
|
99
|
+
function toCompareCounts(onchainRows, offchainRows, onlyOnchain, onlyOffchain, matched) {
|
|
100
|
+
const identical = matched.filter((match) => match.identical).length;
|
|
101
|
+
const clean = matched.filter((match) => match.clean).length;
|
|
102
|
+
return {
|
|
103
|
+
onchainRows,
|
|
104
|
+
offchainRows,
|
|
105
|
+
matched: matched.length,
|
|
106
|
+
identical,
|
|
107
|
+
clean,
|
|
108
|
+
differing: matched.length - identical,
|
|
109
|
+
onlyOnchain,
|
|
110
|
+
onlyOffchain
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* USD floats within {@link USD_RELATIVE_EPSILON}.
|
|
115
|
+
**/
|
|
116
|
+
function isUsdWithinTolerance(onchain, offchain) {
|
|
117
|
+
return withinRelative(asFiniteNumber(onchain), asFiniteNumber(offchain), USD_RELATIVE_EPSILON);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Bps rates that differ by at most {@link BPS_ABSOLUTE_EPSILON}.
|
|
121
|
+
**/
|
|
122
|
+
function isBpsWithinTolerance(onchain, offchain) {
|
|
123
|
+
const left = asFiniteNumber(onchain);
|
|
124
|
+
const right = asFiniteNumber(offchain);
|
|
125
|
+
return left !== void 0 && right !== void 0 && Math.abs(left - right) <= 1;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Bigint amounts within {@link AMOUNT_RELATIVE_EPSILON}.
|
|
129
|
+
**/
|
|
130
|
+
function isAmountWithinTolerance(onchain, offchain) {
|
|
131
|
+
return typeof onchain === "bigint" && typeof offchain === "bigint" && withinRelativeBigint(onchain, offchain, 5e-4);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Finite numbers within a relative epsilon of each other.
|
|
135
|
+
**/
|
|
136
|
+
function withinRelative(onchain, offchain, epsilon) {
|
|
137
|
+
if (onchain === void 0 || offchain === void 0) return false;
|
|
138
|
+
const scale = Math.max(Math.abs(onchain), Math.abs(offchain));
|
|
139
|
+
return scale === 0 ? true : Math.abs(onchain - offchain) / scale <= epsilon;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* `diff / max(|a|, |b|) <= epsilon`, computed in integer arithmetic so a
|
|
143
|
+
* 1e18-scale amount does not round through `Number`.
|
|
144
|
+
**/
|
|
145
|
+
function withinRelativeBigint(onchain, offchain, epsilon) {
|
|
146
|
+
if (onchain === offchain) return true;
|
|
147
|
+
const diff = onchain > offchain ? onchain - offchain : offchain - onchain;
|
|
148
|
+
const scale = abs(onchain) > abs(offchain) ? abs(onchain) : abs(offchain);
|
|
149
|
+
if (scale === 0n) return true;
|
|
150
|
+
return diff * BigInt(Math.round(1 / epsilon)) <= scale;
|
|
151
|
+
}
|
|
152
|
+
function asFiniteNumber(value) {
|
|
153
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
154
|
+
}
|
|
155
|
+
function union(left, right) {
|
|
156
|
+
return [.../* @__PURE__ */ new Set([...left, ...right])];
|
|
157
|
+
}
|
|
158
|
+
function isRecord(value) {
|
|
159
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
160
|
+
}
|
|
161
|
+
function diffArray(path, onchain, offchain, out, options) {
|
|
162
|
+
const onchainKeyed = keyElements(path, onchain, options?.keyOf);
|
|
163
|
+
const offchainKeyed = keyElements(path, offchain, options?.keyOf);
|
|
164
|
+
if (!onchainKeyed || !offchainKeyed) {
|
|
165
|
+
if (onchain.length !== offchain.length) {
|
|
166
|
+
out.push({
|
|
167
|
+
path,
|
|
168
|
+
onchain,
|
|
169
|
+
offchain,
|
|
170
|
+
kind: "other"
|
|
171
|
+
});
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
onchain.forEach((element, index) => {
|
|
175
|
+
diffValue(`${path}[${index}]`, element, offchain[index], out, options);
|
|
176
|
+
});
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
for (const key of union([...onchainKeyed.keys()], [...offchainKeyed.keys()])) diffValue(`${path}[${key}]`, onchainKeyed.get(key), offchainKeyed.get(key), out, options);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* The array indexed by each element's own identity, or `undefined` when its
|
|
183
|
+
* elements have none and order is all there is to go by.
|
|
184
|
+
**/
|
|
185
|
+
function keyElements(path, values, keyOf) {
|
|
186
|
+
const keyed = /* @__PURE__ */ new Map();
|
|
187
|
+
for (const value of values) {
|
|
188
|
+
const identity = keyOf?.(path, value) ?? defaultIdentity(value);
|
|
189
|
+
if (typeof identity !== "string") return;
|
|
190
|
+
keyed.set(identity.toLowerCase(), value);
|
|
191
|
+
}
|
|
192
|
+
return keyed.size === values.length ? keyed : void 0;
|
|
193
|
+
}
|
|
194
|
+
function defaultIdentity(value) {
|
|
195
|
+
if (!isRecord(value)) return;
|
|
196
|
+
if (typeof value.address === "string") return value.address;
|
|
197
|
+
if (typeof value.id === "string") return value.id;
|
|
198
|
+
if (typeof value.token === "string") return value.token;
|
|
199
|
+
if (isRecord(value.token) && typeof value.token.address === "string") return value.token.address;
|
|
200
|
+
}
|
|
201
|
+
const ADDRESS = /^0x[0-9a-f]{40}$/i;
|
|
202
|
+
/**
|
|
203
|
+
* Only addresses are compared case-insensitively: the backend lowercases them
|
|
204
|
+
* while the chain hands out checksummed ones, which is not a disagreement. A
|
|
205
|
+
* symbol or a name spelled differently is.
|
|
206
|
+
**/
|
|
207
|
+
function sameScalar(onchain, offchain) {
|
|
208
|
+
if (typeof onchain === "string" && typeof offchain === "string" && ADDRESS.test(onchain) && ADDRESS.test(offchain)) return onchain.toLowerCase() === offchain.toLowerCase();
|
|
209
|
+
return onchain === offchain;
|
|
210
|
+
}
|
|
211
|
+
function scalarKind(path, onchain) {
|
|
212
|
+
if (path.endsWith("valueUsd")) return "usd";
|
|
213
|
+
return typeof onchain === "number" || typeof onchain === "bigint" ? "numeric" : "other";
|
|
214
|
+
}
|
|
215
|
+
function isAbsent(value) {
|
|
216
|
+
return value === void 0 || value === null;
|
|
217
|
+
}
|
|
218
|
+
function join(path, key) {
|
|
219
|
+
return path ? `${path}.${key}` : key;
|
|
220
|
+
}
|
|
221
|
+
function abs(value) {
|
|
222
|
+
return value < 0n ? -value : value;
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
exports.AMOUNT_RELATIVE_EPSILON = AMOUNT_RELATIVE_EPSILON;
|
|
226
|
+
exports.BPS_ABSOLUTE_EPSILON = BPS_ABSOLUTE_EPSILON;
|
|
227
|
+
exports.USD_RELATIVE_EPSILON = USD_RELATIVE_EPSILON;
|
|
228
|
+
exports.asFiniteNumber = asFiniteNumber;
|
|
229
|
+
exports.collapseArrayKeys = collapseArrayKeys;
|
|
230
|
+
exports.countPaths = countPaths;
|
|
231
|
+
exports.diffObjects = diffObjects;
|
|
232
|
+
exports.diffValue = diffValue;
|
|
233
|
+
exports.isAmountWithinTolerance = isAmountWithinTolerance;
|
|
234
|
+
exports.isBpsWithinTolerance = isBpsWithinTolerance;
|
|
235
|
+
exports.isRecord = isRecord;
|
|
236
|
+
exports.isUsdWithinTolerance = isUsdWithinTolerance;
|
|
237
|
+
exports.toCompareCounts = toCompareCounts;
|
|
238
|
+
exports.union = union;
|
|
239
|
+
exports.withExpected = withExpected;
|
|
240
|
+
exports.withinRelative = withinRelative;
|
|
241
|
+
exports.withinRelativeBigint = withinRelativeBigint;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/model/charts.ts
|
|
3
|
+
/**
|
|
4
|
+
* Historical charts of an opportunity or a position.
|
|
5
|
+
*
|
|
6
|
+
* Charts are backend-only by construction: the chain serves the present, and
|
|
7
|
+
* reconstructing a series from it would mean archive-node reads per point.
|
|
8
|
+
*
|
|
9
|
+
* A chart is read as a {@link ChartBundle}: one shared x-axis plus one
|
|
10
|
+
* {@link ChartSeries} per metric, each holding values only. Alignment is
|
|
11
|
+
* therefore structural — series `i` and series `j` describe the same instant at
|
|
12
|
+
* the same index — rather than a property the backend promises and every
|
|
13
|
+
* consumer re-checks.
|
|
14
|
+
**/
|
|
15
|
+
/**
|
|
16
|
+
* Time window a chart covers, ending at the present.
|
|
17
|
+
*
|
|
18
|
+
* `"max"` is the full history the backend retains for the subject.
|
|
19
|
+
**/
|
|
20
|
+
const CHART_RANGES = [
|
|
21
|
+
"1d",
|
|
22
|
+
"1w",
|
|
23
|
+
"1m",
|
|
24
|
+
"1y",
|
|
25
|
+
"max"
|
|
26
|
+
];
|
|
27
|
+
/**
|
|
28
|
+
* Every metric a pool opportunity can chart.
|
|
29
|
+
**/
|
|
30
|
+
const POOL_OPPORTUNITY_CHART_METRICS = [
|
|
31
|
+
"depositApy",
|
|
32
|
+
"borrowApy",
|
|
33
|
+
"dieselRate",
|
|
34
|
+
"supplied",
|
|
35
|
+
"borrowed",
|
|
36
|
+
"availableLiquidity"
|
|
37
|
+
];
|
|
38
|
+
/**
|
|
39
|
+
* Every metric a strategy opportunity can chart.
|
|
40
|
+
*
|
|
41
|
+
* `collateralPrice` is the collateral/underlying series a liquidation-price
|
|
42
|
+
* chart draws; the two USD series are the same prices quoted in dollars.
|
|
43
|
+
**/
|
|
44
|
+
const STRATEGY_OPPORTUNITY_CHART_METRICS = [
|
|
45
|
+
"netApy",
|
|
46
|
+
"borrowApy",
|
|
47
|
+
"collateralApy",
|
|
48
|
+
"tvl",
|
|
49
|
+
"collateralPrice",
|
|
50
|
+
"collateralUsdPrice",
|
|
51
|
+
"underlyingUsdPrice"
|
|
52
|
+
];
|
|
53
|
+
/**
|
|
54
|
+
* Every metric a pool position can chart.
|
|
55
|
+
*
|
|
56
|
+
* Nothing to do with {@link POOL_OPPORTUNITY_CHART_METRICS}: an opportunity charts what the
|
|
57
|
+
* pool did, a position charts what one wallet's deposit did in it. `mwr` and
|
|
58
|
+
* `twr` are cumulative returns since the position opened — money-weighted, so
|
|
59
|
+
* sensitive to when deposits and withdrawals landed, and time-weighted, which
|
|
60
|
+
* strips that timing out. Both are anchored at inception, so a narrow `range`
|
|
61
|
+
* only zooms the visible slice and its first point is rarely zero.
|
|
62
|
+
**/
|
|
63
|
+
const POOL_POSITION_CHART_METRICS = [
|
|
64
|
+
"value",
|
|
65
|
+
"apy",
|
|
66
|
+
"pnl",
|
|
67
|
+
"mwr",
|
|
68
|
+
"twr",
|
|
69
|
+
"underlyingPrice"
|
|
70
|
+
];
|
|
71
|
+
/**
|
|
72
|
+
* Every metric a strategy position can chart.
|
|
73
|
+
*
|
|
74
|
+
* `twrApy` annualizes `twr` over the position's whole life; the two trailing
|
|
75
|
+
* APYs annualize it over a fixed window instead, so they track the current pace
|
|
76
|
+
* rather than the lifetime rate and are comparable across positions of
|
|
77
|
+
* different ages.
|
|
78
|
+
**/
|
|
79
|
+
const STRATEGY_POSITION_CHART_METRICS = [
|
|
80
|
+
"totalValueUsd",
|
|
81
|
+
"totalValueUnderlying",
|
|
82
|
+
"debt",
|
|
83
|
+
"healthFactor",
|
|
84
|
+
"leverage",
|
|
85
|
+
"borrowApy",
|
|
86
|
+
"underlyingPrice",
|
|
87
|
+
"pnl",
|
|
88
|
+
"mwr",
|
|
89
|
+
"twr",
|
|
90
|
+
"twrApy",
|
|
91
|
+
"trailingApy7d",
|
|
92
|
+
"trailingApy30d"
|
|
93
|
+
];
|
|
94
|
+
/**
|
|
95
|
+
* Unit of every metric, the one place either side decides it.
|
|
96
|
+
*
|
|
97
|
+
* A metric added to a union above fails to compile here until its unit is
|
|
98
|
+
* named, and the wire schema rejects a series whose `unit` disagrees with this
|
|
99
|
+
* table, so the backend cannot drift from it silently.
|
|
100
|
+
**/
|
|
101
|
+
const CHART_METRIC_UNITS = {
|
|
102
|
+
depositApy: "bps",
|
|
103
|
+
borrowApy: "bps",
|
|
104
|
+
netApy: "bps",
|
|
105
|
+
collateralApy: "bps",
|
|
106
|
+
supplied: "token",
|
|
107
|
+
borrowed: "token",
|
|
108
|
+
availableLiquidity: "token",
|
|
109
|
+
tvl: "token",
|
|
110
|
+
dieselRate: "ratio",
|
|
111
|
+
collateralPrice: "ratio",
|
|
112
|
+
collateralUsdPrice: "usd",
|
|
113
|
+
underlyingUsdPrice: "usd",
|
|
114
|
+
value: "token",
|
|
115
|
+
apy: "bps",
|
|
116
|
+
pnl: "token",
|
|
117
|
+
mwr: "bps",
|
|
118
|
+
twr: "bps",
|
|
119
|
+
underlyingPrice: "usd",
|
|
120
|
+
totalValueUsd: "usd",
|
|
121
|
+
totalValueUnderlying: "token",
|
|
122
|
+
debt: "token",
|
|
123
|
+
healthFactor: "bps",
|
|
124
|
+
leverage: "scalar",
|
|
125
|
+
twrApy: "bps",
|
|
126
|
+
trailingApy7d: "bps",
|
|
127
|
+
trailingApy30d: "bps"
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Reason a series could not be produced at all, which is not the same as a
|
|
131
|
+
* series that has no points in the window.
|
|
132
|
+
**/
|
|
133
|
+
const CHART_UNAVAILABLE_CODES = [
|
|
134
|
+
"unknown_subject",
|
|
135
|
+
"unsupported_metric",
|
|
136
|
+
"no_price_feed",
|
|
137
|
+
"not_indexed",
|
|
138
|
+
"internal"
|
|
139
|
+
];
|
|
140
|
+
//#endregion
|
|
141
|
+
exports.CHART_METRIC_UNITS = CHART_METRIC_UNITS;
|
|
142
|
+
exports.CHART_RANGES = CHART_RANGES;
|
|
143
|
+
exports.CHART_UNAVAILABLE_CODES = CHART_UNAVAILABLE_CODES;
|
|
144
|
+
exports.POOL_OPPORTUNITY_CHART_METRICS = POOL_OPPORTUNITY_CHART_METRICS;
|
|
145
|
+
exports.POOL_POSITION_CHART_METRICS = POOL_POSITION_CHART_METRICS;
|
|
146
|
+
exports.STRATEGY_OPPORTUNITY_CHART_METRICS = STRATEGY_OPPORTUNITY_CHART_METRICS;
|
|
147
|
+
exports.STRATEGY_POSITION_CHART_METRICS = STRATEGY_POSITION_CHART_METRICS;
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_model_charts = require("./charts.js");
|
|
3
|
+
const require_model_primitives_schema = require("./primitives.schema.js");
|
|
4
|
+
let zod_v4 = require("zod/v4");
|
|
5
|
+
//#region src/model/charts.schema.ts
|
|
6
|
+
/**
|
|
7
|
+
* Runtime schemas for {@link ./charts.js}, see the note in
|
|
8
|
+
* `primitives.schema.ts` on why they are written by hand.
|
|
9
|
+
*
|
|
10
|
+
* Metric schemas are shared with the backend, while
|
|
11
|
+
* {@link chartBundleSchemaFor} builds the response schema for one concrete
|
|
12
|
+
* request. Component schemas remain available for consumers that validate
|
|
13
|
+
* model fragments.
|
|
14
|
+
**/
|
|
15
|
+
/**
|
|
16
|
+
* {@link ChartRange}
|
|
17
|
+
**/
|
|
18
|
+
const chartRangeSchema = zod_v4.z.enum(require_model_charts.CHART_RANGES);
|
|
19
|
+
/**
|
|
20
|
+
* {@link PoolOpportunityChartMetric}
|
|
21
|
+
**/
|
|
22
|
+
const poolOpportunityChartMetricSchema = zod_v4.z.enum(require_model_charts.POOL_OPPORTUNITY_CHART_METRICS);
|
|
23
|
+
/**
|
|
24
|
+
* {@link StrategyOpportunityChartMetric}
|
|
25
|
+
**/
|
|
26
|
+
const strategyOpportunityChartMetricSchema = zod_v4.z.enum(require_model_charts.STRATEGY_OPPORTUNITY_CHART_METRICS);
|
|
27
|
+
/**
|
|
28
|
+
* {@link PoolPositionChartMetric}
|
|
29
|
+
**/
|
|
30
|
+
const poolPositionChartMetricSchema = zod_v4.z.enum(require_model_charts.POOL_POSITION_CHART_METRICS);
|
|
31
|
+
/**
|
|
32
|
+
* {@link StrategyPositionChartMetric}
|
|
33
|
+
**/
|
|
34
|
+
const strategyPositionChartMetricSchema = zod_v4.z.enum(require_model_charts.STRATEGY_POSITION_CHART_METRICS);
|
|
35
|
+
/**
|
|
36
|
+
* {@link ChartMetric}, every metric either kind of subject can chart.
|
|
37
|
+
**/
|
|
38
|
+
const chartMetricSchema = zod_v4.z.union([
|
|
39
|
+
poolOpportunityChartMetricSchema,
|
|
40
|
+
strategyOpportunityChartMetricSchema,
|
|
41
|
+
poolPositionChartMetricSchema,
|
|
42
|
+
strategyPositionChartMetricSchema
|
|
43
|
+
]);
|
|
44
|
+
/**
|
|
45
|
+
* {@link ChartQuery}
|
|
46
|
+
**/
|
|
47
|
+
const chartQuerySchema = zod_v4.z.object({
|
|
48
|
+
metrics: zod_v4.z.array(chartMetricSchema).readonly().refine((metrics) => metrics.length > 0, { error: "a chart read needs at least one metric" }).refine((metrics) => new Set(metrics).size === metrics.length, { error: "a chart read needs distinct metrics" }),
|
|
49
|
+
range: chartRangeSchema
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* {@link ChartQuery} as a URL can carry it: the metrics comma-joined, since
|
|
53
|
+
* repeated `?metrics=` entries would order differently between clients and give
|
|
54
|
+
* one request two cache keys.
|
|
55
|
+
**/
|
|
56
|
+
const chartQueryParamsSchema = zod_v4.z.object({
|
|
57
|
+
metrics: zod_v4.z.string().regex(/^\w+(,\w+)*$/),
|
|
58
|
+
range: chartRangeSchema
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* Codec for {@link ChartQuery} to encode/decode to/from url query parameters.
|
|
62
|
+
*
|
|
63
|
+
* The one place the wire form of a chart request is decided. The SDK encodes
|
|
64
|
+
* with it, the backend decodes with it, and the checks that a read names at
|
|
65
|
+
* least one metric and names none of them twice ride along in both directions —
|
|
66
|
+
* so a bad request fails before it is issued, not after a round trip.
|
|
67
|
+
**/
|
|
68
|
+
const chartQueryCodec = zod_v4.z.codec(chartQueryParamsSchema, chartQuerySchema, {
|
|
69
|
+
decode: (params) => ({
|
|
70
|
+
metrics: params.metrics.split(","),
|
|
71
|
+
range: params.range
|
|
72
|
+
}),
|
|
73
|
+
encode: (query) => ({
|
|
74
|
+
metrics: query.metrics.join(","),
|
|
75
|
+
range: query.range
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
/**
|
|
79
|
+
* {@link ChartDenomination}
|
|
80
|
+
**/
|
|
81
|
+
const chartDenominationSchema = zod_v4.z.discriminatedUnion("unit", [
|
|
82
|
+
zod_v4.z.object({ unit: zod_v4.z.literal("bps") }),
|
|
83
|
+
zod_v4.z.object({ unit: zod_v4.z.literal("usd") }),
|
|
84
|
+
zod_v4.z.object({ unit: zod_v4.z.literal("scalar") }),
|
|
85
|
+
zod_v4.z.object({
|
|
86
|
+
unit: zod_v4.z.literal("token"),
|
|
87
|
+
base: require_model_primitives_schema.tokenSchema
|
|
88
|
+
}),
|
|
89
|
+
zod_v4.z.object({
|
|
90
|
+
unit: zod_v4.z.literal("ratio"),
|
|
91
|
+
base: require_model_primitives_schema.tokenSchema,
|
|
92
|
+
quote: require_model_primitives_schema.tokenSchema
|
|
93
|
+
})
|
|
94
|
+
]);
|
|
95
|
+
/**
|
|
96
|
+
* {@link ChartValue}. `null` is a gap, never a zero.
|
|
97
|
+
**/
|
|
98
|
+
const chartValueSchema = zod_v4.z.number().nullable();
|
|
99
|
+
/**
|
|
100
|
+
* {@link ChartSeries}
|
|
101
|
+
**/
|
|
102
|
+
const chartSeriesSchema = zod_v4.z.union([zod_v4.z.intersection(zod_v4.z.object({
|
|
103
|
+
status: zod_v4.z.literal("ok"),
|
|
104
|
+
values: zod_v4.z.array(chartValueSchema)
|
|
105
|
+
}), chartDenominationSchema), zod_v4.z.object({
|
|
106
|
+
status: zod_v4.z.literal("unavailable"),
|
|
107
|
+
reason: zod_v4.z.object({
|
|
108
|
+
code: zod_v4.z.enum(require_model_charts.CHART_UNAVAILABLE_CODES),
|
|
109
|
+
message: zod_v4.z.string().optional()
|
|
110
|
+
})
|
|
111
|
+
})]);
|
|
112
|
+
/**
|
|
113
|
+
* {@link ChartWindow}
|
|
114
|
+
**/
|
|
115
|
+
const chartWindowSchema = zod_v4.z.object({
|
|
116
|
+
range: chartRangeSchema,
|
|
117
|
+
from: require_model_primitives_schema.timestampSchema,
|
|
118
|
+
to: require_model_primitives_schema.timestampSchema
|
|
119
|
+
});
|
|
120
|
+
const gridSamplingSchema = zod_v4.z.object({
|
|
121
|
+
kind: zod_v4.z.literal("grid"),
|
|
122
|
+
intervalSeconds: zod_v4.z.number().int().positive()
|
|
123
|
+
});
|
|
124
|
+
/**
|
|
125
|
+
* A bundle whose series are keyed by `keys`.
|
|
126
|
+
*
|
|
127
|
+
* `z.record` over a literal union is what enforces the metric set: a key that
|
|
128
|
+
* was not asked for is rejected, and one that was but is missing fails as an
|
|
129
|
+
* absent value. Exactly-once therefore needs no counting — an object cannot
|
|
130
|
+
* hold the same key twice.
|
|
131
|
+
**/
|
|
132
|
+
function chartBundleSchemaWith(keys, expectedRange) {
|
|
133
|
+
return zod_v4.z.object({
|
|
134
|
+
window: chartWindowSchema,
|
|
135
|
+
sampling: gridSamplingSchema,
|
|
136
|
+
timestamps: zod_v4.z.array(require_model_primitives_schema.timestampSchema),
|
|
137
|
+
series: zod_v4.z.record(keys, chartSeriesSchema)
|
|
138
|
+
}).superRefine((bundle, ctx) => checkChartBundle(bundle, ctx, expectedRange));
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The invariants a bundle upholds beyond its shape, checked on every read so a
|
|
142
|
+
* backend that breaks one is rejected rather than plotted:
|
|
143
|
+
*
|
|
144
|
+
* - each available series holds exactly one value per timestamp, which is what
|
|
145
|
+
* makes two series of a bundle comparable at an index;
|
|
146
|
+
* - a series' unit is the one {@link CHART_METRIC_UNITS} gives the metric it is
|
|
147
|
+
* keyed by, so a consumer can format from either without them disagreeing;
|
|
148
|
+
* - the window's bounds are the axis' own, so a chart drawn from `window` and a
|
|
149
|
+
* chart drawn from `timestamps` cover the same span;
|
|
150
|
+
* - timestamps lie on the declared grid and are exactly one interval apart;
|
|
151
|
+
* - when validating a read, the response names the range that was requested.
|
|
152
|
+
**/
|
|
153
|
+
function checkChartBundle(bundle, ctx, expectedRange) {
|
|
154
|
+
const { sampling, timestamps, window, series } = bundle;
|
|
155
|
+
const entries = Object.entries(series);
|
|
156
|
+
for (const [metric, chart] of entries) {
|
|
157
|
+
if (chart.status !== "ok") continue;
|
|
158
|
+
if (chart.values.length !== timestamps.length) ctx.addIssue({
|
|
159
|
+
code: "custom",
|
|
160
|
+
path: [
|
|
161
|
+
"series",
|
|
162
|
+
metric,
|
|
163
|
+
"values"
|
|
164
|
+
],
|
|
165
|
+
message: `series "${metric}" holds ${chart.values.length} values for ${timestamps.length} timestamps`
|
|
166
|
+
});
|
|
167
|
+
if (require_model_charts.CHART_METRIC_UNITS[metric] !== chart.unit) ctx.addIssue({
|
|
168
|
+
code: "custom",
|
|
169
|
+
path: [
|
|
170
|
+
"series",
|
|
171
|
+
metric,
|
|
172
|
+
"unit"
|
|
173
|
+
],
|
|
174
|
+
message: `metric "${metric}" is ${require_model_charts.CHART_METRIC_UNITS[metric]}, not ${chart.unit}`
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
const first = timestamps.at(0);
|
|
178
|
+
const last = timestamps.at(-1);
|
|
179
|
+
if (first !== void 0 && first !== window.from) ctx.addIssue({
|
|
180
|
+
code: "custom",
|
|
181
|
+
path: ["window", "from"],
|
|
182
|
+
message: `window starts at ${window.from} but the axis starts at ${first}`
|
|
183
|
+
});
|
|
184
|
+
if (last !== void 0 && last !== window.to) ctx.addIssue({
|
|
185
|
+
code: "custom",
|
|
186
|
+
path: ["window", "to"],
|
|
187
|
+
message: `window ends at ${window.to} but the axis ends at ${last}`
|
|
188
|
+
});
|
|
189
|
+
if (expectedRange !== void 0 && window.range !== expectedRange) ctx.addIssue({
|
|
190
|
+
code: "custom",
|
|
191
|
+
path: ["window", "range"],
|
|
192
|
+
message: `requested range ${expectedRange}, received ${window.range}`
|
|
193
|
+
});
|
|
194
|
+
for (let i = 0; i < timestamps.length; i += 1) {
|
|
195
|
+
const timestamp = timestamps[i];
|
|
196
|
+
if (timestamp % sampling.intervalSeconds !== 0) ctx.addIssue({
|
|
197
|
+
code: "custom",
|
|
198
|
+
path: ["timestamps", i],
|
|
199
|
+
message: `timestamp ${timestamp} is not on the ${sampling.intervalSeconds}-second grid`
|
|
200
|
+
});
|
|
201
|
+
const previous = timestamps[i - 1];
|
|
202
|
+
if (previous !== void 0 && timestamp - previous !== sampling.intervalSeconds) ctx.addIssue({
|
|
203
|
+
code: "custom",
|
|
204
|
+
path: ["timestamps", i],
|
|
205
|
+
message: `timestamps are not ${sampling.intervalSeconds} seconds apart`
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* The schema one chart read is decoded with: a {@link ChartBundle} keyed by the
|
|
211
|
+
* requested distinct metrics, all of them and nothing else, for the requested
|
|
212
|
+
* range.
|
|
213
|
+
*
|
|
214
|
+
* Pinning the metrics is what upholds the `ChartBundle<Metrics>` a caller gets
|
|
215
|
+
* back — a response that answers a different question fails validation rather
|
|
216
|
+
* than being cast into the requested shape. The declared return type is the one
|
|
217
|
+
* the key schema actually enforces, which the compiler cannot see through a
|
|
218
|
+
* schema built from a runtime list.
|
|
219
|
+
**/
|
|
220
|
+
function chartBundleSchemaFor(metrics, range) {
|
|
221
|
+
if (metrics.length === 0) throw new RangeError("a chart read needs at least one metric");
|
|
222
|
+
if (new Set(metrics).size !== metrics.length) throw new RangeError("a chart read needs distinct metrics");
|
|
223
|
+
const literals = metrics.map((metric) => zod_v4.z.literal(metric));
|
|
224
|
+
return chartBundleSchemaWith(zod_v4.z.union(literals), range);
|
|
225
|
+
}
|
|
226
|
+
//#endregion
|
|
227
|
+
exports.chartBundleSchemaFor = chartBundleSchemaFor;
|
|
228
|
+
exports.chartDenominationSchema = chartDenominationSchema;
|
|
229
|
+
exports.chartMetricSchema = chartMetricSchema;
|
|
230
|
+
exports.chartQueryCodec = chartQueryCodec;
|
|
231
|
+
exports.chartQueryParamsSchema = chartQueryParamsSchema;
|
|
232
|
+
exports.chartQuerySchema = chartQuerySchema;
|
|
233
|
+
exports.chartRangeSchema = chartRangeSchema;
|
|
234
|
+
exports.chartSeriesSchema = chartSeriesSchema;
|
|
235
|
+
exports.chartValueSchema = chartValueSchema;
|
|
236
|
+
exports.chartWindowSchema = chartWindowSchema;
|
|
237
|
+
exports.poolOpportunityChartMetricSchema = poolOpportunityChartMetricSchema;
|
|
238
|
+
exports.poolPositionChartMetricSchema = poolPositionChartMetricSchema;
|
|
239
|
+
exports.strategyOpportunityChartMetricSchema = strategyOpportunityChartMetricSchema;
|
|
240
|
+
exports.strategyPositionChartMetricSchema = strategyPositionChartMetricSchema;
|