@panoptic-eng/sdk 1.0.11 → 1.0.13

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.
@@ -1,4 +1,4 @@
1
- import { MulticallNoDataError, MulticallResultFailedError, MulticallResultMissingError, PanopticValidationError, collateralTrackerV2Abi, decodeLeftRightUnsigned, getBlockMeta, getPool$1 as getPool, getPositions, panopticPoolV2Abi, riskEngineAbi, tickToSqrtPriceX96$1 as tickToSqrtPriceX96 } from "./position-BVhvYRm8.js";
1
+ import { MulticallNoDataError, MulticallResultFailedError, MulticallResultMissingError, PanopticValidationError, collateralTrackerV2Abi, decodeLeftRightUnsigned, getBlockMeta, getPool$1 as getPool, getPositions, panopticPoolV2Abi, riskEngineAbi, tickToSqrtPriceX96$1 as tickToSqrtPriceX96 } from "./position-C3Ca4itE.js";
2
2
  import { decodeFunctionResult, encodeFunctionData } from "viem";
3
3
  import { call } from "viem/actions";
4
4
 
@@ -705,47 +705,6 @@ const panopticQueryAbi = [
705
705
  }],
706
706
  stateMutability: "view"
707
707
  },
708
- {
709
- type: "function",
710
- name: "getNetLiquidationValue",
711
- inputs: [
712
- {
713
- name: "pool",
714
- type: "address",
715
- internalType: "contract PanopticPool"
716
- },
717
- {
718
- name: "account",
719
- type: "address",
720
- internalType: "address"
721
- },
722
- {
723
- name: "includePendingPremium",
724
- type: "bool",
725
- internalType: "bool"
726
- },
727
- {
728
- name: "positionIdList",
729
- type: "uint256[]",
730
- internalType: "TokenId[]"
731
- },
732
- {
733
- name: "atTick",
734
- type: "int24",
735
- internalType: "int24"
736
- }
737
- ],
738
- outputs: [{
739
- name: "value0",
740
- type: "int256",
741
- internalType: "int256"
742
- }, {
743
- name: "value1",
744
- type: "int256",
745
- internalType: "int256"
746
- }],
747
- stateMutability: "view"
748
- },
749
708
  {
750
709
  type: "function",
751
710
  name: "getPortfolioValue",
@@ -1568,11 +1527,13 @@ async function getNetLiquidationValue(params) {
1568
1527
  account,
1569
1528
  includePendingPremium,
1570
1529
  tokenIds,
1571
- Number(effectiveTick)
1530
+ [Number(effectiveTick)]
1572
1531
  ],
1573
1532
  blockNumber: targetBlockNumber
1574
1533
  });
1575
- const [value0, value1] = result;
1534
+ const [values0, values1] = result;
1535
+ const value0 = values0[0];
1536
+ const value1 = values1[0];
1576
1537
  return {
1577
1538
  value0,
1578
1539
  value1,
@@ -2371,5 +2332,5 @@ async function getIrmCurve(params) {
2371
2332
  }
2372
2333
 
2373
2334
  //#endregion
2374
- export { BORROW_INDEX_BITS, BPS_SCALE, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, Multicall3Abi, RATE_AT_TARGET_BITS, SECONDS_PER_YEAR, UNREALIZED_INTEREST_BITS, WAD as WAD$1, annualizePerSecondRateWad, deriveSupplyRatePerSecWad, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, formatRateWad, formatTokenAmount, formatTokenAmountSigned, formatTokenDelta, formatTokenFlow, formatWad, formatWadPercent, formatWadSigned, getAccountCollateral, getAccountSummaryBasic, getAccountSummaryRisk, getCollateralAddresses, getCollateralData, getCurrentRates, getInterestState, getIrmCurrent, getIrmCurve, getLiquidationPrices, getNetLiquidationValue, getNetLiquidationValues, isLiquidatable, packMarketState, panopticQueryAbi as panopticQueryAbi$1, parseTokenAmount, parseWad, ratePerSecWadToAprPct, readBlockAndAggregate, requireReturnData, utilizationBpsToWad, utilizationPctToWad };
2375
- //# sourceMappingURL=irm-BTK_DhAz.js.map
2335
+ export { BORROW_INDEX_BITS, BPS_SCALE, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, Multicall3Abi, RATE_AT_TARGET_BITS, SECONDS_PER_YEAR, UNREALIZED_INTEREST_BITS, WAD, annualizePerSecondRateWad, deriveSupplyRatePerSecWad, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, formatRateWad, formatTokenAmount, formatTokenAmountSigned, formatTokenDelta, formatTokenFlow, formatWad, formatWadPercent, formatWadSigned, getAccountCollateral, getAccountSummaryBasic, getAccountSummaryRisk, getCollateralAddresses, getCollateralData, getCurrentRates, getInterestState, getIrmCurrent, getIrmCurve, getLiquidationPrices, getNetLiquidationValue, getNetLiquidationValues, isLiquidatable, packMarketState, panopticQueryAbi, parseTokenAmount, parseWad, ratePerSecWadToAprPct, readBlockAndAggregate, requireReturnData, utilizationBpsToWad, utilizationPctToWad };
2336
+ //# sourceMappingURL=irm-psiA-OZ-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"irm-psiA-OZ-.js","names":["client: Client","results: readonly MulticallBlockResult[]","index: number","label: string","amount: bigint","sqrtPriceX96: bigint","params: IsLiquidatableParams","collateralToken0: Address","collateralToken1: Address","calls: MulticallBlockCall[]","denominatedInToken: bigint","pool: {\n collateralTracker0: { address: Address }\n collateralTracker1: { address: Address }\n}","params: GetAccountCollateralParams","collateralToken0: Address","collateralToken1: Address","token0: TokenCollateral","token1: TokenCollateral","params: GetAccountSummaryBasicParams","params: GetAccountSummaryRiskParams","params: GetNetLiquidationValueParams","params: GetNetLiquidationValuesParams","params: GetLiquidationPricesParams","SECONDS_PER_YEAR","erc20Abi","params: GetCollateralDataParams","_meta","poolData","totalShares","interestRate","depositedAssets","insideAMM","creditedShares","utilization","totalAssets","borrowRate","supplyRate","params: GetCurrentRatesParams","collateralToken0: Address","collateralToken1: Address","params: GetInterestStateParams","amount: bigint","decimals: bigint","precision: bigint","amount: string","flow: TokenFlow","decimals0: bigint","decimals1: bigint","precision0: bigint","precision1: bigint","wad: bigint","precision: bigint","rateWad: bigint","value: string","SECONDS_PER_YEAR","ratePerSecondWad: bigint","precision: bigint","utilizationBps: bigint","bits: bigint","value: bigint","fieldName: string","inputs: IrmMarketStateInputs","utilizationPct: number","ratePerSecWad: bigint","borrowRatePerSecWad: bigint","utilizationWad: bigint","params: {\n client: PublicClient\n collateralTrackerAddress: Address\n blockNumber?: bigint\n}","params: {\n client: PublicClient\n collateralTrackerAddress: Address\n points?: number\n blockNumber?: bigint\n}","curvePoints: IrmPoint[]"],"sources":["../src/abis/multicall3.ts","../src/panoptic/v2/abis/panopticQuery.ts","../src/panoptic/v2/reads/multicallBlock.ts","../src/panoptic/v2/reads/checks.ts","../src/panoptic/v2/reads/account.ts","../src/panoptic/v2/reads/collateral.ts","../src/panoptic/v2/formatters/amount.ts","../src/panoptic/v2/formatters/wad.ts","../src/panoptic/v2/formatters/rates.ts","../src/panoptic/v2/reads/irm.ts"],"sourcesContent":["export const Multicall3Abi = [\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address',\n name: 'target',\n type: 'address',\n },\n {\n internalType: 'bytes',\n name: 'callData',\n type: 'bytes',\n },\n ],\n internalType: 'struct Multicall3.Call[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'aggregate',\n outputs: [\n {\n internalType: 'uint256',\n name: 'blockNumber',\n type: 'uint256',\n },\n {\n internalType: 'bytes[]',\n name: 'returnData',\n type: 'bytes[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address',\n name: 'target',\n type: 'address',\n },\n {\n internalType: 'bool',\n name: 'allowFailure',\n type: 'bool',\n },\n {\n internalType: 'bytes',\n name: 'callData',\n type: 'bytes',\n },\n ],\n internalType: 'struct Multicall3.Call3[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'aggregate3',\n outputs: [\n {\n components: [\n {\n internalType: 'bool',\n name: 'success',\n type: 'bool',\n },\n {\n internalType: 'bytes',\n name: 'returnData',\n type: 'bytes',\n },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address',\n name: 'target',\n type: 'address',\n },\n {\n internalType: 'bool',\n name: 'allowFailure',\n type: 'bool',\n },\n {\n internalType: 'uint256',\n name: 'value',\n type: 'uint256',\n },\n {\n internalType: 'bytes',\n name: 'callData',\n type: 'bytes',\n },\n ],\n internalType: 'struct Multicall3.Call3Value[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'aggregate3Value',\n outputs: [\n {\n components: [\n {\n internalType: 'bool',\n name: 'success',\n type: 'bool',\n },\n {\n internalType: 'bytes',\n name: 'returnData',\n type: 'bytes',\n },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n {\n components: [\n {\n internalType: 'address',\n name: 'target',\n type: 'address',\n },\n {\n internalType: 'bytes',\n name: 'callData',\n type: 'bytes',\n },\n ],\n internalType: 'struct Multicall3.Call[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'blockAndAggregate',\n outputs: [\n {\n internalType: 'uint256',\n name: 'blockNumber',\n type: 'uint256',\n },\n {\n internalType: 'bytes32',\n name: 'blockHash',\n type: 'bytes32',\n },\n {\n components: [\n {\n internalType: 'bool',\n name: 'success',\n type: 'bool',\n },\n {\n internalType: 'bytes',\n name: 'returnData',\n type: 'bytes',\n },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getBasefee',\n outputs: [\n {\n internalType: 'uint256',\n name: 'basefee',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'uint256',\n name: 'blockNumber',\n type: 'uint256',\n },\n ],\n name: 'getBlockHash',\n outputs: [\n {\n internalType: 'bytes32',\n name: 'blockHash',\n type: 'bytes32',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getBlockNumber',\n outputs: [\n {\n internalType: 'uint256',\n name: 'blockNumber',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getChainId',\n outputs: [\n {\n internalType: 'uint256',\n name: 'chainid',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockCoinbase',\n outputs: [\n {\n internalType: 'address',\n name: 'coinbase',\n type: 'address',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockDifficulty',\n outputs: [\n {\n internalType: 'uint256',\n name: 'difficulty',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockGasLimit',\n outputs: [\n {\n internalType: 'uint256',\n name: 'gaslimit',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getCurrentBlockTimestamp',\n outputs: [\n {\n internalType: 'uint256',\n name: 'timestamp',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'address',\n name: 'addr',\n type: 'address',\n },\n ],\n name: 'getEthBalance',\n outputs: [\n {\n internalType: 'uint256',\n name: 'balance',\n type: 'uint256',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'getLastBlockHash',\n outputs: [\n {\n internalType: 'bytes32',\n name: 'blockHash',\n type: 'bytes32',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'bool',\n name: 'requireSuccess',\n type: 'bool',\n },\n {\n components: [\n {\n internalType: 'address',\n name: 'target',\n type: 'address',\n },\n {\n internalType: 'bytes',\n name: 'callData',\n type: 'bytes',\n },\n ],\n internalType: 'struct Multicall3.Call[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'tryAggregate',\n outputs: [\n {\n components: [\n {\n internalType: 'bool',\n name: 'success',\n type: 'bool',\n },\n {\n internalType: 'bytes',\n name: 'returnData',\n type: 'bytes',\n },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n {\n inputs: [\n {\n internalType: 'bool',\n name: 'requireSuccess',\n type: 'bool',\n },\n {\n components: [\n {\n internalType: 'address',\n name: 'target',\n type: 'address',\n },\n {\n internalType: 'bytes',\n name: 'callData',\n type: 'bytes',\n },\n ],\n internalType: 'struct Multicall3.Call[]',\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'tryBlockAndAggregate',\n outputs: [\n {\n internalType: 'uint256',\n name: 'blockNumber',\n type: 'uint256',\n },\n {\n internalType: 'bytes32',\n name: 'blockHash',\n type: 'bytes32',\n },\n {\n components: [\n {\n internalType: 'bool',\n name: 'success',\n type: 'bool',\n },\n {\n internalType: 'bytes',\n name: 'returnData',\n type: 'bytes',\n },\n ],\n internalType: 'struct Multicall3.Result[]',\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'payable',\n type: 'function',\n },\n] as const\n","/**\n * PanopticQuery contract ABI\n * Auto-generated from PanopticQuery.json\n * @module abis/panopticQuery\n */\n\nexport const panopticQueryAbi = [\n {\n type: 'constructor',\n inputs: [\n {\n name: 'SFPM_',\n type: 'address',\n internalType: 'contract ISemiFungiblePositionManager',\n },\n ],\n stateMutability: 'payable',\n },\n {\n type: 'function',\n name: 'checkCollateral',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'account', type: 'address', internalType: 'address' },\n { name: 'positionIdList', type: 'uint256[]', internalType: 'TokenId[]' },\n ],\n outputs: [\n { name: 'collateralBalances0', type: 'uint256[4]', internalType: 'uint256[4]' },\n { name: 'requiredCollaterals0', type: 'uint256[4]', internalType: 'uint256[4]' },\n { name: 'collateralBalances1', type: 'uint256[4]', internalType: 'uint256[4]' },\n { name: 'requiredCollaterals1', type: 'uint256[4]', internalType: 'uint256[4]' },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'checkCollateral',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'account', type: 'address', internalType: 'address' },\n { name: 'positionIdList', type: 'uint256[]', internalType: 'TokenId[]' },\n { name: 'atTick', type: 'int24', internalType: 'int24' },\n ],\n outputs: [{ name: 'balancesAndRequired', type: 'uint256[4]', internalType: 'uint256[4]' }],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'checkCollateralListOutput',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'account', type: 'address', internalType: 'address' },\n { name: 'positionIdList', type: 'uint256[]', internalType: 'TokenId[]' },\n ],\n outputs: [\n { name: '', type: 'uint256[2][]', internalType: 'uint256[2][]' },\n { name: '', type: 'int256[]', internalType: 'int256[]' },\n { name: '', type: 'int24[]', internalType: 'int24[]' },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'computeMedianObservedPrice',\n inputs: [\n { name: 'univ3pool', type: 'address', internalType: 'contract IUniswapV3Pool' },\n { name: 'cardinality', type: 'uint256', internalType: 'uint256' },\n { name: 'period', type: 'uint256', internalType: 'uint256' },\n ],\n outputs: [{ name: 'medianTick', type: 'int24', internalType: 'int24' }],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getChunkData',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'positionIdList', type: 'uint256[]', internalType: 'TokenId[]' },\n ],\n outputs: [{ name: '', type: 'uint256[2][4][]', internalType: 'uint256[2][4][]' }],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'scanChunks',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'tickLower', type: 'int24', internalType: 'int24' },\n { name: 'tickUpper', type: 'int24', internalType: 'int24' },\n { name: 'width', type: 'int24', internalType: 'int24' },\n ],\n outputs: [\n { name: 'strikes', type: 'int24[]', internalType: 'int24[]' },\n { name: 'netLiquidities', type: 'uint128[2][]', internalType: 'uint128[2][]' },\n { name: 'removedLiquidities', type: 'uint128[2][]', internalType: 'uint128[2][]' },\n { name: 'settledTokens', type: 'uint256[2][]', internalType: 'LeftRightUnsigned[2][]' },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getLiquidationPrices',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'account', type: 'address', internalType: 'address' },\n { name: 'positionIdList', type: 'uint256[]', internalType: 'TokenId[]' },\n ],\n outputs: [\n { name: 'liquidationPriceDown', type: 'int24', internalType: 'int24' },\n { name: 'liquidationPriceUp', type: 'int24', internalType: 'int24' },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getMaxPositionSizeBounds',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'existingPositionIds', type: 'uint256[]', internalType: 'TokenId[]' },\n { name: 'account', type: 'address', internalType: 'address' },\n { name: 'tokenId', type: 'uint256', internalType: 'TokenId' },\n ],\n outputs: [\n { name: 'maxSizeAtMinUtil', type: 'uint128', internalType: 'uint128' },\n { name: 'maxSizeAtMaxUtil', type: 'uint128', internalType: 'uint128' },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getNetLiquidationValue',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'account', type: 'address', internalType: 'address' },\n { name: 'includePendingPremium', type: 'bool', internalType: 'bool' },\n { name: 'positionIdList', type: 'uint256[]', internalType: 'TokenId[]' },\n { name: 'atTicks', type: 'int24[]', internalType: 'int24[]' },\n ],\n outputs: [\n { name: 'value0', type: 'int256[]', internalType: 'int256[]' },\n { name: 'value1', type: 'int256[]', internalType: 'int256[]' },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getPortfolioValue',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'account', type: 'address', internalType: 'address' },\n { name: 'atTick', type: 'int24', internalType: 'int24' },\n { name: 'positionIdList', type: 'uint256[]', internalType: 'TokenId[]' },\n ],\n outputs: [\n { name: 'value0', type: 'int256', internalType: 'int256' },\n { name: 'value1', type: 'int256', internalType: 'int256' },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getRequiredBase',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'tokenId', type: 'uint256', internalType: 'TokenId' },\n { name: 'atTick', type: 'int24', internalType: 'int24' },\n ],\n outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getTickNets',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'startTick', type: 'int24', internalType: 'int24' },\n { name: 'nTicks', type: 'uint256', internalType: 'uint256' },\n ],\n outputs: [\n { name: 'tickData', type: 'int256[]', internalType: 'int256[]' },\n { name: 'liquidityNets', type: 'int256[]', internalType: 'int256[]' },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getTickNetsV3',\n inputs: [\n { name: 'univ3pool', type: 'address', internalType: 'contract IUniswapV3Pool' },\n { name: 'startTick', type: 'int24', internalType: 'int24' },\n { name: 'nTicks', type: 'uint256', internalType: 'uint256' },\n ],\n outputs: [\n { name: 'tickData', type: 'int256[]', internalType: 'int256[]' },\n { name: 'liquidityNets', type: 'int256[]', internalType: 'int256[]' },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'getTickNetsV4',\n inputs: [\n { name: 'manager', type: 'address', internalType: 'contract IPoolManager' },\n { name: 'poolId', type: 'bytes32', internalType: 'PoolId' },\n { name: 'tickSpacing', type: 'int24', internalType: 'int24' },\n { name: 'startTick', type: 'int24', internalType: 'int24' },\n { name: 'nTicks', type: 'uint256', internalType: 'uint256' },\n ],\n outputs: [\n { name: 'tickData', type: 'int256[]', internalType: 'int256[]' },\n { name: 'liquidityNets', type: 'int256[]', internalType: 'int256[]' },\n ],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'isAccountSolvent',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'account', type: 'address', internalType: 'address' },\n { name: 'positionIdList', type: 'uint256[]', internalType: 'TokenId[]' },\n { name: 'atTick', type: 'int24', internalType: 'int24' },\n ],\n outputs: [{ name: '', type: 'bool', internalType: 'bool' }],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'optimizeRiskPartners',\n inputs: [\n { name: 'pool', type: 'address', internalType: 'contract PanopticPool' },\n { name: 'atTick', type: 'int24', internalType: 'int24' },\n { name: 'tokenId', type: 'uint256', internalType: 'TokenId' },\n ],\n outputs: [{ name: '', type: 'uint256', internalType: 'TokenId' }],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'twapFilter',\n inputs: [\n { name: 'univ3pool', type: 'address', internalType: 'contract IUniswapV3Pool' },\n { name: 'twapWindow', type: 'uint32', internalType: 'uint32' },\n ],\n outputs: [{ name: '', type: 'int24', internalType: 'int24' }],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'validateTokenId',\n inputs: [{ name: 'self', type: 'uint256', internalType: 'TokenId' }],\n outputs: [],\n stateMutability: 'pure',\n },\n {\n type: 'error',\n name: 'CastingError',\n inputs: [],\n },\n {\n type: 'error',\n name: 'InvalidTick',\n inputs: [],\n },\n {\n type: 'error',\n name: 'InvalidTokenIdParameter',\n inputs: [{ name: 'parameterType', type: 'uint256', internalType: 'uint256' }],\n },\n {\n type: 'error',\n name: 'LiquidityTooHigh',\n inputs: [],\n },\n {\n type: 'error',\n name: 'UnderOverFlow',\n inputs: [],\n },\n] as const\n","import type { Address, Client, Hex } from 'viem'\nimport { decodeFunctionResult, encodeFunctionData } from 'viem'\nimport { call } from 'viem/actions'\n\nimport { Multicall3Abi } from '../../../abis/multicall3'\nimport {\n MulticallNoDataError,\n MulticallResultFailedError,\n MulticallResultMissingError,\n} from '../errors'\nimport type { BlockMeta } from '../types'\n\nexport const MULTICALL3_ADDRESS = '0xcA11bde05977b3631167028862bE2a173976CA11' as const\n\nexport interface MulticallBlockCall {\n target: Address\n callData: Hex\n}\n\nexport interface MulticallBlockResult {\n success: boolean\n returnData: Hex\n}\n\ninterface ClientWithCall extends Client {\n call: (parameters: { to: Address; data: Hex; blockNumber?: bigint }) => Promise<{ data?: Hex }>\n}\n\nfunction hasCall(client: Client): client is ClientWithCall {\n return 'call' in client && typeof (client as Record<'call', unknown>).call === 'function'\n}\n\nfunction requireResult(\n results: readonly MulticallBlockResult[],\n index: number,\n label: string,\n): MulticallBlockResult {\n const result = results[index]\n if (result === undefined) {\n throw new MulticallResultMissingError(label, index)\n }\n if (!result.success) {\n throw new MulticallResultFailedError(label, index)\n }\n return result\n}\n\nexport function requireReturnData(\n results: readonly MulticallBlockResult[],\n index: number,\n label: string,\n): Hex {\n return requireResult(results, index, label).returnData\n}\n\nexport async function readBlockAndAggregate({\n client,\n calls,\n blockNumber,\n}: {\n client: Client\n calls: readonly MulticallBlockCall[]\n blockNumber?: bigint\n}): Promise<{ _meta: BlockMeta; results: readonly MulticallBlockResult[] }> {\n const aggregateCalls = [\n ...calls,\n {\n target: MULTICALL3_ADDRESS,\n callData: encodeFunctionData({\n abi: Multicall3Abi,\n functionName: 'getCurrentBlockTimestamp',\n }),\n },\n ]\n\n const data = encodeFunctionData({\n abi: Multicall3Abi,\n functionName: 'blockAndAggregate',\n args: [aggregateCalls],\n })\n const parameters = { to: MULTICALL3_ADDRESS, data, blockNumber }\n const response = hasCall(client) ? await client.call(parameters) : await call(client, parameters)\n\n if (response.data === undefined) {\n throw new MulticallNoDataError('blockAndAggregate')\n }\n const aggregateResult = decodeFunctionResult({\n abi: Multicall3Abi,\n functionName: 'blockAndAggregate',\n data: response.data,\n })\n const [aggregateBlockNumber, blockHash, rawResults] = aggregateResult as readonly [\n bigint,\n Hex,\n readonly MulticallBlockResult[],\n ]\n const timestampResult = requireReturnData(\n rawResults,\n calls.length,\n 'Multicall3.getCurrentBlockTimestamp',\n )\n const blockTimestamp = decodeFunctionResult({\n abi: Multicall3Abi,\n functionName: 'getCurrentBlockTimestamp',\n data: timestampResult,\n })\n\n return {\n _meta: {\n blockNumber: aggregateBlockNumber,\n blockHash,\n blockTimestamp,\n },\n results: rawResults.slice(0, calls.length),\n }\n}\n","/**\n * Position and account check functions for the Panoptic v2 SDK.\n *\n * These functions check account liquidatability.\n *\n * @module v2/reads/checks\n */\n\nimport type { Address, PublicClient } from 'viem'\nimport { decodeFunctionResult, encodeFunctionData } from 'viem'\n\nimport { collateralTrackerV2Abi, panopticPoolV2Abi } from '../../../generated'\nimport { tickToSqrtPriceX96 } from '../formatters/tick'\nimport type { BlockMeta } from '../types'\nimport { decodeLeftRightUnsigned } from '../writes/utils'\nimport { type MulticallBlockCall, readBlockAndAggregate, requireReturnData } from './multicallBlock'\n\nconst FP96 = 1n << 96n\nconst Q128 = 1n << 128n\n\nfunction convert0to1(amount: bigint, sqrtPriceX96: bigint): bigint {\n if (sqrtPriceX96 < Q128) {\n return (amount * sqrtPriceX96 * sqrtPriceX96) >> 192n\n }\n const sp2Hi = (sqrtPriceX96 * sqrtPriceX96) >> 64n\n return (amount * sp2Hi) >> 128n\n}\n\nfunction convert1to0(amount: bigint, sqrtPriceX96: bigint): bigint {\n if (sqrtPriceX96 < Q128) {\n const denom = sqrtPriceX96 * sqrtPriceX96\n return (amount * (1n << 192n)) / denom\n }\n const sp2Hi = (sqrtPriceX96 * sqrtPriceX96) >> 64n\n return (amount * (1n << 128n)) / sp2Hi\n}\n\n/**\n * Liquidation check result with detailed margin breakdown.\n *\n * **Denomination**: both per-token pairs hold the gross account total\n * cross-converted to that single token denomination at `atTick`.\n * - `currentMargin0` / `requiredMargin0` are in token0 units\n * - `currentMargin1` / `requiredMargin1` are in token1 units\n *\n * `denominatedInToken` indicates which pair is \"preferred\": 0n when\n * `atTick < 0` (token0), 1n otherwise.\n */\nexport interface LiquidationCheck {\n /** Whether the account is liquidatable */\n isLiquidatable: boolean\n /** Margin shortfall for slot 0 (positive = shortfall, negative = excess) */\n marginShortfall0: bigint\n /** Margin shortfall for slot 1 (positive = shortfall, negative = excess) */\n marginShortfall1: bigint\n /** Current (gross) margin (collateral balance), denominated in token0 */\n currentMargin0: bigint\n /** Current (gross) margin, denominated in token1 */\n currentMargin1: bigint\n /** Required margin (sum of per-position requirements), denominated in token0 */\n requiredMargin0: bigint\n /** Required margin, denominated in token1 */\n requiredMargin1: bigint\n /**\n * Which token the \"preferred\" margin pair is denominated in.\n * 0n = token0 (when atTick < 0), 1n = token1 (when atTick >= 0).\n */\n denominatedInToken: bigint\n /** Tick at which liquidation was checked */\n atTick: bigint\n /** Block metadata */\n _meta: BlockMeta\n}\n\n/**\n * Parameters for isLiquidatable.\n */\nexport interface IsLiquidatableParams {\n /** viem PublicClient */\n client: PublicClient\n /** PanopticPool address */\n poolAddress: Address\n /** Account to check */\n account: Address\n /** TokenIds of open positions */\n tokenIds: bigint[]\n /**\n * Optional: Tick to check liquidation at (defaults to current tick).\n * Note: collateral requirements are evaluated by the contract at the\n * pool's current tick — `atTick` here governs only the cross-token\n * sqrtPrice used to express the totals in a single denomination.\n */\n atTick?: bigint\n /** PanopticQuery address (kept for backwards compatibility; unused). */\n queryAddress?: Address\n /**\n * Optional pre-fetched collateral tracker addresses (saves an RPC).\n * If omitted, they are fetched from the pool.\n */\n collateralAddresses?: { collateralToken0: Address; collateralToken1: Address }\n /** Optional block number for historical queries */\n blockNumber?: bigint\n /** Optional pre-fetched block metadata (skips getBlockMeta RPC call) */\n _meta?: BlockMeta\n}\n\n/**\n * Check if an account is liquidatable with detailed margin breakdown.\n *\n * Sources gross collateral from `CollateralTracker.assetsOf` and per-position\n * required margin from `PanopticPool.getFullPositionsData.collateralRequirements[]`,\n * cross-converted to each token denomination at `atTick`. Loan tokenIds\n * (width=0 shorts) contribute correctly to required margin.\n *\n * @param params - The parameters\n * @returns Liquidation check result with detailed margin breakdown\n *\n * @example\n * ```typescript\n * const result = await isLiquidatable({\n * client,\n * poolAddress,\n * account,\n * tokenIds: [position1, position2],\n * })\n *\n * if (result.isLiquidatable) {\n * console.log('Account is liquidatable!')\n * }\n * ```\n */\nexport async function isLiquidatable(params: IsLiquidatableParams): Promise<LiquidationCheck> {\n const { client, poolAddress, account, tokenIds, atTick, blockNumber } = params\n\n const targetBlockNumber =\n blockNumber ?? params._meta?.blockNumber ?? (await client.getBlockNumber())\n\n // Resolve collateral tracker addresses (immutable; cache-friendly).\n let collateralToken0: Address\n let collateralToken1: Address\n if (params.collateralAddresses) {\n collateralToken0 = params.collateralAddresses.collateralToken0\n collateralToken1 = params.collateralAddresses.collateralToken1\n } else {\n const addrs = await client.multicall({\n contracts: [\n { address: poolAddress, abi: panopticPoolV2Abi, functionName: 'collateralToken0' },\n { address: poolAddress, abi: panopticPoolV2Abi, functionName: 'collateralToken1' },\n ],\n blockNumber: targetBlockNumber,\n allowFailure: false,\n })\n collateralToken0 = addrs[0]\n collateralToken1 = addrs[1]\n }\n\n const calls: MulticallBlockCall[] = []\n const currentTickIndex = atTick === undefined ? calls.length : null\n if (currentTickIndex !== null) {\n calls.push({\n target: poolAddress,\n callData: encodeFunctionData({\n abi: panopticPoolV2Abi,\n functionName: 'getCurrentTick',\n }),\n })\n }\n\n const assets0Index = calls.length\n calls.push({\n target: collateralToken0,\n callData: encodeFunctionData({\n abi: collateralTrackerV2Abi,\n functionName: 'assetsOf',\n args: [account],\n }),\n })\n\n const assets1Index = calls.length\n calls.push({\n target: collateralToken1,\n callData: encodeFunctionData({\n abi: collateralTrackerV2Abi,\n functionName: 'assetsOf',\n args: [account],\n }),\n })\n\n const positionDataIndex = tokenIds.length > 0 ? calls.length : null\n if (positionDataIndex !== null) {\n calls.push({\n target: poolAddress,\n callData: encodeFunctionData({\n abi: panopticPoolV2Abi,\n functionName: 'getFullPositionsData',\n args: [account, true, tokenIds],\n }),\n })\n }\n\n const { _meta, results } = await readBlockAndAggregate({\n client,\n calls,\n blockNumber: targetBlockNumber,\n })\n\n let effectiveTick = atTick\n if (effectiveTick === undefined) {\n if (currentTickIndex === null) {\n throw new Error('Missing current tick Multicall3 result index')\n }\n effectiveTick = BigInt(\n decodeFunctionResult({\n abi: panopticPoolV2Abi,\n functionName: 'getCurrentTick',\n data: requireReturnData(results, currentTickIndex, 'PanopticPool.getCurrentTick'),\n }),\n )\n }\n const assets0 = decodeFunctionResult({\n abi: collateralTrackerV2Abi,\n functionName: 'assetsOf',\n data: requireReturnData(results, assets0Index, 'CollateralTracker.assetsOf token0'),\n })\n const assets1 = decodeFunctionResult({\n abi: collateralTrackerV2Abi,\n functionName: 'assetsOf',\n data: requireReturnData(results, assets1Index, 'CollateralTracker.assetsOf token1'),\n })\n const positionDataResult =\n positionDataIndex === null\n ? null\n : (decodeFunctionResult({\n abi: panopticPoolV2Abi,\n functionName: 'getFullPositionsData',\n data: requireReturnData(results, positionDataIndex, 'PanopticPool.getFullPositionsData'),\n }) as readonly [bigint, bigint, readonly bigint[], readonly bigint[], readonly bigint[]])\n\n let required0Native = 0n\n let required1Native = 0n\n if (positionDataResult) {\n const collateralRequirements = positionDataResult[3]\n for (const packed of collateralRequirements) {\n const decoded = decodeLeftRightUnsigned(packed)\n required0Native += decoded.right\n required1Native += decoded.left\n }\n }\n\n const sqrtPriceX96 = tickToSqrtPriceX96(effectiveTick)\n const currentMargin0 = assets0 + convert1to0(assets1, sqrtPriceX96)\n const requiredMargin0 = required0Native + convert1to0(required1Native, sqrtPriceX96)\n const currentMargin1 = assets1 + convert0to1(assets0, sqrtPriceX96)\n const requiredMargin1 = required1Native + convert0to1(required0Native, sqrtPriceX96)\n\n const marginShortfall0 = requiredMargin0 - currentMargin0\n const marginShortfall1 = requiredMargin1 - currentMargin1\n const denominatedInToken: bigint = sqrtPriceX96 < FP96 ? 0n : 1n\n const isLiquidatableResult =\n denominatedInToken === 0n ? marginShortfall0 > 0n : marginShortfall1 > 0n\n\n return {\n isLiquidatable: isLiquidatableResult,\n marginShortfall0,\n marginShortfall1,\n currentMargin0,\n currentMargin1,\n requiredMargin0,\n requiredMargin1,\n denominatedInToken,\n atTick: effectiveTick,\n _meta,\n }\n}\n","/**\n * Account read functions for the Panoptic v2 SDK.\n *\n * ## Same-Block Guarantee\n *\n * All dynamic data is fetched in a SINGLE multicall to ensure block consistency.\n * Per PLAN.md §6, immutable \"static prefetch\" data (addresses) can be fetched\n * separately and cached - it's not subject to same-block consistency.\n *\n * @module v2/reads/account\n */\n\nimport type { Address, PublicClient } from 'viem'\n\nimport { collateralTrackerV2Abi, panopticPoolV2Abi } from '../../../generated'\nimport { panopticQueryAbi } from '../abis/panopticQuery'\nimport { getBlockMeta } from '../clients/blockMeta'\nimport type {\n AccountCollateral,\n AccountSummaryBasic,\n AccountSummaryRisk,\n BlockMeta,\n LiquidationPrices,\n NetLiquidationValue,\n NetLiquidationValues,\n TokenCollateral,\n} from '../types'\nimport { isLiquidatable } from './checks'\nimport { type PoolMetadata, getPool } from './pool'\nimport { getPositions } from './position'\n\n/**\n * Collateral tracker addresses (immutable, can be cached).\n */\nexport interface CollateralAddresses {\n /** Collateral tracker 0 address */\n collateralToken0: Address\n /** Collateral tracker 1 address */\n collateralToken1: Address\n}\n\n/**\n * Extract collateral tracker addresses from a Pool object.\n *\n * Convenience helper that avoids re-fetching immutable addresses\n * when you already have a Pool from a prior `getPool()` call.\n *\n * @param pool - Pool object from getPool()\n * @returns Collateral tracker addresses\n */\nexport function getCollateralAddresses(pool: {\n collateralTracker0: { address: Address }\n collateralTracker1: { address: Address }\n}): CollateralAddresses {\n return {\n collateralToken0: pool.collateralTracker0.address,\n collateralToken1: pool.collateralTracker1.address,\n }\n}\n\n/**\n * Parameters for getAccountCollateral.\n */\nexport interface GetAccountCollateralParams {\n /** viem PublicClient */\n client: PublicClient\n /** PanopticPool address */\n poolAddress: Address\n /** Account address */\n account: Address\n /** Optional block number for historical queries */\n blockNumber?: bigint\n /** Optional pre-fetched collateral addresses (for caching/optimization) */\n collateralAddresses?: CollateralAddresses\n /** Optional pre-fetched block metadata (skips getBlockMeta RPC call) */\n _meta?: BlockMeta\n}\n\n/**\n * Get collateral data for an account.\n *\n * ## Same-Block Guarantee\n * All dynamic data is fetched in ONE multicall at the target block.\n * Collateral tracker addresses are either provided or fetched separately (static prefetch).\n *\n * @param params - The parameters\n * @returns Account collateral data with block metadata\n */\nexport async function getAccountCollateral(\n params: GetAccountCollateralParams,\n): Promise<AccountCollateral> {\n const { client, poolAddress, account, blockNumber, collateralAddresses } = params\n\n const targetBlockNumber =\n blockNumber ?? params._meta?.blockNumber ?? (await client.getBlockNumber())\n\n // Get collateral tracker addresses (static prefetch if not provided)\n let collateralToken0: Address\n let collateralToken1: Address\n\n if (collateralAddresses) {\n collateralToken0 = collateralAddresses.collateralToken0\n collateralToken1 = collateralAddresses.collateralToken1\n } else {\n // Static prefetch - addresses are immutable\n const addressResults = await client.multicall({\n contracts: [\n {\n address: poolAddress,\n abi: panopticPoolV2Abi,\n functionName: 'collateralToken0',\n },\n {\n address: poolAddress,\n abi: panopticPoolV2Abi,\n functionName: 'collateralToken1',\n },\n ],\n allowFailure: false,\n })\n collateralToken0 = addressResults[0]\n collateralToken1 = addressResults[1]\n }\n\n // SINGLE multicall for ALL dynamic data - ensures same-block consistency\n const [dynamicResults, _meta] = await Promise.all([\n client.multicall({\n contracts: [\n // Token 0 collateral data\n {\n address: collateralToken0,\n abi: collateralTrackerV2Abi,\n functionName: 'balanceOf',\n args: [account],\n },\n {\n address: collateralToken0,\n abi: collateralTrackerV2Abi,\n functionName: 'assetsOf',\n args: [account],\n },\n {\n address: collateralToken0,\n abi: collateralTrackerV2Abi,\n functionName: 'maxWithdraw',\n args: [account],\n },\n // Token 1 collateral data\n {\n address: collateralToken1,\n abi: collateralTrackerV2Abi,\n functionName: 'balanceOf',\n args: [account],\n },\n {\n address: collateralToken1,\n abi: collateralTrackerV2Abi,\n functionName: 'assetsOf',\n args: [account],\n },\n {\n address: collateralToken1,\n abi: collateralTrackerV2Abi,\n functionName: 'maxWithdraw',\n args: [account],\n },\n // Leg count from pool\n {\n address: poolAddress,\n abi: panopticPoolV2Abi,\n functionName: 'numberOfLegs',\n args: [account],\n },\n ],\n blockNumber: targetBlockNumber,\n allowFailure: false,\n }),\n params._meta ?? getBlockMeta({ client, blockNumber: targetBlockNumber }),\n ])\n\n const [shares0, assets0, maxWithdraw0, shares1, assets1, maxWithdraw1, legCount] = dynamicResults\n\n // Calculate locked assets as total - available (maxWithdraw)\n const locked0 = assets0 > maxWithdraw0 ? assets0 - maxWithdraw0 : 0n\n const locked1 = assets1 > maxWithdraw1 ? assets1 - maxWithdraw1 : 0n\n\n const token0: TokenCollateral = {\n assets: assets0,\n shares: shares0,\n availableAssets: maxWithdraw0,\n lockedAssets: locked0,\n }\n\n const token1: TokenCollateral = {\n assets: assets1,\n shares: shares1,\n availableAssets: maxWithdraw1,\n lockedAssets: locked1,\n }\n\n return {\n account,\n poolAddress,\n token0,\n token1,\n legCount,\n _meta,\n }\n}\n\n/**\n * Parameters for getAccountSummaryBasic.\n */\nexport interface GetAccountSummaryBasicParams {\n /** viem PublicClient */\n client: PublicClient\n /** PanopticPool address */\n poolAddress: Address\n /** Account address */\n account: Address\n /** Chain ID */\n chainId: bigint\n /** TokenIds of open positions */\n tokenIds: bigint[]\n /** Optional block number for historical queries */\n blockNumber?: bigint\n /** Optional pre-fetched pool metadata (for caching/optimization) */\n poolMetadata?: PoolMetadata\n /** Optional pre-fetched block metadata (skips getBlockMeta RPC call) */\n _meta?: BlockMeta\n}\n\n/**\n * Parameters for getAccountSummaryRisk.\n */\nexport interface GetAccountSummaryRiskParams extends GetAccountSummaryBasicParams {\n /** PanopticQuery address (required for risk fields) */\n queryAddress: Address\n /** Optional: Tick to calculate risk metrics at (defaults to current tick) */\n atTick?: bigint\n /** Optional: Whether to include pending premium in NLV */\n includePendingPremium?: boolean\n}\n\ninterface AccountSummaryCoreData {\n pool: Awaited<ReturnType<typeof getPool>>\n collateral: AccountCollateral\n positions: Awaited<ReturnType<typeof getPositions>>['positions']\n _meta: BlockMeta\n}\n\nasync function getAccountSummaryCore(\n params: GetAccountSummaryBasicParams,\n): Promise<AccountSummaryCoreData> {\n const { client, poolAddress, account, chainId, tokenIds, blockNumber, poolMetadata } = params\n\n const targetBlockNumber =\n blockNumber ?? params._meta?.blockNumber ?? (await client.getBlockNumber())\n const sharedMeta =\n params._meta ?? (await getBlockMeta({ client, blockNumber: targetBlockNumber }))\n\n const collateralAddresses = poolMetadata\n ? {\n collateralToken0: poolMetadata.collateralToken0Address,\n collateralToken1: poolMetadata.collateralToken1Address,\n }\n : undefined\n\n const [pool, collateral, { positions }] = await Promise.all([\n getPool({\n client,\n poolAddress,\n chainId,\n blockNumber: targetBlockNumber,\n poolMetadata,\n _meta: sharedMeta,\n }),\n getAccountCollateral({\n client,\n poolAddress,\n account,\n blockNumber: targetBlockNumber,\n collateralAddresses,\n _meta: sharedMeta,\n }),\n getPositions({\n client,\n poolAddress,\n owner: account,\n tokenIds,\n blockNumber: targetBlockNumber,\n _meta: sharedMeta,\n }),\n ])\n\n return {\n pool,\n collateral,\n positions,\n _meta: sharedMeta,\n }\n}\n\n/**\n * Get base account summary data for UI dashboards.\n *\n * ## Same-Block Guarantee\n * Uses the same blockNumber for pool, collateral, and position reads.\n *\n * @param params - The parameters\n * @returns Base account summary with block metadata\n */\nexport async function getAccountSummaryBasic(\n params: GetAccountSummaryBasicParams,\n): Promise<AccountSummaryBasic> {\n const { account } = params\n const { pool, collateral, positions, _meta } = await getAccountSummaryCore(params)\n\n return {\n account,\n pool,\n collateral,\n positions,\n healthStatus: pool.healthStatus,\n networkMismatch: false, // Requires wallet context, not available in read functions\n _meta,\n }\n}\n\n/**\n * Get risk-focused account summary including helper-dependent fields.\n *\n * ## Same-Block Guarantee\n * Uses one block target for all pool/collateral/position/risk reads.\n *\n * @param params - The parameters\n * @returns Risk-focused account summary with block metadata\n */\nexport async function getAccountSummaryRisk(\n params: GetAccountSummaryRiskParams,\n): Promise<AccountSummaryRisk> {\n const {\n client,\n poolAddress,\n account,\n tokenIds,\n queryAddress,\n atTick,\n includePendingPremium = true,\n blockNumber,\n } = params\n\n const targetBlockNumber =\n blockNumber ?? params._meta?.blockNumber ?? (await client.getBlockNumber())\n const sharedMeta =\n params._meta ?? (await getBlockMeta({ client, blockNumber: targetBlockNumber }))\n\n const [{ pool, collateral, positions }, nlv, liquidationCheck, liquidationPrices] =\n await Promise.all([\n getAccountSummaryCore({\n ...params,\n blockNumber: targetBlockNumber,\n _meta: sharedMeta,\n }),\n getNetLiquidationValue({\n client,\n poolAddress,\n account,\n tokenIds,\n atTick,\n includePendingPremium,\n queryAddress,\n blockNumber: targetBlockNumber,\n _meta: sharedMeta,\n }),\n isLiquidatable({\n client,\n poolAddress,\n account,\n tokenIds,\n atTick,\n queryAddress,\n blockNumber: targetBlockNumber,\n _meta: sharedMeta,\n }),\n getLiquidationPrices({\n client,\n poolAddress,\n account,\n tokenIds,\n queryAddress,\n blockNumber: targetBlockNumber,\n _meta: sharedMeta,\n }),\n ])\n\n const totalGreeks = {\n value: 0n,\n delta: 0n,\n gamma: 0n,\n }\n\n const maintenanceMargin0 = liquidationCheck.requiredMargin0\n const maintenanceMargin1 = liquidationCheck.requiredMargin1\n const marginExcess0 = liquidationCheck.currentMargin0 - liquidationCheck.requiredMargin0\n const marginExcess1 = liquidationCheck.currentMargin1 - liquidationCheck.requiredMargin1\n\n return {\n account,\n pool,\n collateral,\n positions,\n totalGreeks,\n netLiquidationValue0: nlv.value0,\n netLiquidationValue1: nlv.value1,\n maintenanceMargin0,\n maintenanceMargin1,\n marginExcess0,\n marginExcess1,\n marginShortfall0: liquidationCheck.marginShortfall0,\n marginShortfall1: liquidationCheck.marginShortfall1,\n currentMargin0: liquidationCheck.currentMargin0,\n currentMargin1: liquidationCheck.currentMargin1,\n isLiquidatable: liquidationCheck.isLiquidatable,\n liquidationPrices,\n healthStatus: pool.healthStatus,\n networkMismatch: false, // Requires wallet context, not available in read functions\n _meta: sharedMeta,\n }\n}\n\n/**\n * Parameters for getNetLiquidationValue.\n */\nexport interface GetNetLiquidationValueParams {\n /** viem PublicClient */\n client: PublicClient\n /** PanopticPool address */\n poolAddress: Address\n /** Account address */\n account: Address\n /** TokenIds of open positions */\n tokenIds: bigint[]\n /** Optional: Tick to calculate NLV at (defaults to current tick) */\n atTick?: bigint\n /** Optional: Whether to include pending premium */\n includePendingPremium?: boolean\n /** PanopticQuery address (required) */\n queryAddress: Address\n /** Optional block number for historical queries */\n blockNumber?: bigint\n /** Optional pre-fetched block metadata (skips getBlockMeta RPC call) */\n _meta?: BlockMeta\n}\n\n/**\n * Get net liquidation value for an account.\n *\n * ## Same-Block Guarantee\n * Tick and NLV are queried at the same target block.\n *\n * Requires PanopticQuery for accurate value and premium accounting.\n *\n * @param params - The parameters\n * @returns Net liquidation value with block metadata\n */\nexport async function getNetLiquidationValue(\n params: GetNetLiquidationValueParams,\n): Promise<NetLiquidationValue> {\n const {\n client,\n poolAddress,\n account,\n tokenIds,\n atTick,\n includePendingPremium = true,\n queryAddress,\n blockNumber,\n } = params\n\n const targetBlockNumber =\n blockNumber ?? params._meta?.blockNumber ?? (await client.getBlockNumber())\n\n // Skip getCurrentTick RPC call when atTick is provided\n const [currentTickResult, _meta] = await Promise.all([\n atTick != null\n ? Promise.resolve(atTick)\n : client\n .readContract({\n address: poolAddress,\n abi: panopticPoolV2Abi,\n functionName: 'getCurrentTick',\n blockNumber: targetBlockNumber,\n })\n .then((r) => BigInt(r)),\n params._meta ?? getBlockMeta({ client, blockNumber: targetBlockNumber }),\n ])\n\n const effectiveTick = currentTickResult\n\n // PanopticQuery only exposes the int24[] overload; query a single tick and unwrap.\n const result = await client.readContract({\n address: queryAddress,\n abi: panopticQueryAbi,\n functionName: 'getNetLiquidationValue',\n args: [poolAddress, account, includePendingPremium, tokenIds, [Number(effectiveTick)]],\n blockNumber: targetBlockNumber,\n })\n\n const [values0, values1] = result\n const value0 = values0[0]\n const value1 = values1[0]\n\n return {\n value0,\n value1,\n atTick: effectiveTick,\n includedPendingPremium: includePendingPremium,\n _meta,\n }\n}\n\n/**\n * Parameters for getNetLiquidationValues (batch/multi-tick).\n */\nexport interface GetNetLiquidationValuesParams {\n /** viem PublicClient */\n client: PublicClient\n /** PanopticPool address */\n poolAddress: Address\n /** Account address */\n account: Address\n /** TokenIds of open positions */\n tokenIds: bigint[]\n /** Ticks to calculate NLV at */\n atTicks: bigint[]\n /** Optional: Whether to include pending premium */\n includePendingPremium?: boolean\n /** PanopticQuery address (required) */\n queryAddress: Address\n /** Optional block number for historical queries */\n blockNumber?: bigint\n /** Optional pre-fetched block metadata (skips getBlockMeta RPC call) */\n _meta?: BlockMeta\n}\n\n/**\n * Get net liquidation values at multiple ticks in a single contract call.\n *\n * Uses the `int24[]` overload of `getNetLiquidationValue` on PanopticQuery.\n *\n * @param params - The parameters\n * @returns Net liquidation values with block metadata\n */\nexport async function getNetLiquidationValues(\n params: GetNetLiquidationValuesParams,\n): Promise<NetLiquidationValues> {\n const {\n client,\n poolAddress,\n account,\n tokenIds,\n atTicks,\n includePendingPremium = true,\n queryAddress,\n blockNumber,\n } = params\n\n const targetBlockNumber =\n blockNumber ?? params._meta?.blockNumber ?? (await client.getBlockNumber())\n\n // Use an isolated ABI with only the int24[] overload to avoid viem overload ambiguity\n const batchNlvAbi = [\n {\n type: 'function' as const,\n name: 'getNetLiquidationValue' as const,\n inputs: [\n { name: 'pool', type: 'address' as const },\n { name: 'account', type: 'address' as const },\n { name: 'includePendingPremium', type: 'bool' as const },\n { name: 'positionIdList', type: 'uint256[]' as const },\n { name: 'atTicks', type: 'int24[]' as const },\n ],\n outputs: [\n { name: 'value0', type: 'int256[]' as const },\n { name: 'value1', type: 'int256[]' as const },\n ],\n stateMutability: 'view' as const,\n },\n ] as const\n\n const [result, _meta] = await Promise.all([\n client.readContract({\n address: queryAddress,\n abi: batchNlvAbi,\n functionName: 'getNetLiquidationValue',\n args: [poolAddress, account, includePendingPremium, tokenIds, atTicks.map((t) => Number(t))],\n blockNumber: targetBlockNumber,\n }),\n params._meta ?? getBlockMeta({ client, blockNumber: targetBlockNumber }),\n ])\n\n const [values0, values1] = result\n\n return {\n values0: [...values0],\n values1: [...values1],\n atTicks,\n _meta,\n }\n}\n\n/**\n * Parameters for getLiquidationPrices.\n */\nexport interface GetLiquidationPricesParams {\n /** viem PublicClient */\n client: PublicClient\n /** PanopticPool address */\n poolAddress: Address\n /** Account address */\n account: Address\n /** TokenIds of open positions */\n tokenIds: bigint[]\n /** PanopticQuery address (required) */\n queryAddress: Address\n /** Optional block number for historical queries */\n blockNumber?: bigint\n /** Optional pre-fetched block metadata (skips getBlockMeta RPC call) */\n _meta?: BlockMeta\n}\n\n/**\n * Get liquidation prices for an account.\n *\n * ## Same-Block Guarantee\n * Liquidation price query is made at a single block.\n *\n * @param params - The parameters\n * @returns Liquidation prices with block metadata\n */\nexport async function getLiquidationPrices(\n params: GetLiquidationPricesParams,\n): Promise<LiquidationPrices> {\n const { client, poolAddress, account, tokenIds, queryAddress, blockNumber } = params\n\n const targetBlockNumber =\n blockNumber ?? params._meta?.blockNumber ?? (await client.getBlockNumber())\n\n // MIN_TICK and MAX_TICK indicate no liquidation at that boundary\n const MIN_TICK = -887272n\n const MAX_TICK = 887272n\n\n const [result, _meta] = await Promise.all([\n client.readContract({\n address: queryAddress,\n abi: panopticQueryAbi,\n functionName: 'getLiquidationPrices',\n args: [poolAddress, account, tokenIds],\n blockNumber: targetBlockNumber,\n }),\n params._meta ?? getBlockMeta({ client, blockNumber: targetBlockNumber }),\n ])\n\n // Convert from number (abitype default for int24) to bigint (viem runtime type)\n const liqPriceDown = BigInt(result[0])\n const liqPriceUp = BigInt(result[1])\n\n return {\n lowerTick: liqPriceDown === MIN_TICK ? null : liqPriceDown,\n upperTick: liqPriceUp === MAX_TICK ? null : liqPriceUp,\n isLiquidatable: liqPriceDown !== MIN_TICK || liqPriceUp !== MAX_TICK,\n _meta,\n }\n}\n","/**\n * Collateral read functions for the Panoptic v2 SDK.\n *\n * ## Same-Block Guarantee\n *\n * All dynamic data is fetched in a SINGLE multicall to ensure block consistency.\n * Per PLAN.md §6, immutable \"static prefetch\" data (addresses, symbols, decimals)\n * can be fetched separately and cached - it's not subject to same-block consistency.\n *\n * @module v2/reads/collateral\n */\n\nimport type { Address, PublicClient } from 'viem'\n\nimport { collateralTrackerV2Abi, panopticPoolV2Abi } from '../../../generated'\nimport { getBlockMeta } from '../clients/blockMeta'\nimport type { BlockMeta, CollateralTracker, CurrentRates } from '../types'\n\nconst SECONDS_PER_YEAR = 31_536_000n\n\n// ERC20 minimal ABI for token metadata\nconst erc20Abi = [\n {\n type: 'function',\n name: 'symbol',\n inputs: [],\n outputs: [{ type: 'string' }],\n stateMutability: 'view',\n },\n {\n type: 'function',\n name: 'decimals',\n inputs: [],\n outputs: [{ type: 'uint8' }],\n stateMutability: 'view',\n },\n] as const\n\n/**\n * Pre-fetched collateral tracker metadata (immutable, can be cached).\n */\nexport interface CollateralTrackerMetadata {\n /** Collateral tracker address */\n address: Address\n /** Underlying asset address */\n assetAddress: Address\n /** Token symbol */\n symbol: string\n /** Token decimals */\n decimals: bigint\n}\n\n/**\n * Parameters for getCollateralData.\n */\nexport interface GetCollateralDataParams {\n /** viem PublicClient */\n client: PublicClient\n /** PanopticPool address */\n poolAddress: Address\n /** Which token's collateral tracker to query (0 or 1) */\n tokenIndex: 0 | 1\n /** Optional block number for historical queries */\n blockNumber?: bigint\n /** Optional pre-fetched collateral tracker metadata (for caching/optimization) */\n trackerMetadata?: CollateralTrackerMetadata\n /** Optional pre-fetched block metadata (skips getBlockMeta RPC call) */\n _meta?: BlockMeta\n}\n\n/**\n * Get collateral tracker data for a specific token.\n *\n * ## Same-Block Guarantee\n * All dynamic data is fetched in ONE multicall at the target block.\n * Static metadata (address, symbol, decimals) is either provided or fetched separately.\n *\n * @param params - The parameters\n * @returns Collateral tracker data with block metadata\n */\nexport async function getCollateralData(\n params: GetCollateralDataParams,\n): Promise<CollateralTracker & { _meta: BlockMeta }> {\n const { client, poolAddress, tokenIndex, blockNumber, trackerMetadata } = params\n\n const targetBlockNumber =\n blockNumber ?? params._meta?.blockNumber ?? (await client.getBlockNumber())\n\n // If metadata is provided, we only need ONE multicall for dynamic data\n if (trackerMetadata) {\n const [dynamicResults, _meta] = await Promise.all([\n client.multicall({\n contracts: [\n {\n address: trackerMetadata.address,\n abi: collateralTrackerV2Abi,\n functionName: 'getPoolData',\n },\n {\n address: trackerMetadata.address,\n abi: collateralTrackerV2Abi,\n functionName: 'totalSupply',\n },\n {\n address: trackerMetadata.address,\n abi: collateralTrackerV2Abi,\n functionName: 'interestRate',\n },\n ],\n blockNumber: targetBlockNumber,\n allowFailure: false,\n }),\n params._meta ?? getBlockMeta({ client, blockNumber: targetBlockNumber }),\n ])\n\n const [poolData, totalShares, interestRate] = dynamicResults\n const [depositedAssets, insideAMM, creditedShares, utilization] = poolData\n const totalAssets = depositedAssets + insideAMM\n\n const borrowRate = BigInt(interestRate) * SECONDS_PER_YEAR\n const supplyRate = (borrowRate * utilization) / 10000n\n\n return {\n address: trackerMetadata.address,\n token: trackerMetadata.assetAddress,\n symbol: trackerMetadata.symbol,\n decimals: trackerMetadata.decimals,\n totalAssets,\n insideAMM,\n creditedShares,\n totalShares,\n utilization,\n borrowRate,\n supplyRate,\n _meta,\n }\n }\n\n // Without metadata, fetch everything (original structure for backwards compatibility)\n // 1. Get tracker address (static)\n const collateralTrackerAddress = await client.readContract({\n address: poolAddress,\n abi: panopticPoolV2Abi,\n functionName: tokenIndex === 0 ? 'collateralToken0' : 'collateralToken1',\n })\n\n // 2. Get asset + dynamic data in one multicall (same-block guarantee for dynamic data)\n const [trackerData, _meta] = await Promise.all([\n client.multicall({\n contracts: [\n {\n address: collateralTrackerAddress,\n abi: collateralTrackerV2Abi,\n functionName: 'asset',\n },\n {\n address: collateralTrackerAddress,\n abi: collateralTrackerV2Abi,\n functionName: 'getPoolData',\n },\n {\n address: collateralTrackerAddress,\n abi: collateralTrackerV2Abi,\n functionName: 'totalSupply',\n },\n {\n address: collateralTrackerAddress,\n abi: collateralTrackerV2Abi,\n functionName: 'interestRate',\n },\n ],\n blockNumber: targetBlockNumber,\n allowFailure: false,\n }),\n params._meta ?? getBlockMeta({ client, blockNumber: targetBlockNumber }),\n ])\n\n const [assetAddress, poolData, totalShares, interestRate] = trackerData\n\n // 3. Get token metadata (static - can be cached)\n const [symbol, decimals] = await client.multicall({\n contracts: [\n {\n address: assetAddress,\n abi: erc20Abi,\n functionName: 'symbol',\n },\n {\n address: assetAddress,\n abi: erc20Abi,\n functionName: 'decimals',\n },\n ],\n allowFailure: false,\n })\n\n // poolData returns: (depositedAssets, insideAMM, creditedShares, currentPoolUtilization)\n const [depositedAssets, insideAMM, creditedShares, utilization] = poolData\n const totalAssets = depositedAssets + insideAMM\n\n // Annualize rates: interestRate() returns WAD/s\n const borrowRate = BigInt(interestRate) * SECONDS_PER_YEAR\n const supplyRate = (borrowRate * utilization) / 10000n\n\n return {\n address: collateralTrackerAddress,\n token: assetAddress,\n symbol,\n decimals: BigInt(decimals),\n totalAssets,\n insideAMM,\n creditedShares,\n totalShares,\n utilization,\n borrowRate,\n supplyRate,\n _meta,\n }\n}\n\n/**\n * Collateral tracker addresses (immutable, can be cached).\n */\nexport interface CollateralAddresses {\n /** Collateral tracker 0 address */\n collateralToken0: Address\n /** Collateral tracker 1 address */\n collateralToken1: Address\n}\n\n/**\n * Parameters for getCurrentRates.\n */\nexport interface GetCurrentRatesParams {\n /** viem PublicClient */\n client: PublicClient\n /** PanopticPool address */\n poolAddress: Address\n /** Optional block number for historical queries */\n blockNumber?: bigint\n /** Optional pre-fetched collateral tracker addresses (for caching/optimization) */\n collateralAddresses?: CollateralAddresses\n /** Optional pre-fetched block metadata (skips getBlockMeta RPC call) */\n _meta?: BlockMeta\n}\n\n/**\n * Get current interest rates for both tokens.\n *\n * ## Same-Block Guarantee\n * All dynamic data is fetched in ONE multicall at the target block.\n * Collateral tracker addresses are either provided or fetched separately (static prefetch).\n *\n * @param params - The parameters\n * @returns Current rates with block metadata\n */\nexport async function getCurrentRates(params: GetCurrentRatesParams): Promise<CurrentRates> {\n const { client, poolAddress, blockNumber, collateralAddresses } = params\n\n const targetBlockNumber =\n blockNumber ?? params._meta?.blockNumber ?? (await client.getBlockNumber())\n\n // Get collateral tracker addresses (static prefetch if not provided)\n let collateralToken0: Address\n let collateralToken1: Address\n\n if (collateralAddresses) {\n collateralToken0 = collateralAddresses.collateralToken0\n collateralToken1 = collateralAddresses.collateralToken1\n } else {\n // Static prefetch - addresses are immutable\n const addressResults = await client.multicall({\n contracts: [\n {\n address: poolAddress,\n abi: panopticPoolV2Abi,\n functionName: 'collateralToken0',\n },\n {\n address: poolAddress,\n abi: panopticPoolV2Abi,\n functionName: 'collateralToken1',\n },\n ],\n allowFailure: false,\n })\n collateralToken0 = addressResults[0]\n collateralToken1 = addressResults[1]\n }\n\n // SINGLE multicall for ALL dynamic data - ensures same-block consistency\n const [rateData, _meta] = await Promise.all([\n client.multicall({\n contracts: [\n {\n address: collateralToken0,\n abi: collateralTrackerV2Abi,\n functionName: 'interestRate',\n },\n {\n address: collateralToken0,\n abi: collateralTrackerV2Abi,\n functionName: 'getPoolData',\n },\n {\n address: collateralToken1,\n abi: collateralTrackerV2Abi,\n functionName: 'interestRate',\n },\n {\n address: collateralToken1,\n abi: collateralTrackerV2Abi,\n functionName: 'getPoolData',\n },\n ],\n blockNumber: targetBlockNumber,\n allowFailure: false,\n }),\n params._meta ?? getBlockMeta({ client, blockNumber: targetBlockNumber }),\n ])\n\n const [interestRate0, poolData0, interestRate1, poolData1] = rateData\n\n // Extract utilization from pool data\n const utilization0 = poolData0[3]\n const utilization1 = poolData1[3]\n\n // Annualize rates: interestRate() returns WAD/s\n const borrowRate0 = BigInt(interestRate0) * SECONDS_PER_YEAR\n const borrowRate1 = BigInt(interestRate1) * SECONDS_PER_YEAR\n\n // Supply rate = borrow rate * utilization (utilization is in bps, so /10000)\n const supplyRate0 = (borrowRate0 * utilization0) / 10000n\n const supplyRate1 = (borrowRate1 * utilization1) / 10000n\n\n return {\n borrowRate0,\n supplyRate0,\n borrowRate1,\n supplyRate1,\n _meta,\n }\n}\n\n// ─── Interest State (per-user borrows) ───────────────────────────────────────\n\n/**\n * Per-user interest state for a single collateral tracker.\n */\nexport interface TokenInterestState {\n /** User's borrow index snapshot (int128) */\n userBorrowIndex: bigint\n /** User's net borrows: positive = borrowing, negative = net supplying (int128) */\n netBorrows: bigint\n}\n\n/**\n * Interest state for both tokens in a Panoptic pool.\n */\nexport interface InterestState {\n /** Token 0 interest state */\n token0: TokenInterestState\n /** Token 1 interest state */\n token1: TokenInterestState\n /** Block metadata */\n _meta: BlockMeta\n}\n\n/**\n * Parameters for getInterestState.\n */\nexport interface GetInterestStateParams {\n /** viem PublicClient */\n client: PublicClient\n /** PanopticPool address */\n poolAddress: Address\n /** Account address to query */\n account: Address\n /** Optional block number for historical queries */\n blockNumber?: bigint\n /** Optional pre-fetched collateral tracker addresses */\n collateralAddresses?: CollateralAddresses\n /** Optional pre-fetched block metadata */\n _meta?: BlockMeta\n}\n\n/**\n * Get per-user interest state (borrow index + net borrows) for both tokens.\n *\n * Calls `collateralTracker.interestState(user)` on both trackers in a single multicall.\n *\n * @param params - The parameters\n * @returns Interest state for both tokens with block metadata\n */\nexport async function getInterestState(params: GetInterestStateParams): Promise<InterestState> {\n const { client, poolAddress, account, blockNumber, collateralAddresses } = params\n\n const targetBlockNumber =\n blockNumber ?? params._meta?.blockNumber ?? (await client.getBlockNumber())\n\n let collateralToken0: Address\n let collateralToken1: Address\n\n if (collateralAddresses) {\n collateralToken0 = collateralAddresses.collateralToken0\n collateralToken1 = collateralAddresses.collateralToken1\n } else {\n const addressResults = await client.multicall({\n contracts: [\n {\n address: poolAddress,\n abi: panopticPoolV2Abi,\n functionName: 'collateralToken0',\n },\n {\n address: poolAddress,\n abi: panopticPoolV2Abi,\n functionName: 'collateralToken1',\n },\n ],\n allowFailure: false,\n })\n collateralToken0 = addressResults[0]\n collateralToken1 = addressResults[1]\n }\n\n const [results, _meta] = await Promise.all([\n client.multicall({\n contracts: [\n {\n address: collateralToken0,\n abi: collateralTrackerV2Abi,\n functionName: 'interestState',\n args: [account],\n },\n {\n address: collateralToken1,\n abi: collateralTrackerV2Abi,\n functionName: 'interestState',\n args: [account],\n },\n ],\n blockNumber: targetBlockNumber,\n allowFailure: false,\n }),\n params._meta ?? getBlockMeta({ client, blockNumber: targetBlockNumber }),\n ])\n\n const [state0, state1] = results\n\n return {\n token0: { userBorrowIndex: state0[0], netBorrows: state0[1] },\n token1: { userBorrowIndex: state1[0], netBorrows: state1[1] },\n _meta,\n }\n}\n","/**\n * Token amount formatters and parsers.\n *\n * All formatters require explicit precision - no hidden defaults.\n *\n * @module v2/formatters/amount\n */\n\nimport type { TokenFlow } from '../types'\n\n/**\n * Format a raw token amount to a human-readable string.\n *\n * @param amount - The amount in smallest units (e.g., wei)\n * @param decimals - Token decimals (e.g., 18n for WETH, 6n for USDC)\n * @param precision - Number of decimal places to display\n * @returns Formatted string\n *\n * @example\n * ```typescript\n * formatTokenAmount(1500000000000000000n, 18n, 4n) // \"1.5000\"\n * formatTokenAmount(1500000000000000000n, 18n, 2n) // \"1.50\"\n * formatTokenAmount(1500000n, 6n, 2n) // \"1.50\" (USDC)\n * formatTokenAmount(-500000000000000000n, 18n, 4n) // \"-0.5000\"\n * ```\n */\nexport function formatTokenAmount(amount: bigint, decimals: bigint, precision: bigint): string {\n const isNegative = amount < 0n\n const absAmount = isNegative ? -amount : amount\n const divisor = 10n ** decimals\n const integerPart = absAmount / divisor\n const fractionalPart = absAmount % divisor\n\n // Build fractional string with proper padding\n const fullFractionalStr = fractionalPart.toString().padStart(Number(decimals), '0')\n const truncatedFractionalStr = fullFractionalStr.slice(0, Number(precision))\n const paddedFractionalStr = truncatedFractionalStr.padEnd(Number(precision), '0')\n\n const sign = isNegative ? '-' : ''\n return precision > 0n ? `${sign}${integerPart}.${paddedFractionalStr}` : `${sign}${integerPart}`\n}\n\n/**\n * Format a token amount with a sign prefix (+/-) for non-zero values.\n * Useful for displaying PnL, deltas, or changes.\n *\n * @param amount - The amount in smallest units\n * @param decimals - Token decimals\n * @param precision - Number of decimal places to display\n * @returns Formatted string with sign prefix\n *\n * @example\n * ```typescript\n * formatTokenAmountSigned(1500000000000000000n, 18n, 4n) // \"+1.5000\"\n * formatTokenAmountSigned(-500000000000000000n, 18n, 4n) // \"-0.5000\"\n * formatTokenAmountSigned(0n, 18n, 4n) // \"0.0000\"\n * ```\n */\nexport function formatTokenAmountSigned(\n amount: bigint,\n decimals: bigint,\n precision: bigint,\n): string {\n const formatted = formatTokenAmount(amount, decimals, precision)\n if (amount > 0n) {\n return `+${formatted}`\n }\n return formatted\n}\n\n/**\n * Parse a human-readable token amount string to raw units.\n *\n * @param amount - Human-readable amount string (e.g., \"1.5\")\n * @param decimals - Token decimals\n * @returns Amount in smallest units\n *\n * @example\n * ```typescript\n * parseTokenAmount(\"1.5\", 18n) // 1500000000000000000n\n * parseTokenAmount(\"1.5\", 6n) // 1500000n (USDC)\n * parseTokenAmount(\"100\", 18n) // 100000000000000000000n\n * parseTokenAmount(\"-0.5\", 18n) // -500000000000000000n\n * ```\n */\nexport function parseTokenAmount(amount: string, decimals: bigint): bigint {\n const trimmed = amount.trim()\n const isNegative = trimmed.startsWith('-')\n const cleanAmount = isNegative ? trimmed.slice(1) : trimmed\n\n const [integerStr, fractionalStr = ''] = cleanAmount.split('.')\n const paddedFractional = fractionalStr.padEnd(Number(decimals), '0').slice(0, Number(decimals))\n\n const integerPart = BigInt(integerStr || '0') * 10n ** decimals\n const fractionalPart = BigInt(paddedFractional || '0')\n\n const result = integerPart + fractionalPart\n return isNegative ? -result : result\n}\n\n/**\n * Format a token delta amount with a sign prefix (+/-) for non-zero values.\n * Alias for formatTokenAmountSigned, useful for clarity at call sites.\n *\n * @param amount - The delta amount in smallest units\n * @param decimals - Token decimals\n * @param precision - Number of decimal places to display\n * @returns Formatted string with sign prefix\n */\nexport function formatTokenDelta(amount: bigint, decimals: bigint, precision: bigint): string {\n return formatTokenAmountSigned(amount, decimals, precision)\n}\n\n/**\n * Format token flow deltas and balances from simulation results.\n *\n * @param flow - Token flow data\n * @param decimals0 - Token0 decimals\n * @param decimals1 - Token1 decimals\n * @param precision0 - Precision for token0 formatting\n * @param precision1 - Precision for token1 formatting\n * @returns Formatted token flow strings\n */\nexport function formatTokenFlow(\n flow: TokenFlow,\n decimals0: bigint,\n decimals1: bigint,\n precision0: bigint,\n precision1: bigint,\n): {\n delta0: string\n delta1: string\n balanceBefore0: string\n balanceBefore1: string\n balanceAfter0: string\n balanceAfter1: string\n} {\n return {\n delta0: formatTokenAmountSigned(flow.delta0, decimals0, precision0),\n delta1: formatTokenAmountSigned(flow.delta1, decimals1, precision1),\n balanceBefore0: formatTokenAmount(flow.balanceBefore0, decimals0, precision0),\n balanceBefore1: formatTokenAmount(flow.balanceBefore1, decimals1, precision1),\n balanceAfter0: formatTokenAmount(flow.balanceAfter0, decimals0, precision0),\n balanceAfter1: formatTokenAmount(flow.balanceAfter1, decimals1, precision1),\n }\n}\n","/**\n * WAD-scaled value formatters.\n *\n * WAD is a fixed-point representation where 1e18 = 1.0.\n * Used extensively in DeFi for representing ratios, prices, and multipliers.\n *\n * @module v2/formatters/wad\n */\n\nimport { formatTokenAmount } from './amount'\n\n/**\n * Format a WAD-scaled value (1e18 = 1.0).\n *\n * @param wad - WAD-scaled value\n * @param precision - Number of decimal places to display\n * @returns Formatted string\n *\n * @example\n * ```typescript\n * formatWad(1220000000000000000n, 2n) // \"1.22\"\n * formatWad(1220000000000000000n, 4n) // \"1.2200\"\n * formatWad(1000000000000000000n, 2n) // \"1.00\"\n * formatWad(500000000000000000n, 2n) // \"0.50\"\n * ```\n */\nexport function formatWad(wad: bigint, precision: bigint): string {\n return formatTokenAmount(wad, 18n, precision)\n}\n\n/**\n * Format a WAD-scaled value with sign prefix (+/-) for non-zero values.\n *\n * @param wad - WAD-scaled value\n * @param precision - Number of decimal places to display\n * @returns Formatted string with sign prefix\n *\n * @example\n * ```typescript\n * formatWadSigned(1220000000000000000n, 2n) // \"+1.22\"\n * formatWadSigned(-500000000000000000n, 2n) // \"-0.50\"\n * formatWadSigned(0n, 2n) // \"0.00\"\n * ```\n */\nexport function formatWadSigned(wad: bigint, precision: bigint): string {\n const formatted = formatWad(wad, precision)\n if (wad > 0n) {\n return `+${formatted}`\n }\n return formatted\n}\n\n/**\n * Format a WAD-scaled value as a percentage string.\n *\n * @param wad - WAD-scaled value\n * @param precision - Number of decimal places to display\n * @returns Formatted percentage string\n *\n * @example\n * ```typescript\n * formatWadPercent(50000000000000000n, 2n) // \"5.00%\"\n * formatWadPercent(1000000000000000000n, 1n) // \"100.0%\"\n * ```\n */\nexport function formatWadPercent(wad: bigint, precision: bigint): string {\n return `${formatTokenAmount(wad * 100n, 18n, precision)}%`\n}\n\n/**\n * Format an annualized rate stored as a WAD-scaled value.\n * Alias for formatWadPercent.\n *\n * @param rateWad - Rate in WAD (1e18 = 1.0)\n * @param precision - Number of decimal places to display\n * @returns Formatted percentage string\n */\nexport function formatRateWad(rateWad: bigint, precision: bigint): string {\n return formatWadPercent(rateWad, precision)\n}\n\n/**\n * Parse a decimal string to a WAD-scaled value.\n *\n * @param value - Decimal string (e.g., \"1.5\")\n * @returns WAD-scaled bigint\n *\n * @example\n * ```typescript\n * parseWad(\"1.5\") // 1500000000000000000n\n * parseWad(\"0.5\") // 500000000000000000n\n * parseWad(\"100\") // 100000000000000000000n\n * parseWad(\"-1.22\") // -1220000000000000000n\n * ```\n */\nexport function parseWad(value: string): bigint {\n const trimmed = value.trim()\n const isNegative = trimmed.startsWith('-')\n const cleanValue = isNegative ? trimmed.slice(1) : trimmed\n\n const [integerStr, fractionalStr = ''] = cleanValue.split('.')\n const paddedFractional = fractionalStr.padEnd(18, '0').slice(0, 18)\n\n const integerPart = BigInt(integerStr || '0') * 10n ** 18n\n const fractionalPart = BigInt(paddedFractional || '0')\n\n const result = integerPart + fractionalPart\n return isNegative ? -result : result\n}\n","/**\n * Per-second rate helpers.\n *\n * Collateral tracker rates are returned as WAD-scaled per-second rates.\n * These helpers annualize them for display.\n *\n * @module v2/formatters/rates\n */\n\nimport { formatWadPercent } from './wad'\n\nconst SECONDS_PER_DAY = 86_400n\nconst DAYS_PER_YEAR = 365n\nconst SECONDS_PER_YEAR = SECONDS_PER_DAY * DAYS_PER_YEAR\n\n/**\n * Annualize a per-second WAD-scaled rate to annual WAD.\n *\n * @param ratePerSecondWad - Rate in WAD per second\n * @returns Annualized rate in WAD\n */\nexport function annualizePerSecondRateWad(ratePerSecondWad: bigint): bigint {\n return ratePerSecondWad * SECONDS_PER_YEAR\n}\n\n/**\n * Format a per-second WAD rate as APY percentage text.\n * Uses linear annualization, then formats as WAD percent.\n *\n * @param ratePerSecondWad - Rate in WAD per second\n * @param precision - Decimal places\n * @returns Percentage string, e.g. \"2.41%\"\n */\nexport function formatPerSecondRateWadAsApyPct(\n ratePerSecondWad: bigint,\n precision: bigint,\n): string {\n return formatWadPercent(annualizePerSecondRateWad(ratePerSecondWad), precision)\n}\n\n/**\n * Format a per-second WAD rate as APR percentage text.\n * For this rate model, APR presentation uses the same annualized output.\n *\n * @param ratePerSecondWad - Rate in WAD per second\n * @param precision - Decimal places\n * @returns Percentage string, e.g. \"2.41%\"\n */\nexport function formatPerSecondRateWadAsAprPct(\n ratePerSecondWad: bigint,\n precision: bigint,\n): string {\n return formatWadPercent(annualizePerSecondRateWad(ratePerSecondWad), precision)\n}\n","/**\n * Interest rate model (IRM) reads for Panoptic v2.\n * @module v2/reads/irm\n */\n\nimport type { Address, PublicClient } from 'viem'\n\nimport { collateralTrackerV2Abi, riskEngineAbi } from '../../../generated'\nimport { PanopticValidationError } from '../errors/sdk'\nimport type { IrmCurrent, IrmMarketStateInputs, IrmPoint } from '../types/irm'\nexport type { IrmCurrent, IrmMarketStateInputs, IrmPoint } from '../types/irm'\n\nexport const WAD = 10n ** 18n\nexport const BPS_SCALE = 10_000n\nexport const SECONDS_PER_YEAR = 31_536_000n\nexport const MARKET_EPOCH_SHIFT = 2n\nexport const BORROW_INDEX_BITS = 80n\nexport const MARKET_EPOCH_BITS = 32n\nexport const RATE_AT_TARGET_BITS = 38n\nexport const UNREALIZED_INTEREST_BITS = 106n\n\nconst BORROW_INDEX_SHIFT = 0n\nconst MARKET_EPOCH_FIELD_SHIFT = BORROW_INDEX_BITS\nconst RATE_AT_TARGET_FIELD_SHIFT = BORROW_INDEX_BITS + MARKET_EPOCH_BITS\nconst UNREALIZED_INTEREST_FIELD_SHIFT = RATE_AT_TARGET_FIELD_SHIFT + RATE_AT_TARGET_BITS\nconst MAX_IRM_CURVE_POINTS = 500\n\nconst clampUtilizationBps = (utilizationBps: bigint): bigint => {\n if (utilizationBps < 0n) {\n return 0n\n }\n if (utilizationBps > BPS_SCALE) {\n return BPS_SCALE\n }\n return utilizationBps\n}\n\nconst getMaxValue = (bits: bigint): bigint => (1n << bits) - 1n\n\nconst assertFitsBits = (value: bigint, bits: bigint, fieldName: string): void => {\n if (value < 0n) {\n throw new PanopticValidationError(`${fieldName} must be >= 0`)\n }\n if (value > getMaxValue(bits)) {\n throw new PanopticValidationError(`${fieldName} exceeds ${bits.toString()} bits`)\n }\n}\n\nexport function packMarketState(inputs: IrmMarketStateInputs): bigint {\n const { borrowIndex, lastInteractionTimestamp, rateAtTarget, unrealizedGlobalInterest } = inputs\n const marketEpoch = lastInteractionTimestamp >> MARKET_EPOCH_SHIFT\n\n assertFitsBits(borrowIndex, BORROW_INDEX_BITS, 'borrowIndex')\n assertFitsBits(marketEpoch, MARKET_EPOCH_BITS, 'marketEpoch')\n assertFitsBits(rateAtTarget, RATE_AT_TARGET_BITS, 'rateAtTarget')\n assertFitsBits(unrealizedGlobalInterest, UNREALIZED_INTEREST_BITS, 'unrealizedGlobalInterest')\n\n return (\n (borrowIndex << BORROW_INDEX_SHIFT) +\n (marketEpoch << MARKET_EPOCH_FIELD_SHIFT) +\n (rateAtTarget << RATE_AT_TARGET_FIELD_SHIFT) +\n (unrealizedGlobalInterest << UNREALIZED_INTEREST_FIELD_SHIFT)\n )\n}\n\nexport function utilizationPctToWad(utilizationPct: number): bigint {\n if (!Number.isFinite(utilizationPct)) {\n throw new PanopticValidationError('utilizationPct must be finite')\n }\n if (utilizationPct < 0 || utilizationPct > 100) {\n throw new PanopticValidationError('utilizationPct must be between 0 and 100')\n }\n\n const scaledPct = Math.round(utilizationPct * 1_000_000)\n return (BigInt(scaledPct) * WAD) / 100_000_000n\n}\n\nexport function utilizationBpsToWad(utilizationBps: bigint): bigint {\n return (clampUtilizationBps(utilizationBps) * WAD) / BPS_SCALE\n}\n\nexport function ratePerSecWadToAprPct(ratePerSecWad: bigint): number {\n return (Number(ratePerSecWad) * Number(SECONDS_PER_YEAR) * 100) / Number(WAD)\n}\n\nexport function deriveSupplyRatePerSecWad(\n borrowRatePerSecWad: bigint,\n utilizationWad: bigint,\n): bigint {\n return (borrowRatePerSecWad * utilizationWad) / WAD\n}\n\nexport async function getIrmCurrent(params: {\n client: PublicClient\n collateralTrackerAddress: Address\n blockNumber?: bigint\n}): Promise<IrmCurrent> {\n const { client, collateralTrackerAddress, blockNumber } = params\n const [\n borrowIndex,\n lastInteractionTimestamp,\n rateAtTarget,\n unrealizedGlobalInterest,\n poolData,\n riskEngineAddress,\n ] = await client.multicall({\n contracts: [\n {\n address: collateralTrackerAddress,\n abi: collateralTrackerV2Abi,\n functionName: 'borrowIndex',\n },\n {\n address: collateralTrackerAddress,\n abi: collateralTrackerV2Abi,\n functionName: 'lastInteractionTimestamp',\n },\n {\n address: collateralTrackerAddress,\n abi: collateralTrackerV2Abi,\n functionName: 'rateAtTarget',\n },\n {\n address: collateralTrackerAddress,\n abi: collateralTrackerV2Abi,\n functionName: 'unrealizedGlobalInterest',\n },\n {\n address: collateralTrackerAddress,\n abi: collateralTrackerV2Abi,\n functionName: 'getPoolData',\n },\n {\n address: collateralTrackerAddress,\n abi: collateralTrackerV2Abi,\n functionName: 'riskEngine',\n },\n ],\n blockNumber,\n allowFailure: false,\n })\n\n const currentUtilizationBps = clampUtilizationBps(poolData[3])\n const currentUtilizationWad = utilizationBpsToWad(currentUtilizationBps)\n const currentUtilizationPct = Number(currentUtilizationBps) / 100\n\n const marketStatePacked = packMarketState({\n borrowIndex,\n lastInteractionTimestamp,\n rateAtTarget,\n unrealizedGlobalInterest,\n })\n\n const borrowRatePerSecWad = await client.readContract({\n address: riskEngineAddress,\n abi: riskEngineAbi,\n functionName: 'interestRate',\n args: [currentUtilizationWad, marketStatePacked],\n blockNumber,\n })\n\n const supplyRatePerSecWad = deriveSupplyRatePerSecWad(borrowRatePerSecWad, currentUtilizationWad)\n\n return {\n collateralTrackerAddress,\n riskEngineAddress,\n currentUtilizationBps,\n currentUtilizationWad,\n currentUtilizationPct,\n borrowRatePerSecWad,\n supplyRatePerSecWad,\n borrowAprPct: ratePerSecWadToAprPct(borrowRatePerSecWad),\n supplyAprPct: ratePerSecWadToAprPct(supplyRatePerSecWad),\n marketStatePacked,\n }\n}\n\nexport async function getIrmCurve(params: {\n client: PublicClient\n collateralTrackerAddress: Address\n points?: number\n blockNumber?: bigint\n}): Promise<{\n current: IrmCurrent\n points: IrmPoint[]\n}> {\n const { client, collateralTrackerAddress, points = 201, blockNumber } = params\n\n if (!Number.isInteger(points) || points < 2) {\n throw new PanopticValidationError('points must be an integer >= 2')\n }\n if (points > MAX_IRM_CURVE_POINTS) {\n throw new PanopticValidationError(`points must be <= ${MAX_IRM_CURVE_POINTS}`)\n }\n\n const current = await getIrmCurrent({\n client,\n collateralTrackerAddress,\n blockNumber,\n })\n\n const denominator = BigInt(points - 1)\n const contracts = Array.from({ length: points }, (_, idx) => {\n const i = BigInt(idx)\n const utilizationWad = (i * WAD) / denominator\n\n return {\n address: current.riskEngineAddress,\n abi: riskEngineAbi,\n functionName: 'interestRate' as const,\n args: [utilizationWad, current.marketStatePacked] as const,\n }\n })\n\n const borrowRatesPerSecWad = await client.multicall({\n contracts,\n blockNumber,\n allowFailure: false,\n })\n\n const curvePoints: IrmPoint[] = borrowRatesPerSecWad.map((borrowRatePerSecWad, idx) => {\n const i = BigInt(idx)\n const utilizationWad = (i * WAD) / denominator\n const supplyRatePerSecWad = deriveSupplyRatePerSecWad(borrowRatePerSecWad, utilizationWad)\n\n return {\n utilizationWad,\n utilizationPct: (idx * 100) / (points - 1),\n borrowRatePerSecWad,\n supplyRatePerSecWad,\n borrowAprPct: ratePerSecWadToAprPct(borrowRatePerSecWad),\n supplyAprPct: ratePerSecWadToAprPct(supplyRatePerSecWad),\n }\n })\n\n return {\n current,\n points: curvePoints,\n }\n}\n"],"mappings":";;;;;AAAA,MAAa,gBAAgB;CAC3B;EACE,QAAQ,CACN;GACE,YAAY,CACV;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP,GACD;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP,CACF;GACD,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,GACD;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CACN;GACE,YAAY;IACV;KACE,cAAc;KACd,MAAM;KACN,MAAM;IACP;IACD;KACE,cAAc;KACd,MAAM;KACN,MAAM;IACP;IACD;KACE,cAAc;KACd,MAAM;KACN,MAAM;IACP;GACF;GACD,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,MAAM;EACN,SAAS,CACP;GACE,YAAY,CACV;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP,GACD;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP,CACF;GACD,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CACN;GACE,YAAY;IACV;KACE,cAAc;KACd,MAAM;KACN,MAAM;IACP;IACD;KACE,cAAc;KACd,MAAM;KACN,MAAM;IACP;IACD;KACE,cAAc;KACd,MAAM;KACN,MAAM;IACP;IACD;KACE,cAAc;KACd,MAAM;KACN,MAAM;IACP;GACF;GACD,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,MAAM;EACN,SAAS,CACP;GACE,YAAY,CACV;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP,GACD;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP,CACF;GACD,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CACN;GACE,YAAY,CACV;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP,GACD;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP,CACF;GACD,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,MAAM;EACN,SAAS;GACP;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP;GACD;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP;GACD;IACE,YAAY,CACV;KACE,cAAc;KACd,MAAM;KACN,MAAM;IACP,GACD;KACE,cAAc;KACd,MAAM;KACN,MAAM;IACP,CACF;IACD,cAAc;IACd,MAAM;IACN,MAAM;GACP;EACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CAAE;EACV,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CAAE;EACV,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CAAE;EACV,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CAAE;EACV,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CAAE;EACV,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CAAE;EACV,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CAAE;EACV,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CAAE;EACV,MAAM;EACN,SAAS,CACP;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CACN;GACE,cAAc;GACd,MAAM;GACN,MAAM;EACP,GACD;GACE,YAAY,CACV;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP,GACD;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP,CACF;GACD,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,MAAM;EACN,SAAS,CACP;GACE,YAAY,CACV;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP,GACD;IACE,cAAc;IACd,MAAM;IACN,MAAM;GACP,CACF;GACD,cAAc;GACd,MAAM;GACN,MAAM;EACP,CACF;EACD,iBAAiB;EACjB,MAAM;CACP;CACD;EACE,QAAQ,CACN;G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AAQ;EACrF,MAAM,IAAI,OAAO,IAAI;EACrB,MAAM,iBAAkB,IAAI,MAAO;EACnC,MAAM,sBAAsB,0BAA0B,qBAAqB,eAAe;AAE1F,SAAO;GACL;GACA,gBAAiB,MAAM,OAAQ,SAAS;GACxC;GACA;GACA,cAAc,sBAAsB,oBAAoB;GACxD,cAAc,sBAAsB,oBAAoB;EACzD;CACF,EAAC;AAEF,QAAO;EACL;EACA,QAAQ;CACT;AACF"}
@@ -2511,6 +2511,52 @@ declare function convertToShares(params: ERC4626PreviewParams): Promise<ERC4626P
2511
2511
  */
2512
2512
  declare function convertToAssets(params: ERC4626PreviewParams): Promise<ERC4626PreviewResult>;
2513
2513
 
2514
+ //#endregion
2515
+ //#region src/panoptic/v2/reads/guardian.d.ts
2516
+ /**
2517
+ * Parameters for getGuardianUnlockState.
2518
+ */
2519
+ interface GetGuardianUnlockStateParams {
2520
+ /** viem PublicClient */
2521
+ client: PublicClient;
2522
+ /** PanopticPool address */
2523
+ poolAddress: Address$1;
2524
+ /** Optional RiskEngine address (skips the pool.riskEngine() read) */
2525
+ riskEngineAddress?: Address$1;
2526
+ /** Optional PanopticGuardian address (skips the riskEngine.GUARDIAN() read) */
2527
+ guardianAddress?: Address$1;
2528
+ /** Optional block number for historical queries */
2529
+ blockNumber?: bigint;
2530
+ /** Optional pre-fetched block metadata (skips getBlockMeta RPC call) */
2531
+ _meta?: BlockMeta;
2532
+ }
2533
+ /**
2534
+ * Guardian pool-unlock state.
2535
+ */
2536
+ interface GuardianUnlockState {
2537
+ /** Resolved PanopticGuardian contract address */
2538
+ guardianAddress: Address$1;
2539
+ /** Unlock ETA as a Unix timestamp (seconds); 0n when no unlock is pending */
2540
+ unlockEta: bigint;
2541
+ /** True when an unlock has been requested but not yet executed */
2542
+ hasPendingUnlock: boolean;
2543
+ /** True when the pending unlock's timelock has elapsed and it can be executed */
2544
+ isReady: boolean;
2545
+ /** Block metadata */
2546
+ _meta: BlockMeta;
2547
+ }
2548
+ /**
2549
+ * Read the Guardian pending-unlock state for a pool.
2550
+ *
2551
+ * Resolves the Guardian address from the pool's RiskEngine when not provided,
2552
+ * then reads `unlockEta` and `isPoolUnlockReady` from the PanopticGuardian in a
2553
+ * single multicall pinned to the same block.
2554
+ *
2555
+ * @param params - The parameters
2556
+ * @returns Guardian unlock state with block metadata
2557
+ */
2558
+ declare function getGuardianUnlockState(params: GetGuardianUnlockStateParams): Promise<GuardianUnlockState>;
2559
+
2514
2560
  //#endregion
2515
2561
  //#region src/panoptic/v2/reads/safeMode.d.ts
2516
2562
  /**
@@ -4243,6 +4289,18 @@ declare function useOracleState(poolAddress: Address$1, options?: QueryOptions):
4243
4289
  declare function useRiskParameters(poolAddress: Address$1, options?: QueryOptions): QueryObserverResult<TData, TError>;
4244
4290
  declare function useCurrentRates(poolAddress: Address$1, options?: QueryOptions): QueryObserverResult<TData, TError>;
4245
4291
  declare function useSafeMode(poolAddress: Address$1, options?: QueryOptions): QueryObserverResult<TData, TError>;
4292
+ /**
4293
+ * React hook for the Guardian pending-unlock state of a pool.
4294
+ *
4295
+ * Reads `unlockEta` + `isPoolUnlockReady` from the PanopticGuardian so the UI
4296
+ * can surface the unlock timelock while a pool is locked (close-only). Gate it
4297
+ * via `options.enabled` so it only runs when the pool is actually locked.
4298
+ *
4299
+ * @param poolAddress - The PanopticPool address
4300
+ * @param options - Optional react-query settings (enabled, refetchInterval, staleTime, gcTime)
4301
+ * @returns A react-query result whose `data` is a `GuardianUnlockState`
4302
+ */
4303
+ declare function useGuardianUnlockState(poolAddress: Address$1, options?: QueryOptions): QueryObserverResult<TData, TError>;
4246
4304
  declare function useCollateralData(poolAddress: Address$1, tokenIndex: 0 | 1, options?: QueryOptions): QueryObserverResult<TData, TError>;
4247
4305
  declare function usePoolLiquidities(poolAddress: Address$1, params: {
4248
4306
  queryAddress: Address$1;
@@ -5428,6 +5486,10 @@ declare const queryKeys: {
5428
5486
  * Key for safe mode state.
5429
5487
  */
5430
5488
  readonly safeMode: (chainId: bigint, poolAddress: Address) => readonly ["panoptic-v2", "safeMode", string, Address];
5489
+ /**
5490
+ * Key for Guardian pool-unlock state.
5491
+ */
5492
+ readonly guardianUnlock: (chainId: bigint, poolAddress: Address) => readonly ["panoptic-v2", "guardianUnlock", string, Address];
5431
5493
  /**
5432
5494
  * Key for risk parameters.
5433
5495
  */
@@ -9449,5 +9511,5 @@ declare function isNonceError(error: unknown): boolean;
9449
9511
  declare function isGasError(error: unknown): boolean;
9450
9512
 
9451
9513
  //#endregion
9452
- export { AccountBuyingPower, AccountCollateral, AccountGreeksCurveResult, AccountGreeksResult, AccountInsolventError, AccountLiquidatedEvent, AccountPremia, AccountSummaryBasic, AccountSummaryRisk, AddPendingPositionParams, AddTrackedChunksParams, AlreadyInitializedError, ApprovalStatus, ApproveParams, ApprovePoolParams, BORROW_INDEX_BITS, BPS_DENOMINATOR, BPS_SCALE, BaseEvent, BatchDiagnostic, BatchDiagnosticCode, BatchDispatchArgs, BatchOp, BatchOpBurn, BatchOpKind, BatchOpMint, BatchValidationError, BelowMinimumRedemptionError, BlockMeta, BorrowParams, BuildBatchDispatchArgsParams, BuildBatchDispatchArgsResult, CalculateAccountGreeksPureParams, CancelParams, CastingError, CheckApprovalParams, CheckCollateralAcrossTicksParams, ChunkData, ChunkHasZeroLiquidityError, ChunkInput, ChunkKey, ChunkLimitError, ChunkLiquidityResult, ChunkMetadata, ChunkSpread, ChunkStats, ClosePositionParams, ClosePositionSimulation, ClosedPosition, CollateralAcrossTicks, CollateralDataPoint, CollateralEstimate, CollateralSharePriceData, CollateralTracker, ConfirmPendingPositionParams, CreateEventPollerParams, CreateEventSubscriptionParams, CrossPoolError, CurrentRates, DEFAULT_MAX_SPREAD, DEFAULT_RECONNECT_CONFIG, DEFAULT_VEGOID, DataWithMeta, DecodedLeg, DecodedTokenId, DeltaHedgeResult, DeployNewPoolParams, DepositEvent, DepositParams, DepositSimulation, DepositTooLargeError, DetectReorgParams, DispatchCall, DispatchCalldata, DispatchParams, DispatchSimulation, DuplicateTokenIdError, ERC4626PreviewParams, ERC4626PreviewResult, EffectiveLiquidityAboveThresholdError, EncodeLegParams, EnforcedTickLimits, EstimateBlockNumbersParams, EstimateCollateralRequiredParams, EventPoller, EventReconstructionParams, EventReconstructionResult, EventSubscription, EventSubscriptionHandle, ExceedsMaximumRedemptionError, ExecuteBatchDispatchParams, FailPendingPositionParams, FetchPoolIdParams, FetchPoolIdResult, ForceExerciseParams, ForceExerciseSimulation, ForcedExercisedEvent, GetAccountBuyingPowerParams, GetAccountCollateralParams, GetAccountGreeksParams, GetAccountPremiaParams, GetAccountSummaryBasicParams, GetAccountSummaryRiskParams, GetBlockMetaParams, GetChunkLiquiditiesParams, GetChunkLiquiditiesResult, GetChunkSpreadsParams, GetCollateralDataParams, GetCurrentRatesParams, GetDeltaHedgeParamsInput, GetEnforcedTickLimitsParams, GetFactoryConstructMetadataParams, GetFactoryOwnerOfParams, GetFactoryTokenURIParams, GetInterestStateParams, GetLiquidationPricesParams, GetMarginBufferParams, GetMaxPositionSizeParams, GetMaxWithdrawableParams, GetNativeTokenPriceParams, GetNetLiquidationValueParams, GetNetLiquidationValuesParams, GetOpenPositionIdsParams, GetOpenPositionPreviewParams, GetOracleStateParams, GetPanopticPoolAddressParams, GetPanopticPoolFromPoolIdParams, GetPendingPositionsParams, GetPoolLiquiditiesParams, GetPoolMetadataParams, GetPoolParams, GetPortfolioValueParams, GetPositionChunkDataParams, GetPositionChunkDataResult, GetPositionEnrichmentDataParams, GetPositionEnrichmentDataResult, GetPositionGreeksParams, GetPositionParams, GetPositionsParams, GetPositionsWithPremiaParams, GetPriceHistoryParams, GetRealizedPnLParams, GetRequiredCreditForITMParams, GetRiskParametersParams, GetSafeModeParams, GetStreamiaHistoryParams, GetSyncStatusParams, GetTrackedChunksParams, GetTrackedPositionIdsParams, GetTradeHistoryParams, GetUniswapFeeHistoryParams, GetUniswapV3PoolFromIdParams, GetUniswapV3PoolInfoParams, GetUniswapV3PoolLiquiditiesParams, GetUniswapV4PoolBasicStateParams, GetUniswapV4PoolInfoParams, GetUniswapV4PoolKeyFromIdParams, GetUniswapV4PoolLiquiditiesParams, GetUtilizationParams, InputListFailError, InsufficientCreditLiquidityError, InterestState, InvalidBuilderCodeError, InvalidHistoryRangeError, InvalidTickBoundError, InvalidTickError, InvalidTokenIdParameterError, InvalidUniswapCallbackError, IrmCurrent, IrmMarketStateInputs, IrmPoint, IsLiquidatableParams, LEG_BITS, LEG_LIMITS, LEG_MASKS, LegChunkData, LegConfig, LegGreeksParams, LegUpdate, LengthMismatchError, LiquidateParams, LiquidateSimulation, LiquidationCheck, LiquidationPrices, LiquidityChunkKey, LiquidityChunkSpread, LiquidityTooHighError, LoanSlotExhaustedError, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, MAX_TICK, MAX_TRACKED_CHUNKS, MIN_TICK, MarginBuffer, MaxPositionSize, MaxRetriesExceededError, MinePoolAddressParams, MinePoolAddressResult, MintParams, MissingPositionIdsError, MulticallContract, MulticallReadParams, MutationEffectParams, MutationType, NetLiquidationValue, NetLiquidationValues, NetLiquidityZeroError, NetworkMismatchError, NoLegsExercisableError, NonceManager, NotALongLegError, NotBuilderError, NotEnoughLiquidityInChunkError, NotEnoughTokensError, NotGuardianError, NotMarginCalledError, NotPanopticPoolError, ORACLE_EPOCH_SECONDS, OpenPositionParams, OpenPositionPreview, OpenPositionSimulation, OptimizeTokenIdRiskPartnersParams, OptionBurntEvent, OptionMintedEvent, OracleRateLimitedError, OracleState, PanopticContextValue, PanopticError, PanopticEvent, PanopticEventType, PanopticHelperNotDeployedError, PanopticNFTMetadata, PanopticProvider, PanopticProviderProps, PanopticValidationError, ParsedError, PendingPosition, PokeOracleParams, Pool, PoolFormatterConfig, PoolFormatters, PoolHealthStatus, PoolKey, PoolLiquidities, PoolMetadata, PoolNotInitializedError, PoolVersionConfig, PortfolioValue, Position, PositionChunkData, PositionCountNotZeroError, PositionEnrichmentResult, PositionGreeks, PositionGreeksInput, PositionGreeksResult, PositionInput, PositionNotOwnedError, PositionSnapshotNotFoundError, PositionStorageParams, PositionTooLargeError, PositionWithPremia, PositionsWithPremiaResult, PremiumSettledEvent, PreviewBorrowParams, PreviewBorrowResult, PreviewWrapParams, PriceBoundFailError, PriceHistoryResult, PriceHistoryTimeRange, PriceImpactTooLargeError, PriceSnapshot, ProviderLagError, QueryOptions, RATE_AT_TARGET_BITS, REORG_DEPTH, RealizedPnL, ReconnectConfig, RecoverSnapshotFromTxParams, RecoverSnapshotParams, RedeemParams, ReentrancyError, RemoveTrackedChunksParams, ReorgDetection, RepayParams, RequiredCreditForITM, ResolveBlockNumbersParams, ResolvePanopticPoolFromPoolIdParams, ResolvePanopticPoolFromPoolIdResult, ResolveUniswapV4PoolKeyParams, RiskEngine, RiskParameters, RollPositionParams, RpcError, RpcResponseError, SCHEMA_VERSION, SECONDS_PER_YEAR, SFPMSimulationResult, STANDARD_TICK_WIDTHS, STORAGE_PREFIX, SafeMode, SafeModeError, SafeModeState, SaveCheckpointParams, SaveClosedPositionParams, ScanChunksParams, ScanChunksResult, ScannedChunk, SettleParams, SettleSimulation, SettledEvent, SimulateBatchDispatchParams, SimulateBatchDispatchResult, SimulateClosePositionParams, SimulateDeployNewPoolParams, SimulateDepositParams, SimulateDispatchParams, SimulateForceExerciseParams, SimulateLiquidateParams, SimulateOpenPositionParams, SimulateSFPMParams, SimulateSettleParams, SimulateSwapExactInParams, SimulateSwapExactOutParams, SimulateWithdrawParams, SimulationResult, SmartRepayParams, SnapshotRecoveryResult, SpeedUpParams, StaleDataError, StaleOracleError, StorageAdapter, StreamiaHistoryResult, StreamiaLeg, StreamiaSnapshot, SupplyParams, SwapExactInParams, SwapExactOutParams, SwapSimulation, SwapTokenMismatchError, SyncCheckpoint, SyncEvent, SyncOptions, SyncPositionsParams, SyncPositionsResult, SyncProgressEvent, SyncResult, SyncState, SyncStatus, SyncStatusResult, SyncTimeoutError, TOKEN_ID_BITS, TickAndSpreadLimits, TickLimitsResult, Timescale, TokenCollateral, TokenFlow, TokenIdBuilder, TokenIdHasZeroLegsError, TokenIdLeg, TokenInterestState, TooManyLegsOpenError, TransferFailedError, TxBroadcaster, TxOverrides, TxReceipt, TxResult, TxResultWithReceipt, UNREALIZED_INTEREST_BITS, UTILIZATION_DENOMINATOR, UnauthorizedUniswapCallbackError, UnderOverFlowError, UnhealthyPoolError, UniswapFeeHistoryResult, UniswapFeeSnapshot, UniswapV3Liquidities, UniswapV3PoolInfo, UniswapV3PoolToken, UniswapV4PoolBasicState, UniswapV4PoolInfo, UniswapV4PoolKey, UnsupplyParams, UnwrapWethParams, UnwrapXstockParams, Utilization, V3PoolConfig, V4PoolConfig, ValidateBatchParams, WAD, WatchEventsParams, WithdrawEvent, WithdrawParams, WithdrawSimulation, WithdrawWithPositionsParams, WrapEthParams, WrapXstockParams, WriteConfig, WrongPoolIdError, WrongUniswapPoolError, ZERO_COLLATERAL, ZERO_VALUATION, ZeroAddressError, ZeroCollateralRequirementError, addLegToTokenId, addPendingPosition, addTrackedChunks, annualizePerSecondRateWad, approve, approveAndWait, approvePool, assertCanBurn, assertCanForceExercise, assertCanLiquidate, assertCanMint, assertFresh, assertHealthy, assertTradeable, borrow, borrowAndWait, buildBatchDispatchArgs, buildOpenPositionCalldata, buildUniqueLoan, calculateAccountGreeksPure, calculatePositionDelta, calculatePositionDeltaWithSwap, calculatePositionGamma, calculatePositionGreeks, calculatePositionValue, calculateResyncBlock, calculateSpreadWad, cancelTransaction, checkApproval, checkCollateralAcrossTicks, cleanupStalePendingPositions, clearCheckpoint, clearPendingPositions, clearTrackedChunks, clearTrackedPositions, clearTradeHistory, closePosition, closePositionAndWait, computeV4PoolId, confirmPendingPosition, convertToAssets, convertToShares, countLegs, createEventPoller, createEventSubscription, createFileStorage, createMemoryStorage, createNonceManager, createPoolFormatters, createTokenIdBuilder, decodeAllLegs, decodeDispatchCalldata, decodeLeftRightSigned, decodeLeftRightUnsigned, decodeLeg, decodePanopticTokenURI, decodePoolId, decodeTickSpacing, decodeTokenId, decodeVegoid, deployNewPool, deployNewPoolAndWait, deposit, depositAndWait, deriveSupplyRatePerSecWad, detectReorg, dispatch, dispatchAndWait, encodeLeg, encodePoolId, encodePoolKeyBytes, encodeV3PoolKeyBytes, encodeV4PoolId, estimateBlockNumbers, estimateCollateralRequired, executeBatchDispatch, executeBatchDispatchAndWait, failPendingPosition, fetchPoolId, forceExercise, forceExerciseAndWait, formatBlockNumber, formatBps, formatCompact, formatDatetime, formatDuration, formatDurationSeconds, formatFeeTier, formatGas, formatGwei, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, formatPoolIdHex, formatPriceRange, formatRateWad, formatRatioPercent, formatTick, formatTickRange, formatTimestamp, formatTimestampLocale, formatTokenAmount, formatTokenAmountSigned, formatTokenDelta, formatTokenFlow, formatTokenIdHex, formatTokenIdShort, formatTxHash, formatUtilization, formatWad, formatWadPercent, formatWadSigned, formatWei, getAccountBuyingPower, getAccountCollateral, getAccountGreeks, getAccountHistory, getAccountPremia, getAccountSummaryBasic, getAccountSummaryRisk, getAssetIndex, getBlockMeta, getChunkLiquidities, getChunkSpreads, getClosedPositions, getClosedPositionsKey, getCollateralAddresses, getCollateralData, getCollateralSharePrices, getCollateralTotalAssetsBatch, getCurrentRates, getDeltaHedgeParams, getEnforcedTickLimits, getFactoryConstructMetadata, getFactoryOwnerOf, getFactoryTokenURI, getInterestState, getIrmCurrent, getIrmCurve, getLegDelta, getLegGamma, getLegValue, getLiquidationPrices, getMarginBuffer, getMaxPositionSize, getMaxWithdrawable, getNativeTokenPrice, getNetLiquidationValue, getNetLiquidationValues, getOpenPositionIds, getOpenPositionPreview, getOracleState, getPanopticPoolAddress, getPanopticPoolFromPoolId, getPendingPositions, getPendingPositionsKey, getPool, getPoolDeploymentBlock, getPoolDisplayId, getPoolLiquidities, getPoolMetaKey, getPoolMetadata, getPoolPrefix, getPortfolioValue, getPosition, getPositionChunkData, getPositionEnrichmentData, getPositionGreeks, getPositionMetaKey, getPositions, getPositionsKey, getPositionsWithPremia, getPriceHistory, getPricesAtTick, getRealizedPnL, getRequiredCreditForITM, getRiskParameters, getSafeMode, getSchemaVersionKey, getStreamiaHistory, getSyncCheckpointKey, getSyncStatus, getTickSpacing, getTokenListId, getTrackedChunks, getTrackedChunksKey, getTrackedPositionIds, getTradeHistory, getUniswapFeeHistory, getUniswapV3PoolFromId, getUniswapV3PoolInfo, getUniswapV3PoolLiquidities, getUniswapV4PoolBasicState, getUniswapV4PoolInfo, getUniswapV4PoolKeyFromId, getUniswapV4PoolLiquidities, getUtilization, hasLoanOrCredit, hasLongLeg, interpolateBlocks, isCall, isCowSupportedChain, isCredit, isCreditLeg, isDefinedRisk, isGasError, isInputListFailError, isLiquidatable, isLoan, isLoanLeg, isNonceError, isPanopticErrorType, isPositionTracked, isRetryableRpcError, isShortOnly, isSpread, jsonSerializer, liquidate, liquidateAndWait, loadCheckpoint, minePoolAddress, mint, mintAndWait, multicallRead, mutationEffects, openPosition, openPositionAndWait, optimizeTokenIdRiskPartners, packMarketState, parseBps, parseCollateralLog, parsePanopticError, parsePoolLog, parseTokenAmount, parseTokenListId, parseWad, pokeOracle, pokeOracleAndWait, previewBorrow, previewDeposit, previewMint, previewRedeem, previewUnwrap, previewWithdraw, previewWrap, priceToTick, publicBroadcaster, queryKeys, ratePerSecWadToAprPct, reconstructFromEvents, recoverSnapshot, recoverSnapshotFromTx, redeem, redeemAndWait, removeTrackedChunks, repay, repayAndWait, resolveBlockNumbers, resolvePanopticPoolFromPoolId, resolveTokenIndex, resolveUniswapV4PoolKey, rollPosition, rollPositionAndWait, roundToTickSpacing, saveCheckpoint, saveClosedPosition, scanChunks, settleAccumulatedPremia, settleAccumulatedPremiaAndWait, simulateBatchDispatch, simulateClosePosition, simulateDeployNewPool, simulateDeposit, simulateDispatch, simulateForceExercise, simulateLiquidate, simulateOpenPosition, simulateSFPMBurn, simulateSFPMMint, simulateSettle, simulateSwapExactIn, simulateSwapExactOut, simulateWithdraw, smartRepay, smartRepayAndWait, speedUpTransaction, sqrtPriceX96ToPriceDecimalScaled, sqrtPriceX96ToTick, supply, supplyAndWait, swapExactIn, swapExactInAndWait, swapExactOut, swapExactOutAndWait, syncPositions, tickLimits, tickToPrice, tickToPriceDecimalScaled, tickToSqrtPriceX96, truncateAddress, unsupply, unsupplyAndWait, unwrapWeth, unwrapWethAndWait, unwrapXstock, unwrapXstockAndWait, useAccountCollateral, useAccountGreeks, useAccountPremia, useAccountSummaryBasic, useAccountSummaryRisk, useAddPendingPosition, useApprove, useApproveErc20ForCow, useApproveErc20ForPermit2, useApprovePool, useApproveRouterViaPermit2, useBatchDispatch as useBatchDispatchHook, useBorrow as useBorrowHook, useCancelCowOrder, useCheckCowApproval, useCheckRouterApproval, useChunkSpreads, useClearTrackedPositions, useClosePosition as useClosePositionHook, useClosedPositions, useCollateralData, useConfirmPendingPosition, useCowOrderStatus, useCurrentRates, useDeployNewPool as useDeployNewPoolHook, useDeposit as useDepositHook, useDispatch as useDispatchHook, useEstimateCollateralRequired, useEventPoller, useEventSubscription, useFactoryConstructMetadata, useFactoryOwnerOf, useFactoryTokenURI, useFailPendingPosition, useForceExercise as useForceExerciseHook, useInterestState, useIsLiquidatable, useLiquidate as useLiquidateHook, useLiquidationPrices, useMarginBuffer, useMaxPositionSize, useMaxWithdrawable, useMinePoolAddress as useMinePoolAddressHook, useMintShares, useNativeTokenPrice, useNetLiquidationValue, useNetLiquidationValues, useOpenPosition as useOpenPositionHook, useOpenPositionPreview, useOptimizeRiskPartners, useOracleState, usePanopticContext, usePanopticPoolAddress, usePokeOracle as usePokeOracleHook, usePool, usePoolLiquidities, usePosition, usePositionGreeks, usePositions, usePositionsWithPremia, usePreviewBorrow, usePreviewDeposit, usePreviewMint, usePreviewRedeem, usePreviewWithdraw, usePriceHistory, useQuoteCowSwap, useQuoteSwapExactInViaRouter, useQuoteSwapExactOutViaRouter, useRealizedPnL, useRedeem as useRedeemHook, useRepay as useRepayHook, useResolveUniswapV4PoolKey, useRiskParameters, useRollPosition as useRollPositionHook, useSafeMode, useSettleAccumulatedPremia as useSettleAccumulatedPremiaHook, useSimulateBatchDispatch, useSimulateClosePosition, useSimulateDeployNewPool, useSimulateDeposit, useSimulateDispatch, useSimulateForceExercise, useSimulateLiquidate, useSimulateOpenPosition, useSimulateSFPMBurn, useSimulateSFPMMint, useSimulateSettle, useSimulateSwapExactIn, useSimulateSwapExactOut, useSimulateWithdraw, useSmartRepay as useSmartRepayHook, useStreamiaHistory, useSubmitCowOrder, useSupply as useSupplyHook, useSwapExactIn, useSwapExactInViaRouter, useSwapExactOut, useSwapExactOutViaRouter, useSyncPositions, useSyncStatus, useTrackedPositionIds, useTradeHistory, useTxEventConfirmation, useUniswapFeeHistory, useUniswapV3PoolInfo, useUniswapV3PoolLiquidities, useUniswapV4PoolBasicState, useUniswapV4PoolInfo, useUniswapV4PoolLiquidities, useUnsupply as useUnsupplyHook, useUnwrapWeth, useUnwrapXstock, useUtilization, useValidateBuilderCode, useWatchEvents, useWithdraw as useWithdrawHook, useWithdrawWithPositions as useWithdrawWithPositionsHook, useWrapEth, useWrapXstock, utilizationBpsToWad, utilizationPctToWad, validateBatch, validateBuilderCode, validatePoolId, verifyBlockContinuity, watchEvents, wethWrapAbi, withdraw, withdrawAndWait, withdrawWithPositions, withdrawWithPositionsAndWait, wrapEth, wrapEthAndWait, wrapXstock, wrapXstockAndWait, xstockWrapperAbi };
9514
+ export { AccountBuyingPower, AccountCollateral, AccountGreeksCurveResult, AccountGreeksResult, AccountInsolventError, AccountLiquidatedEvent, AccountPremia, AccountSummaryBasic, AccountSummaryRisk, AddPendingPositionParams, AddTrackedChunksParams, AlreadyInitializedError, ApprovalStatus, ApproveParams, ApprovePoolParams, BORROW_INDEX_BITS, BPS_DENOMINATOR, BPS_SCALE, BaseEvent, BatchDiagnostic, BatchDiagnosticCode, BatchDispatchArgs, BatchOp, BatchOpBurn, BatchOpKind, BatchOpMint, BatchValidationError, BelowMinimumRedemptionError, BlockMeta, BorrowParams, BuildBatchDispatchArgsParams, BuildBatchDispatchArgsResult, CalculateAccountGreeksPureParams, CancelParams, CastingError, CheckApprovalParams, CheckCollateralAcrossTicksParams, ChunkData, ChunkHasZeroLiquidityError, ChunkInput, ChunkKey, ChunkLimitError, ChunkLiquidityResult, ChunkMetadata, ChunkSpread, ChunkStats, ClosePositionParams, ClosePositionSimulation, ClosedPosition, CollateralAcrossTicks, CollateralDataPoint, CollateralEstimate, CollateralSharePriceData, CollateralTracker, ConfirmPendingPositionParams, CreateEventPollerParams, CreateEventSubscriptionParams, CrossPoolError, CurrentRates, DEFAULT_MAX_SPREAD, DEFAULT_RECONNECT_CONFIG, DEFAULT_VEGOID, DataWithMeta, DecodedLeg, DecodedTokenId, DeltaHedgeResult, DeployNewPoolParams, DepositEvent, DepositParams, DepositSimulation, DepositTooLargeError, DetectReorgParams, DispatchCall, DispatchCalldata, DispatchParams, DispatchSimulation, DuplicateTokenIdError, ERC4626PreviewParams, ERC4626PreviewResult, EffectiveLiquidityAboveThresholdError, EncodeLegParams, EnforcedTickLimits, EstimateBlockNumbersParams, EstimateCollateralRequiredParams, EventPoller, EventReconstructionParams, EventReconstructionResult, EventSubscription, EventSubscriptionHandle, ExceedsMaximumRedemptionError, ExecuteBatchDispatchParams, FailPendingPositionParams, FetchPoolIdParams, FetchPoolIdResult, ForceExerciseParams, ForceExerciseSimulation, ForcedExercisedEvent, GetAccountBuyingPowerParams, GetAccountCollateralParams, GetAccountGreeksParams, GetAccountPremiaParams, GetAccountSummaryBasicParams, GetAccountSummaryRiskParams, GetBlockMetaParams, GetChunkLiquiditiesParams, GetChunkLiquiditiesResult, GetChunkSpreadsParams, GetCollateralDataParams, GetCurrentRatesParams, GetDeltaHedgeParamsInput, GetEnforcedTickLimitsParams, GetFactoryConstructMetadataParams, GetFactoryOwnerOfParams, GetFactoryTokenURIParams, GetGuardianUnlockStateParams, GetInterestStateParams, GetLiquidationPricesParams, GetMarginBufferParams, GetMaxPositionSizeParams, GetMaxWithdrawableParams, GetNativeTokenPriceParams, GetNetLiquidationValueParams, GetNetLiquidationValuesParams, GetOpenPositionIdsParams, GetOpenPositionPreviewParams, GetOracleStateParams, GetPanopticPoolAddressParams, GetPanopticPoolFromPoolIdParams, GetPendingPositionsParams, GetPoolLiquiditiesParams, GetPoolMetadataParams, GetPoolParams, GetPortfolioValueParams, GetPositionChunkDataParams, GetPositionChunkDataResult, GetPositionEnrichmentDataParams, GetPositionEnrichmentDataResult, GetPositionGreeksParams, GetPositionParams, GetPositionsParams, GetPositionsWithPremiaParams, GetPriceHistoryParams, GetRealizedPnLParams, GetRequiredCreditForITMParams, GetRiskParametersParams, GetSafeModeParams, GetStreamiaHistoryParams, GetSyncStatusParams, GetTrackedChunksParams, GetTrackedPositionIdsParams, GetTradeHistoryParams, GetUniswapFeeHistoryParams, GetUniswapV3PoolFromIdParams, GetUniswapV3PoolInfoParams, GetUniswapV3PoolLiquiditiesParams, GetUniswapV4PoolBasicStateParams, GetUniswapV4PoolInfoParams, GetUniswapV4PoolKeyFromIdParams, GetUniswapV4PoolLiquiditiesParams, GetUtilizationParams, GuardianUnlockState, InputListFailError, InsufficientCreditLiquidityError, InterestState, InvalidBuilderCodeError, InvalidHistoryRangeError, InvalidTickBoundError, InvalidTickError, InvalidTokenIdParameterError, InvalidUniswapCallbackError, IrmCurrent, IrmMarketStateInputs, IrmPoint, IsLiquidatableParams, LEG_BITS, LEG_LIMITS, LEG_MASKS, LegChunkData, LegConfig, LegGreeksParams, LegUpdate, LengthMismatchError, LiquidateParams, LiquidateSimulation, LiquidationCheck, LiquidationPrices, LiquidityChunkKey, LiquidityChunkSpread, LiquidityTooHighError, LoanSlotExhaustedError, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, MAX_TICK, MAX_TRACKED_CHUNKS, MIN_TICK, MarginBuffer, MaxPositionSize, MaxRetriesExceededError, MinePoolAddressParams, MinePoolAddressResult, MintParams, MissingPositionIdsError, MulticallContract, MulticallReadParams, MutationEffectParams, MutationType, NetLiquidationValue, NetLiquidationValues, NetLiquidityZeroError, NetworkMismatchError, NoLegsExercisableError, NonceManager, NotALongLegError, NotBuilderError, NotEnoughLiquidityInChunkError, NotEnoughTokensError, NotGuardianError, NotMarginCalledError, NotPanopticPoolError, ORACLE_EPOCH_SECONDS, OpenPositionParams, OpenPositionPreview, OpenPositionSimulation, OptimizeTokenIdRiskPartnersParams, OptionBurntEvent, OptionMintedEvent, OracleRateLimitedError, OracleState, PanopticContextValue, PanopticError, PanopticEvent, PanopticEventType, PanopticHelperNotDeployedError, PanopticNFTMetadata, PanopticProvider, PanopticProviderProps, PanopticValidationError, ParsedError, PendingPosition, PokeOracleParams, Pool, PoolFormatterConfig, PoolFormatters, PoolHealthStatus, PoolKey, PoolLiquidities, PoolMetadata, PoolNotInitializedError, PoolVersionConfig, PortfolioValue, Position, PositionChunkData, PositionCountNotZeroError, PositionEnrichmentResult, PositionGreeks, PositionGreeksInput, PositionGreeksResult, PositionInput, PositionNotOwnedError, PositionSnapshotNotFoundError, PositionStorageParams, PositionTooLargeError, PositionWithPremia, PositionsWithPremiaResult, PremiumSettledEvent, PreviewBorrowParams, PreviewBorrowResult, PreviewWrapParams, PriceBoundFailError, PriceHistoryResult, PriceHistoryTimeRange, PriceImpactTooLargeError, PriceSnapshot, ProviderLagError, QueryOptions, RATE_AT_TARGET_BITS, REORG_DEPTH, RealizedPnL, ReconnectConfig, RecoverSnapshotFromTxParams, RecoverSnapshotParams, RedeemParams, ReentrancyError, RemoveTrackedChunksParams, ReorgDetection, RepayParams, RequiredCreditForITM, ResolveBlockNumbersParams, ResolvePanopticPoolFromPoolIdParams, ResolvePanopticPoolFromPoolIdResult, ResolveUniswapV4PoolKeyParams, RiskEngine, RiskParameters, RollPositionParams, RpcError, RpcResponseError, SCHEMA_VERSION, SECONDS_PER_YEAR, SFPMSimulationResult, STANDARD_TICK_WIDTHS, STORAGE_PREFIX, SafeMode, SafeModeError, SafeModeState, SaveCheckpointParams, SaveClosedPositionParams, ScanChunksParams, ScanChunksResult, ScannedChunk, SettleParams, SettleSimulation, SettledEvent, SimulateBatchDispatchParams, SimulateBatchDispatchResult, SimulateClosePositionParams, SimulateDeployNewPoolParams, SimulateDepositParams, SimulateDispatchParams, SimulateForceExerciseParams, SimulateLiquidateParams, SimulateOpenPositionParams, SimulateSFPMParams, SimulateSettleParams, SimulateSwapExactInParams, SimulateSwapExactOutParams, SimulateWithdrawParams, SimulationResult, SmartRepayParams, SnapshotRecoveryResult, SpeedUpParams, StaleDataError, StaleOracleError, StorageAdapter, StreamiaHistoryResult, StreamiaLeg, StreamiaSnapshot, SupplyParams, SwapExactInParams, SwapExactOutParams, SwapSimulation, SwapTokenMismatchError, SyncCheckpoint, SyncEvent, SyncOptions, SyncPositionsParams, SyncPositionsResult, SyncProgressEvent, SyncResult, SyncState, SyncStatus, SyncStatusResult, SyncTimeoutError, TOKEN_ID_BITS, TickAndSpreadLimits, TickLimitsResult, Timescale, TokenCollateral, TokenFlow, TokenIdBuilder, TokenIdHasZeroLegsError, TokenIdLeg, TokenInterestState, TooManyLegsOpenError, TransferFailedError, TxBroadcaster, TxOverrides, TxReceipt, TxResult, TxResultWithReceipt, UNREALIZED_INTEREST_BITS, UTILIZATION_DENOMINATOR, UnauthorizedUniswapCallbackError, UnderOverFlowError, UnhealthyPoolError, UniswapFeeHistoryResult, UniswapFeeSnapshot, UniswapV3Liquidities, UniswapV3PoolInfo, UniswapV3PoolToken, UniswapV4PoolBasicState, UniswapV4PoolInfo, UniswapV4PoolKey, UnsupplyParams, UnwrapWethParams, UnwrapXstockParams, Utilization, V3PoolConfig, V4PoolConfig, ValidateBatchParams, WAD, WatchEventsParams, WithdrawEvent, WithdrawParams, WithdrawSimulation, WithdrawWithPositionsParams, WrapEthParams, WrapXstockParams, WriteConfig, WrongPoolIdError, WrongUniswapPoolError, ZERO_COLLATERAL, ZERO_VALUATION, ZeroAddressError, ZeroCollateralRequirementError, addLegToTokenId, addPendingPosition, addTrackedChunks, annualizePerSecondRateWad, approve, approveAndWait, approvePool, assertCanBurn, assertCanForceExercise, assertCanLiquidate, assertCanMint, assertFresh, assertHealthy, assertTradeable, borrow, borrowAndWait, buildBatchDispatchArgs, buildOpenPositionCalldata, buildUniqueLoan, calculateAccountGreeksPure, calculatePositionDelta, calculatePositionDeltaWithSwap, calculatePositionGamma, calculatePositionGreeks, calculatePositionValue, calculateResyncBlock, calculateSpreadWad, cancelTransaction, checkApproval, checkCollateralAcrossTicks, cleanupStalePendingPositions, clearCheckpoint, clearPendingPositions, clearTrackedChunks, clearTrackedPositions, clearTradeHistory, closePosition, closePositionAndWait, computeV4PoolId, confirmPendingPosition, convertToAssets, convertToShares, countLegs, createEventPoller, createEventSubscription, createFileStorage, createMemoryStorage, createNonceManager, createPoolFormatters, createTokenIdBuilder, decodeAllLegs, decodeDispatchCalldata, decodeLeftRightSigned, decodeLeftRightUnsigned, decodeLeg, decodePanopticTokenURI, decodePoolId, decodeTickSpacing, decodeTokenId, decodeVegoid, deployNewPool, deployNewPoolAndWait, deposit, depositAndWait, deriveSupplyRatePerSecWad, detectReorg, dispatch, dispatchAndWait, encodeLeg, encodePoolId, encodePoolKeyBytes, encodeV3PoolKeyBytes, encodeV4PoolId, estimateBlockNumbers, estimateCollateralRequired, executeBatchDispatch, executeBatchDispatchAndWait, failPendingPosition, fetchPoolId, forceExercise, forceExerciseAndWait, formatBlockNumber, formatBps, formatCompact, formatDatetime, formatDuration, formatDurationSeconds, formatFeeTier, formatGas, formatGwei, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, formatPoolIdHex, formatPriceRange, formatRateWad, formatRatioPercent, formatTick, formatTickRange, formatTimestamp, formatTimestampLocale, formatTokenAmount, formatTokenAmountSigned, formatTokenDelta, formatTokenFlow, formatTokenIdHex, formatTokenIdShort, formatTxHash, formatUtilization, formatWad, formatWadPercent, formatWadSigned, formatWei, getAccountBuyingPower, getAccountCollateral, getAccountGreeks, getAccountHistory, getAccountPremia, getAccountSummaryBasic, getAccountSummaryRisk, getAssetIndex, getBlockMeta, getChunkLiquidities, getChunkSpreads, getClosedPositions, getClosedPositionsKey, getCollateralAddresses, getCollateralData, getCollateralSharePrices, getCollateralTotalAssetsBatch, getCurrentRates, getDeltaHedgeParams, getEnforcedTickLimits, getFactoryConstructMetadata, getFactoryOwnerOf, getFactoryTokenURI, getGuardianUnlockState, getInterestState, getIrmCurrent, getIrmCurve, getLegDelta, getLegGamma, getLegValue, getLiquidationPrices, getMarginBuffer, getMaxPositionSize, getMaxWithdrawable, getNativeTokenPrice, getNetLiquidationValue, getNetLiquidationValues, getOpenPositionIds, getOpenPositionPreview, getOracleState, getPanopticPoolAddress, getPanopticPoolFromPoolId, getPendingPositions, getPendingPositionsKey, getPool, getPoolDeploymentBlock, getPoolDisplayId, getPoolLiquidities, getPoolMetaKey, getPoolMetadata, getPoolPrefix, getPortfolioValue, getPosition, getPositionChunkData, getPositionEnrichmentData, getPositionGreeks, getPositionMetaKey, getPositions, getPositionsKey, getPositionsWithPremia, getPriceHistory, getPricesAtTick, getRealizedPnL, getRequiredCreditForITM, getRiskParameters, getSafeMode, getSchemaVersionKey, getStreamiaHistory, getSyncCheckpointKey, getSyncStatus, getTickSpacing, getTokenListId, getTrackedChunks, getTrackedChunksKey, getTrackedPositionIds, getTradeHistory, getUniswapFeeHistory, getUniswapV3PoolFromId, getUniswapV3PoolInfo, getUniswapV3PoolLiquidities, getUniswapV4PoolBasicState, getUniswapV4PoolInfo, getUniswapV4PoolKeyFromId, getUniswapV4PoolLiquidities, getUtilization, hasLoanOrCredit, hasLongLeg, interpolateBlocks, isCall, isCowSupportedChain, isCredit, isCreditLeg, isDefinedRisk, isGasError, isInputListFailError, isLiquidatable, isLoan, isLoanLeg, isNonceError, isPanopticErrorType, isPositionTracked, isRetryableRpcError, isShortOnly, isSpread, jsonSerializer, liquidate, liquidateAndWait, loadCheckpoint, minePoolAddress, mint, mintAndWait, multicallRead, mutationEffects, openPosition, openPositionAndWait, optimizeTokenIdRiskPartners, packMarketState, parseBps, parseCollateralLog, parsePanopticError, parsePoolLog, parseTokenAmount, parseTokenListId, parseWad, pokeOracle, pokeOracleAndWait, previewBorrow, previewDeposit, previewMint, previewRedeem, previewUnwrap, previewWithdraw, previewWrap, priceToTick, publicBroadcaster, queryKeys, ratePerSecWadToAprPct, reconstructFromEvents, recoverSnapshot, recoverSnapshotFromTx, redeem, redeemAndWait, removeTrackedChunks, repay, repayAndWait, resolveBlockNumbers, resolvePanopticPoolFromPoolId, resolveTokenIndex, resolveUniswapV4PoolKey, rollPosition, rollPositionAndWait, roundToTickSpacing, saveCheckpoint, saveClosedPosition, scanChunks, settleAccumulatedPremia, settleAccumulatedPremiaAndWait, simulateBatchDispatch, simulateClosePosition, simulateDeployNewPool, simulateDeposit, simulateDispatch, simulateForceExercise, simulateLiquidate, simulateOpenPosition, simulateSFPMBurn, simulateSFPMMint, simulateSettle, simulateSwapExactIn, simulateSwapExactOut, simulateWithdraw, smartRepay, smartRepayAndWait, speedUpTransaction, sqrtPriceX96ToPriceDecimalScaled, sqrtPriceX96ToTick, supply, supplyAndWait, swapExactIn, swapExactInAndWait, swapExactOut, swapExactOutAndWait, syncPositions, tickLimits, tickToPrice, tickToPriceDecimalScaled, tickToSqrtPriceX96, truncateAddress, unsupply, unsupplyAndWait, unwrapWeth, unwrapWethAndWait, unwrapXstock, unwrapXstockAndWait, useAccountCollateral, useAccountGreeks, useAccountPremia, useAccountSummaryBasic, useAccountSummaryRisk, useAddPendingPosition, useApprove, useApproveErc20ForCow, useApproveErc20ForPermit2, useApprovePool, useApproveRouterViaPermit2, useBatchDispatch as useBatchDispatchHook, useBorrow as useBorrowHook, useCancelCowOrder, useCheckCowApproval, useCheckRouterApproval, useChunkSpreads, useClearTrackedPositions, useClosePosition as useClosePositionHook, useClosedPositions, useCollateralData, useConfirmPendingPosition, useCowOrderStatus, useCurrentRates, useDeployNewPool as useDeployNewPoolHook, useDeposit as useDepositHook, useDispatch as useDispatchHook, useEstimateCollateralRequired, useEventPoller, useEventSubscription, useFactoryConstructMetadata, useFactoryOwnerOf, useFactoryTokenURI, useFailPendingPosition, useForceExercise as useForceExerciseHook, useGuardianUnlockState, useInterestState, useIsLiquidatable, useLiquidate as useLiquidateHook, useLiquidationPrices, useMarginBuffer, useMaxPositionSize, useMaxWithdrawable, useMinePoolAddress as useMinePoolAddressHook, useMintShares, useNativeTokenPrice, useNetLiquidationValue, useNetLiquidationValues, useOpenPosition as useOpenPositionHook, useOpenPositionPreview, useOptimizeRiskPartners, useOracleState, usePanopticContext, usePanopticPoolAddress, usePokeOracle as usePokeOracleHook, usePool, usePoolLiquidities, usePosition, usePositionGreeks, usePositions, usePositionsWithPremia, usePreviewBorrow, usePreviewDeposit, usePreviewMint, usePreviewRedeem, usePreviewWithdraw, usePriceHistory, useQuoteCowSwap, useQuoteSwapExactInViaRouter, useQuoteSwapExactOutViaRouter, useRealizedPnL, useRedeem as useRedeemHook, useRepay as useRepayHook, useResolveUniswapV4PoolKey, useRiskParameters, useRollPosition as useRollPositionHook, useSafeMode, useSettleAccumulatedPremia as useSettleAccumulatedPremiaHook, useSimulateBatchDispatch, useSimulateClosePosition, useSimulateDeployNewPool, useSimulateDeposit, useSimulateDispatch, useSimulateForceExercise, useSimulateLiquidate, useSimulateOpenPosition, useSimulateSFPMBurn, useSimulateSFPMMint, useSimulateSettle, useSimulateSwapExactIn, useSimulateSwapExactOut, useSimulateWithdraw, useSmartRepay as useSmartRepayHook, useStreamiaHistory, useSubmitCowOrder, useSupply as useSupplyHook, useSwapExactIn, useSwapExactInViaRouter, useSwapExactOut, useSwapExactOutViaRouter, useSyncPositions, useSyncStatus, useTrackedPositionIds, useTradeHistory, useTxEventConfirmation, useUniswapFeeHistory, useUniswapV3PoolInfo, useUniswapV3PoolLiquidities, useUniswapV4PoolBasicState, useUniswapV4PoolInfo, useUniswapV4PoolLiquidities, useUnsupply as useUnsupplyHook, useUnwrapWeth, useUnwrapXstock, useUtilization, useValidateBuilderCode, useWatchEvents, useWithdraw as useWithdrawHook, useWithdrawWithPositions as useWithdrawWithPositionsHook, useWrapEth, useWrapXstock, utilizationBpsToWad, utilizationPctToWad, validateBatch, validateBuilderCode, validatePoolId, verifyBlockContinuity, watchEvents, wethWrapAbi, withdraw, withdrawAndWait, withdrawWithPositions, withdrawWithPositionsAndWait, wrapEth, wrapEthAndWait, wrapXstock, wrapXstockAndWait, xstockWrapperAbi };
9453
9515
  //# sourceMappingURL=index.d.ts.map